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

Side by Side Diff: chrome/browser/extensions/component_loader.cc

Issue 1394993004: Make ValueDeserializer::Deserialize return scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix and add todo about not failed trybot Created 5 years, 2 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
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/extensions/component_loader.h" 5 #include "chrome/browser/extensions/component_loader.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 for (RegisteredComponentExtensions::iterator it = 157 for (RegisteredComponentExtensions::iterator it =
158 component_extensions_.begin(); 158 component_extensions_.begin();
159 it != component_extensions_.end(); ++it) { 159 it != component_extensions_.end(); ++it) {
160 Load(*it); 160 Load(*it);
161 } 161 }
162 } 162 }
163 163
164 base::DictionaryValue* ComponentLoader::ParseManifest( 164 base::DictionaryValue* ComponentLoader::ParseManifest(
165 const std::string& manifest_contents) const { 165 const std::string& manifest_contents) const {
166 JSONStringValueDeserializer deserializer(manifest_contents); 166 JSONStringValueDeserializer deserializer(manifest_contents);
167 scoped_ptr<base::Value> manifest(deserializer.Deserialize(NULL, NULL)); 167 scoped_ptr<base::Value> manifest = deserializer.Deserialize(NULL, NULL);
168 168
169 if (!manifest.get() || !manifest->IsType(base::Value::TYPE_DICTIONARY)) { 169 if (!manifest.get() || !manifest->IsType(base::Value::TYPE_DICTIONARY)) {
170 LOG(ERROR) << "Failed to parse extension manifest."; 170 LOG(ERROR) << "Failed to parse extension manifest.";
171 return NULL; 171 return NULL;
172 } 172 }
173 // Transfer ownership to the caller. 173 // Transfer ownership to the caller.
174 return static_cast<base::DictionaryValue*>(manifest.release()); 174 return static_cast<base::DictionaryValue*>(manifest.release());
175 } 175 }
176 176
177 void ComponentLoader::ClearAllRegistered() { 177 void ComponentLoader::ClearAllRegistered() {
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 manifest.release(), 768 manifest.release(),
769 root_directory, 769 root_directory,
770 false); 770 false);
771 CHECK_EQ(extension_id, actual_extension_id); 771 CHECK_EQ(extension_id, actual_extension_id);
772 if (!done_cb.is_null()) 772 if (!done_cb.is_null())
773 done_cb.Run(); 773 done_cb.Run();
774 } 774 }
775 #endif 775 #endif
776 776
777 } // namespace extensions 777 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698