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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" | 88 #include "third_party/WebKit/Source/WebKit/chromium/public/WebKit.h" |
89 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" | 89 #include "third_party/WebKit/Source/WebKit/chromium/public/WebRuntimeFeatures.h" |
90 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h
" | 90 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScriptController.h
" |
91 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" | 91 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityPolicy.h" |
92 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispat
cher.h" | 92 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageEventDispat
cher.h" |
93 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" | 93 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" |
94 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 94 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
95 #include "webkit/extensions/v8/benchmarking_extension.h" | 95 #include "webkit/extensions/v8/benchmarking_extension.h" |
96 #include "webkit/extensions/v8/gears_extension.h" | 96 #include "webkit/extensions/v8/gears_extension.h" |
97 #include "webkit/extensions/v8/playback_extension.h" | 97 #include "webkit/extensions/v8/playback_extension.h" |
| 98 #include "webkit/glue/webkit_glue.h" |
98 #include "v8/include/v8.h" | 99 #include "v8/include/v8.h" |
99 | 100 |
100 #if defined(OS_WIN) | 101 #if defined(OS_WIN) |
101 #include <windows.h> | 102 #include <windows.h> |
102 #include <objbase.h> | 103 #include <objbase.h> |
103 #endif | 104 #endif |
104 | 105 |
105 #if defined(OS_MACOSX) | 106 #if defined(OS_MACOSX) |
106 #include "chrome/app/breakpad_mac.h" | 107 #include "chrome/app/breakpad_mac.h" |
107 #endif | 108 #endif |
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 v8::V8::SetCreateHistogramFunction(CreateHistogram); | 859 v8::V8::SetCreateHistogramFunction(CreateHistogram); |
859 v8::V8::SetAddHistogramSampleFunction(AddHistogramSample); | 860 v8::V8::SetAddHistogramSampleFunction(AddHistogramSample); |
860 | 861 |
861 webkit_client_.reset(new RendererWebKitClientImpl); | 862 webkit_client_.reset(new RendererWebKitClientImpl); |
862 WebKit::initialize(webkit_client_.get()); | 863 WebKit::initialize(webkit_client_.get()); |
863 | 864 |
864 WebScriptController::enableV8SingleThreadMode(); | 865 WebScriptController::enableV8SingleThreadMode(); |
865 | 866 |
866 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 867 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
867 | 868 |
| 869 webkit_glue::EnableWebCoreLogChannels( |
| 870 command_line.GetSwitchValueASCII(switches::kWebCoreLogChannels)); |
| 871 |
868 // chrome: pages should not be accessible by normal content, and should | 872 // chrome: pages should not be accessible by normal content, and should |
869 // also be unable to script anything but themselves (to help limit the damage | 873 // also be unable to script anything but themselves (to help limit the damage |
870 // that a corrupt chrome: page could cause). | 874 // that a corrupt chrome: page could cause). |
871 WebString chrome_ui_scheme(ASCIIToUTF16(chrome::kChromeUIScheme)); | 875 WebString chrome_ui_scheme(ASCIIToUTF16(chrome::kChromeUIScheme)); |
872 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(chrome_ui_scheme); | 876 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(chrome_ui_scheme); |
873 | 877 |
874 // chrome-extension: resources shouldn't trigger insecure content warnings. | 878 // chrome-extension: resources shouldn't trigger insecure content warnings. |
875 WebString extension_scheme(ASCIIToUTF16(chrome::kExtensionScheme)); | 879 WebString extension_scheme(ASCIIToUTF16(chrome::kExtensionScheme)); |
876 WebSecurityPolicy::registerURLSchemeAsSecure(extension_scheme); | 880 WebSecurityPolicy::registerURLSchemeAsSecure(extension_scheme); |
877 | 881 |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1127 } | 1131 } |
1128 | 1132 |
1129 return false; | 1133 return false; |
1130 } | 1134 } |
1131 | 1135 |
1132 void RenderThread::RegisterExtension(v8::Extension* extension, | 1136 void RenderThread::RegisterExtension(v8::Extension* extension, |
1133 bool restrict_to_extensions) { | 1137 bool restrict_to_extensions) { |
1134 WebScriptController::registerExtension(extension); | 1138 WebScriptController::registerExtension(extension); |
1135 v8_extensions_[extension->name()] = restrict_to_extensions; | 1139 v8_extensions_[extension->name()] = restrict_to_extensions; |
1136 } | 1140 } |
OLD | NEW |