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

Side by Side Diff: chrome/browser/file_system_proxy.h

Issue 3131026: Moving file_system_proxy to base/ and changing it to work with MessageLoopPro... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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
« no previous file with comments | « chrome/browser/chrome_thread_relay.cc ('k') | chrome/browser/file_system_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_FILE_SYSTEM_PROXY_H_
6 #define CHROME_BROWSER_FILE_SYSTEM_PROXY_H_
7
8 #include "base/callback.h"
9 #include "base/platform_file.h"
10 #include "base/ref_counted.h"
11
12 // This class provides asynchronous access to common file routines.
13 class FileSystemProxy {
14 public:
15 // This callback is used by methods that report success with a bool. It is
16 // valid to pass NULL as the callback parameter to any function that takes a
17 // StatusCallback, in which case the operation will complete silently.
18 typedef Callback1<bool /* succeeded */>::Type StatusCallback;
19
20 // Creates or opens a file with the given flags. It is invalid to pass NULL
21 // for the callback.
22 typedef Callback2<base::PassPlatformFile, bool /* created */>::Type
23 CreateOrOpenCallback;
24 static void CreateOrOpen(const FilePath& file_path,
25 int file_flags,
26 CreateOrOpenCallback* callback);
27
28 // Creates a temporary file for writing. The path and an open file handle
29 // are returned. It is invalid to pass NULL for the callback.
30 typedef Callback2<base::PassPlatformFile, FilePath>::Type
31 CreateTemporaryCallback;
32 static void CreateTemporary(CreateTemporaryCallback* callback);
33
34 // Close the given file handle.
35 static void Close(base::PlatformFile, StatusCallback* callback);
36
37 // Deletes a file or empty directory.
38 static void Delete(const FilePath& file_path,
39 StatusCallback* callback);
40
41 // Deletes a directory and all of its contents.
42 static void RecursiveDelete(const FilePath& file_path,
43 StatusCallback* callback);
44
45 private:
46 DISALLOW_IMPLICIT_CONSTRUCTORS(FileSystemProxy);
47 };
48
49 #endif // CHROME_BROWSER_FILE_SYSTEM_PROXY_H_
OLDNEW
« no previous file with comments | « chrome/browser/chrome_thread_relay.cc ('k') | chrome/browser/file_system_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698