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