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

Unified Diff: extensions/browser/declarative_user_script_master.cc

Issue 2227193002: Make UserScript non-copyable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove browser/renderer specific file impl as it is not helping much Created 4 years, 4 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/browser/declarative_user_script_master.cc
diff --git a/extensions/browser/declarative_user_script_master.cc b/extensions/browser/declarative_user_script_master.cc
index 9ea77e865ed8461c19ba970add592d9efc819b2d..d752960bba62a6d5607c9ef2800baf707a03a2fe 100644
--- a/extensions/browser/declarative_user_script_master.cc
+++ b/extensions/browser/declarative_user_script_master.cc
@@ -31,20 +31,23 @@ DeclarativeUserScriptMaster::DeclarativeUserScriptMaster(
DeclarativeUserScriptMaster::~DeclarativeUserScriptMaster() {
}
-void DeclarativeUserScriptMaster::AddScript(const UserScript& script) {
- loader_->AddScripts(UserScriptList(1, script));
Devlin 2016/08/17 16:39:31 Can we not use this vector ctor with non-movable t
lazyboy 2016/08/17 18:55:52 I can't seem to get std::unique_ptr<UserScriptList
+void DeclarativeUserScriptMaster::AddScript(
+ std::unique_ptr<UserScript> script) {
+ UserScriptList scripts;
+ scripts.push_back(std::move(script));
+ loader_->AddScripts(scripts);
}
-void DeclarativeUserScriptMaster::AddScripts(const UserScriptList& scripts,
+void DeclarativeUserScriptMaster::AddScripts(UserScriptList& scripts,
int render_process_id,
int render_view_id) {
loader_->AddScripts(scripts, render_process_id, render_view_id);
}
-void DeclarativeUserScriptMaster::RemoveScript(const UserScript& script) {
- std::set<UserScriptIDPair> set;
- set.insert(UserScriptIDPair(script.id(), script.host_id()));
- loader_->RemoveScripts(set);
+void DeclarativeUserScriptMaster::RemoveScript(const UserScriptIDPair& script) {
+ std::set<UserScriptIDPair> scripts;
+ scripts.insert(script);
+ RemoveScripts(scripts);
}
void DeclarativeUserScriptMaster::RemoveScripts(

Powered by Google App Engine
This is Rietveld 408576698