OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/render_thread.h" | 5 #include "chrome/renderer/render_thread.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFontCache.h" | 83 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFontCache.h" |
84 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 84 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
85 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 85 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
86 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" | 86 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" |
87 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h
" | 87 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h
" |
88 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" | 88 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" |
89 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispat
cher.h" | 89 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispat
cher.h" |
90 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" | 90 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" |
91 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 91 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
92 #include "webkit/extensions/v8/benchmarking_extension.h" | 92 #include "webkit/extensions/v8/benchmarking_extension.h" |
93 #include "webkit/extensions/v8/gears_extension.h" | |
94 #include "webkit/extensions/v8/playback_extension.h" | 93 #include "webkit/extensions/v8/playback_extension.h" |
95 #include "webkit/glue/webkit_glue.h" | 94 #include "webkit/glue/webkit_glue.h" |
96 #include "v8/include/v8.h" | 95 #include "v8/include/v8.h" |
97 | 96 |
98 // TODO(port) | 97 // TODO(port) |
99 #if defined(OS_WIN) | 98 #if defined(OS_WIN) |
100 #include "chrome/plugin/plugin_channel.h" | 99 #include "chrome/plugin/plugin_channel.h" |
101 #else | 100 #else |
102 #include "base/scoped_handle.h" | 101 #include "base/scoped_handle.h" |
103 #include "chrome/plugin/plugin_channel_base.h" | 102 #include "chrome/plugin/plugin_channel_base.h" |
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
901 // chrome: pages should not be accessible by normal content, and should | 900 // chrome: pages should not be accessible by normal content, and should |
902 // also be unable to script anything but themselves (to help limit the damage | 901 // also be unable to script anything but themselves (to help limit the damage |
903 // that a corrupt chrome: page could cause). | 902 // that a corrupt chrome: page could cause). |
904 WebString chrome_ui_scheme(ASCIIToUTF16(chrome::kChromeUIScheme)); | 903 WebString chrome_ui_scheme(ASCIIToUTF16(chrome::kChromeUIScheme)); |
905 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(chrome_ui_scheme); | 904 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(chrome_ui_scheme); |
906 | 905 |
907 // chrome-extension: resources shouldn't trigger insecure content warnings. | 906 // chrome-extension: resources shouldn't trigger insecure content warnings. |
908 WebString extension_scheme(ASCIIToUTF16(chrome::kExtensionScheme)); | 907 WebString extension_scheme(ASCIIToUTF16(chrome::kExtensionScheme)); |
909 WebSecurityPolicy::registerURLSchemeAsSecure(extension_scheme); | 908 WebSecurityPolicy::registerURLSchemeAsSecure(extension_scheme); |
910 | 909 |
911 #if defined(OS_WIN) | |
912 // We don't yet support Gears on non-Windows, so don't tell pages that we do. | |
913 RegisterExtension(extensions_v8::GearsExtension::Get(), false); | |
914 #endif | |
915 RegisterExtension(extensions_v8::LoadTimesExtension::Get(), false); | 910 RegisterExtension(extensions_v8::LoadTimesExtension::Get(), false); |
916 RegisterExtension(extensions_v8::ChromeAppExtension::Get(), false); | 911 RegisterExtension(extensions_v8::ChromeAppExtension::Get(), false); |
917 RegisterExtension(extensions_v8::ExternalExtension::Get(), false); | 912 RegisterExtension(extensions_v8::ExternalExtension::Get(), false); |
918 RegisterExtension(extensions_v8::SearchBoxExtension::Get(), false); | 913 RegisterExtension(extensions_v8::SearchBoxExtension::Get(), false); |
919 v8::Extension* search_extension = extensions_v8::SearchExtension::Get(); | 914 v8::Extension* search_extension = extensions_v8::SearchExtension::Get(); |
920 // search_extension is null if not enabled. | 915 // search_extension is null if not enabled. |
921 if (search_extension) | 916 if (search_extension) |
922 RegisterExtension(search_extension, false); | 917 RegisterExtension(search_extension, false); |
923 | 918 |
924 if (command_line.HasSwitch(switches::kEnableBenchmarking)) | 919 if (command_line.HasSwitch(switches::kEnableBenchmarking)) |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1166 } | 1161 } |
1167 | 1162 |
1168 return false; | 1163 return false; |
1169 } | 1164 } |
1170 | 1165 |
1171 void RenderThread::RegisterExtension(v8::Extension* extension, | 1166 void RenderThread::RegisterExtension(v8::Extension* extension, |
1172 bool restrict_to_extensions) { | 1167 bool restrict_to_extensions) { |
1173 WebScriptController::registerExtension(extension); | 1168 WebScriptController::registerExtension(extension); |
1174 v8_extensions_[extension->name()] = restrict_to_extensions; | 1169 v8_extensions_[extension->name()] = restrict_to_extensions; |
1175 } | 1170 } |
OLD | NEW |