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

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

Issue 2252373002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/event_router_unittest.cc ('k') | extensions/browser/extension_prefs.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 <utility> 7 #include <utility>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 void ExtensionFunction::SetError(const std::string& error) { 327 void ExtensionFunction::SetError(const std::string& error) {
328 error_ = error; 328 error_ = error;
329 } 329 }
330 330
331 bool ExtensionFunction::user_gesture() const { 331 bool ExtensionFunction::user_gesture() const {
332 return user_gesture_ || UserGestureForTests::GetInstance()->HaveGesture(); 332 return user_gesture_ || UserGestureForTests::GetInstance()->HaveGesture();
333 } 333 }
334 334
335 ExtensionFunction::ResponseValue ExtensionFunction::NoArguments() { 335 ExtensionFunction::ResponseValue ExtensionFunction::NoArguments() {
336 return ResponseValue(new ArgumentListResponseValue( 336 return ResponseValue(new ArgumentListResponseValue(
337 name(), "NoArguments", this, base::WrapUnique(new base::ListValue()))); 337 name(), "NoArguments", this, base::MakeUnique<base::ListValue>()));
338 } 338 }
339 339
340 ExtensionFunction::ResponseValue ExtensionFunction::OneArgument( 340 ExtensionFunction::ResponseValue ExtensionFunction::OneArgument(
341 std::unique_ptr<base::Value> arg) { 341 std::unique_ptr<base::Value> arg) {
342 std::unique_ptr<base::ListValue> args(new base::ListValue()); 342 std::unique_ptr<base::ListValue> args(new base::ListValue());
343 args->Append(std::move(arg)); 343 args->Append(std::move(arg));
344 return ResponseValue(new ArgumentListResponseValue(name(), "OneArgument", 344 return ResponseValue(new ArgumentListResponseValue(name(), "OneArgument",
345 this, std::move(args))); 345 this, std::move(args)));
346 } 346 }
347 347
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 634
635 ExtensionFunction::ResponseAction SyncExtensionFunction::Run() { 635 ExtensionFunction::ResponseAction SyncExtensionFunction::Run() {
636 return RespondNow(RunSync() ? ArgumentList(std::move(results_)) 636 return RespondNow(RunSync() ? ArgumentList(std::move(results_))
637 : Error(error_)); 637 : Error(error_));
638 } 638 }
639 639
640 // static 640 // static
641 bool SyncExtensionFunction::ValidationFailure(SyncExtensionFunction* function) { 641 bool SyncExtensionFunction::ValidationFailure(SyncExtensionFunction* function) {
642 return false; 642 return false;
643 } 643 }
OLDNEW
« no previous file with comments | « extensions/browser/event_router_unittest.cc ('k') | extensions/browser/extension_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698