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" |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 explicit FileUtilities(ThreadSafeSender* sender) | 54 explicit FileUtilities(ThreadSafeSender* sender) |
55 : thread_safe_sender_(sender) {} | 55 : thread_safe_sender_(sender) {} |
56 virtual bool getFileInfo(const WebString& path, WebFileInfo& result); | 56 virtual bool getFileInfo(const WebString& path, WebFileInfo& result); |
57 private: | 57 private: |
58 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 58 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
59 }; | 59 }; |
60 | 60 |
61 bool WorkerWebKitPlatformSupportImpl::FileUtilities::getFileInfo( | 61 bool WorkerWebKitPlatformSupportImpl::FileUtilities::getFileInfo( |
62 const WebString& path, | 62 const WebString& path, |
63 WebFileInfo& web_file_info) { | 63 WebFileInfo& web_file_info) { |
64 base::PlatformFileInfo file_info; | 64 base::File::Info file_info; |
65 base::PlatformFileError status; | 65 base::File::Error status; |
66 if (!thread_safe_sender_.get() || | 66 if (!thread_safe_sender_.get() || |
67 !thread_safe_sender_->Send(new FileUtilitiesMsg_GetFileInfo( | 67 !thread_safe_sender_->Send(new FileUtilitiesMsg_GetFileInfo( |
68 base::FilePath::FromUTF16Unsafe(path), &file_info, &status)) || | 68 base::FilePath::FromUTF16Unsafe(path), &file_info, &status)) || |
69 status != base::PLATFORM_FILE_OK) { | 69 status != base::File::FILE_OK) { |
70 return false; | 70 return false; |
71 } | 71 } |
72 webkit_glue::PlatformFileInfoToWebFileInfo(file_info, &web_file_info); | 72 webkit_glue::FileInfoToWebFileInfo(file_info, &web_file_info); |
73 web_file_info.platformPath = path; | 73 web_file_info.platformPath = path; |
74 return true; | 74 return true; |
75 } | 75 } |
76 | 76 |
77 //------------------------------------------------------------------------------ | 77 //------------------------------------------------------------------------------ |
78 | 78 |
79 WorkerWebKitPlatformSupportImpl::WorkerWebKitPlatformSupportImpl( | 79 WorkerWebKitPlatformSupportImpl::WorkerWebKitPlatformSupportImpl( |
80 ThreadSafeSender* sender, | 80 ThreadSafeSender* sender, |
81 IPC::SyncMessageFilter* sync_message_filter, | 81 IPC::SyncMessageFilter* sync_message_filter, |
82 QuotaMessageFilter* quota_message_filter) | 82 QuotaMessageFilter* quota_message_filter) |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 return; | 297 return; |
298 QuotaDispatcher::ThreadSpecificInstance( | 298 QuotaDispatcher::ThreadSpecificInstance( |
299 thread_safe_sender_.get(), | 299 thread_safe_sender_.get(), |
300 quota_message_filter_.get())->QueryStorageUsageAndQuota( | 300 quota_message_filter_.get())->QueryStorageUsageAndQuota( |
301 storage_partition, | 301 storage_partition, |
302 static_cast<quota::StorageType>(type), | 302 static_cast<quota::StorageType>(type), |
303 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); | 303 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); |
304 } | 304 } |
305 | 305 |
306 } // namespace content | 306 } // namespace content |
OLD | NEW |