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

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: Change ConsumerID to class; remove usages of linked_ptr, and nits. 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..67ee47923d27700317730bb9d81211cbd47e964c 100644
--- a/chrome/browser/extensions/api/declarative_content/content_action.h
+++ b/chrome/browser/extensions/api/declarative_content/content_action.h
@@ -95,6 +95,15 @@ class RequestContentScript : public ContentAction {
public:
struct ScriptData;
+ // TODO(hanxi): add RulesRegistryID to the RequestKey.
+ struct RequestKey {
Devlin 2015/01/20 17:51:05 Could we instead just use a std::string for this?
Xi Han 2015/01/21 21:30:16 Ok, I will change it to std::string, and change it
+ explicit RequestKey(const std::string& host_id) : host_id(host_id) {}
+ bool operator<(const RequestKey& key) const {
+ return host_id.compare(key.host_id) < 0;
+ }
+ std::string host_id;
+ };
+
RequestContentScript(content::BrowserContext* browser_context,
const Extension* extension,
const ScriptData& script_data);
@@ -150,6 +159,8 @@ class RequestContentScript : public ContentAction {
const std::string& extension_id) const;
UserScript script_;
+ // The lifetime of the master_ is managed by DeclarativeUserScriptManager,
Devlin 2015/01/20 17:51:05 nit: newline before this. nit: Document why the li
Xi Han 2015/01/21 21:30:16 Lifetime is hard to explain, so I try my best to a
+ // which manages a map of master objects.
DeclarativeUserScriptMaster* master_;
DISALLOW_COPY_AND_ASSIGN(RequestContentScript);

Powered by Google App Engine
This is Rietveld 408576698