Modernize to C++11: Use for-range loop.
This commit is contained in:
parent
3bdeac98bf
commit
55b3f1936f
17 changed files with 66 additions and 71 deletions
|
@ -86,10 +86,10 @@ std::string ReadDataFromPickle(const base::string16& format,
|
|||
bool WriteDataToPickle(const std::map<base::string16, std::string>& data,
|
||||
base::Pickle* pickle) {
|
||||
pickle->WriteUInt32(data.size());
|
||||
for (auto it = data.begin(); it != data.end(); ++it) {
|
||||
if (!pickle->WriteString16(it->first))
|
||||
for (const auto& it : data) {
|
||||
if (!pickle->WriteString16(it.first))
|
||||
return false;
|
||||
if (!pickle->WriteString(it->second))
|
||||
if (!pickle->WriteString(it.second))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -43,16 +43,14 @@ void WidevineCdmMessageFilter::OnIsInternalPluginAvailableForMimeType(
|
|||
std::vector<WebPluginInfo> plugins;
|
||||
PluginService::GetInstance()->GetInternalPlugins(&plugins);
|
||||
|
||||
for (size_t i = 0; i < plugins.size(); ++i) {
|
||||
const WebPluginInfo& plugin = plugins[i];
|
||||
for (auto& plugin : plugins) {
|
||||
const std::vector<content::WebPluginMimeType>& mime_types =
|
||||
plugin.mime_types;
|
||||
for (size_t j = 0; j < mime_types.size(); ++j) {
|
||||
|
||||
if (mime_types[j].mime_type == mime_type) {
|
||||
for (const auto& j : mime_types) {
|
||||
if (j.mime_type == mime_type) {
|
||||
*is_available = true;
|
||||
*additional_param_names = mime_types[j].additional_param_names;
|
||||
*additional_param_values = mime_types[j].additional_param_values;
|
||||
*additional_param_names = j.additional_param_names;
|
||||
*additional_param_values = j.additional_param_values;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue