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

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

Issue 9950079: Revert 130248 - Add full support for filesystem URLs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 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
« no previous file with comments | « chrome/common/extensions/url_pattern.h ('k') | chrome/common/extensions/url_pattern_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/url_pattern.cc
===================================================================
--- chrome/common/extensions/url_pattern.cc (revision 130291)
+++ chrome/common/extensions/url_pattern.cc (working copy)
@@ -97,14 +97,12 @@
URLPattern::URLPattern()
: valid_schemes_(SCHEME_NONE),
match_all_urls_(false),
- partial_filesystem_support_hack_(false),
match_subdomains_(false),
port_("*") {}
URLPattern::URLPattern(int valid_schemes)
: valid_schemes_(valid_schemes),
match_all_urls_(false),
- partial_filesystem_support_hack_(false),
match_subdomains_(false),
port_("*") {}
@@ -113,7 +111,6 @@
// appropriate when we know |pattern| is valid.
: valid_schemes_(valid_schemes),
match_all_urls_(false),
- partial_filesystem_support_hack_(false),
match_subdomains_(false),
port_("*") {
if (PARSE_SUCCESS != Parse(pattern))
@@ -298,27 +295,14 @@
}
bool URLPattern::MatchesURL(const GURL& test) const {
- const GURL* test_url = &test;
- bool has_inner_url = test.inner_url() != NULL;
-
- if (partial_filesystem_support_hack_ != has_inner_url)
+ if (!MatchesScheme(test.scheme()))
return false;
- if (has_inner_url)
- test_url = test.inner_url();
-
- if (!MatchesScheme(test_url->scheme()))
- return false;
-
if (match_all_urls_)
return true;
- std::string path_for_request = test.PathForRequest();
- if (has_inner_url)
- path_for_request = test_url->path() + path_for_request;
-
- return MatchesSecurityOriginHelper(*test_url) &&
- MatchesPath(path_for_request);
+ return MatchesSecurityOriginHelper(test) &&
+ MatchesPath(test.PathForRequest());
}
bool URLPattern::MatchesSecurityOrigin(const GURL& test) const {
@@ -449,10 +433,6 @@
DCHECK(path_.find('*') == path_.size() - 1);
DCHECK(other.path().find('*') == other.path().size() - 1);
- if (partial_filesystem_support_hack_ !=
- other.partial_filesystem_support_hack())
- return false;
-
if (!MatchesPath(other.path().substr(0, other.path().size() - 1)) &&
!other.MatchesPath(path_.substr(0, path_.size() - 1)))
return false;
« no previous file with comments | « chrome/common/extensions/url_pattern.h ('k') | chrome/common/extensions/url_pattern_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698