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

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

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

Powered by Google App Engine
This is Rietveld 408576698