OLD | NEW |
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/child/fileapi/file_system_dispatcher.h" | 5 #include "content/child/fileapi/file_system_dispatcher.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
10 #include "base/process/process.h" | 10 #include "base/process/process.h" |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 dispatchers_.Remove(request_id); | 383 dispatchers_.Remove(request_id); |
384 } | 384 } |
385 | 385 |
386 void FileSystemDispatcher::OnDidReadDirectory( | 386 void FileSystemDispatcher::OnDidReadDirectory( |
387 int request_id, | 387 int request_id, |
388 const std::vector<fileapi::DirectoryEntry>& entries, | 388 const std::vector<fileapi::DirectoryEntry>& entries, |
389 bool has_more) { | 389 bool has_more) { |
390 CallbackDispatcher* dispatcher = dispatchers_.Lookup(request_id); | 390 CallbackDispatcher* dispatcher = dispatchers_.Lookup(request_id); |
391 DCHECK(dispatcher); | 391 DCHECK(dispatcher); |
392 dispatcher->DidReadDirectory(entries, has_more); | 392 dispatcher->DidReadDirectory(entries, has_more); |
393 dispatchers_.Remove(request_id); | 393 if (!has_more) |
| 394 dispatchers_.Remove(request_id); |
394 } | 395 } |
395 | 396 |
396 void FileSystemDispatcher::OnDidFail( | 397 void FileSystemDispatcher::OnDidFail( |
397 int request_id, base::File::Error error_code) { | 398 int request_id, base::File::Error error_code) { |
398 CallbackDispatcher* dispatcher = dispatchers_.Lookup(request_id); | 399 CallbackDispatcher* dispatcher = dispatchers_.Lookup(request_id); |
399 DCHECK(dispatcher); | 400 DCHECK(dispatcher); |
400 dispatcher->DidFail(error_code); | 401 dispatcher->DidFail(error_code); |
401 dispatchers_.Remove(request_id); | 402 dispatchers_.Remove(request_id); |
402 } | 403 } |
403 | 404 |
(...skipping 13 matching lines...) Expand all Loading... |
417 quota::QuotaLimitType quota_policy) { | 418 quota::QuotaLimitType quota_policy) { |
418 CallbackDispatcher* dispatcher = dispatchers_.Lookup(request_id); | 419 CallbackDispatcher* dispatcher = dispatchers_.Lookup(request_id); |
419 DCHECK(dispatcher); | 420 DCHECK(dispatcher); |
420 dispatcher->DidOpenFile(IPC::PlatformFileForTransitToPlatformFile(file), | 421 dispatcher->DidOpenFile(IPC::PlatformFileForTransitToPlatformFile(file), |
421 file_open_id, | 422 file_open_id, |
422 quota_policy); | 423 quota_policy); |
423 dispatchers_.Remove(request_id); | 424 dispatchers_.Remove(request_id); |
424 } | 425 } |
425 | 426 |
426 } // namespace content | 427 } // namespace content |
OLD | NEW |