Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(458)

Unified Diff: chrome/browser/chrome_content_browser_client.cc

Issue 9646027: Switch PPAPITests to run in browser_tests instead of ui_tests. The former is sharded and so tests r… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix race condition where we might miss the first notification Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_content_browser_client.cc
===================================================================
--- chrome/browser/chrome_content_browser_client.cc (revision 126008)
+++ chrome/browser/chrome_content_browser_client.cc (working copy)
@@ -288,16 +288,6 @@
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() {
@@ -1532,6 +1522,19 @@
if (allowed_socket_origins_.count(host))
return true;
+ // Need to check this now and not on construction because otherwise it won't
+ // work with browser_tests.
+ 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()) {
+ if (t.token() == host)
+ return true;
+ }
+ }
+
Profile* profile = Profile::FromBrowserContext(browser_context);
if (!profile || !profile->GetExtensionService())
return false;
« no previous file with comments | « no previous file | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698