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

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

Issue 10003001: Update JSONReader to take base::StringPiece instead of std::string (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Sync with Parser changes Created 8 years, 6 months 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 | « base/json/json_reader.cc ('k') | chrome/common/extensions/api/extension_api.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/plugin_finder.h" 5 #include "chrome/browser/plugin_finder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 30 matching lines...) Expand all
41 } 41 }
42 42
43 // static 43 // static
44 DictionaryValue* PluginFinder::LoadPluginList() { 44 DictionaryValue* PluginFinder::LoadPluginList() {
45 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) 45 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
46 base::StringPiece json_resource( 46 base::StringPiece json_resource(
47 ResourceBundle::GetSharedInstance().GetRawDataResource( 47 ResourceBundle::GetSharedInstance().GetRawDataResource(
48 IDR_PLUGIN_DB_JSON, ui::SCALE_FACTOR_NONE)); 48 IDR_PLUGIN_DB_JSON, ui::SCALE_FACTOR_NONE));
49 std::string error_str; 49 std::string error_str;
50 scoped_ptr<base::Value> value(base::JSONReader::ReadAndReturnError( 50 scoped_ptr<base::Value> value(base::JSONReader::ReadAndReturnError(
51 json_resource.as_string(), 51 json_resource,
52 base::JSON_PARSE_RFC, 52 base::JSON_PARSE_RFC,
53 NULL, 53 NULL,
54 &error_str)); 54 &error_str));
55 if (!value.get()) { 55 if (!value.get()) {
56 DLOG(ERROR) << error_str; 56 DLOG(ERROR) << error_str;
57 return NULL; 57 return NULL;
58 } 58 }
59 if (value->GetType() != base::Value::TYPE_DICTIONARY) 59 if (value->GetType() != base::Value::TYPE_DICTIONARY)
60 return NULL; 60 return NULL;
61 return static_cast<base::DictionaryValue*>(value.release()); 61 return static_cast<base::DictionaryValue*>(value.release());
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 PluginInstaller::SECURITY_STATUS_UP_TO_DATE; 156 PluginInstaller::SECURITY_STATUS_UP_TO_DATE;
157 success = PluginInstaller::ParseSecurityStatus(status_str, &status); 157 success = PluginInstaller::ParseSecurityStatus(status_str, &status);
158 DCHECK(success); 158 DCHECK(success);
159 installer->AddVersion(Version(version), status); 159 installer->AddVersion(Version(version), status);
160 } 160 }
161 } 161 }
162 162
163 installers_[identifier] = installer; 163 installers_[identifier] = installer;
164 return installer; 164 return installer;
165 } 165 }
OLDNEW
« no previous file with comments | « base/json/json_reader.cc ('k') | chrome/common/extensions/api/extension_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698