| 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/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 : thread_safe_sender_(sender) {} | 54 : thread_safe_sender_(sender) {} |
| 55 virtual bool getFileInfo(const WebString& path, WebFileInfo& result); | 55 virtual bool getFileInfo(const WebString& path, WebFileInfo& result); |
| 56 private: | 56 private: |
| 57 scoped_refptr<ThreadSafeSender> thread_safe_sender_; | 57 scoped_refptr<ThreadSafeSender> thread_safe_sender_; |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 bool WorkerWebKitPlatformSupportImpl::FileUtilities::getFileInfo( | 60 bool WorkerWebKitPlatformSupportImpl::FileUtilities::getFileInfo( |
| 61 const WebString& path, | 61 const WebString& path, |
| 62 WebFileInfo& web_file_info) { | 62 WebFileInfo& web_file_info) { |
| 63 base::File::Info file_info; | 63 base::File::Info file_info; |
| 64 base::File::Error status; | 64 base::File::Error status = base::File::FILE_ERROR_MAX; |
| 65 if (!thread_safe_sender_.get() || | 65 if (!thread_safe_sender_.get() || |
| 66 !thread_safe_sender_->Send(new FileUtilitiesMsg_GetFileInfo( | 66 !thread_safe_sender_->Send(new FileUtilitiesMsg_GetFileInfo( |
| 67 base::FilePath::FromUTF16Unsafe(path), &file_info, &status)) || | 67 base::FilePath::FromUTF16Unsafe(path), &file_info, &status)) || |
| 68 status != base::File::FILE_OK) { | 68 status != base::File::FILE_OK) { |
| 69 return false; | 69 return false; |
| 70 } | 70 } |
| 71 FileInfoToWebFileInfo(file_info, &web_file_info); | 71 FileInfoToWebFileInfo(file_info, &web_file_info); |
| 72 web_file_info.platformPath = path; | 72 web_file_info.platformPath = path; |
| 73 return true; | 73 return true; |
| 74 } | 74 } |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 return; | 306 return; |
| 307 QuotaDispatcher::ThreadSpecificInstance( | 307 QuotaDispatcher::ThreadSpecificInstance( |
| 308 thread_safe_sender_.get(), | 308 thread_safe_sender_.get(), |
| 309 quota_message_filter_.get())->QueryStorageUsageAndQuota( | 309 quota_message_filter_.get())->QueryStorageUsageAndQuota( |
| 310 storage_partition, | 310 storage_partition, |
| 311 static_cast<quota::StorageType>(type), | 311 static_cast<quota::StorageType>(type), |
| 312 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); | 312 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); |
| 313 } | 313 } |
| 314 | 314 |
| 315 } // namespace content | 315 } // namespace content |
| OLD | NEW |