| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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::PlatformFileInfo file_info; | 63 base::PlatformFileInfo file_info; |
| 64 base::PlatformFileError status; | 64 base::PlatformFileError status; |
| 65 #if defined(OS_ANDROID) |
| 66 GURL url(path.utf8()); |
| 67 if (url.SchemeIsContent()) { |
| 68 if (!thread_safe_sender_.get() || |
| 69 !thread_safe_sender_->Send(new FileUtilitiesMsg_GetContentUrlInfo( |
| 70 url, &file_info, &status)) || |
| 71 status != base::PLATFORM_FILE_OK) { |
| 72 return false; |
| 73 } |
| 74 } else { |
| 75 #endif |
| 65 if (!thread_safe_sender_.get() || | 76 if (!thread_safe_sender_.get() || |
| 66 !thread_safe_sender_->Send(new FileUtilitiesMsg_GetFileInfo( | 77 !thread_safe_sender_->Send(new FileUtilitiesMsg_GetFileInfo( |
| 67 base::FilePath::FromUTF16Unsafe(path), &file_info, &status)) || | 78 base::FilePath::FromUTF16Unsafe(path), &file_info, &status)) || |
| 68 status != base::PLATFORM_FILE_OK) { | 79 status != base::PLATFORM_FILE_OK) { |
| 69 return false; | 80 return false; |
| 70 } | 81 } |
| 82 #if defined(OS_ANDROID) |
| 83 } |
| 84 #endif |
| 71 webkit_glue::PlatformFileInfoToWebFileInfo(file_info, &web_file_info); | 85 webkit_glue::PlatformFileInfoToWebFileInfo(file_info, &web_file_info); |
| 72 web_file_info.platformPath = path; | 86 web_file_info.platformPath = path; |
| 73 return true; | 87 return true; |
| 74 } | 88 } |
| 75 | 89 |
| 76 //------------------------------------------------------------------------------ | 90 //------------------------------------------------------------------------------ |
| 77 | 91 |
| 78 WorkerWebKitPlatformSupportImpl::WorkerWebKitPlatformSupportImpl( | 92 WorkerWebKitPlatformSupportImpl::WorkerWebKitPlatformSupportImpl( |
| 79 ThreadSafeSender* sender, | 93 ThreadSafeSender* sender, |
| 80 IPC::SyncMessageFilter* sync_message_filter, | 94 IPC::SyncMessageFilter* sync_message_filter, |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 return; | 302 return; |
| 289 QuotaDispatcher::ThreadSpecificInstance( | 303 QuotaDispatcher::ThreadSpecificInstance( |
| 290 thread_safe_sender_.get(), | 304 thread_safe_sender_.get(), |
| 291 quota_message_filter_.get())->QueryStorageUsageAndQuota( | 305 quota_message_filter_.get())->QueryStorageUsageAndQuota( |
| 292 storage_partition, | 306 storage_partition, |
| 293 static_cast<quota::StorageType>(type), | 307 static_cast<quota::StorageType>(type), |
| 294 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); | 308 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); |
| 295 } | 309 } |
| 296 | 310 |
| 297 } // namespace content | 311 } // namespace content |
| OLD | NEW |