Chromium Code Reviews| Index: webkit/fileapi/mtp_device_interface_win.h |
| diff --git a/webkit/fileapi/mtp_device_interface_win.h b/webkit/fileapi/mtp_device_interface_win.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5f6fa53f2a30e40e23ad3023ea332814876bb072 |
| --- /dev/null |
| +++ b/webkit/fileapi/mtp_device_interface_win.h |
| @@ -0,0 +1,63 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef WEBKIT_FILEAPI_MTP_DEVICE_INTERFACE_WIN_H_ |
| +#define WEBKIT_FILEAPI_MTP_DEVICE_INTERFACE_WIN_H_ |
| + |
| +#include <PortableDeviceApi.h> |
| +#include <PortableDevice.h> |
| + |
| +#include "base/file_path.h" |
| +#include "base/memory/ref_counted.h" |
| +#include "base/platform_file.h" |
| +#include "base/timer.h" |
| +#include "base/win/scoped_comptr.h" |
| +#include "webkit/fileapi/file_system_file_util.h" |
| + |
| +namespace base { |
| +struct PlatformFileInfo; |
| +class Time; |
| +} |
| + |
| +namespace fileapi { |
| + |
| +using base::PlatformFileError; |
| +using base::PlatformFileInfo; |
| + |
| +// Helper class to support MTP device isolated file system operations. This |
| +// class contains platform specific code to communicate with the attached MTP |
| +// device. We instantiate this class per MTP device. MTP device is opened for |
| +// communication during initialization and closed during destruction. |
| +class MtpDeviceInterfaceWin : |
| + public base::RefCountedThreadSafe<MtpDeviceInterfaceWin> { |
|
kinuko
2012/07/26 00:38:06
Keeping this device interface as RefCountedThreadS
kmadhusu
2012/07/27 02:13:41
As we discussed, we are going to make the construc
|
| + public: |
| + MtpDeviceInterfaceWin(const FilePath::StringType& device_id); |
| + |
| + PlatformFileError GetFileInfo(const FilePath& file_path, |
| + PlatformFileInfo* file_info); |
| + FileSystemFileUtil::AbstractFileEnumerator* CreateFileEnumerator( |
| + const FilePath& root, bool recursive); |
| + PlatformFileError Touch(const FilePath& file_path, |
| + const base::Time& last_access_time, |
| + const base::Time& last_modified_time); |
| + bool PathExists(const FilePath& file_path); |
| + bool DirectoryExists(const FilePath& file_path); |
| + bool IsDirectoryEmpty(const FilePath& file_path); |
| + |
| + protected: |
| + friend class base::RefCountedThreadSafe<MtpDeviceInterfaceWin>; |
| + virtual ~MtpDeviceInterfaceWin(); |
| + |
| + private: |
| + bool Init(); |
| + |
| + FilePath::StringType device_id_; |
| + base::win::ScopedComPtr<IPortableDevice> pdevice_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(MtpDeviceInterfaceWin); |
| +}; |
| + |
| +} // namespace fileapi |
| + |
| +#endif // WEBKIT_FILEAPI_MTP_DEVICE_INTERFACE_WIN_H_ |