| Index: chrome/browser/chrome_content_browser_client.cc
|
| diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
|
| index da011198b3138690bcbaed4936b38916d398b4cc..f4406908af0107f904b8d831ad34c8100842f0fa 100644
|
| --- a/chrome/browser/chrome_content_browser_client.cc
|
| +++ b/chrome/browser/chrome_content_browser_client.cc
|
| @@ -10,6 +10,7 @@
|
|
|
| #include "base/bind.h"
|
| #include "base/command_line.h"
|
| +#include "base/string_tokenizer.h"
|
| #include "base/utf_string_conversions.h"
|
| #include "chrome/app/breakpad_mac.h"
|
| #include "chrome/browser/browser_about_handler.h"
|
| @@ -137,6 +138,11 @@ using content::WebContents;
|
|
|
| namespace {
|
|
|
| +const char* kPredefinedAllowedSocketOrigins[] = {
|
| + "okddffdblfhhnmhodogpojmfkjmhinfp", // Test SSH Client
|
| + "pnhechapfaindjhompbnflcldabbghjo" // HTerm App (SSH Client)
|
| +};
|
| +
|
| // Handles rewriting Web UI URLs.
|
| bool HandleWebUI(GURL* url, content::BrowserContext* browser_context) {
|
| if (!ChromeWebUIControllerFactory::GetInstance()->UseWebUIForURL(
|
| @@ -269,6 +275,24 @@ void FillFontFamilyMap(const PrefService* prefs,
|
|
|
| namespace chrome {
|
|
|
| +ChromeContentBrowserClient::ChromeContentBrowserClient() {
|
| + for (size_t i = 0; i < arraysize(kPredefinedAllowedSocketOrigins); ++i)
|
| + allowed_socket_origins_.insert(kPredefinedAllowedSocketOrigins[i]);
|
| +
|
| + const CommandLine& command_line = *CommandLine::ForCurrentProcess();
|
| + std::string allowed_list =
|
| + command_line.GetSwitchValueASCII(switches::kAllowNaClSocketAPI);
|
| + if (!allowed_list.empty()) {
|
| + StringTokenizer t(allowed_list, ",");
|
| + while (t.GetNext()) {
|
| + allowed_socket_origins_.insert(t.token());
|
| + }
|
| + }
|
| +}
|
| +
|
| +ChromeContentBrowserClient::~ChromeContentBrowserClient() {
|
| +}
|
| +
|
| content::BrowserMainParts* ChromeContentBrowserClient::CreateBrowserMainParts(
|
| const content::MainFunctionParams& parameters) {
|
| ChromeBrowserMainParts* main_parts;
|
| @@ -640,7 +664,6 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches(
|
| static const char* const kSwitchNames[] = {
|
| switches::kAllowHTTPBackgroundPage,
|
| switches::kAllowLegacyExtensionManifests,
|
| - switches::kAllowNaClSocketAPI,
|
| switches::kAllowScriptingGallery,
|
| switches::kAppsCheckoutURL,
|
| switches::kAppsGalleryURL,
|
| @@ -1310,6 +1333,11 @@ std::string ChromeContentBrowserClient::GetDefaultDownloadName() {
|
| return l10n_util::GetStringUTF8(IDS_DEFAULT_DOWNLOAD_FILENAME);
|
| }
|
|
|
| +bool ChromeContentBrowserClient::AllowSocketAPI(const GURL& url) {
|
| + return url.is_valid() &&
|
| + allowed_socket_origins_.find(url.host()) != allowed_socket_origins_.end();
|
| +}
|
| +
|
| #if defined(OS_POSIX) && !defined(OS_MACOSX)
|
| int ChromeContentBrowserClient::GetCrashSignalFD(
|
| const CommandLine& command_line) {
|
|
|