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

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

Issue 9372044: Refactor FileSystemOperation to take callback for each method. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reflected kinuko's comments + Fixture for failing-Write -> Cancel pattern. 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 WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_
6 #define WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback_forward.h" 11 #include "base/callback_forward.h"
12 #include "base/file_path.h" 12 #include "base/file_path.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/platform_file.h" 14 #include "base/platform_file.h"
15 #include "base/platform_file.h" 15 #include "base/platform_file.h"
16 #include "webkit/fileapi/file_system_types.h" 16 #include "webkit/fileapi/file_system_types.h"
17 17
18 class GURL; 18 class GURL;
19 19
20 namespace base { 20 namespace base {
21 class MessageLoopProxy; 21 class MessageLoopProxy;
22 } 22 }
23 23
24 namespace fileapi { 24 namespace fileapi {
25 25
26 class FileSystemCallbackDispatcher;
27 class FileSystemContext; 26 class FileSystemContext;
28 class FileSystemFileUtil; 27 class FileSystemFileUtil;
29 class FileSystemOperationInterface; 28 class FileSystemOperationInterface;
30 29
31 // An interface to provide mount-point-specific path-related utilities 30 // An interface to provide mount-point-specific path-related utilities
32 // and specialized FileSystemFileUtil instance. 31 // and specialized FileSystemFileUtil instance.
33 class FileSystemMountPointProvider { 32 class FileSystemMountPointProvider {
34 public: 33 public:
35 // Callback for ValidateFileSystemRoot. 34 // Callback for ValidateFileSystemRoot.
36 typedef base::Callback<void(base::PlatformFileError error)> 35 typedef base::Callback<void(base::PlatformFileError error)>
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 76
78 // Returns a new instance of the specialized FileSystemOperation for this 77 // Returns a new instance of the specialized FileSystemOperation for this
79 // mount point based on the given triplet of |origin_url|, |file_system_type| 78 // mount point based on the given triplet of |origin_url|, |file_system_type|
80 // and |virtual_path|. 79 // and |virtual_path|.
81 // This method is usually dispatched by 80 // This method is usually dispatched by
82 // FileSystemContext::CreateFileSystemOperation. 81 // FileSystemContext::CreateFileSystemOperation.
83 virtual FileSystemOperationInterface* CreateFileSystemOperation( 82 virtual FileSystemOperationInterface* CreateFileSystemOperation(
84 const GURL& origin_url, 83 const GURL& origin_url,
85 FileSystemType file_system_type, 84 FileSystemType file_system_type,
86 const FilePath& virtual_path, 85 const FilePath& virtual_path,
87 scoped_ptr<FileSystemCallbackDispatcher> dispatcher,
88 base::MessageLoopProxy* file_proxy, 86 base::MessageLoopProxy* file_proxy,
89 FileSystemContext* context) const = 0; 87 FileSystemContext* context) const = 0;
90 }; 88 };
91 89
92 // An interface to control external file system access permissions. 90 // An interface to control external file system access permissions.
93 class ExternalFileSystemMountPointProvider 91 class ExternalFileSystemMountPointProvider
94 : public FileSystemMountPointProvider { 92 : public FileSystemMountPointProvider {
95 public: 93 public:
96 // Grant access to all external file system from extension identified with 94 // Grant access to all external file system from extension identified with
97 // |extension_id|. 95 // |extension_id|.
(...skipping 11 matching lines...) Expand all
109 virtual void RemoveMountPoint(FilePath mount_point) = 0; 107 virtual void RemoveMountPoint(FilePath mount_point) = 0;
110 // Gets virtual path by known filesystem path. Returns false when filesystem 108 // Gets virtual path by known filesystem path. Returns false when filesystem
111 // path is not exposed by this provider. 109 // path is not exposed by this provider.
112 virtual bool GetVirtualPath(const FilePath& filesystem_path, 110 virtual bool GetVirtualPath(const FilePath& filesystem_path,
113 FilePath* virtual_path) = 0; 111 FilePath* virtual_path) = 0;
114 }; 112 };
115 113
116 } // namespace fileapi 114 } // namespace fileapi
117 115
118 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_ 116 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_MOUNT_POINT_PROVIDER_H_
OLDNEW
« no previous file with comments | « webkit/fileapi/file_system_dir_url_request_job.cc ('k') | webkit/fileapi/file_system_operation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698