OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_dispatcher.h" | 5 #include "extensions/browser/extension_function_dispatcher.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/json/json_string_value_serializer.h" | 8 #include "base/json/json_string_value_serializer.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 // static | 224 // static |
225 void ExtensionFunctionDispatcher::DispatchOnIOThread( | 225 void ExtensionFunctionDispatcher::DispatchOnIOThread( |
226 InfoMap* extension_info_map, | 226 InfoMap* extension_info_map, |
227 void* profile_id, | 227 void* profile_id, |
228 int render_process_id, | 228 int render_process_id, |
229 base::WeakPtr<ExtensionMessageFilter> ipc_sender, | 229 base::WeakPtr<ExtensionMessageFilter> ipc_sender, |
230 int routing_id, | 230 int routing_id, |
231 const ExtensionHostMsg_Request_Params& params) { | 231 const ExtensionHostMsg_Request_Params& params) { |
232 const Extension* extension = | 232 const Extension* extension = |
233 extension_info_map->extensions().GetByID(params.extension_id); | 233 extension_info_map->extensions().GetByID(params.extension_id); |
| 234 if (!extension) |
| 235 return; |
234 | 236 |
235 ExtensionFunction::ResponseCallback callback( | 237 ExtensionFunction::ResponseCallback callback( |
236 base::Bind(&IOThreadResponseCallback, ipc_sender, routing_id, | 238 base::Bind(&IOThreadResponseCallback, ipc_sender, routing_id, |
237 params.request_id)); | 239 params.request_id)); |
238 | 240 |
239 scoped_refptr<ExtensionFunction> function( | 241 scoped_refptr<ExtensionFunction> function( |
240 CreateExtensionFunction(params, | 242 CreateExtensionFunction(params, |
241 extension, | 243 extension, |
242 render_process_id, | 244 render_process_id, |
243 extension_info_map->process_map(), | 245 extension_info_map->process_map(), |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 | 464 |
463 // static | 465 // static |
464 void ExtensionFunctionDispatcher::SendAccessDenied( | 466 void ExtensionFunctionDispatcher::SendAccessDenied( |
465 const ExtensionFunction::ResponseCallback& callback) { | 467 const ExtensionFunction::ResponseCallback& callback) { |
466 base::ListValue empty_list; | 468 base::ListValue empty_list; |
467 callback.Run(ExtensionFunction::FAILED, empty_list, | 469 callback.Run(ExtensionFunction::FAILED, empty_list, |
468 "Access to extension API denied."); | 470 "Access to extension API denied."); |
469 } | 471 } |
470 | 472 |
471 } // namespace extensions | 473 } // namespace extensions |
OLD | NEW |