summaryrefslogtreecommitdiffstats
path: root/extensions/shell/common
diff options
context:
space:
mode:
authortyoshino <tyoshino@chromium.org>2015-08-19 01:51:46 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-19 08:52:22 +0000
commit11a7c9fe93850341043844ab48bf379c485d05b1 (patch)
treeaf53c4126a6f36fbbc4b965205a7630743f365c7 /extensions/shell/common
parent2dafe52f9b16aa9833f3a5455632c7bbb64c9080 (diff)
downloadchromium_src-11a7c9fe93850341043844ab48bf379c485d05b1.zip
chromium_src-11a7c9fe93850341043844ab48bf379c485d05b1.tar.gz
chromium_src-11a7c9fe93850341043844ab48bf379c485d05b1.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 Committed: https://crrev.com/1ac9ec7bccd1b5178b18338b10149f36292f5fb6 Cr-Commit-Position: refs/heads/master@{#343895} Review URL: https://codereview.chromium.org/1272113002 Cr-Commit-Position: refs/heads/master@{#344181}
Diffstat (limited to 'extensions/shell/common')
-rw-r--r--extensions/shell/common/shell_content_client.cc14
-rw-r--r--extensions/shell/common/shell_content_client.h3
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;