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

Unified Diff: extensions/common/user_script.cc

Issue 906493004: Refactoring: de-couple Extensions from "script injection System" [render side]:2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@decouple_brower_isolated_world_1
Patch Set: resubmit Created 5 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: extensions/common/user_script.cc
diff --git a/extensions/common/user_script.cc b/extensions/common/user_script.cc
index b8ba22e1d7639523157f3cf99abbafe666117255..7859e75f244cb0849ee6c91f46da3e314f3c1624 100644
--- a/extensions/common/user_script.cc
+++ b/extensions/common/user_script.cc
@@ -145,6 +145,8 @@ void UserScript::Pickle(::Pickle* pickle) const {
pickle->WriteBool(is_incognito_enabled());
PickleHostID(pickle, host_id_);
+ pickle->WriteInt(consumer_instance_type());
+ PickleRoutingInfo(pickle, routing_info_);
PickleGlobs(pickle, globs_);
PickleGlobs(pickle, exclude_globs_);
PickleURLPatternSet(pickle, url_set_);
@@ -167,6 +169,12 @@ void UserScript::PickleHostID(::Pickle* pickle, const HostID& host_id) const {
pickle->WriteString(host_id.id());
}
+void UserScript::PickleRoutingInfo(::Pickle* pickle,
+ const RoutingInfo& routing_info) const {
+ pickle->WriteInt(routing_info.render_process_id);
+ pickle->WriteInt(routing_info.render_view_id);
+}
+
void UserScript::PickleURLPatternSet(::Pickle* pickle,
const URLPatternSet& pattern_list) const {
pickle->WriteSizeT(pattern_list.patterns().size());
@@ -200,6 +208,13 @@ void UserScript::Unpickle(const ::Pickle& pickle, PickleIterator* iter) {
CHECK(iter->ReadBool(&incognito_enabled_));
UnpickleHostID(pickle, iter, &host_id_);
+
+ int consumer_instance_type = 0;
+ CHECK(iter->ReadInt(&consumer_instance_type));
+ consumer_instance_type_ =
+ static_cast<ConsumerInstanceType>(consumer_instance_type);
+
+ UnpickleRoutingInfo(pickle, iter, &routing_info_);
UnpickleGlobs(pickle, iter, &globs_);
UnpickleGlobs(pickle, iter, &exclude_globs_);
UnpickleURLPatternSet(pickle, iter, &url_set_);
@@ -230,6 +245,13 @@ void UserScript::UnpickleHostID(const ::Pickle& pickle,
*host_id = HostID(static_cast<HostID::HostType>(type), id);
}
+void UserScript::UnpickleRoutingInfo(const ::Pickle& pickle,
+ PickleIterator* iter,
+ RoutingInfo* routing_info) {
+ CHECK(iter->ReadInt(&routing_info->render_process_id));
+ CHECK(iter->ReadInt(&routing_info->render_view_id));
+}
+
void UserScript::UnpickleURLPatternSet(const ::Pickle& pickle,
PickleIterator* iter,
URLPatternSet* pattern_list) {

Powered by Google App Engine
This is Rietveld 408576698