| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 } | 180 } |
| 181 | 181 |
| 182 void IOThreadExtensionFunction::SendResponse(bool success) { | 182 void IOThreadExtensionFunction::SendResponse(bool success) { |
| 183 if (!ipc_sender()) | 183 if (!ipc_sender()) |
| 184 return; | 184 return; |
| 185 | 185 |
| 186 SendResponseImpl(ipc_sender()->peer_handle(), | 186 SendResponseImpl(ipc_sender()->peer_handle(), |
| 187 ipc_sender(), routing_id_, success); | 187 ipc_sender(), routing_id_, success); |
| 188 } | 188 } |
| 189 | 189 |
| 190 AsyncExtensionFunction::AsyncExtensionFunction() : delegate_(NULL) { | 190 AsyncExtensionFunction::AsyncExtensionFunction() { |
| 191 } | |
| 192 | |
| 193 void AsyncExtensionFunction::SendResponse(bool success) { | |
| 194 if (delegate_) | |
| 195 delegate_->OnSendResponse(this, success); | |
| 196 else | |
| 197 UIThreadExtensionFunction::SendResponse(success); | |
| 198 } | 191 } |
| 199 | 192 |
| 200 AsyncExtensionFunction::~AsyncExtensionFunction() { | 193 AsyncExtensionFunction::~AsyncExtensionFunction() { |
| 201 } | 194 } |
| 202 | 195 |
| 203 SyncExtensionFunction::SyncExtensionFunction() { | 196 SyncExtensionFunction::SyncExtensionFunction() { |
| 204 } | 197 } |
| 205 | 198 |
| 206 SyncExtensionFunction::~SyncExtensionFunction() { | 199 SyncExtensionFunction::~SyncExtensionFunction() { |
| 207 } | 200 } |
| 208 | 201 |
| 209 void SyncExtensionFunction::Run() { | 202 void SyncExtensionFunction::Run() { |
| 210 SendResponse(RunImpl()); | 203 SendResponse(RunImpl()); |
| 211 } | 204 } |
| 212 | 205 |
| 213 SyncIOThreadExtensionFunction::SyncIOThreadExtensionFunction() { | 206 SyncIOThreadExtensionFunction::SyncIOThreadExtensionFunction() { |
| 214 } | 207 } |
| 215 | 208 |
| 216 SyncIOThreadExtensionFunction::~SyncIOThreadExtensionFunction() { | 209 SyncIOThreadExtensionFunction::~SyncIOThreadExtensionFunction() { |
| 217 } | 210 } |
| 218 | 211 |
| 219 void SyncIOThreadExtensionFunction::Run() { | 212 void SyncIOThreadExtensionFunction::Run() { |
| 220 SendResponse(RunImpl()); | 213 SendResponse(RunImpl()); |
| 221 } | 214 } |
| OLD | NEW |