| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CONTENT_COMMON_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_H_ | 5 #ifndef CONTENT_COMMON_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_H_ |
| 6 #define CONTENT_COMMON_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_H_ | 6 #define CONTENT_COMMON_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 fileapi::FileSystemCallbackDispatcher* dispatcher); | 72 fileapi::FileSystemCallbackDispatcher* dispatcher); |
| 73 bool Cancel(int request_id_to_cancel, | 73 bool Cancel(int request_id_to_cancel, |
| 74 fileapi::FileSystemCallbackDispatcher* dispatcher); | 74 fileapi::FileSystemCallbackDispatcher* dispatcher); |
| 75 bool TouchFile(const GURL& file_path, | 75 bool TouchFile(const GURL& file_path, |
| 76 const base::Time& last_access_time, | 76 const base::Time& last_access_time, |
| 77 const base::Time& last_modified_time, | 77 const base::Time& last_modified_time, |
| 78 fileapi::FileSystemCallbackDispatcher* dispatcher); | 78 fileapi::FileSystemCallbackDispatcher* dispatcher); |
| 79 | 79 |
| 80 // This returns a raw open PlatformFile, unlike the above, which are | 80 // This returns a raw open PlatformFile, unlike the above, which are |
| 81 // self-contained operations. | 81 // self-contained operations. |
| 82 // Used only for ppapi implementation. |
| 82 bool OpenFile(const GURL& file_path, | 83 bool OpenFile(const GURL& file_path, |
| 83 int file_flags, // passed to FileUtilProxy::CreateOrOpen | 84 int file_flags, // passed to FileUtilProxy::CreateOrOpen |
| 84 fileapi::FileSystemCallbackDispatcher* dispatcher); | 85 fileapi::FileSystemCallbackDispatcher* dispatcher); |
| 85 private: | 86 private: |
| 86 // Message handlers. | 87 // Message handlers. |
| 87 void OnOpenComplete( | 88 void OnOpenComplete( |
| 88 int request_id, | 89 int request_id, |
| 89 bool accepted, | 90 bool accepted, |
| 90 const std::string& name, | 91 const std::string& name, |
| 91 const GURL& root); | 92 const GURL& root); |
| 92 void OnDidSucceed(int request_id); | 93 void OnDidSucceed(int request_id); |
| 93 void OnDidReadMetadata(int request_id, | 94 void OnDidReadMetadata(int request_id, |
| 94 const base::PlatformFileInfo& file_info, | 95 const base::PlatformFileInfo& file_info, |
| 95 const FilePath& platform_path); | 96 const FilePath& platform_path); |
| 96 void OnDidReadDirectory( | 97 void OnDidReadDirectory( |
| 97 int request_id, | 98 int request_id, |
| 98 const std::vector<base::FileUtilProxy::Entry>& entries, | 99 const std::vector<base::FileUtilProxy::Entry>& entries, |
| 99 bool has_more); | 100 bool has_more); |
| 100 void OnDidFail(int request_id, base::PlatformFileError error_code); | 101 void OnDidFail(int request_id, base::PlatformFileError error_code); |
| 101 void OnDidWrite(int request_id, int64 bytes, bool complete); | 102 void OnDidWrite(int request_id, int64 bytes, bool complete); |
| 102 void OnDidOpenFile( | 103 void OnDidOpenFile( |
| 103 int request_id, | 104 int request_id, |
| 104 IPC::PlatformFileForTransit file); | 105 IPC::PlatformFileForTransit file, |
| 106 int64 file_size); |
| 105 | 107 |
| 106 IDMap<fileapi::FileSystemCallbackDispatcher, IDMapOwnPointer> dispatchers_; | 108 IDMap<fileapi::FileSystemCallbackDispatcher, IDMapOwnPointer> dispatchers_; |
| 107 | 109 |
| 108 DISALLOW_COPY_AND_ASSIGN(FileSystemDispatcher); | 110 DISALLOW_COPY_AND_ASSIGN(FileSystemDispatcher); |
| 109 }; | 111 }; |
| 110 | 112 |
| 111 #endif // CONTENT_COMMON_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_H_ | 113 #endif // CONTENT_COMMON_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_H_ |
| OLD | NEW |