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

Unified Diff: extensions/browser/api/web_request/web_request_api.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
Index: extensions/browser/api/web_request/web_request_api.cc
diff --git a/extensions/browser/api/web_request/web_request_api.cc b/extensions/browser/api/web_request/web_request_api.cc
index a188447e4f60be779268176a24cb3e9efb415744..c1e8f9d36ab0dd3bedd29b4500285cce82f14653 100644
--- a/extensions/browser/api/web_request/web_request_api.cc
+++ b/extensions/browser/api/web_request/web_request_api.cc
@@ -2213,8 +2213,9 @@ bool WebRequestInternalAddEventListenerFunction::RunSync() {
ipc_sender.get() ? ipc_sender->render_process_id() : -1;
const Extension* extension =
- extension_info_map()->extensions().GetByID(extension_id());
- std::string extension_name = extension ? extension->name() : extension_id();
+ extension_info_map()->extensions().GetByID(extension_id_safe());
+ std::string extension_name =
+ extension ? extension->name() : extension_id_safe();
bool is_web_view_guest = webview_instance_id != 0;
// We check automatically whether the extension has the 'webRequest'
@@ -2244,7 +2245,7 @@ bool WebRequestInternalAddEventListenerFunction::RunSync() {
bool success =
ExtensionWebRequestEventRouter::GetInstance()->AddEventListener(
- profile_id(), extension_id(), extension_name,
+ profile_id(), extension_id_safe(), extension_name,
event_name, sub_event_name, filter, extra_info_spec,
embedder_process_id, webview_instance_id, ipc_sender_weak());
EXTENSION_FUNCTION_VALIDATE(success);
@@ -2269,7 +2270,7 @@ void WebRequestInternalEventHandledFunction::RespondWithError(
error_ = error;
ExtensionWebRequestEventRouter::GetInstance()->OnEventHandled(
profile_id(),
- extension_id(),
+ extension_id_safe(),
event_name,
sub_event_name,
request_id,
@@ -2296,9 +2297,9 @@ bool WebRequestInternalEventHandledFunction::RunSync() {
if (!value->empty()) {
base::Time install_time =
- extension_info_map()->GetInstallTime(extension_id());
+ extension_info_map()->GetInstallTime(extension_id_safe());
response.reset(new ExtensionWebRequestEventRouter::EventResponse(
- extension_id(), install_time));
+ extension_id_safe(), install_time));
}
if (value->HasKey("cancel")) {
@@ -2421,7 +2422,7 @@ bool WebRequestInternalEventHandledFunction::RunSync() {
}
ExtensionWebRequestEventRouter::GetInstance()->OnEventHandled(
- profile_id(), extension_id(), event_name, sub_event_name, request_id,
+ profile_id(), extension_id_safe(), event_name, sub_event_name, request_id,
response.release());
return true;
@@ -2445,7 +2446,7 @@ void WebRequestHandlerBehaviorChangedFunction::OnQuotaExceeded(
// Post warning message.
WarningSet warnings;
warnings.insert(
- Warning::CreateRepeatedCacheFlushesWarning(extension_id()));
+ Warning::CreateRepeatedCacheFlushesWarning(extension_id_safe()));
BrowserThread::PostTask(
BrowserThread::UI,
FROM_HERE,
« no previous file with comments | « extensions/browser/api/web_request/web_request_api.h ('k') | extensions/browser/api/web_request/web_request_api_helpers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698