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 "content/renderer/renderer_webkitplatformsupport_impl.h" | 5 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" | 68 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" |
69 #include "third_party/WebKit/public/platform/WebMediaStreamCenterClient.h" | 69 #include "third_party/WebKit/public/platform/WebMediaStreamCenterClient.h" |
70 #include "third_party/WebKit/public/platform/WebPluginListBuilder.h" | 70 #include "third_party/WebKit/public/platform/WebPluginListBuilder.h" |
71 #include "third_party/WebKit/public/platform/WebURL.h" | 71 #include "third_party/WebKit/public/platform/WebURL.h" |
72 #include "third_party/WebKit/public/platform/WebVector.h" | 72 #include "third_party/WebKit/public/platform/WebVector.h" |
73 #include "ui/gfx/color_profile.h" | 73 #include "ui/gfx/color_profile.h" |
74 #include "url/gurl.h" | 74 #include "url/gurl.h" |
75 #include "webkit/common/gpu/context_provider_web_context.h" | 75 #include "webkit/common/gpu/context_provider_web_context.h" |
76 #include "webkit/common/quota/quota_types.h" | 76 #include "webkit/common/quota/quota_types.h" |
77 | 77 |
78 #if defined(OS_WIN) | 78 #if defined(OS_ANDROID) |
79 #include "content/common/child_process_messages.h" | 79 #include "content/renderer/media/android/audio_decoder_android.h" |
80 #include "third_party/WebKit/public/platform/win/WebSandboxSupport.h" | |
81 #endif | 80 #endif |
82 | 81 |
83 #if defined(OS_MACOSX) | 82 #if defined(OS_MACOSX) |
84 #include "content/common/mac/font_descriptor.h" | 83 #include "content/common/mac/font_descriptor.h" |
85 #include "content/common/mac/font_loader.h" | 84 #include "content/common/mac/font_loader.h" |
| 85 #include "content/renderer/webscrollbarbehavior_impl_mac.h" |
86 #include "third_party/WebKit/public/platform/mac/WebSandboxSupport.h" | 86 #include "third_party/WebKit/public/platform/mac/WebSandboxSupport.h" |
87 #endif | 87 #endif |
88 | 88 |
89 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) | 89 #if defined(OS_POSIX) |
| 90 #include "base/file_descriptor_posix.h" |
| 91 #if !defined(OS_MACOSX) && !defined(OS_ANDROID) |
90 #include <map> | 92 #include <map> |
91 #include <string> | 93 #include <string> |
92 | 94 |
93 #include "base/synchronization/lock.h" | 95 #include "base/synchronization/lock.h" |
94 #include "content/common/child_process_sandbox_support_impl_linux.h" | 96 #include "content/common/child_process_sandbox_support_impl_linux.h" |
95 #include "third_party/WebKit/public/platform/linux/WebFontFamily.h" | 97 #include "third_party/WebKit/public/platform/linux/WebFontFamily.h" |
96 #include "third_party/WebKit/public/platform/linux/WebSandboxSupport.h" | 98 #include "third_party/WebKit/public/platform/linux/WebSandboxSupport.h" |
97 #include "third_party/icu/source/common/unicode/utf16.h" | 99 #include "third_party/icu/source/common/unicode/utf16.h" |
98 #endif | 100 #endif |
99 | |
100 #if defined(OS_POSIX) | |
101 #include "base/file_descriptor_posix.h" | |
102 #endif | 101 #endif |
103 | 102 |
104 #if defined(OS_ANDROID) | 103 #if defined(OS_WIN) |
105 #include "content/renderer/media/android/audio_decoder_android.h" | 104 #include "content/common/child_process_messages.h" |
| 105 #include "third_party/WebKit/public/platform/win/WebSandboxSupport.h" |
| 106 #endif |
| 107 |
| 108 #if defined(TOOLKIT_GTK) || defined(USE_AURA) |
| 109 #include "content/renderer/webscrollbarbehavior_impl_gtkoraura.h" |
| 110 #elif !defined(OS_MACOSX) |
| 111 #include "third_party/WebKit/public/platform/WebScrollbarBehavior.h" |
| 112 #define WebScrollbarBehaviorImpl blink::WebScrollbarBehavior |
106 #endif | 113 #endif |
107 | 114 |
108 using blink::Platform; | 115 using blink::Platform; |
109 using blink::WebAudioDevice; | 116 using blink::WebAudioDevice; |
110 using blink::WebBlobRegistry; | 117 using blink::WebBlobRegistry; |
111 using blink::WebDatabaseObserver; | 118 using blink::WebDatabaseObserver; |
112 using blink::WebFileInfo; | 119 using blink::WebFileInfo; |
113 using blink::WebFileSystem; | 120 using blink::WebFileSystem; |
114 using blink::WebGamepads; | 121 using blink::WebGamepads; |
115 using blink::WebIDBFactory; | 122 using blink::WebIDBFactory; |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 #endif // defined(OS_ANDROID) | 206 #endif // defined(OS_ANDROID) |
200 | 207 |
201 //------------------------------------------------------------------------------ | 208 //------------------------------------------------------------------------------ |
202 | 209 |
203 RendererWebKitPlatformSupportImpl::RendererWebKitPlatformSupportImpl() | 210 RendererWebKitPlatformSupportImpl::RendererWebKitPlatformSupportImpl() |
204 : clipboard_client_(new RendererClipboardClient), | 211 : clipboard_client_(new RendererClipboardClient), |
205 clipboard_(new WebClipboardImpl(clipboard_client_.get())), | 212 clipboard_(new WebClipboardImpl(clipboard_client_.get())), |
206 mime_registry_(new RendererWebKitPlatformSupportImpl::MimeRegistry), | 213 mime_registry_(new RendererWebKitPlatformSupportImpl::MimeRegistry), |
207 sudden_termination_disables_(0), | 214 sudden_termination_disables_(0), |
208 plugin_refresh_allowed_(true), | 215 plugin_refresh_allowed_(true), |
209 child_thread_loop_(base::MessageLoopProxy::current()) { | 216 child_thread_loop_(base::MessageLoopProxy::current()), |
| 217 web_scrollbar_behavior_(new WebScrollbarBehaviorImpl) { |
210 if (g_sandbox_enabled && sandboxEnabled()) { | 218 if (g_sandbox_enabled && sandboxEnabled()) { |
211 sandbox_support_.reset( | 219 sandbox_support_.reset( |
212 new RendererWebKitPlatformSupportImpl::SandboxSupport); | 220 new RendererWebKitPlatformSupportImpl::SandboxSupport); |
213 } else { | 221 } else { |
214 DVLOG(1) << "Disabling sandbox support for testing."; | 222 DVLOG(1) << "Disabling sandbox support for testing."; |
215 } | 223 } |
216 | 224 |
217 // ChildThread may not exist in some tests. | 225 // ChildThread may not exist in some tests. |
218 if (ChildThread::current()) { | 226 if (ChildThread::current()) { |
219 sync_message_filter_ = ChildThread::current()->sync_message_filter(); | 227 sync_message_filter_ = ChildThread::current()->sync_message_filter(); |
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
843 *to_profile = profile; | 851 *to_profile = profile; |
844 #else | 852 #else |
845 // On other platforms color profile can be obtained directly. | 853 // On other platforms color profile can be obtained directly. |
846 gfx::ColorProfile profile; | 854 gfx::ColorProfile profile; |
847 *to_profile = profile.profile(); | 855 *to_profile = profile.profile(); |
848 #endif | 856 #endif |
849 } | 857 } |
850 | 858 |
851 //------------------------------------------------------------------------------ | 859 //------------------------------------------------------------------------------ |
852 | 860 |
| 861 blink::WebScrollbarBehavior* |
| 862 RendererWebKitPlatformSupportImpl::scrollbarBehavior() { |
| 863 return web_scrollbar_behavior_.get(); |
| 864 } |
| 865 |
| 866 //------------------------------------------------------------------------------ |
| 867 |
853 WebBlobRegistry* RendererWebKitPlatformSupportImpl::blobRegistry() { | 868 WebBlobRegistry* RendererWebKitPlatformSupportImpl::blobRegistry() { |
854 // blob_registry_ can be NULL when running some tests. | 869 // blob_registry_ can be NULL when running some tests. |
855 return blob_registry_.get(); | 870 return blob_registry_.get(); |
856 } | 871 } |
857 | 872 |
858 //------------------------------------------------------------------------------ | 873 //------------------------------------------------------------------------------ |
859 | 874 |
860 void RendererWebKitPlatformSupportImpl::sampleGamepads(WebGamepads& gamepads) { | 875 void RendererWebKitPlatformSupportImpl::sampleGamepads(WebGamepads& gamepads) { |
861 if (g_test_gamepads == 0) { | 876 if (g_test_gamepads == 0) { |
862 RenderThreadImpl::current()->SampleGamepads(&gamepads); | 877 RenderThreadImpl::current()->SampleGamepads(&gamepads); |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1078 return; | 1093 return; |
1079 QuotaDispatcher::ThreadSpecificInstance( | 1094 QuotaDispatcher::ThreadSpecificInstance( |
1080 thread_safe_sender_.get(), | 1095 thread_safe_sender_.get(), |
1081 quota_message_filter_.get())->QueryStorageUsageAndQuota( | 1096 quota_message_filter_.get())->QueryStorageUsageAndQuota( |
1082 storage_partition, | 1097 storage_partition, |
1083 static_cast<quota::StorageType>(type), | 1098 static_cast<quota::StorageType>(type), |
1084 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); | 1099 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); |
1085 } | 1100 } |
1086 | 1101 |
1087 } // namespace content | 1102 } // namespace content |
OLD | NEW |