| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 100 |
| 101 void ExtensionFunction::SetError(const std::string& error) { | 101 void ExtensionFunction::SetError(const std::string& error) { |
| 102 error_ = error; | 102 error_ = error; |
| 103 } | 103 } |
| 104 | 104 |
| 105 void ExtensionFunction::Run() { | 105 void ExtensionFunction::Run() { |
| 106 if (!RunImpl()) | 106 if (!RunImpl()) |
| 107 SendResponse(false); | 107 SendResponse(false); |
| 108 } | 108 } |
| 109 | 109 |
| 110 bool ExtensionFunction::ShouldSkipQuotaLimiting() const { |
| 111 return false; |
| 112 } |
| 113 |
| 110 bool ExtensionFunction::HasOptionalArgument(size_t index) { | 114 bool ExtensionFunction::HasOptionalArgument(size_t index) { |
| 111 Value* value; | 115 Value* value; |
| 112 return args_->Get(index, &value) && !value->IsType(Value::TYPE_NULL); | 116 return args_->Get(index, &value) && !value->IsType(Value::TYPE_NULL); |
| 113 } | 117 } |
| 114 | 118 |
| 115 void ExtensionFunction::SendResponseImpl(base::ProcessHandle process, | 119 void ExtensionFunction::SendResponseImpl(base::ProcessHandle process, |
| 116 IPC::Message::Sender* ipc_sender, | 120 IPC::Message::Sender* ipc_sender, |
| 117 int routing_id, | 121 int routing_id, |
| 118 bool success) { | 122 bool success) { |
| 119 DCHECK(ipc_sender); | 123 DCHECK(ipc_sender); |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 | 239 |
| 236 SyncIOThreadExtensionFunction::SyncIOThreadExtensionFunction() { | 240 SyncIOThreadExtensionFunction::SyncIOThreadExtensionFunction() { |
| 237 } | 241 } |
| 238 | 242 |
| 239 SyncIOThreadExtensionFunction::~SyncIOThreadExtensionFunction() { | 243 SyncIOThreadExtensionFunction::~SyncIOThreadExtensionFunction() { |
| 240 } | 244 } |
| 241 | 245 |
| 242 void SyncIOThreadExtensionFunction::Run() { | 246 void SyncIOThreadExtensionFunction::Run() { |
| 243 SendResponse(RunImpl()); | 247 SendResponse(RunImpl()); |
| 244 } | 248 } |
| OLD | NEW |