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

Unified Diff: extensions/common/user_script.cc

Issue 825353003: Revert of Remove deprecated methods from Pickle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « extensions/browser/script_executor.cc ('k') | extensions/renderer/user_script_set.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/common/user_script.cc
diff --git a/extensions/common/user_script.cc b/extensions/common/user_script.cc
index 6f79887e2806760f778eeb307a933e842a6b470c..a56cadbff019485187ea2a9087107c87d5785f03 100644
--- a/extensions/common/user_script.cc
+++ b/extensions/common/user_script.cc
@@ -131,7 +131,7 @@
void UserScript::File::Unpickle(const ::Pickle& pickle, PickleIterator* iter) {
// Read the url from the pickle.
std::string url;
- CHECK(iter->ReadString(&url));
+ CHECK(pickle.ReadString(iter, &url));
set_url(GURL(url));
}
@@ -184,16 +184,16 @@
void UserScript::Unpickle(const ::Pickle& pickle, PickleIterator* iter) {
// Read the run location.
int run_location = 0;
- CHECK(iter->ReadInt(&run_location));
+ CHECK(pickle.ReadInt(iter, &run_location));
CHECK(run_location >= 0 && run_location < RUN_LOCATION_LAST);
run_location_ = static_cast<RunLocation>(run_location);
- CHECK(iter->ReadString(&extension_id_));
- CHECK(iter->ReadInt(&user_script_id_));
- CHECK(iter->ReadBool(&emulate_greasemonkey_));
- CHECK(iter->ReadBool(&match_all_frames_));
- CHECK(iter->ReadBool(&match_about_blank_));
- CHECK(iter->ReadBool(&incognito_enabled_));
+ CHECK(pickle.ReadString(iter, &extension_id_));
+ CHECK(pickle.ReadInt(iter, &user_script_id_));
+ CHECK(pickle.ReadBool(iter, &emulate_greasemonkey_));
+ CHECK(pickle.ReadBool(iter, &match_all_frames_));
+ CHECK(pickle.ReadBool(iter, &match_about_blank_));
+ CHECK(pickle.ReadBool(iter, &incognito_enabled_));
UnpickleGlobs(pickle, iter, &globs_);
UnpickleGlobs(pickle, iter, &exclude_globs_);
@@ -206,11 +206,11 @@
void UserScript::UnpickleGlobs(const ::Pickle& pickle, PickleIterator* iter,
std::vector<std::string>* globs) {
size_t num_globs = 0;
- CHECK(iter->ReadSizeT(&num_globs));
+ CHECK(pickle.ReadSizeT(iter, &num_globs));
globs->clear();
for (size_t i = 0; i < num_globs; ++i) {
std::string glob;
- CHECK(iter->ReadString(&glob));
+ CHECK(pickle.ReadString(iter, &glob));
globs->push_back(glob);
}
}
@@ -219,15 +219,15 @@
PickleIterator* iter,
URLPatternSet* pattern_list) {
size_t num_patterns = 0;
- CHECK(iter->ReadSizeT(&num_patterns));
+ CHECK(pickle.ReadSizeT(iter, &num_patterns));
pattern_list->ClearPatterns();
for (size_t i = 0; i < num_patterns; ++i) {
int valid_schemes;
- CHECK(iter->ReadInt(&valid_schemes));
+ CHECK(pickle.ReadInt(iter, &valid_schemes));
std::string pattern_str;
- CHECK(iter->ReadString(&pattern_str));
+ CHECK(pickle.ReadString(iter, &pattern_str));
URLPattern pattern(kValidUserScriptSchemes);
URLPattern::ParseResult result = pattern.Parse(pattern_str);
@@ -242,7 +242,7 @@
void UserScript::UnpickleScripts(const ::Pickle& pickle, PickleIterator* iter,
FileList* scripts) {
size_t num_files = 0;
- CHECK(iter->ReadSizeT(&num_files));
+ CHECK(pickle.ReadSizeT(iter, &num_files));
scripts->clear();
for (size_t i = 0; i < num_files; ++i) {
File file;
« no previous file with comments | « extensions/browser/script_executor.cc ('k') | extensions/renderer/user_script_set.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698