Index: chrome/common/extensions/user_script.cc |
diff --git a/chrome/common/extensions/user_script.cc b/chrome/common/extensions/user_script.cc |
index dc62066c679348861e39773e63f3f14490108cbf..998374a1af1a84f1e16431ed22f9d8abc6417645 100644 |
--- a/chrome/common/extensions/user_script.cc |
+++ b/chrome/common/extensions/user_script.cc |
@@ -130,6 +130,7 @@ void UserScript::PickleURLPatternSet(::Pickle* pickle, |
pattern != pattern_list.end(); ++pattern) { |
pickle->WriteInt(pattern->valid_schemes()); |
pickle->WriteString(pattern->GetAsString()); |
+ pickle->WriteInt(pattern->allowed_schemes()); |
} |
} |
@@ -188,16 +189,13 @@ void UserScript::UnpickleURLPatternSet(const ::Pickle& pickle, |
URLPattern pattern(valid_schemes); |
CHECK(pickle.ReadString(iter, &pattern_str)); |
- // We remove the file scheme if it's not actually allowed (see Extension:: |
- // LoadUserScriptHelper), but we need it temporarily while loading the |
- // pattern so that it's valid. |
- bool had_file_scheme = (valid_schemes & URLPattern::SCHEME_FILE) != 0; |
- if (!had_file_scheme) |
- pattern.SetValidSchemes(valid_schemes | URLPattern::SCHEME_FILE); |
- CHECK(URLPattern::PARSE_SUCCESS == pattern.Parse(pattern_str)); |
- if (!had_file_scheme) |
- pattern.SetValidSchemes(valid_schemes); |
+ URLPattern::ParseResult result = pattern.Parse(pattern_str); |
+ CHECK(URLPattern::PARSE_SUCCESS == result) << |
+ URLPattern::GetParseResultString(result) << " " << pattern_str.c_str(); |
+ int allowed_schemes; |
+ if (pickle.ReadInt(iter, &allowed_schemes)) |
+ pattern.SetAllowedSchemes(allowed_schemes); |
pattern_list->AddPattern(pattern); |
} |
} |