| 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/common/fileapi/file_system_dispatcher.h" | 5 #include "content/common/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/process.h" | 9 #include "base/process.h" |
| 10 #include "content/common/child_thread.h" | 10 #include "content/common/child_thread.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 metadata_callback_.Run(file_info, platform_path); | 80 metadata_callback_.Run(file_info, platform_path); |
| 81 } | 81 } |
| 82 | 82 |
| 83 void DidCreateSnapshotFile( | 83 void DidCreateSnapshotFile( |
| 84 const base::PlatformFileInfo& file_info, | 84 const base::PlatformFileInfo& file_info, |
| 85 const base::FilePath& platform_path) { | 85 const base::FilePath& platform_path) { |
| 86 metadata_callback_.Run(file_info, platform_path); | 86 metadata_callback_.Run(file_info, platform_path); |
| 87 } | 87 } |
| 88 | 88 |
| 89 void DidReadDirectory( | 89 void DidReadDirectory( |
| 90 const std::vector<base::FileUtilProxy::Entry>& entries, | 90 const std::vector<fileapi::DirectoryEntry>& entries, |
| 91 bool has_more) { | 91 bool has_more) { |
| 92 directory_callback_.Run(entries, has_more); | 92 directory_callback_.Run(entries, has_more); |
| 93 } | 93 } |
| 94 | 94 |
| 95 void DidOpenFileSystem(const std::string& name, | 95 void DidOpenFileSystem(const std::string& name, |
| 96 const GURL& root) { | 96 const GURL& root) { |
| 97 filesystem_callback_.Run(name, root); | 97 filesystem_callback_.Run(name, root); |
| 98 } | 98 } |
| 99 | 99 |
| 100 void DidWrite(int64 bytes, bool complete) { | 100 void DidWrite(int64 bytes, bool complete) { |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 CallbackDispatcher* dispatcher = dispatchers_.Lookup(request_id); | 420 CallbackDispatcher* dispatcher = dispatchers_.Lookup(request_id); |
| 421 DCHECK(dispatcher); | 421 DCHECK(dispatcher); |
| 422 dispatcher->DidCreateSnapshotFile(file_info, platform_path); | 422 dispatcher->DidCreateSnapshotFile(file_info, platform_path); |
| 423 dispatchers_.Remove(request_id); | 423 dispatchers_.Remove(request_id); |
| 424 ChildThread::current()->Send( | 424 ChildThread::current()->Send( |
| 425 new FileSystemHostMsg_DidReceiveSnapshotFile(request_id)); | 425 new FileSystemHostMsg_DidReceiveSnapshotFile(request_id)); |
| 426 } | 426 } |
| 427 | 427 |
| 428 void FileSystemDispatcher::OnDidReadDirectory( | 428 void FileSystemDispatcher::OnDidReadDirectory( |
| 429 int request_id, | 429 int request_id, |
| 430 const std::vector<base::FileUtilProxy::Entry>& entries, | 430 const std::vector<fileapi::DirectoryEntry>& entries, |
| 431 bool has_more) { | 431 bool has_more) { |
| 432 CallbackDispatcher* dispatcher = dispatchers_.Lookup(request_id); | 432 CallbackDispatcher* dispatcher = dispatchers_.Lookup(request_id); |
| 433 DCHECK(dispatcher); | 433 DCHECK(dispatcher); |
| 434 dispatcher->DidReadDirectory(entries, has_more); | 434 dispatcher->DidReadDirectory(entries, has_more); |
| 435 dispatchers_.Remove(request_id); | 435 dispatchers_.Remove(request_id); |
| 436 } | 436 } |
| 437 | 437 |
| 438 void FileSystemDispatcher::OnDidFail( | 438 void FileSystemDispatcher::OnDidFail( |
| 439 int request_id, base::PlatformFileError error_code) { | 439 int request_id, base::PlatformFileError error_code) { |
| 440 CallbackDispatcher* dispatcher = dispatchers_.Lookup(request_id); | 440 CallbackDispatcher* dispatcher = dispatchers_.Lookup(request_id); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 459 quota::QuotaLimitType quota_policy) { | 459 quota::QuotaLimitType quota_policy) { |
| 460 CallbackDispatcher* dispatcher = dispatchers_.Lookup(request_id); | 460 CallbackDispatcher* dispatcher = dispatchers_.Lookup(request_id); |
| 461 DCHECK(dispatcher); | 461 DCHECK(dispatcher); |
| 462 dispatcher->DidOpenFile(IPC::PlatformFileForTransitToPlatformFile(file), | 462 dispatcher->DidOpenFile(IPC::PlatformFileForTransitToPlatformFile(file), |
| 463 file_open_id, | 463 file_open_id, |
| 464 quota_policy); | 464 quota_policy); |
| 465 dispatchers_.Remove(request_id); | 465 dispatchers_.Remove(request_id); |
| 466 } | 466 } |
| 467 | 467 |
| 468 } // namespace content | 468 } // namespace content |
| OLD | NEW |