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

Unified Diff: chrome/browser/extensions/extension_function_dispatcher.cc

Issue 10703111: Cleanup: make ExtensionRequestSender manage its IPC responses directly, rather (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert sceopd_observer change Created 8 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_function_dispatcher.cc
diff --git a/chrome/browser/extensions/extension_function_dispatcher.cc b/chrome/browser/extensions/extension_function_dispatcher.cc
index 1ad8e2885b385e861e06ef07c14a873e13da6ad7..0054f016019bd5a75ee75be0cf39ad385ec6a8a2 100644
--- a/chrome/browser/extensions/extension_function_dispatcher.cc
+++ b/chrome/browser/extensions/extension_function_dispatcher.cc
@@ -126,7 +126,6 @@ void ExtensionFunctionDispatcher::DispatchOnIOThread(
void* profile,
int render_process_id,
base::WeakPtr<ChromeRenderMessageFilter> ipc_sender,
- int routing_id,
const ExtensionHostMsg_Request_Params& params) {
const Extension* extension =
extension_info_map->extensions().GetByID(params.extension_id);
@@ -136,7 +135,7 @@ void ExtensionFunctionDispatcher::DispatchOnIOThread(
extension_info_map->process_map(),
g_global_io_data.Get().api.get(),
profile,
- ipc_sender, routing_id));
+ ipc_sender));
if (!function) {
LogFailure(extension, params.name, kAccessDenied);
return;
@@ -148,7 +147,7 @@ void ExtensionFunctionDispatcher::DispatchOnIOThread(
NOTREACHED();
return;
}
- function_io->set_ipc_sender(ipc_sender, routing_id);
+ function_io->set_ipc_sender(ipc_sender);
function_io->set_extension_info_map(extension_info_map);
function->set_include_incognito(
extension_info_map->IsIncognitoEnabled(extension->id()));
@@ -189,12 +188,13 @@ void ExtensionFunctionDispatcher::Dispatch(
params.source_url));
scoped_refptr<ExtensionFunction> function(
- CreateExtensionFunction(params, extension,
+ CreateExtensionFunction(params,
+ extension,
render_view_host->GetProcess()->GetID(),
*(service->process_map()),
extensions::ExtensionAPI::GetSharedInstance(),
- profile(), render_view_host,
- render_view_host->GetRoutingID()));
+ profile(),
+ render_view_host));
if (!function) {
LogFailure(extension, params.name, kAccessDenied);
return;
@@ -250,11 +250,10 @@ ExtensionFunction* ExtensionFunctionDispatcher::CreateExtensionFunction(
const extensions::ProcessMap& process_map,
extensions::ExtensionAPI* api,
void* profile,
- IPC::Sender* ipc_sender,
- int routing_id) {
+ IPC::Sender* ipc_sender) {
if (!extension) {
LOG(ERROR) << "Specified extension does not exist.";
- SendAccessDenied(ipc_sender, routing_id, params.request_id);
+ SendAccessDenied(ipc_sender, params.request_id);
return NULL;
}
@@ -263,14 +262,14 @@ ExtensionFunction* ExtensionFunctionDispatcher::CreateExtensionFunction(
LOG(ERROR) << "Extension API called from incorrect process "
<< requesting_process_id
<< " from URL " << params.source_url.spec();
- SendAccessDenied(ipc_sender, routing_id, params.request_id);
+ SendAccessDenied(ipc_sender, params.request_id);
return NULL;
}
if (!extension->HasAPIPermission(params.name)) {
LOG(ERROR) << "Extension " << extension->id() << " does not have "
<< "permission to function: " << params.name;
- SendAccessDenied(ipc_sender, routing_id, params.request_id);
+ SendAccessDenied(ipc_sender, params.request_id);
return NULL;
}
@@ -288,9 +287,9 @@ ExtensionFunction* ExtensionFunctionDispatcher::CreateExtensionFunction(
// static
void ExtensionFunctionDispatcher::SendAccessDenied(
- IPC::Sender* ipc_sender, int routing_id, int request_id) {
+ IPC::Sender* ipc_sender, int request_id) {
ListValue empty_list;
ipc_sender->Send(new ExtensionMsg_Response(
- routing_id, request_id, false, empty_list,
+ request_id, false, empty_list,
"Access to extension API denied."));
}

Powered by Google App Engine
This is Rietveld 408576698