summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/url_pattern.h
diff options
context:
space:
mode:
authorbattre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-10 01:01:07 +0000
committerbattre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-10 01:01:07 +0000
commitbb12d853e4af985379bd56ba3025ec0d2b087148 (patch)
tree720c648e4a2c15e1c4e565989f395491c1bb7b7b /chrome/common/extensions/url_pattern.h
parent71229fa8616c36c326dab127564922b14e443fa9 (diff)
downloadchromium_src-bb12d853e4af985379bd56ba3025ec0d2b087148.zip
chromium_src-bb12d853e4af985379bd56ba3025ec0d2b087148.tar.gz
chromium_src-bb12d853e4af985379bd56ba3025ec0d2b087148.tar.bz2
Support chrome-extension:// scheme in URLPattern.
This CL is mostly motivated to allow users of the web request API to filter network traffic to the extension. The URLParser was configured to broadly before in that is allowed parsing URLPattern::SCHEME_ALL. BUG=105656 TEST=no Review URL: http://codereview.chromium.org/8800006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113907 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/url_pattern.h')
-rw-r--r--chrome/common/extensions/url_pattern.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/chrome/common/extensions/url_pattern.h b/chrome/common/extensions/url_pattern.h
index ef01c1b..094c472c 100644
--- a/chrome/common/extensions/url_pattern.h
+++ b/chrome/common/extensions/url_pattern.h
@@ -15,7 +15,8 @@ class GURL;
// subset of URL syntax:
//
// <url-pattern> := <scheme>://<host><port><path> | '<all_urls>'
-// <scheme> := '*' | 'http' | 'https' | 'file' | 'ftp' | 'chrome'
+// <scheme> := '*' | 'http' | 'https' | 'file' | 'ftp' | 'chrome' |
+// 'chrome-extension' | 'filesystem'
// <host> := '*' | '*.' <anychar except '/' and '*'>+
// <port> := [':' ('*' | <port number between 0 and 65535>)]
// <path> := '/' <any chars>
@@ -90,12 +91,15 @@ class URLPattern {
SCHEME_FILE = 1 << 2,
SCHEME_FTP = 1 << 3,
SCHEME_CHROMEUI = 1 << 4,
- SCHEME_FILESYSTEM = 1 << 5,
+ SCHEME_EXTENSION = 1 << 5,
+ SCHEME_FILESYSTEM = 1 << 6,
+
+ // IMPORTANT!
// SCHEME_ALL will match every scheme, including chrome://, chrome-
// extension://, about:, etc. Because this has lots of security
- // implications, third-party extensions should never be able to get access
- // to URL patterns initialized this way. It should only be used for internal
- // Chrome code.
+ // implications, third-party extensions should usually not be able to get
+ // access to URL patterns initialized this way. If there is a reason
+ // for violating this general rule, document why this it safe.
SCHEME_ALL = -1,
};