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

Side by Side Diff: chrome/common/file_system/file_system_dispatcher.cc

Issue 3347005: Moving file_util::FileInfo to base::PlatformFileInfo, and adding the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 3 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/common/file_system/file_system_dispatcher.h" 5 #include "chrome/common/file_system/file_system_dispatcher.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "chrome/common/child_thread.h" 8 #include "chrome/common/child_thread.h"
9 #include "chrome/common/render_messages.h" 9 #include "chrome/common/render_messages.h"
10 #include "chrome/common/render_messages_params.h" 10 #include "chrome/common/render_messages_params.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 } 103 }
104 104
105 void FileSystemDispatcher::DidSucceed(int request_id) { 105 void FileSystemDispatcher::DidSucceed(int request_id) {
106 WebFileSystemCallbacks* callbacks = callbacks_.Lookup(request_id); 106 WebFileSystemCallbacks* callbacks = callbacks_.Lookup(request_id);
107 DCHECK(callbacks); 107 DCHECK(callbacks);
108 callbacks_.Remove(request_id); 108 callbacks_.Remove(request_id);
109 callbacks->didSucceed(); 109 callbacks->didSucceed();
110 } 110 }
111 111
112 void FileSystemDispatcher::DidReadMetadata(int request_id, 112 void FileSystemDispatcher::DidReadMetadata(int request_id,
113 const file_util::FileInfo& file_info) { 113 const base::PlatformFileInfo& file_info) {
114 WebFileSystemCallbacks* callbacks = callbacks_.Lookup(request_id); 114 WebFileSystemCallbacks* callbacks = callbacks_.Lookup(request_id);
115 DCHECK(callbacks); 115 DCHECK(callbacks);
116 callbacks_.Remove(request_id); 116 callbacks_.Remove(request_id);
117 WebFileInfo web_file_info; 117 WebFileInfo web_file_info;
118 web_file_info.modificationTime = file_info.last_modified.ToDoubleT(); 118 web_file_info.modificationTime = file_info.last_modified.ToDoubleT();
119 callbacks->didReadMetadata(web_file_info); 119 callbacks->didReadMetadata(web_file_info);
120 } 120 }
121 121
122 void FileSystemDispatcher::DidReadDirectory( 122 void FileSystemDispatcher::DidReadDirectory(
123 const ViewMsg_FileSystem_DidReadDirectory_Params& params) { 123 const ViewMsg_FileSystem_DidReadDirectory_Params& params) {
124 WebFileSystemCallbacks* callbacks = callbacks_.Lookup(params.request_id); 124 WebFileSystemCallbacks* callbacks = callbacks_.Lookup(params.request_id);
125 DCHECK(callbacks); 125 DCHECK(callbacks);
126 if (!params.has_more) 126 if (!params.has_more)
127 callbacks_.Remove(params.request_id); 127 callbacks_.Remove(params.request_id);
128 WebVector<WebFileSystemEntry> entries(params.entries.size()); 128 WebVector<WebFileSystemEntry> entries(params.entries.size());
129 for (size_t i = 0; i < params.entries.size(); ++i) { 129 for (size_t i = 0; i < params.entries.size(); ++i) {
130 entries[i].name = webkit_glue::FilePathToWebString(params.entries[i].name); 130 entries[i].name = webkit_glue::FilePathToWebString(params.entries[i].name);
131 entries[i].isDirectory = params.entries[i].is_directory; 131 entries[i].isDirectory = params.entries[i].is_directory;
132 } 132 }
133 callbacks->didReadDirectory(entries, params.has_more); 133 callbacks->didReadDirectory(entries, params.has_more);
134 } 134 }
135 135
136 void FileSystemDispatcher::DidFail(int request_id, WebFileError code) { 136 void FileSystemDispatcher::DidFail(int request_id, WebFileError code) {
137 WebFileSystemCallbacks* callbacks = callbacks_.Lookup(request_id); 137 WebFileSystemCallbacks* callbacks = callbacks_.Lookup(request_id);
138 DCHECK(callbacks); 138 DCHECK(callbacks);
139 callbacks_.Remove(request_id); 139 callbacks_.Remove(request_id);
140 callbacks->didFail(code); 140 callbacks->didFail(code);
141 } 141 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698