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

Side by Side Diff: webkit/fileapi/file_system_context.h

Issue 9016020: Cleanup FileSystemOperation for preparing for adding FSO-factory method (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: build fix Created 8 years, 11 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 WEBKIT_FILEAPI_FILE_SYSTEM_CONTEXT_H_ 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_CONTEXT_H_
6 #define WEBKIT_FILEAPI_FILE_SYSTEM_CONTEXT_H_ 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_CONTEXT_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/platform_file.h"
ericu 2012/01/09 18:44:44 Why include platform_file.h?
kinuko 2012/01/10 09:48:53 Removed.
10 #include "webkit/fileapi/file_system_types.h" 11 #include "webkit/fileapi/file_system_types.h"
11 #include "webkit/quota/special_storage_policy.h" 12 #include "webkit/quota/special_storage_policy.h"
12 13
13 class FilePath; 14 class FilePath;
14 class GURL; 15 class GURL;
15 16
16 namespace base { 17 namespace base {
17 class MessageLoopProxy; 18 class MessageLoopProxy;
18 } 19 }
19 20
20 namespace quota { 21 namespace quota {
21 class QuotaManagerProxy; 22 class QuotaManagerProxy;
22 } 23 }
23 24
24 namespace fileapi { 25 namespace fileapi {
25 26
26 class ExternalFileSystemMountPointProvider; 27 class ExternalFileSystemMountPointProvider;
28 class FileSystemCallbackDispatcher;
27 class FileSystemContext; 29 class FileSystemContext;
28 class FileSystemFileUtil; 30 class FileSystemFileUtil;
29 class FileSystemMountPointProvider; 31 class FileSystemMountPointProvider;
30 class FileSystemOptions; 32 class FileSystemOptions;
31 class FileSystemPathManager; 33 class FileSystemPathManager;
32 class FileSystemQuotaUtil; 34 class FileSystemQuotaUtil;
33 class SandboxMountPointProvider; 35 class SandboxMountPointProvider;
34 36
35 struct DefaultContextDeleter; 37 struct DefaultContextDeleter;
36 38
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 // Returns a FileSystemMountPointProvider instance for sandboxed filesystem 79 // Returns a FileSystemMountPointProvider instance for sandboxed filesystem
78 // types (e.g. TEMPORARY or PERSISTENT). This is equivalent to calling 80 // types (e.g. TEMPORARY or PERSISTENT). This is equivalent to calling
79 // GetMountPointProvider(kFileSystemType{Temporary, Persistent}). 81 // GetMountPointProvider(kFileSystemType{Temporary, Persistent}).
80 SandboxMountPointProvider* sandbox_provider() const; 82 SandboxMountPointProvider* sandbox_provider() const;
81 83
82 // Returns a FileSystemMountPointProvider instance for external filesystem 84 // Returns a FileSystemMountPointProvider instance for external filesystem
83 // type, which is used only by chromeos for now. This is equivalent to 85 // type, which is used only by chromeos for now. This is equivalent to
84 // calling GetMountPointProvider(kFileSystemTypeExternal). 86 // calling GetMountPointProvider(kFileSystemTypeExternal).
85 ExternalFileSystemMountPointProvider* external_provider() const; 87 ExternalFileSystemMountPointProvider* external_provider() const;
86 88
89 // Opens the filesystem for the given |origin_url| and |type|, and dispatches
90 // the DidOpenFileSystem callback of the given |dispatcher|.
91 // If |create| is true this may actually setup a filesystem instance
ericu 2012/01/09 18:44:44 s/setup/set up/
kinuko 2012/01/10 09:48:53 Done.
92 // (e.g. by creating the root directory or initializing the database
93 // entry etc).
94 // TODO(kinuko): replace the dispatcher with a regular callback.
95 void OpenFileSystem(
96 const GURL& origin_url,
97 FileSystemType type,
98 bool create,
99 scoped_ptr<FileSystemCallbackDispatcher> dispatcher);
100
87 private: 101 private:
88 friend struct DefaultContextDeleter; 102 friend struct DefaultContextDeleter;
89 void DeleteOnCorrectThread() const; 103 void DeleteOnCorrectThread() const;
90 104
91 scoped_refptr<base::MessageLoopProxy> file_message_loop_; 105 scoped_refptr<base::MessageLoopProxy> file_message_loop_;
92 scoped_refptr<base::MessageLoopProxy> io_message_loop_; 106 scoped_refptr<base::MessageLoopProxy> io_message_loop_;
93 107
94 scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_; 108 scoped_refptr<quota::QuotaManagerProxy> quota_manager_proxy_;
95 109
96 // Mount point providers. 110 // Mount point providers.
97 scoped_ptr<SandboxMountPointProvider> sandbox_provider_; 111 scoped_ptr<SandboxMountPointProvider> sandbox_provider_;
98 scoped_ptr<ExternalFileSystemMountPointProvider> external_provider_; 112 scoped_ptr<ExternalFileSystemMountPointProvider> external_provider_;
99 113
100 DISALLOW_IMPLICIT_CONSTRUCTORS(FileSystemContext); 114 DISALLOW_IMPLICIT_CONSTRUCTORS(FileSystemContext);
101 }; 115 };
102 116
103 struct DefaultContextDeleter { 117 struct DefaultContextDeleter {
104 static void Destruct(const FileSystemContext* context) { 118 static void Destruct(const FileSystemContext* context) {
105 context->DeleteOnCorrectThread(); 119 context->DeleteOnCorrectThread();
106 } 120 }
107 }; 121 };
108 122
109 } // namespace fileapi 123 } // namespace fileapi
110 124
111 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_CONTEXT_H_ 125 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698