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

Unified Diff: chrome/common/extensions/user_script.cc

Issue 19624: Add early-injection capability to user scripts. I haven't yet (Closed)
Patch Set: Use new documentElementAvailable() callback Created 11 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: chrome/common/extensions/user_script.cc
diff --git a/chrome/common/extensions/user_script.cc b/chrome/common/extensions/user_script.cc
index c726ad3bddd3d32e999981e5e372fc454eccb450..9a0da2d382a8e5ea60ac5eed48302f05dd13b528 100644
--- a/chrome/common/extensions/user_script.cc
+++ b/chrome/common/extensions/user_script.cc
@@ -24,6 +24,7 @@ bool UserScript::MatchesUrl(const GURL& url) {
void UserScript::Pickle(::Pickle* pickle) {
pickle->WriteString(url_.spec());
+ pickle->WriteInt(run_location_);
// Don't write path as we don't need that in the renderer.
@@ -45,6 +46,11 @@ void UserScript::Unpickle(const ::Pickle& pickle, void** iter) {
CHECK(pickle.ReadString(iter, &url_spec));
url_ = GURL(url_spec);
+ int run_location = 0;
+ CHECK(pickle.ReadInt(iter, &run_location));
+ CHECK(run_location >= 0 && run_location < UserScript::RUN_LOCATION_LAST);
+ run_location_ = static_cast<UserScript::RunLocation>(run_location);
+
size_t num_globs = 0;
CHECK(pickle.ReadSize(iter, &num_globs));

Powered by Google App Engine
This is Rietveld 408576698