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

Side by Side Diff: extensions/browser/extension_function_dispatcher.cc

Issue 489033003: extensions: Speculative fix for crash on IO thread. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698