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

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

Issue 62713003: Move ExtensionProcessManager to src/extensions, part 4 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 1 month 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
OLDNEW
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_dispatcher.h" 5 #include "chrome/browser/extensions/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 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 callback_wrapper->CreateCallback(params.request_id)); 315 callback_wrapper->CreateCallback(params.request_id));
316 } 316 }
317 317
318 void ExtensionFunctionDispatcher::DispatchWithCallback( 318 void ExtensionFunctionDispatcher::DispatchWithCallback(
319 const ExtensionHostMsg_Request_Params& params, 319 const ExtensionHostMsg_Request_Params& params,
320 RenderViewHost* render_view_host, 320 RenderViewHost* render_view_host,
321 const ExtensionFunction::ResponseCallback& callback) { 321 const ExtensionFunction::ResponseCallback& callback) {
322 // TODO(yzshen): There is some shared logic between this method and 322 // TODO(yzshen): There is some shared logic between this method and
323 // DispatchOnIOThread(). It is nice to deduplicate. 323 // DispatchOnIOThread(). It is nice to deduplicate.
324 ExtensionService* service = profile()->GetExtensionService(); 324 ExtensionService* service = profile()->GetExtensionService();
325 ExtensionProcessManager* process_manager = 325 extensions::ProcessManager* process_manager =
326 extensions::ExtensionSystem::Get(profile())->process_manager(); 326 extensions::ExtensionSystem::Get(profile())->process_manager();
327 extensions::ProcessMap* process_map = service->process_map(); 327 extensions::ProcessMap* process_map = service->process_map();
328 if (!service || !process_map) 328 if (!service || !process_map)
329 return; 329 return;
330 330
331 const Extension* extension = service->extensions()->GetByID( 331 const Extension* extension = service->extensions()->GetByID(
332 params.extension_id); 332 params.extension_id);
333 if (!extension) 333 if (!extension)
334 extension = service->extensions()->GetHostedAppByURL(params.source_url); 334 extension = service->extensions()->GetHostedAppByURL(params.source_url);
335 335
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 return function; 488 return function;
489 } 489 }
490 490
491 // static 491 // static
492 void ExtensionFunctionDispatcher::SendAccessDenied( 492 void ExtensionFunctionDispatcher::SendAccessDenied(
493 const ExtensionFunction::ResponseCallback& callback) { 493 const ExtensionFunction::ResponseCallback& callback) {
494 ListValue empty_list; 494 ListValue empty_list;
495 callback.Run(ExtensionFunction::FAILED, empty_list, 495 callback.Run(ExtensionFunction::FAILED, empty_list,
496 "Access to extension API denied."); 496 "Access to extension API denied.");
497 } 497 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_crash_recovery_browsertest.cc ('k') | chrome/browser/extensions/extension_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698