Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(17)

Side by Side Diff: content/common/fileapi/webfilesystem_callback_dispatcher.cc

Issue 14671020: FileAPI: Copy base::FileUtilProxy::Entry to fileapi::DirectoryEntry (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
11 #include "base/logging.h" 10 #include "base/logging.h"
12 #include "base/utf_string_conversions.h" 11 #include "base/utf_string_conversions.h"
13 #include "googleurl/src/gurl.h" 12 #include "googleurl/src/gurl.h"
14 #include "third_party/WebKit/Source/Platform/chromium/public/WebFileInfo.h" 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebFileInfo.h"
15 #include "third_party/WebKit/Source/Platform/chromium/public/WebFileSystem.h" 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebFileSystem.h"
16 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h" 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebString.h"
17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallback s.h" 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileSystemCallback s.h"
18 #include "webkit/base/file_path_string_conversions.h" 17 #include "webkit/base/file_path_string_conversions.h"
19 #include "webkit/fileapi/file_system_util.h" 18 #include "webkit/fileapi/file_system_util.h"
20 #include "webkit/glue/webkit_glue.h" 19 #include "webkit/glue/webkit_glue.h"
(...skipping 28 matching lines...) Expand all
49 void WebFileSystemCallbackDispatcher::DidCreateSnapshotFile( 48 void WebFileSystemCallbackDispatcher::DidCreateSnapshotFile(
50 const base::PlatformFileInfo& file_info, 49 const base::PlatformFileInfo& file_info,
51 const base::FilePath& platform_path) { 50 const base::FilePath& platform_path) {
52 WebFileInfo web_file_info; 51 WebFileInfo web_file_info;
53 webkit_glue::PlatformFileInfoToWebFileInfo(file_info, &web_file_info); 52 webkit_glue::PlatformFileInfoToWebFileInfo(file_info, &web_file_info);
54 web_file_info.platformPath = webkit_base::FilePathToWebString(platform_path); 53 web_file_info.platformPath = webkit_base::FilePathToWebString(platform_path);
55 callbacks_->didCreateSnapshotFile(web_file_info); 54 callbacks_->didCreateSnapshotFile(web_file_info);
56 } 55 }
57 56
58 void WebFileSystemCallbackDispatcher::DidReadDirectory( 57 void WebFileSystemCallbackDispatcher::DidReadDirectory(
59 const std::vector<base::FileUtilProxy::Entry>& entries, bool has_more) { 58 const std::vector<fileapi::FileSystemOperation::Entry>& entries,
59 bool has_more) {
60 WebVector<WebFileSystemEntry> file_system_entries(entries.size()); 60 WebVector<WebFileSystemEntry> file_system_entries(entries.size());
61 for (size_t i = 0; i < entries.size(); i++) { 61 for (size_t i = 0; i < entries.size(); i++) {
62 file_system_entries[i].name = 62 file_system_entries[i].name =
63 webkit_base::FilePathStringToWebString(entries[i].name); 63 webkit_base::FilePathStringToWebString(entries[i].name);
64 file_system_entries[i].isDirectory = entries[i].is_directory; 64 file_system_entries[i].isDirectory = entries[i].is_directory;
65 } 65 }
66 callbacks_->didReadDirectory(file_system_entries, has_more); 66 callbacks_->didReadDirectory(file_system_entries, has_more);
67 } 67 }
68 68
69 void WebFileSystemCallbackDispatcher::DidOpenFileSystem( 69 void WebFileSystemCallbackDispatcher::DidOpenFileSystem(
70 const std::string& name, const GURL& root) { 70 const std::string& name, const GURL& root) {
71 callbacks_->didOpenFileSystem(UTF8ToUTF16(name), root); 71 callbacks_->didOpenFileSystem(UTF8ToUTF16(name), root);
72 } 72 }
73 73
74 void WebFileSystemCallbackDispatcher::DidFail( 74 void WebFileSystemCallbackDispatcher::DidFail(
75 base::PlatformFileError error_code) { 75 base::PlatformFileError error_code) {
76 callbacks_->didFail( 76 callbacks_->didFail(
77 fileapi::PlatformFileErrorToWebFileError(error_code)); 77 fileapi::PlatformFileErrorToWebFileError(error_code));
78 } 78 }
79 79
80 void WebFileSystemCallbackDispatcher::DidWrite(int64 bytes, bool complete) { 80 void WebFileSystemCallbackDispatcher::DidWrite(int64 bytes, bool complete) {
81 NOTREACHED(); 81 NOTREACHED();
82 } 82 }
83 83
84 } // namespace content 84 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698