Pickle write methods now return void and use GE_CHECK instead
This commit is contained in:
parent
9181db1304
commit
0b6293e2f5
1 changed files with 6 additions and 12 deletions
|
@ -83,18 +83,15 @@ std::string ReadDataFromPickle(const base::string16& format,
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WriteDataToPickle(const std::map<base::string16, std::string>& data,
|
void WriteDataToPickle(const std::map<base::string16, std::string>& data,
|
||||||
base::Pickle* pickle) {
|
base::Pickle* pickle) {
|
||||||
pickle->WriteUInt32(data.size());
|
pickle->WriteUInt32(data.size());
|
||||||
for (std::map<base::string16, std::string>::const_iterator it = data.begin();
|
for (std::map<base::string16, std::string>::const_iterator it = data.begin();
|
||||||
it != data.end();
|
it != data.end();
|
||||||
++it) {
|
++it) {
|
||||||
if (!pickle->WriteString16(it->first))
|
pickle->WriteString16(it->first);
|
||||||
return false;
|
pickle->WriteString(it->second);
|
||||||
if (!pickle->WriteString(it->second))
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@ -344,12 +341,9 @@ int32_t PepperFlashClipboardMessageFilter::OnMsgWriteData(
|
||||||
|
|
||||||
if (custom_data_map.size() > 0) {
|
if (custom_data_map.size() > 0) {
|
||||||
base::Pickle pickle;
|
base::Pickle pickle;
|
||||||
if (WriteDataToPickle(custom_data_map, &pickle)) {
|
WriteDataToPickle(custom_data_map, &pickle);
|
||||||
scw.WritePickledData(pickle,
|
scw.WritePickledData(pickle,
|
||||||
ui::Clipboard::GetPepperCustomDataFormatType());
|
ui::Clipboard::GetPepperCustomDataFormatType());
|
||||||
} else {
|
|
||||||
res = PP_ERROR_BADARGUMENT;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res != PP_OK) {
|
if (res != PP_OK) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue