OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |