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

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

Issue 10781014: Isolated FS for media devices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 8 years, 5 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef WEBKIT_FILEAPI_MTP_DEVICE_INTERFACE_LINUX_H_
6 #define WEBKIT_FILEAPI_MTP_DEVICE_INTERFACE_LINUX_H_
7
8 #include "base/file_path.h"
9 #include "base/memory/ref_counted.h"
10 #include "base/platform_file.h"
11 #include "base/timer.h"
12 #include "webkit/fileapi/file_system_file_util.h"
13
14 namespace base {
15 struct PlatformFileInfo;
16 class Time;
17 }
18
19 namespace fileapi {
20
21 using base::PlatformFileError;
22 using base::PlatformFileInfo;
23
24 // Helper class to support MTP device isolated file system operations. This
25 // class contains platform specific code to communicate with the attached
26 // MTP device. We instantiate this class per MTP device. MTP device is
27 // opened for communication during initialization and closed during
28 // destruction.
29 class MtpDeviceInterfaceLinux :
30 public base::RefCountedThreadSafe<MtpDeviceInterfaceLinux> {
31 public:
32 MtpDeviceInterfaceLinux(const FilePath::StringType& device_id);
33
34 PlatformFileError GetFileInfo(const FilePath& file_path,
35 PlatformFileInfo* file_info);
36 FileSystemFileUtil::AbstractFileEnumerator* CreateFileEnumerator(
37 const FilePath& root, bool recursive);
38 PlatformFileError Touch(const FilePath& file_path,
39 const base::Time& last_access_time,
40 const base::Time& last_modified_time);
41 bool PathExists(const FilePath& file_path);
42 bool DirectoryExists(const FilePath& file_path);
43 bool IsDirectoryEmpty(const FilePath& file_path);
44
45 protected:
46 friend class base::RefCountedThreadSafe<MtpDeviceInterfaceLinux>;
47 virtual ~MtpDeviceInterfaceLinux();
48
49 private:
50 bool Init();
51
52 FilePath::StringType device_id_;
53
54 DISALLOW_COPY_AND_ASSIGN(MtpDeviceInterfaceLinux);
55 };
56
57 } // namespace fileapi
58
59 #endif // WEBKIT_FILEAPI_MTP_DEVICE_INTERFACE_LINUX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698