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

Side by Side Diff: chrome/browser/storage_monitor/storage_monitor_linux.h

Issue 12334096: Regularize ownerships and lifecycle for storage monitor platform classes. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix comment name Created 7 years, 9 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
OLDNEW
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 // StorageMonitorLinux listens for mount point changes, notifies listeners 5 // StorageMonitorLinux listens for mount point changes, notifies listeners
6 // about the addition and deletion of media devices, and answers queries about 6 // about the addition and deletion of media devices, and answers queries about
7 // mounted devices. 7 // mounted devices.
8 8
9 #ifndef CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_LINUX_H_ 9 #ifndef CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_LINUX_H_
10 #define CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_LINUX_H_ 10 #define CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_LINUX_H_
(...skipping 25 matching lines...) Expand all
36 std::string* device_id, 36 std::string* device_id,
37 string16* name, 37 string16* name,
38 bool* removable, 38 bool* removable,
39 uint64* partition_size_in_bytes, 39 uint64* partition_size_in_bytes,
40 string16* volume_label, 40 string16* volume_label,
41 string16* vendor_name, 41 string16* vendor_name,
42 string16* model_name); 42 string16* model_name);
43 43
44 namespace chrome { 44 namespace chrome {
45 45
46 class MediaTransferProtocolDeviceObserverLinux;
47
46 class StorageMonitorLinux 48 class StorageMonitorLinux
47 : public StorageMonitor, 49 : public StorageMonitor,
48 public base::RefCountedThreadSafe<StorageMonitorLinux, 50 public base::RefCountedThreadSafe<StorageMonitorLinux,
49 content::BrowserThread::DeleteOnFileThread> { 51 content::BrowserThread::DeleteOnFileThread> {
50 public: 52 public:
51 // Should only be called by browser start up code. Use GetInstance() instead. 53 // Should only be called by browser start up code. Use GetInstance() instead.
52 explicit StorageMonitorLinux(const base::FilePath& path); 54 explicit StorageMonitorLinux(const base::FilePath& path);
53 55
54 // Must be called for StorageMonitorLinux to work. 56 // Must be called for StorageMonitorLinux to work.
55 void Init(); 57 void Init();
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 // Keep in mind on Linux, a device can be mounted at multiple mount points, 136 // Keep in mind on Linux, a device can be mounted at multiple mount points,
135 // and multiple devices can be mounted at a mount point. 137 // and multiple devices can be mounted at a mount point.
136 MountMap mount_info_map_; 138 MountMap mount_info_map_;
137 139
138 // Because a device can be mounted to multiple places, we only want to 140 // Because a device can be mounted to multiple places, we only want to
139 // notify about one of them. If (and only if) that one is unmounted, we need 141 // notify about one of them. If (and only if) that one is unmounted, we need
140 // to notify about it's departure and notify about another one of it's mount 142 // to notify about it's departure and notify about another one of it's mount
141 // points. 143 // points.
142 MountPriorityMap mount_priority_map_; 144 MountPriorityMap mount_priority_map_;
143 145
146 scoped_ptr<MediaTransferProtocolDeviceObserverLinux>
147 media_transfer_protocol_device_observer_;
148
144 DISALLOW_COPY_AND_ASSIGN(StorageMonitorLinux); 149 DISALLOW_COPY_AND_ASSIGN(StorageMonitorLinux);
145 }; 150 };
146 151
147 } // namespace chrome 152 } // namespace chrome
148 153
149 #endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_LINUX_H_ 154 #endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_LINUX_H_
OLDNEW
« no previous file with comments | « chrome/browser/storage_monitor/storage_monitor_chromeos.cc ('k') | chrome/browser/storage_monitor/storage_monitor_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698