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 "webkit/tools/test_shell/simple_file_system.h" | 5 #include "webkit/tools/test_shell/simple_file_system.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 using webkit_blob::BlobData; | 45 using webkit_blob::BlobData; |
46 using webkit_blob::BlobStorageController; | 46 using webkit_blob::BlobStorageController; |
47 using fileapi::DirectoryEntry; | 47 using fileapi::DirectoryEntry; |
48 using fileapi::FileSystemContext; | 48 using fileapi::FileSystemContext; |
49 using fileapi::FileSystemOperation; | 49 using fileapi::FileSystemOperation; |
50 using fileapi::FileSystemTaskRunners; | 50 using fileapi::FileSystemTaskRunners; |
51 using fileapi::FileSystemURL; | 51 using fileapi::FileSystemURL; |
52 | 52 |
53 namespace { | 53 namespace { |
54 MessageLoop* g_io_thread; | 54 base::MessageLoop* g_io_thread; |
55 webkit_blob::BlobStorageController* g_blob_storage_controller; | 55 webkit_blob::BlobStorageController* g_blob_storage_controller; |
56 | 56 |
57 void RegisterBlob(const GURL& blob_url, const base::FilePath& file_path) { | 57 void RegisterBlob(const GURL& blob_url, const base::FilePath& file_path) { |
58 DCHECK(g_blob_storage_controller); | 58 DCHECK(g_blob_storage_controller); |
59 | 59 |
60 base::FilePath::StringType extension = file_path.Extension(); | 60 base::FilePath::StringType extension = file_path.Extension(); |
61 if (!extension.empty()) | 61 if (!extension.empty()) |
62 extension = extension.substr(1); // Strip leading ".". | 62 extension = extension.substr(1); // Strip leading ".". |
63 | 63 |
64 // This may fail, but then we'll be just setting the empty mime type. | 64 // This may fail, but then we'll be just setting the empty mime type. |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 web_file_info.modificationTime = info.last_modified.ToDoubleT(); | 401 web_file_info.modificationTime = info.last_modified.ToDoubleT(); |
402 web_file_info.type = info.is_directory ? | 402 web_file_info.type = info.is_directory ? |
403 WebFileInfo::TypeDirectory : WebFileInfo::TypeFile; | 403 WebFileInfo::TypeDirectory : WebFileInfo::TypeFile; |
404 web_file_info.platformPath = | 404 web_file_info.platformPath = |
405 webkit_base::FilePathToWebString(platform_path); | 405 webkit_base::FilePathToWebString(platform_path); |
406 callbacks->didCreateSnapshotFile(web_file_info); | 406 callbacks->didCreateSnapshotFile(web_file_info); |
407 } else { | 407 } else { |
408 callbacks->didFail(fileapi::PlatformFileErrorToWebFileError(result)); | 408 callbacks->didFail(fileapi::PlatformFileErrorToWebFileError(result)); |
409 } | 409 } |
410 } | 410 } |
OLD | NEW |