summaryrefslogtreecommitdiffstats
path: root/extensions/common/user_script.cc
diff options
context:
space:
mode:
authoravi <avi@chromium.org>2014-12-28 11:06:08 -0800
committerCommit bot <commit-bot@chromium.org>2014-12-28 19:07:18 +0000
commitf13c491db505994d71f7c2c4e11b93f726e9933a (patch)
treea7f42618fe83a384e24d165f64949f39ac634444 /extensions/common/user_script.cc
parent1ce8c777d4e9551989d4b83380fd1bd0189d818c (diff)
downloadchromium_src-f13c491db505994d71f7c2c4e11b93f726e9933a.zip
chromium_src-f13c491db505994d71f7c2c4e11b93f726e9933a.tar.gz
chromium_src-f13c491db505994d71f7c2c4e11b93f726e9933a.tar.bz2
Revert of Remove deprecated methods from Pickle. (patchset #10 id:180001 of https://codereview.chromium.org/818833004/)
Reason for revert: Allegedly causes a performance hit: http://crbug.com/445173 Original issue's description: > Remove deprecated methods from Pickle. > > BUG=444578 > TEST=none > R=nasko@chromium.org > TBR=ben@chromium.org > > Committed: https://chromium.googlesource.com/chromium/src/+/b740bfe23ae7ad244356a4a7538b95ae560251db TBR=nasko@chromium.org NOTREECHECKS=true NOTRY=true BUG=444578 Review URL: https://codereview.chromium.org/825353003 Cr-Commit-Position: refs/heads/master@{#309689}
Diffstat (limited to 'extensions/common/user_script.cc')
-rw-r--r--extensions/common/user_script.cc28
1 files changed, 14 insertions, 14 deletions
diff --git a/extensions/common/user_script.cc b/extensions/common/user_script.cc
index 4410290..ec0e553 100644
--- a/extensions/common/user_script.cc
+++ b/extensions/common/user_script.cc
@@ -131,7 +131,7 @@ void UserScript::File::Pickle(::Pickle* pickle) const {
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::PickleScripts(::Pickle* pickle,
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::Unpickle(const ::Pickle& pickle, PickleIterator* iter) {
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 @@ void UserScript::UnpickleURLPatternSet(const ::Pickle& pickle,
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::UnpickleURLPatternSet(const ::Pickle& pickle,
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;