diff options
author | tyoshino <tyoshino@chromium.org> | 2015-08-18 05:50:45 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-18 12:51:15 +0000 |
commit | 1ac9ec7bccd1b5178b18338b10149f36292f5fb6 (patch) | |
tree | a257a5763665b93a2edd8bb9fbcbf26e3dd7046a /extensions/shell/common | |
parent | 897bb847ac903313cdcabd976155e2d15ef8ad79 (diff) | |
download | chromium_src-1ac9ec7bccd1b5178b18338b10149f36292f5fb6.zip chromium_src-1ac9ec7bccd1b5178b18338b10149f36292f5fb6.tar.gz chromium_src-1ac9ec7bccd1b5178b18338b10149f36292f5fb6.tar.bz2 |
Allow url::SchemeHostPort to hold non-file scheme without port
WebSockets use url::Origin to pass origin info between renderer and
browser. Currently, it cannot hold an origin with non-file scheme and
no port. Chrome extensions have been using such origins, so we need
to keep the channel to convey origin info work for such origins.
BUG=516971
R=sleevi,brettw
Review URL: https://codereview.chromium.org/1272113002
Cr-Commit-Position: refs/heads/master@{#343895}
Diffstat (limited to 'extensions/shell/common')
-rw-r--r-- | extensions/shell/common/shell_content_client.cc | 14 | ||||
-rw-r--r-- | extensions/shell/common/shell_content_client.h | 3 |
2 files changed, 13 insertions, 4 deletions
diff --git a/extensions/shell/common/shell_content_client.cc b/extensions/shell/common/shell_content_client.cc index 1879a8f..946fe83 100644 --- a/extensions/shell/common/shell_content_client.cc +++ b/extensions/shell/common/shell_content_client.cc @@ -74,12 +74,20 @@ void ShellContentClient::AddPepperPlugins( #endif // !defined(DISABLE_NACL) } +static const int kNumShellStandardURLSchemes = 2; +static const url::SchemeWithType kShellStandardURLSchemes[ + kNumShellStandardURLSchemes] = { + {extensions::kExtensionScheme, url::SCHEME_WITHOUT_PORT}, + {extensions::kExtensionResourceScheme, url::SCHEME_WITHOUT_PORT}, +}; + void ShellContentClient::AddAdditionalSchemes( - std::vector<std::string>* standard_schemes, + std::vector<url::SchemeWithType>* standard_schemes, std::vector<std::string>* savable_schemes) { - standard_schemes->push_back(kExtensionScheme); + for (int i = 0; i < kNumShellStandardURLSchemes; i++) + standard_schemes->push_back(kShellStandardURLSchemes[i]); + savable_schemes->push_back(kExtensionScheme); - standard_schemes->push_back(kExtensionResourceScheme); savable_schemes->push_back(kExtensionResourceScheme); } diff --git a/extensions/shell/common/shell_content_client.h b/extensions/shell/common/shell_content_client.h index 4e0e384..f105511 100644 --- a/extensions/shell/common/shell_content_client.h +++ b/extensions/shell/common/shell_content_client.h @@ -8,6 +8,7 @@ #include "base/compiler_specific.h" #include "base/macros.h" #include "content/public/common/content_client.h" +#include "url/url_util.h" namespace extensions { @@ -18,7 +19,7 @@ class ShellContentClient : public content::ContentClient { void AddPepperPlugins( std::vector<content::PepperPluginInfo>* plugins) override; - void AddAdditionalSchemes(std::vector<std::string>* standard_schemes, + void AddAdditionalSchemes(std::vector<url::SchemeWithType>* standard_schemes, std::vector<std::string>* saveable_shemes) override; std::string GetUserAgent() const override; base::string16 GetLocalizedString(int message_id) const override; |