Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(299)

Side by Side Diff: chrome/browser/plugins/plugin_finder.cc

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: Rebase Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/net/referrer.cc ('k') | chrome/browser/plugins/plugin_finder_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/plugins/plugin_finder.h" 5 #include "chrome/browser/plugins/plugin_finder.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 PluginListError::JSON_UNQUOTED_DICTIONARY_KEY); 223 PluginListError::JSON_UNQUOTED_DICTIONARY_KEY);
224 break; 224 break;
225 case base::JSONReader::JSON_NO_ERROR: 225 case base::JSONReader::JSON_NO_ERROR:
226 case base::JSONReader::JSON_PARSE_ERROR_COUNT: 226 case base::JSONReader::JSON_PARSE_ERROR_COUNT:
227 NOTREACHED(); 227 NOTREACHED();
228 break; 228 break;
229 } 229 }
230 return nullptr; 230 return nullptr;
231 } 231 }
232 232
233 if (value->GetType() != base::Value::TYPE_DICTIONARY) { 233 if (value->GetType() != base::Value::Type::DICTIONARY) {
234 // JSONReader::JSON_PARSE_ERROR_COUNT is used for the case where the JSON 234 // JSONReader::JSON_PARSE_ERROR_COUNT is used for the case where the JSON
235 // value has the wrong type. 235 // value has the wrong type.
236 RecordBuiltInPluginListError(PluginListError::SCHEMA_ERROR); 236 RecordBuiltInPluginListError(PluginListError::SCHEMA_ERROR);
237 return nullptr; 237 return nullptr;
238 } 238 }
239 239
240 DCHECK_EQ(base::JSONReader::JSON_NO_ERROR, error_code); 240 DCHECK_EQ(base::JSONReader::JSON_NO_ERROR, error_code);
241 RecordBuiltInPluginListError(PluginListError::PLUGIN_LIST_NO_ERROR); 241 RecordBuiltInPluginListError(PluginListError::PLUGIN_LIST_NO_ERROR);
242 return static_cast<base::DictionaryValue*>(value.release()); 242 return static_cast<base::DictionaryValue*>(value.release());
243 } 243 }
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 metadata->AddMatchingMimeType(plugin.mime_types[i].mime_type); 339 metadata->AddMatchingMimeType(plugin.mime_types[i].mime_type);
340 340
341 DCHECK(metadata->MatchesPlugin(plugin)); 341 DCHECK(metadata->MatchesPlugin(plugin));
342 if (identifier_plugin_.find(identifier) != identifier_plugin_.end()) 342 if (identifier_plugin_.find(identifier) != identifier_plugin_.end())
343 identifier = GetLongIdentifier(plugin); 343 identifier = GetLongIdentifier(plugin);
344 344
345 DCHECK(identifier_plugin_.find(identifier) == identifier_plugin_.end()); 345 DCHECK(identifier_plugin_.find(identifier) == identifier_plugin_.end());
346 identifier_plugin_[identifier] = std::move(metadata); 346 identifier_plugin_[identifier] = std::move(metadata);
347 return identifier_plugin_[identifier]->Clone(); 347 return identifier_plugin_[identifier]->Clone();
348 } 348 }
OLDNEW
« no previous file with comments | « chrome/browser/net/referrer.cc ('k') | chrome/browser/plugins/plugin_finder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698