Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: content/renderer/renderer_webkitplatformsupport_impl.cc

Issue 20015002: Make Platform::queryStorageUsageAndQuota work from worker threads (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use map Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
22 #include "content/child/thread_safe_sender.h" 23 #include "content/child/thread_safe_sender.h"
23 #include "content/child/webblobregistry_impl.h" 24 #include "content/child/webblobregistry_impl.h"
24 #include "content/child/webmessageportchannel_impl.h" 25 #include "content/child/webmessageportchannel_impl.h"
25 #include "content/common/file_utilities_messages.h" 26 #include "content/common/file_utilities_messages.h"
26 #include "content/common/gpu/client/context_provider_command_buffer.h" 27 #include "content/common/gpu/client/context_provider_command_buffer.h"
27 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" 28 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
28 #include "content/common/mime_registry_messages.h" 29 #include "content/common/mime_registry_messages.h"
29 #include "content/common/view_messages.h" 30 #include "content/common/view_messages.h"
30 #include "content/public/common/content_switches.h" 31 #include "content/public/common/content_switches.h"
31 #include "content/public/common/webplugininfo.h" 32 #include "content/public/common/webplugininfo.h"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 sandbox_support_.reset( 242 sandbox_support_.reset(
242 new RendererWebKitPlatformSupportImpl::SandboxSupport); 243 new RendererWebKitPlatformSupportImpl::SandboxSupport);
243 } else { 244 } else {
244 DVLOG(1) << "Disabling sandbox support for testing."; 245 DVLOG(1) << "Disabling sandbox support for testing.";
245 } 246 }
246 247
247 // ChildThread may not exist in some tests. 248 // ChildThread may not exist in some tests.
248 if (ChildThread::current()) { 249 if (ChildThread::current()) {
249 sync_message_filter_ = ChildThread::current()->sync_message_filter(); 250 sync_message_filter_ = ChildThread::current()->sync_message_filter();
250 thread_safe_sender_ = ChildThread::current()->thread_safe_sender(); 251 thread_safe_sender_ = ChildThread::current()->thread_safe_sender();
252 quota_message_filter_ = ChildThread::current()->quota_message_filter();
251 } 253 }
252 } 254 }
253 255
254 RendererWebKitPlatformSupportImpl::~RendererWebKitPlatformSupportImpl() { 256 RendererWebKitPlatformSupportImpl::~RendererWebKitPlatformSupportImpl() {
255 } 257 }
256 258
257 //------------------------------------------------------------------------------ 259 //------------------------------------------------------------------------------
258 260
259 WebKit::WebClipboard* RendererWebKitPlatformSupportImpl::clipboard() { 261 WebKit::WebClipboard* RendererWebKitPlatformSupportImpl::clipboard() {
260 WebKit::WebClipboard* clipboard = 262 WebKit::WebClipboard* clipboard =
(...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after
1155 RenderThread::Get()->Send(new ViewHostMsg_CancelVibration()); 1157 RenderThread::Get()->Send(new ViewHostMsg_CancelVibration());
1156 } 1158 }
1157 #endif // defined(OS_ANDROID) 1159 #endif // defined(OS_ANDROID)
1158 1160
1159 //------------------------------------------------------------------------------ 1161 //------------------------------------------------------------------------------
1160 1162
1161 void RendererWebKitPlatformSupportImpl::queryStorageUsageAndQuota( 1163 void RendererWebKitPlatformSupportImpl::queryStorageUsageAndQuota(
1162 const WebKit::WebURL& storage_partition, 1164 const WebKit::WebURL& storage_partition,
1163 WebKit::WebStorageQuotaType type, 1165 WebKit::WebStorageQuotaType type,
1164 WebKit::WebStorageQuotaCallbacks* callbacks) { 1166 WebKit::WebStorageQuotaCallbacks* callbacks) {
1165 ChildThread::current()->quota_dispatcher()->QueryStorageUsageAndQuota( 1167 if (!thread_safe_sender_.get() || !quota_message_filter_.get())
1166 storage_partition, 1168 return;
1167 static_cast<quota::StorageType>(type), 1169 QuotaDispatcher::ThreadSpecificInstance(
1168 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); 1170 thread_safe_sender_.get(),
1171 quota_message_filter_.get())->QueryStorageUsageAndQuota(
1172 storage_partition,
1173 static_cast<quota::StorageType>(type),
1174 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks));
1169 } 1175 }
1170 1176
1171 } // namespace content 1177 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698