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