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

Unified Diff: extensions/browser/api/web_request/web_request_api.h

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.h
diff --git a/extensions/browser/api/web_request/web_request_api.h b/extensions/browser/api/web_request/web_request_api.h
index 773cb5873453b694c471f74d9a5246b1073f5d91..f519409aa99a916406fba22da6abbc96deaa4e92 100644
--- a/extensions/browser/api/web_request/web_request_api.h
+++ b/extensions/browser/api/web_request/web_request_api.h
@@ -13,6 +13,7 @@
#include "base/memory/singleton.h"
#include "base/memory/weak_ptr.h"
+#include "base/strings/string_util.h"
#include "base/time/time.h"
#include "content/public/common/resource_type.h"
#include "extensions/browser/api/declarative/rules_registry.h"
@@ -488,8 +489,20 @@ class ExtensionWebRequestEventRouter
DISALLOW_COPY_AND_ASSIGN(ExtensionWebRequestEventRouter);
};
+class WebRequestInternalFunction : public SyncIOThreadExtensionFunction {
+ public:
+ WebRequestInternalFunction() {}
+
+ protected:
+ ~WebRequestInternalFunction() override {}
+
+ const std::string& extension_id_safe() const {
+ return extension() ? extension_id() : base::EmptyString();
+ }
+};
+
class WebRequestInternalAddEventListenerFunction
- : public SyncIOThreadExtensionFunction {
+ : public WebRequestInternalFunction {
public:
DECLARE_EXTENSION_FUNCTION("webRequestInternal.addEventListener",
WEBREQUESTINTERNAL_ADDEVENTLISTENER)
@@ -502,7 +515,7 @@ class WebRequestInternalAddEventListenerFunction
};
class WebRequestInternalEventHandledFunction
- : public SyncIOThreadExtensionFunction {
+ : public WebRequestInternalFunction {
public:
DECLARE_EXTENSION_FUNCTION("webRequestInternal.eventHandled",
WEBREQUESTINTERNAL_EVENTHANDLED)
@@ -526,7 +539,7 @@ class WebRequestInternalEventHandledFunction
};
class WebRequestHandlerBehaviorChangedFunction
- : public SyncIOThreadExtensionFunction {
+ : public WebRequestInternalFunction {
public:
DECLARE_EXTENSION_FUNCTION("webRequest.handlerBehaviorChanged",
WEBREQUEST_HANDLERBEHAVIORCHANGED)

Powered by Google App Engine
This is Rietveld 408576698