OLD | NEW |
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 "webkit/tools/test_shell/simple_file_system.h" | 5 #include "webkit/tools/test_shell/simple_file_system.h" |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/message_loop_proxy.h" | 8 #include "base/message_loop_proxy.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "third_party/WebKit/WebKit/chromium/public/WebFileInfo.h" | 10 #include "third_party/WebKit/WebKit/chromium/public/WebFileInfo.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 entry.name = webkit_glue::FilePathStringToWebString(it->name); | 76 entry.name = webkit_glue::FilePathStringToWebString(it->name); |
77 entry.isDirectory = it->is_directory; | 77 entry.isDirectory = it->is_directory; |
78 web_entries_vector.push_back(entry); | 78 web_entries_vector.push_back(entry); |
79 } | 79 } |
80 WebVector<WebKit::WebFileSystemEntry> web_entries = | 80 WebVector<WebKit::WebFileSystemEntry> web_entries = |
81 web_entries_vector; | 81 web_entries_vector; |
82 callbacks_->didReadDirectory(web_entries, has_more); | 82 callbacks_->didReadDirectory(web_entries, has_more); |
83 file_system_->RemoveCompletedOperation(request_id_); | 83 file_system_->RemoveCompletedOperation(request_id_); |
84 } | 84 } |
85 | 85 |
86 virtual void DidOpenFileSystem(const string16&, const FilePath&) { | 86 virtual void DidOpenFileSystem(const std::string&, const FilePath&) { |
87 NOTREACHED(); | 87 NOTREACHED(); |
88 } | 88 } |
89 | 89 |
90 virtual void DidFail(base::PlatformFileError error_code) { | 90 virtual void DidFail(base::PlatformFileError error_code) { |
91 callbacks_->didFail(PlatformFileErrorToWebFileError(error_code)); | 91 callbacks_->didFail(PlatformFileErrorToWebFileError(error_code)); |
92 file_system_->RemoveCompletedOperation(request_id_); | 92 file_system_->RemoveCompletedOperation(request_id_); |
93 } | 93 } |
94 | 94 |
95 private: | 95 private: |
96 SimpleFileSystem* file_system_; | 96 SimpleFileSystem* file_system_; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 fileapi::FileSystemOperation* operation = new fileapi::FileSystemOperation( | 182 fileapi::FileSystemOperation* operation = new fileapi::FileSystemOperation( |
183 dispatcher, base::MessageLoopProxy::CreateForCurrentThread()); | 183 dispatcher, base::MessageLoopProxy::CreateForCurrentThread()); |
184 int32 request_id = operations_.Add(operation); | 184 int32 request_id = operations_.Add(operation); |
185 dispatcher->set_request_id(request_id); | 185 dispatcher->set_request_id(request_id); |
186 return operation; | 186 return operation; |
187 } | 187 } |
188 | 188 |
189 void SimpleFileSystem::RemoveCompletedOperation(int request_id) { | 189 void SimpleFileSystem::RemoveCompletedOperation(int request_id) { |
190 operations_.Remove(request_id); | 190 operations_.Remove(request_id); |
191 } | 191 } |
OLD | NEW |