diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-14 15:34:54 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-14 15:34:54 +0000 |
commit | 3fea6c59c43e584136852ed447193e15602e787b (patch) | |
tree | 25e7a259cab02002cfee1ecc0c3ca43f60d0c6e2 /chrome/common/url_constants.cc | |
parent | dd34de09bf66de5ec57686a76de7120b748c32e2 (diff) | |
download | chromium_src-3fea6c59c43e584136852ed447193e15602e787b.zip chromium_src-3fea6c59c43e584136852ed447193e15602e787b.tar.gz chromium_src-3fea6c59c43e584136852ed447193e15602e787b.tar.bz2 |
Remove registration of the extension protocol late in the init process. This
protocol is already getting registered by url_util.cc super early in the
process, so this extra registration is redundant. Re-adding the protocol later
apparently modifies the set that url_util uses, and when this happens there
could be other threads reading it.
BUG=41150
TEST=none
Review URL: http://codereview.chromium.org/1545029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44476 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/url_constants.cc')
-rw-r--r-- | chrome/common/url_constants.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/common/url_constants.cc b/chrome/common/url_constants.cc index a42de1f9..924de94 100644 --- a/chrome/common/url_constants.cc +++ b/chrome/common/url_constants.cc @@ -21,6 +21,7 @@ const char kHttpScheme[] = "http"; const char kHttpsScheme[] = "https"; const char kJavaScriptScheme[] = "javascript"; const char kMailToScheme[] = "mailto"; +const char kMetadataScheme[] = "metadata"; const char kPrintScheme[] = "print"; const char kUserScriptScheme[] = "chrome-user-script"; const char kViewSourceScheme[] = "view-source"; @@ -101,6 +102,14 @@ void RegisterChromeSchemes() { // the new tab page. url_util::AddStandardScheme(kChromeUIScheme); url_util::AddStandardScheme(kExtensionScheme); + url_util::AddStandardScheme(kMetadataScheme); + + // Prevent future modification of the standard schemes list. This is to + // prevent accidental creation of data races in the program. AddStandardScheme + // isn't threadsafe so must be called when GURL isn't used on any other + // thread. This is really easy to mess up, so we say that all calls to + // AddStandardScheme in Chrome must be inside this function. + url_util::LockStandardSchemes(); } } // namespace chrome |