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

Side by Side Diff: content/browser/file_system/file_system_dispatcher_host.h

Issue 9380040: Revert 121620 - Refactor FileSystemOperation to take callback for each method. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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_BROWSER_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_HOST_H_ 5 #ifndef CONTENT_BROWSER_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_HOST_H_
6 #define CONTENT_BROWSER_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_HOST_H_ 6 #define CONTENT_BROWSER_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_HOST_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/file_util_proxy.h"
12 #include "base/id_map.h" 11 #include "base/id_map.h"
13 #include "base/platform_file.h"
14 #include "content/public/browser/browser_message_filter.h" 12 #include "content/public/browser/browser_message_filter.h"
15 #include "webkit/fileapi/file_system_types.h" 13 #include "webkit/fileapi/file_system_types.h"
16 14
17 class FilePath; 15 class FilePath;
18 class GURL; 16 class GURL;
19 17
20 namespace base { 18 namespace base {
21 class Time; 19 class Time;
22 } 20 }
23 21
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 const GURL& path, 81 const GURL& path,
84 const base::Time& last_access_time, 82 const base::Time& last_access_time,
85 const base::Time& last_modified_time); 83 const base::Time& last_modified_time);
86 void OnCancel(int request_id, int request_to_cancel); 84 void OnCancel(int request_id, int request_to_cancel);
87 void OnOpenFile(int request_id, const GURL& path, int file_flags); 85 void OnOpenFile(int request_id, const GURL& path, int file_flags);
88 void OnWillUpdate(const GURL& path); 86 void OnWillUpdate(const GURL& path);
89 void OnDidUpdate(const GURL& path, int64 delta); 87 void OnDidUpdate(const GURL& path, int64 delta);
90 void OnSyncGetPlatformPath(const GURL& path, 88 void OnSyncGetPlatformPath(const GURL& path,
91 FilePath* platform_path); 89 FilePath* platform_path);
92 90
93 // Callback functions to be used when each file operation is finished.
94 void DidFinish(int request_id, base::PlatformFileError result);
95 void DidCancel(int request_id, base::PlatformFileError result);
96 void DidGetMetadata(int request_id,
97 base::PlatformFileError result,
98 const base::PlatformFileInfo& info,
99 const FilePath& platform_path);
100 void DidReadDirectory(int request_id,
101 base::PlatformFileError result,
102 const std::vector<base::FileUtilProxy::Entry>& entries,
103 bool has_more);
104 void DidOpenFile(int request_id,
105 base::PlatformFileError result,
106 base::PlatformFile file,
107 base::ProcessHandle peer_handle);
108 void DidWrite(int request_id,
109 base::PlatformFileError result,
110 int64 bytes,
111 bool complete);
112 void DidOpenFileSystem(int request_id,
113 base::PlatformFileError result,
114 const std::string& name,
115 const GURL& root);
116
117 // Creates a new FileSystemOperationInterface based on |target_path|. 91 // Creates a new FileSystemOperationInterface based on |target_path|.
118 fileapi::FileSystemOperationInterface* GetNewOperation( 92 fileapi::FileSystemOperationInterface* GetNewOperation(
119 const GURL& target_path, 93 const GURL& target_path,
120 int request_id); 94 int request_id);
121 95
122 fileapi::FileSystemContext* context_; 96 fileapi::FileSystemContext* context_;
123 97
124 // Keeps ongoing file system operations. 98 // Keeps ongoing file system operations.
125 typedef IDMap<fileapi::FileSystemOperationInterface> OperationsMap; 99 typedef IDMap<fileapi::FileSystemOperationInterface> OperationsMap;
126 OperationsMap operations_; 100 OperationsMap operations_;
127 101
128 // The getter holds the context until Init() can be called from the 102 // The getter holds the context until Init() can be called from the
129 // IO thread, which will extract the net::URLRequestContext from it. 103 // IO thread, which will extract the net::URLRequestContext from it.
130 scoped_refptr<net::URLRequestContextGetter> request_context_getter_; 104 scoped_refptr<net::URLRequestContextGetter> request_context_getter_;
131 net::URLRequestContext* request_context_; 105 net::URLRequestContext* request_context_;
132 106
133 DISALLOW_COPY_AND_ASSIGN(FileSystemDispatcherHost); 107 DISALLOW_COPY_AND_ASSIGN(FileSystemDispatcherHost);
134 }; 108 };
135 109
136 #endif // CONTENT_BROWSER_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_HOST_H_ 110 #endif // CONTENT_BROWSER_FILE_SYSTEM_FILE_SYSTEM_DISPATCHER_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698