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

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

Issue 7661009: base: Add Is* functions to Value class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tony review Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/extensions/extension_function.h" 5 #include "chrome/browser/extensions/extension_function.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "chrome/browser/extensions/extension_function_dispatcher.h" 9 #include "chrome/browser/extensions/extension_function_dispatcher.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 return error_; 79 return error_;
80 } 80 }
81 81
82 void ExtensionFunction::Run() { 82 void ExtensionFunction::Run() {
83 if (!RunImpl()) 83 if (!RunImpl())
84 SendResponse(false); 84 SendResponse(false);
85 } 85 }
86 86
87 bool ExtensionFunction::HasOptionalArgument(size_t index) { 87 bool ExtensionFunction::HasOptionalArgument(size_t index) {
88 Value* value; 88 Value* value;
89 return args_->Get(index, &value) && !value->IsType(Value::TYPE_NULL); 89 return args_->Get(index, &value) && !value->IsNull();
90 } 90 }
91 91
92 void ExtensionFunction::SendResponseImpl(base::ProcessHandle process, 92 void ExtensionFunction::SendResponseImpl(base::ProcessHandle process,
93 IPC::Message::Sender* ipc_sender, 93 IPC::Message::Sender* ipc_sender,
94 int routing_id, 94 int routing_id,
95 bool success) { 95 bool success) {
96 DCHECK(ipc_sender); 96 DCHECK(ipc_sender);
97 if (bad_message_) { 97 if (bad_message_) {
98 HandleBadMessage(process); 98 HandleBadMessage(process);
99 return; 99 return;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 194
195 SyncIOThreadExtensionFunction::SyncIOThreadExtensionFunction() { 195 SyncIOThreadExtensionFunction::SyncIOThreadExtensionFunction() {
196 } 196 }
197 197
198 SyncIOThreadExtensionFunction::~SyncIOThreadExtensionFunction() { 198 SyncIOThreadExtensionFunction::~SyncIOThreadExtensionFunction() {
199 } 199 }
200 200
201 void SyncIOThreadExtensionFunction::Run() { 201 void SyncIOThreadExtensionFunction::Run() {
202 SendResponse(RunImpl()); 202 SendResponse(RunImpl());
203 } 203 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_debugger_api.cc ('k') | chrome/browser/extensions/extension_management_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698