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

Unified Diff: extensions/renderer/extension_injection_host.h

Issue 934763003: Refactoring: de-couple Extensions from "script injection System" [render side]:3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@decouple_brower_isolated_world_routingid_user_script_1
Patch Set: Devlin's comments. Created 5 years, 10 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/renderer/extension_injection_host.h
diff --git a/extensions/renderer/extension_injection_host.h b/extensions/renderer/extension_injection_host.h
index d940c949f7b473399a1ae015608ec307868e1439..bdf6f41247e462de823c87f69487ee7eb9a7d8b3 100644
--- a/extensions/renderer/extension_injection_host.h
+++ b/extensions/renderer/extension_injection_host.h
@@ -10,17 +10,23 @@
#include "extensions/renderer/injection_host.h"
namespace extensions {
+class ExtensionSet;
// A wrapper class that holds an extension and implements the InjectionHost
// interface.
class ExtensionInjectionHost : public InjectionHost {
public:
- ExtensionInjectionHost(const scoped_refptr<const Extension>& extension);
+ ExtensionInjectionHost(const Extension* extension);
~ExtensionInjectionHost() override;
+ // Create an ExtensionInjectionHost object. If the extension is gone, returns
+ // a null scoped ptr.
+ static scoped_ptr<const ExtensionInjectionHost> Create(
+ const std::string& extension_id, const ExtensionSet* extensions);
+
private:
// InjectionHost:
- const std::string& GetContentSecurityPolicy() const override;
+ std::string GetContentSecurityPolicy() const override;
const GURL& url() const override;
const std::string& name() const override;
PermissionsData::AccessType CanExecuteOnFrame(
@@ -30,7 +36,7 @@ class ExtensionInjectionHost : public InjectionHost {
bool is_declarative) const override;
bool ShouldNotifyBrowserOfInjection() const override;
- scoped_refptr<const Extension> extension_;
+ const Extension* extension_;
DISALLOW_COPY_AND_ASSIGN(ExtensionInjectionHost);
};

Powered by Google App Engine
This is Rietveld 408576698