| 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 "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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 int request_id, const base::PlatformFileInfo& file_info) { | 241 int request_id, const base::PlatformFileInfo& file_info) { |
| 242 fileapi::FileSystemCallbackDispatcher* dispatcher = | 242 fileapi::FileSystemCallbackDispatcher* dispatcher = |
| 243 dispatchers_.Lookup(request_id); | 243 dispatchers_.Lookup(request_id); |
| 244 DCHECK(dispatcher); | 244 DCHECK(dispatcher); |
| 245 dispatcher->DidReadMetadata(file_info); | 245 dispatcher->DidReadMetadata(file_info); |
| 246 dispatchers_.Remove(request_id); | 246 dispatchers_.Remove(request_id); |
| 247 } | 247 } |
| 248 | 248 |
| 249 void FileSystemDispatcher::DidReadDirectory( | 249 void FileSystemDispatcher::DidReadDirectory( |
| 250 int request_id, | 250 int request_id, |
| 251 const std::vector<base::FileUtilProxy::Entry>& entries, | 251 const std::vector<base::FileUtilProxyBase::Entry>& entries, |
| 252 bool has_more) { | 252 bool has_more) { |
| 253 fileapi::FileSystemCallbackDispatcher* dispatcher = | 253 fileapi::FileSystemCallbackDispatcher* dispatcher = |
| 254 dispatchers_.Lookup(request_id); | 254 dispatchers_.Lookup(request_id); |
| 255 DCHECK(dispatcher); | 255 DCHECK(dispatcher); |
| 256 dispatcher->DidReadDirectory(entries, has_more); | 256 dispatcher->DidReadDirectory(entries, has_more); |
| 257 dispatchers_.Remove(request_id); | 257 dispatchers_.Remove(request_id); |
| 258 } | 258 } |
| 259 | 259 |
| 260 void FileSystemDispatcher::DidFail( | 260 void FileSystemDispatcher::DidFail( |
| 261 int request_id, base::PlatformFileError error_code) { | 261 int request_id, base::PlatformFileError error_code) { |
| 262 fileapi::FileSystemCallbackDispatcher* dispatcher = | 262 fileapi::FileSystemCallbackDispatcher* dispatcher = |
| 263 dispatchers_.Lookup(request_id); | 263 dispatchers_.Lookup(request_id); |
| 264 DCHECK(dispatcher); | 264 DCHECK(dispatcher); |
| 265 dispatcher->DidFail(error_code); | 265 dispatcher->DidFail(error_code); |
| 266 dispatchers_.Remove(request_id); | 266 dispatchers_.Remove(request_id); |
| 267 } | 267 } |
| 268 | 268 |
| 269 void FileSystemDispatcher::DidWrite( | 269 void FileSystemDispatcher::DidWrite( |
| 270 int request_id, int64 bytes, bool complete) { | 270 int request_id, int64 bytes, bool complete) { |
| 271 fileapi::FileSystemCallbackDispatcher* dispatcher = | 271 fileapi::FileSystemCallbackDispatcher* dispatcher = |
| 272 dispatchers_.Lookup(request_id); | 272 dispatchers_.Lookup(request_id); |
| 273 DCHECK(dispatcher); | 273 DCHECK(dispatcher); |
| 274 dispatcher->DidWrite(bytes, complete); | 274 dispatcher->DidWrite(bytes, complete); |
| 275 if (complete) | 275 if (complete) |
| 276 dispatchers_.Remove(request_id); | 276 dispatchers_.Remove(request_id); |
| 277 } | 277 } |
| OLD | NEW |