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

Unified Diff: chrome/browser/extensions/chrome_content_browser_client_extensions_part.h

Issue 2182633007: Avoid using ContentBrowserClient::IsIllegalOrigin in ResourceDispatcherHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile failures Created 4 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/chrome_content_browser_client_extensions_part.h
diff --git a/chrome/browser/extensions/chrome_content_browser_client_extensions_part.h b/chrome/browser/extensions/chrome_content_browser_client_extensions_part.h
index 8982d5271a418fac9dfd9a473c7c5c9d4b32fb00..07cb4365c1740ca996d8ee417eb91ab23f268f95 100644
--- a/chrome/browser/extensions/chrome_content_browser_client_extensions_part.h
+++ b/chrome/browser/extensions/chrome_content_browser_client_extensions_part.h
@@ -16,6 +16,9 @@ class VpnServiceProxy;
namespace extensions {
+class Extension;
+class InfoMap;
+
// Implements the extensions portion of ChromeContentBrowserClient.
class ChromeContentBrowserClientExtensionsPart
: public ChromeContentBrowserClientParts {
@@ -71,6 +74,16 @@ class ChromeContentBrowserClientExtensionsPart
static std::unique_ptr<content::VpnServiceProxy> GetVpnServiceProxy(
content::BrowserContext* browser_context);
+ // Updates the ResourceDispatcherHost instance with the extension origin
+ // access information.
+ static void AddExtension(const content::ResourceContext* context,
+ const Extension* extension);
+
+ // Removes the extension origin access information from the
+ // ResourceDispatcherHost instance.
+ static void RemoveExtension(const content::ResourceContext* context,
+ const std::string& extension_id);
+
private:
// ChromeContentBrowserClientParts:
void RenderProcessWillLaunch(content::RenderProcessHost* host) override;
@@ -92,6 +105,22 @@ class ChromeContentBrowserClientExtensionsPart
content::RenderProcessHost* process,
Profile* profile) override;
+ // Helper functions to register and unregister an extension process. Invoked
+ // on the IO thread.
+ static void RegisterExtensionProcessHelper(
+ InfoMap* info_map,
+ const Extension* extension,
+ int process_id,
+ int site_instance_id,
+ const content::ResourceContext* context);
+
+ static void UnregisterExtensionProcessHelper(
+ InfoMap* info_map,
+ const Extension* extension,
+ int process_id,
+ int site_instance_id,
+ const content::ResourceContext* context);
+
DISALLOW_COPY_AND_ASSIGN(ChromeContentBrowserClientExtensionsPart);
};

Powered by Google App Engine
This is Rietveld 408576698