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

Unified Diff: chrome/browser/extensions/api/declarative_content/content_action.h

Issue 822453002: Introduce HostID and de-couple Extensions from "script injection System" [browser side] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another round of comments of Devlin@. Created 5 years, 11 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/api/declarative_content/content_action.h
diff --git a/chrome/browser/extensions/api/declarative_content/content_action.h b/chrome/browser/extensions/api/declarative_content/content_action.h
index dc39431aed870bfe65d677064bf23bc30e542a05..93b2cf79960152f5605f5305041ca874419b9836 100644
--- a/chrome/browser/extensions/api/declarative_content/content_action.h
+++ b/chrome/browser/extensions/api/declarative_content/content_action.h
@@ -95,6 +95,9 @@ class RequestContentScript : public ContentAction {
public:
struct ScriptData;
+ // TODO(hanxi): add RulesRegistryID to the RequestKey.
+ using RequestKey = std::string;
+
RequestContentScript(content::BrowserContext* browser_context,
const Extension* extension,
const ScriptData& script_data);
@@ -150,6 +153,13 @@ class RequestContentScript : public ContentAction {
const std::string& extension_id) const;
UserScript script_;
+
+ // The lifetime of the |master_| is managed by DeclarativeUserScriptManager,
Devlin 2015/01/21 23:25:20 How about instead "Since the lifetime of Declarati
Xi Han 2015/01/22 17:19:36 Sounds better, thanks!
+ // which manages a map of master objects.
+ // DeclarativeUserScriptManager is owned by ExtensionSystemImpl::Shared, and a
+ // master object will only be desctructed when the
+ // DeclarativeUserScriptManager is desctructed.
+ // So it is safe to use a raw pointer here.
DeclarativeUserScriptMaster* master_;
DISALLOW_COPY_AND_ASSIGN(RequestContentScript);

Powered by Google App Engine
This is Rietveld 408576698