Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 241 thread->GetChannel()->set_outgoing_message_filter(LoadExternalIPCFuzzer()); | 241 thread->GetChannel()->set_outgoing_message_filter(LoadExternalIPCFuzzer()); |
| 242 } | 242 } |
| 243 // chrome:, chrome-search:, chrome-devtools:, and chrome-internal: pages | 243 // chrome:, chrome-search:, chrome-devtools:, and chrome-internal: pages |
| 244 // should not be accessible by normal content, and should also be unable to | 244 // should not be accessible by normal content, and should also be unable to |
| 245 // script anything but themselves (to help limit the damage that a corrupt | 245 // script anything but themselves (to help limit the damage that a corrupt |
| 246 // page could cause). | 246 // page could cause). |
| 247 WebString chrome_ui_scheme(ASCIIToUTF16(chrome::kChromeUIScheme)); | 247 WebString chrome_ui_scheme(ASCIIToUTF16(chrome::kChromeUIScheme)); |
| 248 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(chrome_ui_scheme); | 248 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(chrome_ui_scheme); |
| 249 | 249 |
| 250 WebString chrome_search_scheme(ASCIIToUTF16(chrome::kChromeSearchScheme)); | 250 WebString chrome_search_scheme(ASCIIToUTF16(chrome::kChromeSearchScheme)); |
| 251 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(chrome_search_scheme); | 251 if (!command_line->HasSwitch(switches::kInstantProcess)) |
| 252 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(chrome_search_scheme); | |
|
Shishir
2013/03/20 21:35:52
As sreeram pointed out, we should just block all c
dhollowa
2013/03/20 22:15:08
We're effectively doing that on the browser-side a
Shishir
2013/03/20 22:20:49
One way I can think of doing that on the renderer
dhollowa
2013/03/20 23:12:24
But, correct me if I'm wrong, adding a similar che
| |
| 252 | 253 |
| 253 WebString dev_tools_scheme(ASCIIToUTF16(chrome::kChromeDevToolsScheme)); | 254 WebString dev_tools_scheme(ASCIIToUTF16(chrome::kChromeDevToolsScheme)); |
| 254 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(dev_tools_scheme); | 255 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(dev_tools_scheme); |
| 255 | 256 |
| 256 WebString internal_scheme(ASCIIToUTF16(chrome::kChromeInternalScheme)); | 257 WebString internal_scheme(ASCIIToUTF16(chrome::kChromeInternalScheme)); |
| 257 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(internal_scheme); | 258 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(internal_scheme); |
| 258 | 259 |
| 259 #if defined(OS_CHROMEOS) | 260 #if defined(OS_CHROMEOS) |
| 260 WebString drive_scheme(ASCIIToUTF16(chrome::kDriveScheme)); | 261 WebString drive_scheme(ASCIIToUTF16(chrome::kDriveScheme)); |
| 261 WebSecurityPolicy::registerURLSchemeAsLocal(drive_scheme); | 262 WebSecurityPolicy::registerURLSchemeAsLocal(drive_scheme); |
| (...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1127 return false; | 1128 return false; |
| 1128 | 1129 |
| 1129 if (container->element().shadowHost().isNull()) | 1130 if (container->element().shadowHost().isNull()) |
| 1130 return false; | 1131 return false; |
| 1131 | 1132 |
| 1132 return container->element().shadowHost().tagName().equals( | 1133 return container->element().shadowHost().tagName().equals( |
| 1133 WebString::fromUTF8(kWebViewTagName)); | 1134 WebString::fromUTF8(kWebViewTagName)); |
| 1134 } | 1135 } |
| 1135 | 1136 |
| 1136 } // namespace chrome | 1137 } // namespace chrome |
| OLD | NEW |