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

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: Fix the test failures. 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..48f4e72dac9e596bff73614452a2002949b35660 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 {
+ 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);
@@ -140,7 +149,7 @@ class RequestContentScript : public ContentAction {
void InitScript(const Extension* extension, const ScriptData& script_data);
void AddScript() {
- DCHECK(master_);
+ DCHECK(master_.get());
master_->AddScript(script_);
}
@@ -150,7 +159,7 @@ class RequestContentScript : public ContentAction {
const std::string& extension_id) const;
UserScript script_;
- DeclarativeUserScriptMaster* master_;
+ linked_ptr<DeclarativeUserScriptMaster> master_;
Devlin 2015/01/14 16:45:08 I don't think it's wise to make this a linked_ptr.
Xi Han 2015/01/14 23:46:02 linked_ptr was removed from here. Also I have to d
Devlin 2015/01/16 17:05:03 That's my bad - when I say "weak pointer", I mean
Xi Han 2015/01/19 22:40:05 Sounds good:)
DISALLOW_COPY_AND_ASSIGN(RequestContentScript);
};

Powered by Google App Engine
This is Rietveld 408576698