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

Unified Diff: extensions/browser/extension_function_dispatcher.cc

Issue 670173002: Fix webrequest api for webview in webui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scoped_refptr not testable Created 6 years, 2 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
« no previous file with comments | « extensions/browser/extension_function.h ('k') | extensions/browser/guest_view/guest_view_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_function_dispatcher.cc
diff --git a/extensions/browser/extension_function_dispatcher.cc b/extensions/browser/extension_function_dispatcher.cc
index f9bbec561b911df0eadb21606c01769ed0b4916f..5edb3ecd41da0fbcd4c673fe48c502b9a7396bbe 100644
--- a/extensions/browser/extension_function_dispatcher.cc
+++ b/extensions/browser/extension_function_dispatcher.cc
@@ -229,8 +229,6 @@ void ExtensionFunctionDispatcher::DispatchOnIOThread(
const ExtensionHostMsg_Request_Params& params) {
const Extension* extension =
extension_info_map->extensions().GetByID(params.extension_id);
- if (!extension)
- return;
ExtensionFunction::ResponseCallback callback(
base::Bind(&IOThreadResponseCallback, ipc_sender, routing_id,
@@ -255,12 +253,21 @@ void ExtensionFunctionDispatcher::DispatchOnIOThread(
}
function_io->set_ipc_sender(ipc_sender, routing_id);
function_io->set_extension_info_map(extension_info_map);
- function->set_include_incognito(
- extension_info_map->IsIncognitoEnabled(extension->id()));
+ if (extension) {
+ function->set_include_incognito(
+ extension_info_map->IsIncognitoEnabled(extension->id()));
+ }
if (!CheckPermissions(function.get(), params, callback))
return;
+ if (!extension) {
+ // Skip all of the UMA, quota, event page, activity logging stuff if there
+ // isn't an extension, e.g. if the function call was from WebUI.
+ function->Run()->Execute();
+ return;
+ }
+
QuotaService* quota = extension_info_map->GetQuotaService();
std::string violation_error = quota->Assess(extension->id(),
function.get(),
« no previous file with comments | « extensions/browser/extension_function.h ('k') | extensions/browser/guest_view/guest_view_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698