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

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

Issue 6864040: Fixed file/directory url resolution for external mount point provider. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_FILE_UTIL_H_ 5 #ifndef WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_
6 #define WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ 6 #define WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/file_path.h" 9 #include "base/file_path.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
11 #include "base/file_util_proxy.h" 11 #include "base/file_util_proxy.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/memory/singleton.h" 13 #include "base/memory/singleton.h"
14 #include "base/platform_file.h" 14 #include "base/platform_file.h"
15 #include "base/tracked_objects.h" 15 #include "base/tracked_objects.h"
16 #include "webkit/fileapi/file_system_types.h"
16 17
17 namespace base { 18 namespace base {
18 struct PlatformFileInfo; 19 struct PlatformFileInfo;
19 class MessageLoopProxy; 20 class MessageLoopProxy;
20 class Time; 21 class Time;
21 } 22 }
22 23
23 namespace fileapi { 24 namespace fileapi {
24 25
25 using base::PlatformFile; 26 using base::PlatformFile;
26 using base::PlatformFileError; 27 using base::PlatformFileError;
27
28 class FileSystemOperationContext; 28 class FileSystemOperationContext;
29 29
30 // A large part of this implementation is taken from base::FileUtilProxy. 30 // A large part of this implementation is taken from base::FileUtilProxy.
31 // TODO(dmikurube, kinuko): Clean up base::FileUtilProxy to factor out common 31 // TODO(dmikurube, kinuko): Clean up base::FileUtilProxy to factor out common
32 // routines. It includes dropping FileAPI-specific routines from FileUtilProxy. 32 // routines. It includes dropping FileAPI-specific routines from FileUtilProxy.
33 class FileSystemFileUtil { 33 class FileSystemFileUtil {
34 public: 34 public:
35 static FileSystemFileUtil* GetInstance(); 35 static FileSystemFileUtil* GetInstance();
36 36
37 // Creates or opens a file with the given flags. It is invalid to pass NULL 37 // Creates or opens a file with the given flags. It is invalid to pass NULL
(...skipping 19 matching lines...) Expand all
57 // |created| of the callback argument is set true and |error code| 57 // |created| of the callback argument is set true and |error code|
58 // is set PLATFORM_FILE_OK. 58 // is set PLATFORM_FILE_OK.
59 // If the file already exists, |created| is set false and |error code| 59 // If the file already exists, |created| is set false and |error code|
60 // is set PLATFORM_FILE_OK. 60 // is set PLATFORM_FILE_OK.
61 // If the file hasn't existed but it couldn't be created for some other 61 // If the file hasn't existed but it couldn't be created for some other
62 // reasons, |created| is set false and |error code| indicates the error. 62 // reasons, |created| is set false and |error code| indicates the error.
63 virtual PlatformFileError EnsureFileExists( 63 virtual PlatformFileError EnsureFileExists(
64 FileSystemOperationContext* context, 64 FileSystemOperationContext* context,
65 const FilePath& file_path, bool* created); 65 const FilePath& file_path, bool* created);
66 66
67 // Maps |virtual_path| given |context| into |local_path| which represents
68 // physical file location on the host OS. This may not always make sense for
69 // all subclasses.
70 virtual PlatformFileError GetLocalFilePath(
71 FileSystemOperationContext* context,
72 const FilePath& virtual_path,
73 FilePath* local_path);
74
67 // Retrieves the information about a file. It is invalid to pass NULL for the 75 // Retrieves the information about a file. It is invalid to pass NULL for the
68 // callback. 76 // callback.
69 virtual PlatformFileError GetFileInfo( 77 virtual PlatformFileError GetFileInfo(
70 FileSystemOperationContext* context, 78 FileSystemOperationContext* context,
71 const FilePath& file_, 79 const FilePath& file_,
72 base::PlatformFileInfo* file_info, 80 base::PlatformFileInfo* file_info,
73 FilePath* platform_path); 81 FilePath* platform_path);
74 82
75 virtual PlatformFileError ReadDirectory( 83 virtual PlatformFileError ReadDirectory(
76 FileSystemOperationContext* context, 84 FileSystemOperationContext* context,
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 virtual AbstractFileEnumerator* CreateFileEnumerator( 198 virtual AbstractFileEnumerator* CreateFileEnumerator(
191 const FilePath& root_path); 199 const FilePath& root_path);
192 200
193 friend struct DefaultSingletonTraits<FileSystemFileUtil>; 201 friend struct DefaultSingletonTraits<FileSystemFileUtil>;
194 DISALLOW_COPY_AND_ASSIGN(FileSystemFileUtil); 202 DISALLOW_COPY_AND_ASSIGN(FileSystemFileUtil);
195 }; 203 };
196 204
197 } // namespace fileapi 205 } // namespace fileapi
198 206
199 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_ 207 #endif // WEBKIT_FILEAPI_FILE_SYSTEM_FILE_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698