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

Side by Side Diff: chrome/browser/component_updater/pnacl_component_installer.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/component_updater/pnacl_component_installer.h" 5 #include "chrome/browser/component_updater/pnacl_component_installer.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 found = true; 120 found = true;
121 } 121 }
122 } 122 }
123 return found; 123 return found;
124 } 124 }
125 125
126 // Read a manifest file in. 126 // Read a manifest file in.
127 base::DictionaryValue* ReadJSONManifest(const base::FilePath& manifest_path) { 127 base::DictionaryValue* ReadJSONManifest(const base::FilePath& manifest_path) {
128 JSONFileValueDeserializer deserializer(manifest_path); 128 JSONFileValueDeserializer deserializer(manifest_path);
129 std::string error; 129 std::string error;
130 scoped_ptr<base::Value> root(deserializer.Deserialize(NULL, &error)); 130 scoped_ptr<base::Value> root = deserializer.Deserialize(NULL, &error);
131 if (!root.get()) 131 if (!root.get())
132 return NULL; 132 return NULL;
133 if (!root->IsType(base::Value::TYPE_DICTIONARY)) 133 if (!root->IsType(base::Value::TYPE_DICTIONARY))
134 return NULL; 134 return NULL;
135 return static_cast<base::DictionaryValue*>(root.release()); 135 return static_cast<base::DictionaryValue*>(root.release());
136 } 136 }
137 137
138 // Read the PNaCl specific manifest. 138 // Read the PNaCl specific manifest.
139 base::DictionaryValue* ReadPnaclManifest(const base::FilePath& unpack_path) { 139 base::DictionaryValue* ReadPnaclManifest(const base::FilePath& unpack_path) {
140 base::FilePath manifest_path = 140 base::FilePath manifest_path =
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 } // namespace component_updater 375 } // namespace component_updater
376 376
377 namespace pnacl { 377 namespace pnacl {
378 378
379 bool NeedsOnDemandUpdate() { 379 bool NeedsOnDemandUpdate() {
380 return base::subtle::NoBarrier_Load( 380 return base::subtle::NoBarrier_Load(
381 &component_updater::needs_on_demand_update) != 0; 381 &component_updater::needs_on_demand_update) != 0;
382 } 382 }
383 383
384 } // namespace pnacl 384 } // namespace pnacl
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698