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

Side by Side Diff: extensions/utility/utility_handler.cc

Issue 2803023005: Switch base::Value typemapping to be by value instead of by unique_ptr.
Patch Set: Created 3 years, 8 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 | « extensions/browser/sandboxed_unpacker.cc ('k') | media/base/video_frame_metadata.h » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/utility/utility_handler.h" 5 #include "extensions/utility/utility_handler.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "content/public/utility/utility_thread.h" 9 #include "content/public/utility/utility_thread.h"
10 #include "extensions/common/constants.h" 10 #include "extensions/common/constants.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 const UnpackCallback& callback) override { 56 const UnpackCallback& callback) override {
57 CHECK_GT(location, Manifest::INVALID_LOCATION); 57 CHECK_GT(location, Manifest::INVALID_LOCATION);
58 CHECK_LT(location, Manifest::NUM_LOCATIONS); 58 CHECK_LT(location, Manifest::NUM_LOCATIONS);
59 DCHECK(ExtensionsClient::Get()); 59 DCHECK(ExtensionsClient::Get());
60 60
61 content::UtilityThread::Get()->EnsureBlinkInitialized(); 61 content::UtilityThread::Get()->EnsureBlinkInitialized();
62 62
63 Unpacker unpacker(path.DirName(), path, extension_id, location, 63 Unpacker unpacker(path.DirName(), path, extension_id, location,
64 creation_flags); 64 creation_flags);
65 if (unpacker.Run()) { 65 if (unpacker.Run()) {
66 callback.Run(base::string16(), unpacker.TakeParsedManifest()); 66 callback.Run(base::string16(), std::move(*unpacker.TakeParsedManifest()));
67 } else { 67 } else {
68 callback.Run(unpacker.error_message(), nullptr); 68 callback.Run(unpacker.error_message(), base::nullopt);
69 } 69 }
70 } 70 }
71 71
72 static bool UnzipFileManifestIntoPath( 72 static bool UnzipFileManifestIntoPath(
73 const base::FilePath& file, 73 const base::FilePath& file,
74 const base::FilePath& path, 74 const base::FilePath& path,
75 std::unique_ptr<base::DictionaryValue>* manifest) { 75 std::unique_ptr<base::DictionaryValue>* manifest) {
76 if (zip::UnzipWithFilterCallback( 76 if (zip::UnzipWithFilterCallback(
77 file, path, base::Bind(&Unpacker::IsManifestFile), false)) { 77 file, path, base::Bind(&Unpacker::IsManifestFile), false)) {
78 std::string error; 78 std::string error;
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 if (running_elevated) 141 if (running_elevated)
142 return; 142 return;
143 143
144 registry->AddInterface(base::Bind(&ExtensionUnpackerImpl::Create)); 144 registry->AddInterface(base::Bind(&ExtensionUnpackerImpl::Create));
145 registry->AddInterface(base::Bind(&ManifestParserImpl::Create)); 145 registry->AddInterface(base::Bind(&ManifestParserImpl::Create));
146 } 146 }
147 147
148 } // namespace utility_handler 148 } // namespace utility_handler
149 149
150 } // namespace extensions 150 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/sandboxed_unpacker.cc ('k') | media/base/video_frame_metadata.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698