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

Side by Side Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 12089059: Don't grant special privs to any http URL, ever. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/renderer/chrome_content_renderer_client_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/chrome_content_renderer_client.h" 5 #include "chrome/renderer/chrome_content_renderer_client.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 bool ChromeContentRendererClient::IsNaClAllowed( 666 bool ChromeContentRendererClient::IsNaClAllowed(
667 const GURL& manifest_url, 667 const GURL& manifest_url,
668 const GURL& top_url, 668 const GURL& top_url,
669 bool is_nacl_unrestricted, 669 bool is_nacl_unrestricted,
670 bool is_extension_unrestricted, 670 bool is_extension_unrestricted,
671 bool is_extension_from_webstore, 671 bool is_extension_from_webstore,
672 WebPluginParams* params) { 672 WebPluginParams* params) {
673 // Temporarily allow these URLs to run NaCl apps. We should remove this 673 // Temporarily allow these URLs to run NaCl apps. We should remove this
674 // code when PNaCl ships. 674 // code when PNaCl ships.
675 bool is_whitelisted_url = 675 bool is_whitelisted_url =
676 ((top_url.SchemeIs("http") || top_url.SchemeIs("https")) && 676 top_url.SchemeIs("https") &&
677 (top_url.host() == "plus.google.com" || 677 (top_url.host() == "plus.google.com" ||
678 top_url.host() == "plus.sandbox.google.com") && 678 top_url.host() == "plus.sandbox.google.com") &&
679 top_url.path().find("/games") == 0); 679 top_url.path().find("/games") == 0;
680 680
681 // Allow Chrome Web Store extensions, built-in extensions, extensions 681 // Allow Chrome Web Store extensions, built-in extensions, extensions
682 // under development, invocations from whitelisted URLs, and all invocations 682 // under development, invocations from whitelisted URLs, and all invocations
683 // if --enable-nacl is set. 683 // if --enable-nacl is set.
684 bool is_nacl_allowed = is_extension_from_webstore || 684 bool is_nacl_allowed = is_extension_from_webstore ||
685 is_whitelisted_url || 685 is_whitelisted_url ||
686 is_extension_unrestricted || 686 is_extension_unrestricted ||
687 is_nacl_unrestricted; 687 is_nacl_unrestricted;
688 if (is_nacl_allowed) { 688 if (is_nacl_allowed) {
689 bool app_can_use_dev_interfaces = 689 bool app_can_use_dev_interfaces =
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 } 1055 }
1056 1056
1057 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( 1057 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories(
1058 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { 1058 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) {
1059 #if defined(ENABLE_PLUGINS) 1059 #if defined(ENABLE_PLUGINS)
1060 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); 1060 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory);
1061 #endif 1061 #endif
1062 } 1062 }
1063 1063
1064 } // namespace chrome 1064 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/chrome_content_renderer_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698