| OLD | NEW |
| 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_MEDIA_MTP_DEVICE_MAP_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_MAP_SERVICE_H_ |
| 6 #define WEBKIT_FILEAPI_MEDIA_MTP_DEVICE_MAP_SERVICE_H_ | 6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_MAP_SERVICE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
| 12 #include "base/threading/thread_checker.h" | 12 #include "base/threading/thread_checker.h" |
| 13 #include "webkit/storage/webkit_storage_export.h" | |
| 14 | 13 |
| 15 namespace fileapi { | 14 namespace chrome { |
| 16 | 15 |
| 17 class MTPDeviceAsyncDelegate; | 16 class MTPDeviceAsyncDelegate; |
| 18 | 17 |
| 19 // This class provides media transfer protocol (MTP) device delegate to | 18 // This class provides media transfer protocol (MTP) device delegate to |
| 20 // complete media file system operations. ScopedMTPDeviceMapEntry class | 19 // complete media file system operations. ScopedMTPDeviceMapEntry class |
| 21 // manages the device map entries. | 20 // manages the device map entries. |
| 22 class WEBKIT_STORAGE_EXPORT MTPDeviceMapService { | 21 class MTPDeviceMapService { |
| 23 public: | 22 public: |
| 24 static MTPDeviceMapService* GetInstance(); | 23 static MTPDeviceMapService* GetInstance(); |
| 25 | 24 |
| 26 ///////////////////////////////////////////////////////////////////////////// | 25 ///////////////////////////////////////////////////////////////////////////// |
| 27 // Following methods are used to manage MTPDeviceAsyncDelegate objects. // | 26 // Following methods are used to manage MTPDeviceAsyncDelegate objects. // |
| 28 ///////////////////////////////////////////////////////////////////////////// | 27 ///////////////////////////////////////////////////////////////////////////// |
| 29 // Adds the MTP device delegate to the map service. |device_location| | 28 // Adds the MTP device delegate to the map service. |device_location| |
| 30 // specifies the mount location of the MTP device. | 29 // specifies the mount location of the MTP device. |
| 31 // Called on the IO thread. | 30 // Called on the IO thread. |
| 32 void AddAsyncDelegate(const base::FilePath::StringType& device_location, | 31 void AddAsyncDelegate(const base::FilePath::StringType& device_location, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 60 // Following member variables are used to manage asynchronous // | 59 // Following member variables are used to manage asynchronous // |
| 61 // MTP device delegate objects. // | 60 // MTP device delegate objects. // |
| 62 ///////////////////////////////////////////////////////////////////////////// | 61 ///////////////////////////////////////////////////////////////////////////// |
| 63 // Map of attached mtp device async delegates. | 62 // Map of attached mtp device async delegates. |
| 64 AsyncDelegateMap async_delegate_map_; | 63 AsyncDelegateMap async_delegate_map_; |
| 65 base::ThreadChecker thread_checker_; | 64 base::ThreadChecker thread_checker_; |
| 66 | 65 |
| 67 DISALLOW_COPY_AND_ASSIGN(MTPDeviceMapService); | 66 DISALLOW_COPY_AND_ASSIGN(MTPDeviceMapService); |
| 68 }; | 67 }; |
| 69 | 68 |
| 70 } // namespace fileapi | 69 } // namespace chrome |
| 71 | 70 |
| 72 #endif // WEBKIT_FILEAPI_MEDIA_MTP_DEVICE_MAP_SERVICE_H_ | 71 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_MTP_DEVICE_MAP_SERVICE_H_ |
| OLD | NEW |