Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(215)

Side by Side Diff: content/common/fileapi/file_system_dispatcher.h

Issue 14472008: [FileAPI] Add file open ID and close callback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #ifndef CONTENT_COMMON_FILEAPI_FILE_SYSTEM_DISPATCHER_H_ 5 #ifndef CONTENT_COMMON_FILEAPI_FILE_SYSTEM_DISPATCHER_H_
6 #define CONTENT_COMMON_FILEAPI_FILE_SYSTEM_DISPATCHER_H_ 6 #define CONTENT_COMMON_FILEAPI_FILE_SYSTEM_DISPATCHER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 const base::Time& last_modified_time, 83 const base::Time& last_modified_time,
84 fileapi::FileSystemCallbackDispatcher* dispatcher); 84 fileapi::FileSystemCallbackDispatcher* dispatcher);
85 85
86 // This returns a raw open PlatformFile, unlike the above, which are 86 // This returns a raw open PlatformFile, unlike the above, which are
87 // self-contained operations. 87 // self-contained operations.
88 bool OpenFile(const GURL& file_path, 88 bool OpenFile(const GURL& file_path,
89 int file_flags, // passed to FileUtilProxy::CreateOrOpen 89 int file_flags, // passed to FileUtilProxy::CreateOrOpen
90 fileapi::FileSystemCallbackDispatcher* dispatcher); 90 fileapi::FileSystemCallbackDispatcher* dispatcher);
91 // This must be paired with OpenFile, and called after finished using the 91 // This must be paired with OpenFile, and called after finished using the
92 // raw PlatformFile returned from OpenFile. 92 // raw PlatformFile returned from OpenFile.
93 bool NotifyCloseFile(const GURL& file_path); 93 bool NotifyCloseFile(int file_open_id);
94 94
95 bool CreateSnapshotFile(const GURL& file_path, 95 bool CreateSnapshotFile(const GURL& file_path,
96 fileapi::FileSystemCallbackDispatcher* dispatcher); 96 fileapi::FileSystemCallbackDispatcher* dispatcher);
97 97
98 private: 98 private:
99 // Message handlers. 99 // Message handlers.
100 void OnDidOpenFileSystem(int request_id, 100 void OnDidOpenFileSystem(int request_id,
101 const std::string& name, 101 const std::string& name,
102 const GURL& root); 102 const GURL& root);
103 void OnDidSucceed(int request_id); 103 void OnDidSucceed(int request_id);
104 void OnDidReadMetadata(int request_id, 104 void OnDidReadMetadata(int request_id,
105 const base::PlatformFileInfo& file_info, 105 const base::PlatformFileInfo& file_info,
106 const base::FilePath& platform_path); 106 const base::FilePath& platform_path);
107 void OnDidCreateSnapshotFile(int request_id, 107 void OnDidCreateSnapshotFile(int request_id,
108 const base::PlatformFileInfo& file_info, 108 const base::PlatformFileInfo& file_info,
109 const base::FilePath& platform_path); 109 const base::FilePath& platform_path);
110 void OnDidReadDirectory( 110 void OnDidReadDirectory(
111 int request_id, 111 int request_id,
112 const std::vector<base::FileUtilProxy::Entry>& entries, 112 const std::vector<base::FileUtilProxy::Entry>& entries,
113 bool has_more); 113 bool has_more);
114 void OnDidFail(int request_id, base::PlatformFileError error_code); 114 void OnDidFail(int request_id, base::PlatformFileError error_code);
115 void OnDidWrite(int request_id, int64 bytes, bool complete); 115 void OnDidWrite(int request_id, int64 bytes, bool complete);
116 void OnDidOpenFile( 116 void OnDidOpenFile(
117 int request_id, 117 int request_id,
118 IPC::PlatformFileForTransit file, 118 IPC::PlatformFileForTransit file,
119 int file_open_id,
119 quota::QuotaLimitType quota_policy); 120 quota::QuotaLimitType quota_policy);
120 121
121 IDMap<fileapi::FileSystemCallbackDispatcher, IDMapOwnPointer> dispatchers_; 122 IDMap<fileapi::FileSystemCallbackDispatcher, IDMapOwnPointer> dispatchers_;
122 123
123 DISALLOW_COPY_AND_ASSIGN(FileSystemDispatcher); 124 DISALLOW_COPY_AND_ASSIGN(FileSystemDispatcher);
124 }; 125 };
125 126
126 } // namespace content 127 } // namespace content
127 128
128 #endif // CONTENT_COMMON_FILEAPI_FILE_SYSTEM_DISPATCHER_H_ 129 #endif // CONTENT_COMMON_FILEAPI_FILE_SYSTEM_DISPATCHER_H_
OLDNEW
« no previous file with comments | « content/browser/fileapi/fileapi_message_filter.cc ('k') | content/common/fileapi/file_system_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698