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/renderer/renderer_webkitplatformsupport_impl.h" | 5 #include "content/renderer/renderer_webkitplatformsupport_impl.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 return ASCIIToUTF16(mime_type); | 469 return ASCIIToUTF16(mime_type); |
470 } | 470 } |
471 | 471 |
472 //------------------------------------------------------------------------------ | 472 //------------------------------------------------------------------------------ |
473 | 473 |
474 bool RendererWebKitPlatformSupportImpl::FileUtilities::getFileInfo( | 474 bool RendererWebKitPlatformSupportImpl::FileUtilities::getFileInfo( |
475 const WebString& path, | 475 const WebString& path, |
476 WebFileInfo& web_file_info) { | 476 WebFileInfo& web_file_info) { |
477 base::PlatformFileInfo file_info; | 477 base::PlatformFileInfo file_info; |
478 base::PlatformFileError status; | 478 base::PlatformFileError status; |
| 479 #if defined(OS_ANDROID) |
| 480 GURL url(path.utf8()); |
| 481 if (url.SchemeIsContent()) { |
| 482 if (!SendSyncMessageFromAnyThread(new FileUtilitiesMsg_GetContentUrlInfo( |
| 483 url, &file_info, &status)) || |
| 484 status != base::PLATFORM_FILE_OK) { |
| 485 return false; |
| 486 } |
| 487 } else { |
| 488 #endif |
479 if (!SendSyncMessageFromAnyThread(new FileUtilitiesMsg_GetFileInfo( | 489 if (!SendSyncMessageFromAnyThread(new FileUtilitiesMsg_GetFileInfo( |
480 base::FilePath::FromUTF16Unsafe(path), &file_info, &status)) || | 490 base::FilePath::FromUTF16Unsafe(path), &file_info, &status)) || |
481 status != base::PLATFORM_FILE_OK) { | 491 status != base::PLATFORM_FILE_OK) { |
482 return false; | 492 return false; |
483 } | 493 } |
| 494 #if defined(OS_ANDROID) |
| 495 } |
| 496 #endif |
484 webkit_glue::PlatformFileInfoToWebFileInfo(file_info, &web_file_info); | 497 webkit_glue::PlatformFileInfoToWebFileInfo(file_info, &web_file_info); |
485 web_file_info.platformPath = path; | 498 web_file_info.platformPath = path; |
486 return true; | 499 return true; |
487 } | 500 } |
488 | 501 |
489 bool RendererWebKitPlatformSupportImpl::FileUtilities:: | 502 bool RendererWebKitPlatformSupportImpl::FileUtilities:: |
490 SendSyncMessageFromAnyThread(IPC::SyncMessage* msg) const { | 503 SendSyncMessageFromAnyThread(IPC::SyncMessage* msg) const { |
491 base::TimeTicks begin = base::TimeTicks::Now(); | 504 base::TimeTicks begin = base::TimeTicks::Now(); |
492 const bool success = thread_safe_sender_->Send(msg); | 505 const bool success = thread_safe_sender_->Send(msg); |
493 base::TimeDelta delta = base::TimeTicks::Now() - begin; | 506 base::TimeDelta delta = base::TimeTicks::Now() - begin; |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1042 return; | 1055 return; |
1043 QuotaDispatcher::ThreadSpecificInstance( | 1056 QuotaDispatcher::ThreadSpecificInstance( |
1044 thread_safe_sender_.get(), | 1057 thread_safe_sender_.get(), |
1045 quota_message_filter_.get())->QueryStorageUsageAndQuota( | 1058 quota_message_filter_.get())->QueryStorageUsageAndQuota( |
1046 storage_partition, | 1059 storage_partition, |
1047 static_cast<quota::StorageType>(type), | 1060 static_cast<quota::StorageType>(type), |
1048 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); | 1061 QuotaDispatcher::CreateWebStorageQuotaCallbacksWrapper(callbacks)); |
1049 } | 1062 } |
1050 | 1063 |
1051 } // namespace content | 1064 } // namespace content |
OLD | NEW |