Skip to content

Commit

Permalink
Don't grant special privs to any http URL, ever.
Browse files Browse the repository at this point in the history
BUG=172984

Review URL: https://chromiumcodereview.appspot.com/12089059

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@179583 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
cevans@chromium.org committed Jan 30, 2013
1 parent a95ef63 commit a571620
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions chrome/renderer/chrome_content_renderer_client.cc
Expand Up @@ -673,10 +673,10 @@ bool ChromeContentRendererClient::IsNaClAllowed(
// Temporarily allow these URLs to run NaCl apps. We should remove this
// code when PNaCl ships.
bool is_whitelisted_url =
((top_url.SchemeIs("http") || top_url.SchemeIs("https")) &&
top_url.SchemeIs("https") &&
(top_url.host() == "plus.google.com" ||
top_url.host() == "plus.sandbox.google.com") &&
top_url.path().find("/games") == 0);
top_url.path().find("/games") == 0;

// Allow Chrome Web Store extensions, built-in extensions, extensions
// under development, invocations from whitelisted URLs, and all invocations
Expand Down
6 changes: 3 additions & 3 deletions chrome/renderer/chrome_content_renderer_client_unittest.cc
Expand Up @@ -136,7 +136,7 @@ TEST_F(ChromeContentRendererClientTest, NaClRestriction) {
// interfaces.
{
WebPluginParams params;
EXPECT_TRUE(ChromeContentRendererClient::IsNaClAllowed(
EXPECT_FALSE(ChromeContentRendererClient::IsNaClAllowed(
GURL(), GURL("http://plus.google.com/games"),
kNaClRestricted, kExtensionRestricted, kExtensionNotFromWebStore,
&params));
Expand All @@ -151,7 +151,7 @@ TEST_F(ChromeContentRendererClientTest, NaClRestriction) {
kNaClRestricted, kExtensionRestricted, kExtensionNotFromWebStore,
&params));
EXPECT_FALSE(AllowsDevInterfaces(params));
EXPECT_TRUE(ChromeContentRendererClient::IsNaClAllowed(
EXPECT_FALSE(ChromeContentRendererClient::IsNaClAllowed(
GURL(), GURL("http://plus.sandbox.google.com/games"),
kNaClRestricted, kExtensionRestricted, kExtensionNotFromWebStore,
&params));
Expand Down Expand Up @@ -191,7 +191,7 @@ TEST_F(ChromeContentRendererClientTest, NaClRestriction) {
{
WebPluginParams params;
EXPECT_FALSE(ChromeContentRendererClient::IsNaClAllowed(
GURL(), GURL("http://plus.google.com.evil.com/games"),
GURL(), GURL("https://plus.google.com.evil.com/games"),
kNaClRestricted, kExtensionRestricted, kExtensionNotFromWebStore,
&params));
}
Expand Down

0 comments on commit a571620

Please sign in to comment.