OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_STORAGE_MONITOR_STORAGE_INFO_H_ | 5 #ifndef COMPONENTS_STORAGE_MONITOR_STORAGE_INFO_H_ |
6 #define COMPONENTS_STORAGE_MONITOR_STORAGE_INFO_H_ | 6 #define COMPONENTS_STORAGE_MONITOR_STORAGE_INFO_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 }; | 34 }; |
35 | 35 |
36 StorageInfo(); | 36 StorageInfo(); |
37 // Note: |device_id_in| should be constructed with MakeDeviceId. | 37 // Note: |device_id_in| should be constructed with MakeDeviceId. |
38 StorageInfo(const std::string& device_id_in, | 38 StorageInfo(const std::string& device_id_in, |
39 const base::FilePath::StringType& device_location, | 39 const base::FilePath::StringType& device_location, |
40 const base::string16& label, | 40 const base::string16& label, |
41 const base::string16& vendor, | 41 const base::string16& vendor, |
42 const base::string16& model, | 42 const base::string16& model, |
43 uint64_t size_in_bytes); | 43 uint64_t size_in_bytes); |
| 44 StorageInfo(const StorageInfo& other); |
44 ~StorageInfo(); | 45 ~StorageInfo(); |
45 | 46 |
46 // Returns a device id given properties of the device. A prefix dependent on | 47 // Returns a device id given properties of the device. A prefix dependent on |
47 // |type| is added so |unique_id| need only be unique within the given type. | 48 // |type| is added so |unique_id| need only be unique within the given type. |
48 // Returns an empty string if an invalid type is passed in. | 49 // Returns an empty string if an invalid type is passed in. |
49 static std::string MakeDeviceId(Type type, const std::string& unique_id); | 50 static std::string MakeDeviceId(Type type, const std::string& unique_id); |
50 | 51 |
51 // Extracts the device |type| and |unique_id| from |device_id|. Returns false | 52 // Extracts the device |type| and |unique_id| from |device_id|. Returns false |
52 // if the device_id isn't properly formatted. | 53 // if the device_id isn't properly formatted. |
53 static bool CrackDeviceId(const std::string& device_id, | 54 static bool CrackDeviceId(const std::string& device_id, |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 base::string16 model_name_; | 117 base::string16 model_name_; |
117 | 118 |
118 // Size of the removable device in bytes. | 119 // Size of the removable device in bytes. |
119 // Zero if not collected or unknown. | 120 // Zero if not collected or unknown. |
120 uint64_t total_size_in_bytes_; | 121 uint64_t total_size_in_bytes_; |
121 }; | 122 }; |
122 | 123 |
123 } // namespace storage_monitor | 124 } // namespace storage_monitor |
124 | 125 |
125 #endif // COMPONENTS_STORAGE_MONITOR_STORAGE_INFO_H_ | 126 #endif // COMPONENTS_STORAGE_MONITOR_STORAGE_INFO_H_ |
OLD | NEW |