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/worker/worker_webkitplatformsupport_impl.h" | 5 #include "content/worker/worker_webkitplatformsupport_impl.h" |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
10 #include "base/platform_file.h" | 10 #include "base/platform_file.h" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "content/child/database_util.h" | 12 #include "content/child/database_util.h" |
13 #include "content/child/fileapi/webfilesystem_impl.h" | 13 #include "content/child/fileapi/webfilesystem_impl.h" |
14 #include "content/child/indexed_db/proxy_webidbfactory_impl.h" | 14 #include "content/child/indexed_db/proxy_webidbfactory_impl.h" |
15 #include "content/child/quota_dispatcher.h" | 15 #include "content/child/quota_dispatcher.h" |
| 16 #include "content/child/quota_message_filter.h" |
16 #include "content/child/thread_safe_sender.h" | 17 #include "content/child/thread_safe_sender.h" |
17 #include "content/child/webblobregistry_impl.h" | 18 #include "content/child/webblobregistry_impl.h" |
18 #include "content/child/webmessageportchannel_impl.h" | 19 #include "content/child/webmessageportchannel_impl.h" |
19 #include "content/common/file_utilities_messages.h" | 20 #include "content/common/file_utilities_messages.h" |
20 #include "content/common/mime_registry_messages.h" | 21 #include "content/common/mime_registry_messages.h" |
21 #include "content/worker/worker_thread.h" | 22 #include "content/worker/worker_thread.h" |
22 #include "ipc/ipc_sync_message_filter.h" | 23 #include "ipc/ipc_sync_message_filter.h" |
23 #include "net/base/mime_util.h" | 24 #include "net/base/mime_util.h" |
24 #include "third_party/WebKit/public/platform/WebBlobRegistry.h" | 25 #include "third_party/WebKit/public/platform/WebBlobRegistry.h" |
25 #include "third_party/WebKit/public/platform/WebFileInfo.h" | 26 #include "third_party/WebKit/public/platform/WebFileInfo.h" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 } | 70 } |
70 webkit_glue::PlatformFileInfoToWebFileInfo(file_info, &web_file_info); | 71 webkit_glue::PlatformFileInfoToWebFileInfo(file_info, &web_file_info); |
71 web_file_info.platformPath = path; | 72 web_file_info.platformPath = path; |
72 return true; | 73 return true; |
73 } | 74 } |
74 | 75 |
75 //------------------------------------------------------------------------------ | 76 //------------------------------------------------------------------------------ |
76 | 77 |
77 WorkerWebKitPlatformSupportImpl::WorkerWebKitPlatformSupportImpl( | 78 WorkerWebKitPlatformSupportImpl::WorkerWebKitPlatformSupportImpl( |
78 ThreadSafeSender* sender, | 79 ThreadSafeSender* sender, |
79 IPC::SyncMessageFilter* sync_message_filter) | 80 IPC::SyncMessageFilter* sync_message_filter, |
| 81 QuotaMessageFilter* quota_message_filter) |
80 : thread_safe_sender_(sender), | 82 : thread_safe_sender_(sender), |
81 child_thread_loop_(base::MessageLoopProxy::current()), | 83 child_thread_loop_(base::MessageLoopProxy::current()), |
82 sync_message_filter_(sync_message_filter) { | 84 sync_message_filter_(sync_message_filter), |
| 85 quota_message_filter_(quota_message_filter) { |
83 } | 86 } |
84 | 87 |
85 WorkerWebKitPlatformSupportImpl::~WorkerWebKitPlatformSupportImpl() { | 88 WorkerWebKitPlatformSupportImpl::~WorkerWebKitPlatformSupportImpl() { |
86 } | 89 } |
87 | 90 |
88 WebClipboard* WorkerWebKitPlatformSupportImpl::clipboard() { | 91 WebClipboard* WorkerWebKitPlatformSupportImpl::clipboard() { |
89 NOTREACHED(); | 92 NOTREACHED(); |
90 return NULL; | 93 return NULL; |
91 } | 94 } |
92 | 95 |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 WebBlobRegistry* WorkerWebKitPlatformSupportImpl::blobRegistry() { | 298 WebBlobRegistry* WorkerWebKitPlatformSupportImpl::blobRegistry() { |
296 if (!blob_registry_.get() && thread_safe_sender_.get()) | 299 if (!blob_registry_.get() && thread_safe_sender_.get()) |
297 blob_registry_.reset(new WebBlobRegistryImpl(thread_safe_sender_.get())); | 300 blob_registry_.reset(new WebBlobRegistryImpl(thread_safe_sender_.get())); |
298 return blob_registry_.get(); | 301 return blob_registry_.get(); |
299 } | 302 } |
300 | 303 |
301 void WorkerWebKitPlatformSupportImpl::queryStorageUsageAndQuota( | 304 void WorkerWebKitPlatformSupportImpl::queryStorageUsageAndQuota( |
302 const WebKit::WebURL& storage_partition, | 305 const WebKit::WebURL& storage_partition, |
303 WebKit::WebStorageQuotaType type, | 306 WebKit::WebStorageQuotaType type, |
304 WebKit::WebStorageQuotaCallbacks* callbacks) { | 307 WebKit::WebStorageQuotaCallbacks* callbacks) { |
305 ChildThread::current()->quota_dispatcher()->QueryStorageUsageAndQuota( | 308 if (!thread_safe_sender_.get() || !quota_message_filter_.get()) |
306 storage_partition, | 309 return; |
307 static_cast<quota::StorageType>(type), | 310 QuotaDispatcher::ThreadSpecificInstance( |
308 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); | 311 thread_safe_sender_.get(), |
| 312 quota_message_filter_.get())->QueryStorageUsageAndQuota( |
| 313 storage_partition, |
| 314 static_cast<quota::StorageType>(type), |
| 315 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); |
309 } | 316 } |
310 | 317 |
311 } // namespace content | 318 } // namespace content |
OLD | NEW |