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 CHROME_BROWSER_MEDIA_GALLERIES_SCOPED_MTP_DEVICE_MAP_ENTRY_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_SCOPED_MTP_DEVICE_MAP_ENTRY_H_ |
6 #define CHROME_BROWSER_MEDIA_GALLERIES_SCOPED_MTP_DEVICE_MAP_ENTRY_H_ | 6 #define CHROME_BROWSER_MEDIA_GALLERIES_SCOPED_MTP_DEVICE_MAP_ENTRY_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
11 #include "base/sequenced_task_runner_helpers.h" | 11 #include "base/sequenced_task_runner_helpers.h" |
12 #include "content/public/browser/browser_thread.h" | 12 #include "content/public/browser/browser_thread.h" |
13 | 13 |
14 namespace chrome { | |
15 | |
16 class MTPDeviceAsyncDelegate; | 14 class MTPDeviceAsyncDelegate; |
17 | 15 |
18 // ScopedMTPDeviceMapEntry manages the reference count on a particular | 16 // ScopedMTPDeviceMapEntry manages the reference count on a particular |
19 // MTP device location. These objects are held reference counted in | 17 // MTP device location. These objects are held reference counted in |
20 // the ExtensionGalleriesHost objects. When a particular location is | 18 // the ExtensionGalleriesHost objects. When a particular location is |
21 // destroyed, the constructor-time callback tells the MediaFileSystemRegistry | 19 // destroyed, the constructor-time callback tells the MediaFileSystemRegistry |
22 // to erase it from the system-wide map, and it is also removed from | 20 // to erase it from the system-wide map, and it is also removed from |
23 // the MTPServiceMap at that point. | 21 // the MTPServiceMap at that point. |
24 // TODO(gbillock): Move this to media_file_system_registry. | 22 // TODO(gbillock): Move this to media_file_system_registry. |
25 class ScopedMTPDeviceMapEntry | 23 class ScopedMTPDeviceMapEntry |
(...skipping 22 matching lines...) Expand all Loading... |
48 | 46 |
49 // The MTP or PTP device location. | 47 // The MTP or PTP device location. |
50 const base::FilePath::StringType device_location_; | 48 const base::FilePath::StringType device_location_; |
51 | 49 |
52 // Called when the object is destroyed. | 50 // Called when the object is destroyed. |
53 base::Closure on_destruction_callback_; | 51 base::Closure on_destruction_callback_; |
54 | 52 |
55 DISALLOW_COPY_AND_ASSIGN(ScopedMTPDeviceMapEntry); | 53 DISALLOW_COPY_AND_ASSIGN(ScopedMTPDeviceMapEntry); |
56 }; | 54 }; |
57 | 55 |
58 } // namespace chrome | |
59 | |
60 #endif // CHROME_BROWSER_MEDIA_GALLERIES_SCOPED_MTP_DEVICE_MAP_ENTRY_H_ | 56 #endif // CHROME_BROWSER_MEDIA_GALLERIES_SCOPED_MTP_DEVICE_MAP_ENTRY_H_ |
OLD | NEW |