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

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

Issue 16472007: Rename StorageMonitor Initialize function to EnsureInitialized for better understanding. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 6 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 #ifndef CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_H_ 5 #ifndef CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_H_
6 #define CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_H_ 6 #define CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 EJECT_OK, 65 EJECT_OK,
66 EJECT_IN_USE, 66 EJECT_IN_USE,
67 EJECT_NO_SUCH_DEVICE, 67 EJECT_NO_SUCH_DEVICE,
68 EJECT_FAILURE 68 EJECT_FAILURE
69 }; 69 };
70 70
71 // Returns a pointer to an object owned by the BrowserMainParts, with lifetime 71 // Returns a pointer to an object owned by the BrowserMainParts, with lifetime
72 // somewhat shorter than a process Singleton. 72 // somewhat shorter than a process Singleton.
73 static StorageMonitor* GetInstance(); 73 static StorageMonitor* GetInstance();
74 74
75 // Initialize the storage monitor. The provided callback, if non-null, 75 // Initialize the storage monitor. The provided callback, if non-null,
Dan Beam 2013/06/20 00:35:32 shouldn't this now say "Ensures that the storage m
76 // will be called when initialization is complete. If initialization has 76 // will be called when initialization is complete. If initialization has
77 // already completed, this callback will be invoked within the calling stack. 77 // already completed, this callback will be invoked within the calling stack.
78 // Before the callback is run, calls to |GetAllAvailableStorages| and 78 // Before the callback is run, calls to |GetAllAvailableStorages| and
79 // |GetStorageInfoForPath| may not return the correct results. In addition, 79 // |GetStorageInfoForPath| may not return the correct results. In addition,
80 // registered observers will not be notified on device attachment/detachment. 80 // registered observers will not be notified on device attachment/detachment.
81 // Should be invoked on the UI thread; callbacks will be run on the UI thread. 81 // Should be invoked on the UI thread; callbacks will be run on the UI thread.
82 void Initialize(base::Closure callback); 82 void EnsureInitialized(base::Closure callback);
83 83
84 // Return true if the storage monitor has already been initialized. 84 // Return true if the storage monitor has already been initialized.
85 bool IsInitialized(); 85 bool IsInitialized();
86 86
87 // Finds the device that contains |path| and populates |device_info|. 87 // Finds the device that contains |path| and populates |device_info|.
88 // Should be able to handle any path on the local system, not just removable 88 // Should be able to handle any path on the local system, not just removable
89 // storage. Returns false if unable to find the device. 89 // storage. Returns false if unable to find the device.
90 virtual bool GetStorageInfoForPath( 90 virtual bool GetStorageInfoForPath(
91 const base::FilePath& path, 91 const base::FilePath& path,
92 StorageInfo* device_info) const = 0; 92 StorageInfo* device_info) const = 0;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 174
175 // Map of all known storage devices,including fixed and removable storages. 175 // Map of all known storage devices,including fixed and removable storages.
176 StorageMap storage_map_; 176 StorageMap storage_map_;
177 177
178 scoped_ptr<TransientDeviceIds> transient_device_ids_; 178 scoped_ptr<TransientDeviceIds> transient_device_ids_;
179 }; 179 };
180 180
181 } // namespace chrome 181 } // namespace chrome
182 182
183 #endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_H_ 183 #endif // CHROME_BROWSER_STORAGE_MONITOR_STORAGE_MONITOR_H_
OLDNEW
« no previous file with comments | « chrome/browser/media_galleries/media_galleries_dialog_controller.cc ('k') | chrome/browser/storage_monitor/storage_monitor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698