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" |
11 #include "base/message_loop/message_loop_proxy.h" | 11 #include "base/message_loop/message_loop_proxy.h" |
12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
13 #include "base/platform_file.h" | 13 #include "base/platform_file.h" |
14 #include "base/safe_numerics.h" | 14 #include "base/safe_numerics.h" |
15 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
17 #include "content/child/database_util.h" | 17 #include "content/child/database_util.h" |
18 #include "content/child/fileapi/webfilesystem_impl.h" | 18 #include "content/child/fileapi/webfilesystem_impl.h" |
19 #include "content/child/indexed_db/proxy_webidbfactory_impl.h" | 19 #include "content/child/indexed_db/proxy_webidbfactory_impl.h" |
20 #include "content/child/npapi/npobject_util.h" | 20 #include "content/child/npapi/npobject_util.h" |
21 #include "content/child/quota_dispatcher.h" | 21 #include "content/child/quota_dispatcher.h" |
22 #include "content/child/quota_message_filter.h" | |
23 #include "content/child/thread_safe_sender.h" | 22 #include "content/child/thread_safe_sender.h" |
24 #include "content/child/webblobregistry_impl.h" | 23 #include "content/child/webblobregistry_impl.h" |
25 #include "content/child/webmessageportchannel_impl.h" | 24 #include "content/child/webmessageportchannel_impl.h" |
26 #include "content/common/file_utilities_messages.h" | 25 #include "content/common/file_utilities_messages.h" |
27 #include "content/common/gpu/client/context_provider_command_buffer.h" | 26 #include "content/common/gpu/client/context_provider_command_buffer.h" |
28 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 27 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
29 #include "content/common/mime_registry_messages.h" | 28 #include "content/common/mime_registry_messages.h" |
30 #include "content/common/view_messages.h" | 29 #include "content/common/view_messages.h" |
31 #include "content/public/common/content_switches.h" | 30 #include "content/public/common/content_switches.h" |
32 #include "content/public/common/webplugininfo.h" | 31 #include "content/public/common/webplugininfo.h" |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 sandbox_support_.reset( | 234 sandbox_support_.reset( |
236 new RendererWebKitPlatformSupportImpl::SandboxSupport); | 235 new RendererWebKitPlatformSupportImpl::SandboxSupport); |
237 } else { | 236 } else { |
238 DVLOG(1) << "Disabling sandbox support for testing."; | 237 DVLOG(1) << "Disabling sandbox support for testing."; |
239 } | 238 } |
240 | 239 |
241 // ChildThread may not exist in some tests. | 240 // ChildThread may not exist in some tests. |
242 if (ChildThread::current()) { | 241 if (ChildThread::current()) { |
243 sync_message_filter_ = ChildThread::current()->sync_message_filter(); | 242 sync_message_filter_ = ChildThread::current()->sync_message_filter(); |
244 thread_safe_sender_ = ChildThread::current()->thread_safe_sender(); | 243 thread_safe_sender_ = ChildThread::current()->thread_safe_sender(); |
245 quota_message_filter_ = ChildThread::current()->quota_message_filter(); | |
246 } | 244 } |
247 } | 245 } |
248 | 246 |
249 RendererWebKitPlatformSupportImpl::~RendererWebKitPlatformSupportImpl() { | 247 RendererWebKitPlatformSupportImpl::~RendererWebKitPlatformSupportImpl() { |
250 } | 248 } |
251 | 249 |
252 //------------------------------------------------------------------------------ | 250 //------------------------------------------------------------------------------ |
253 | 251 |
254 WebKit::WebClipboard* RendererWebKitPlatformSupportImpl::clipboard() { | 252 WebKit::WebClipboard* RendererWebKitPlatformSupportImpl::clipboard() { |
255 WebKit::WebClipboard* clipboard = | 253 WebKit::WebClipboard* clipboard = |
(...skipping 887 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1143 RenderThread::Get()->Send(new ViewHostMsg_CancelVibration()); | 1141 RenderThread::Get()->Send(new ViewHostMsg_CancelVibration()); |
1144 } | 1142 } |
1145 #endif // defined(OS_ANDROID) | 1143 #endif // defined(OS_ANDROID) |
1146 | 1144 |
1147 //------------------------------------------------------------------------------ | 1145 //------------------------------------------------------------------------------ |
1148 | 1146 |
1149 void RendererWebKitPlatformSupportImpl::queryStorageUsageAndQuota( | 1147 void RendererWebKitPlatformSupportImpl::queryStorageUsageAndQuota( |
1150 const WebKit::WebURL& storage_partition, | 1148 const WebKit::WebURL& storage_partition, |
1151 WebKit::WebStorageQuotaType type, | 1149 WebKit::WebStorageQuotaType type, |
1152 WebKit::WebStorageQuotaCallbacks* callbacks) { | 1150 WebKit::WebStorageQuotaCallbacks* callbacks) { |
1153 if (!thread_safe_sender_.get() || !quota_message_filter_.get()) | 1151 ChildThread::current()->quota_dispatcher()->QueryStorageUsageAndQuota( |
1154 return; | 1152 storage_partition, |
1155 QuotaDispatcher::ThreadSpecificInstance( | 1153 static_cast<quota::StorageType>(type), |
1156 thread_safe_sender_.get(), | 1154 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); |
1157 quota_message_filter_.get())->QueryStorageUsageAndQuota( | |
1158 storage_partition, | |
1159 static_cast<quota::StorageType>(type), | |
1160 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); | |
1161 } | 1155 } |
1162 | 1156 |
1163 } // namespace content | 1157 } // namespace content |
OLD | NEW |