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

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

Issue 2539363004: Make base::Value::TYPE a scoped enum. (Closed)
Patch Set: Rebase Created 4 years 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 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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 } 415 }
416 return Run(); 416 return Run();
417 } 417 }
418 418
419 bool ExtensionFunction::ShouldSkipQuotaLimiting() const { 419 bool ExtensionFunction::ShouldSkipQuotaLimiting() const {
420 return false; 420 return false;
421 } 421 }
422 422
423 bool ExtensionFunction::HasOptionalArgument(size_t index) { 423 bool ExtensionFunction::HasOptionalArgument(size_t index) {
424 base::Value* value; 424 base::Value* value;
425 return args_->Get(index, &value) && !value->IsType(base::Value::TYPE_NULL); 425 return args_->Get(index, &value) && !value->IsType(base::Value::Type::NONE);
426 } 426 }
427 427
428 void ExtensionFunction::SendResponseImpl(bool success) { 428 void ExtensionFunction::SendResponseImpl(bool success) {
429 DCHECK(!response_callback_.is_null()); 429 DCHECK(!response_callback_.is_null());
430 DCHECK(!did_respond_) << name_; 430 DCHECK(!did_respond_) << name_;
431 did_respond_ = true; 431 did_respond_ = true;
432 432
433 ResponseType response = success ? SUCCEEDED : FAILED; 433 ResponseType response = success ? SUCCEEDED : FAILED;
434 if (bad_message_) { 434 if (bad_message_) {
435 response = BAD_MESSAGE; 435 response = BAD_MESSAGE;
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 void AsyncExtensionFunction::SendResponse(bool success) { 616 void AsyncExtensionFunction::SendResponse(bool success) {
617 ResponseValue response; 617 ResponseValue response;
618 if (success) { 618 if (success) {
619 response = ArgumentList(std::move(results_)); 619 response = ArgumentList(std::move(results_));
620 } else { 620 } else {
621 response = results_ ? ErrorWithArguments(std::move(results_), error_) 621 response = results_ ? ErrorWithArguments(std::move(results_), error_)
622 : Error(error_); 622 : Error(error_);
623 } 623 }
624 Respond(std::move(response)); 624 Respond(std::move(response));
625 } 625 }
OLDNEW
« no previous file with comments | « extensions/browser/api/system_network/system_network_apitest.cc ('k') | extensions/browser/extension_prefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698