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/common/fileapi/webfilesystem_callback_dispatcher.h" | 5 #include "content/common/fileapi/webfilesystem_callback_dispatcher.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/files/file_util_proxy.h" | 10 #include "base/files/file_util_proxy.h" |
(...skipping 27 matching lines...) Expand all Loading... | |
38 } | 38 } |
39 | 39 |
40 void WebFileSystemCallbackDispatcher::DidReadMetadata( | 40 void WebFileSystemCallbackDispatcher::DidReadMetadata( |
41 const base::PlatformFileInfo& file_info, const FilePath& platform_path) { | 41 const base::PlatformFileInfo& file_info, const FilePath& platform_path) { |
42 WebFileInfo web_file_info; | 42 WebFileInfo web_file_info; |
43 webkit_glue::PlatformFileInfoToWebFileInfo(file_info, &web_file_info); | 43 webkit_glue::PlatformFileInfoToWebFileInfo(file_info, &web_file_info); |
44 web_file_info.platformPath = webkit_base::FilePathToWebString(platform_path); | 44 web_file_info.platformPath = webkit_base::FilePathToWebString(platform_path); |
45 callbacks_->didReadMetadata(web_file_info); | 45 callbacks_->didReadMetadata(web_file_info); |
46 } | 46 } |
47 | 47 |
48 void WebFileSystemCallbackDispatcher::DidCreateSnapshotFile( | |
49 const base::PlatformFileInfo& file_info, const FilePath& platform_path) { | |
50 WebFileInfo web_file_info; | |
51 webkit_glue::PlatformFileInfoToWebFileInfo(file_info, &web_file_info); | |
52 web_file_info.platformPath = webkit_base::FilePathToWebString(platform_path); | |
53 //callbacks_->didCreateSnapshotFile(web_file_info); | |
michaeln
2013/01/30 23:32:24
I need to land the first in the series of patches
| |
54 } | |
55 | |
48 void WebFileSystemCallbackDispatcher::DidReadDirectory( | 56 void WebFileSystemCallbackDispatcher::DidReadDirectory( |
49 const std::vector<base::FileUtilProxy::Entry>& entries, bool has_more) { | 57 const std::vector<base::FileUtilProxy::Entry>& entries, bool has_more) { |
50 WebVector<WebFileSystemEntry> file_system_entries(entries.size()); | 58 WebVector<WebFileSystemEntry> file_system_entries(entries.size()); |
51 for (size_t i = 0; i < entries.size(); i++) { | 59 for (size_t i = 0; i < entries.size(); i++) { |
52 file_system_entries[i].name = | 60 file_system_entries[i].name = |
53 webkit_base::FilePathStringToWebString(entries[i].name); | 61 webkit_base::FilePathStringToWebString(entries[i].name); |
54 file_system_entries[i].isDirectory = entries[i].is_directory; | 62 file_system_entries[i].isDirectory = entries[i].is_directory; |
55 } | 63 } |
56 callbacks_->didReadDirectory(file_system_entries, has_more); | 64 callbacks_->didReadDirectory(file_system_entries, has_more); |
57 } | 65 } |
58 | 66 |
59 void WebFileSystemCallbackDispatcher::DidOpenFileSystem( | 67 void WebFileSystemCallbackDispatcher::DidOpenFileSystem( |
60 const std::string& name, const GURL& root) { | 68 const std::string& name, const GURL& root) { |
61 callbacks_->didOpenFileSystem(UTF8ToUTF16(name), root); | 69 callbacks_->didOpenFileSystem(UTF8ToUTF16(name), root); |
62 } | 70 } |
63 | 71 |
64 void WebFileSystemCallbackDispatcher::DidFail( | 72 void WebFileSystemCallbackDispatcher::DidFail( |
65 base::PlatformFileError error_code) { | 73 base::PlatformFileError error_code) { |
66 callbacks_->didFail( | 74 callbacks_->didFail( |
67 fileapi::PlatformFileErrorToWebFileError(error_code)); | 75 fileapi::PlatformFileErrorToWebFileError(error_code)); |
68 } | 76 } |
69 | 77 |
70 void WebFileSystemCallbackDispatcher::DidWrite(int64 bytes, bool complete) { | 78 void WebFileSystemCallbackDispatcher::DidWrite(int64 bytes, bool complete) { |
71 NOTREACHED(); | 79 NOTREACHED(); |
72 } | 80 } |
73 | 81 |
74 } // namespace content | 82 } // namespace content |
OLD | NEW |