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

Side by Side Diff: extensions/browser/extension_function.cc

Issue 1129083003: More base::Values-related bare pointer -> scoped_ptr conversions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix bad merge Created 5 years, 7 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/extension_function.h ('k') | extensions/common/event_filtering_info.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/browser/extension_function.h" 5 #include "extensions/browser/extension_function.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "base/synchronization/lock.h" 9 #include "base/synchronization/lock.h"
10 #include "content/public/browser/notification_source.h" 10 #include "content/public/browser/notification_source.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 void ExtensionFunction::SetArgs(const base::ListValue* args) { 266 void ExtensionFunction::SetArgs(const base::ListValue* args) {
267 DCHECK(!args_.get()); // Should only be called once. 267 DCHECK(!args_.get()); // Should only be called once.
268 args_.reset(args->DeepCopy()); 268 args_.reset(args->DeepCopy());
269 } 269 }
270 270
271 void ExtensionFunction::SetResult(base::Value* result) { 271 void ExtensionFunction::SetResult(base::Value* result) {
272 results_.reset(new base::ListValue()); 272 results_.reset(new base::ListValue());
273 results_->Append(result); 273 results_->Append(result);
274 } 274 }
275 275
276 void ExtensionFunction::SetResult(scoped_ptr<base::Value> result) {
277 results_.reset(new base::ListValue());
278 results_->Append(result.Pass());
279 }
280
276 void ExtensionFunction::SetResultList(scoped_ptr<base::ListValue> results) { 281 void ExtensionFunction::SetResultList(scoped_ptr<base::ListValue> results) {
277 results_ = results.Pass(); 282 results_ = results.Pass();
278 } 283 }
279 284
280 const base::ListValue* ExtensionFunction::GetResultList() const { 285 const base::ListValue* ExtensionFunction::GetResultList() const {
281 return results_.get(); 286 return results_.get();
282 } 287 }
283 288
284 std::string ExtensionFunction::GetError() const { 289 std::string ExtensionFunction::GetError() const {
285 return error_; 290 return error_;
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 580
576 ExtensionFunction::ResponseAction SyncIOThreadExtensionFunction::Run() { 581 ExtensionFunction::ResponseAction SyncIOThreadExtensionFunction::Run() {
577 return RespondNow(RunSync() ? ArgumentList(results_.Pass()) : Error(error_)); 582 return RespondNow(RunSync() ? ArgumentList(results_.Pass()) : Error(error_));
578 } 583 }
579 584
580 // static 585 // static
581 bool SyncIOThreadExtensionFunction::ValidationFailure( 586 bool SyncIOThreadExtensionFunction::ValidationFailure(
582 SyncIOThreadExtensionFunction* function) { 587 SyncIOThreadExtensionFunction* function) {
583 return false; 588 return false;
584 } 589 }
OLDNEW
« no previous file with comments | « extensions/browser/extension_function.h ('k') | extensions/common/event_filtering_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698