Chromium Code Reviews| 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 // Use the <code>chrome.experimental.systemInfo.storage</code> API to query | 5 // Use the <code>chrome.experimental.systemInfo.storage</code> API to query |
| 6 // storage device information and be notified when it changes. | 6 // storage device information and be notified when it changes. |
| 7 namespace experimental.systemInfo.storage { | 7 namespace experimental.systemInfo.storage { |
| 8 | 8 |
| 9 enum StorageUnitType { | 9 enum StorageUnitType { |
| 10 // The storage has fixed media, e.g. hard disk or SSD. | 10 // The storage has fixed media, e.g. hard disk or SSD. |
| 11 fixed, | 11 fixed, |
| 12 // The storage is removable, e.g. USB flash drive. | 12 // The storage is removable, e.g. USB flash drive. |
| 13 removable, | 13 removable, |
| 14 // The storage type is unknown. | 14 // The storage type is unknown. |
| 15 unknown | 15 unknown |
| 16 }; | 16 }; |
| 17 | 17 |
| 18 dictionary StorageUnitInfo { | 18 dictionary StorageUnitInfo { |
| 19 // The unique id of the storage unit. | 19 // The unique storage id. It will use the transient ID. |
| 20 DOMString id; | 20 DOMString id; |
| 21 // The name of the storage unit. | |
| 22 DOMString name; | |
| 21 // The media type of the storage unit. | 23 // The media type of the storage unit. |
| 22 StorageUnitType type; | 24 StorageUnitType type; |
| 23 // The total amount of the storage space, in bytes. | 25 // The total amount of the storage space, in bytes, default value is 0. |
|
Jeffrey Yasskin
2013/07/02 23:00:50
What does "default" mean here? Storage units don't
Haojian Wu
2013/07/03 16:23:49
If we can't establish the capacity or available ca
Greg Billock
2013/07/03 17:33:57
Maybe the comment should be "If the storage size c
| |
| 24 double capacity; | 26 double capacity; |
| 25 // The available amount of the storage space, in bytes. | 27 // The available amount of the storage space, in bytes, default value is 0. |
| 26 double availableCapacity; | 28 double availableCapacity; |
| 27 }; | 29 }; |
| 28 | 30 |
| 29 dictionary StorageChangeInfo { | 31 dictionary StorageCapacityChangeInfo { |
|
Jeffrey Yasskin
2013/07/02 23:00:50
It's not the capacity that's changing with this ev
Haojian Wu
2013/07/03 16:23:49
Done. But the current name "StorageCapacityChangeI
Greg Billock
2013/07/03 17:33:57
Either way is fine with me. I think "StorageAvaila
Haojian Wu
2013/07/04 00:41:17
Now rename to StorageFreeSpaceChangeInfo.
| |
| 30 // The uniue id of the storage unit already changed. | 32 // The unique id of the storage unit already changed. |
|
Jeffrey Yasskin
2013/07/02 23:00:50
s/already/that/ I think.
Haojian Wu
2013/07/03 16:23:49
Done.
| |
| 31 DOMString id; | 33 DOMString id; |
| 32 // The new value of the available capacity. | 34 // The new value of the available capacity. |
| 33 double availableCapacity; | 35 double availableCapacity; |
| 34 }; | 36 }; |
| 35 | 37 |
| 36 // A dictionary that describes the add particular storage device watch | 38 // A dictionary that describes the add particular storage device watch |
| 37 // request results. | 39 // request results. |
| 38 dictionary AddWatchResult { | 40 dictionary AddWatchResult { |
| 39 DOMString id; | 41 DOMString id; |
| 40 boolean success; | 42 boolean success; |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 60 // Get all the watched storage devices. | 62 // Get all the watched storage devices. |
| 61 static void getAllWatch(GetAllWatchCallback callback); | 63 static void getAllWatch(GetAllWatchCallback callback); |
| 62 | 64 |
| 63 // Remove all the storage devices monitors. | 65 // Remove all the storage devices monitors. |
| 64 static void removeAllWatch(); | 66 static void removeAllWatch(); |
| 65 }; | 67 }; |
| 66 | 68 |
| 67 interface Events { | 69 interface Events { |
| 68 // Fired when the storage device available capacity is changed. | 70 // Fired when the storage device available capacity is changed. |
| 69 // |info|: The changed information for the specified storage unit. | 71 // |info|: The changed information for the specified storage unit. |
| 70 static void onAvailableCapacityChanged(StorageChangeInfo info); | 72 static void onAvailableCapacityChanged(StorageCapacityChangeInfo info); |
| 71 | 73 |
| 72 // Fired when a new removable storage is attached to the system. | 74 // Fired when a new removable storage is attached to the system. |
| 73 static void onAttached(StorageUnitInfo info); | 75 static void onAttached(StorageUnitInfo info); |
| 74 | 76 |
| 75 // Fired when a removable storage is detached from the system. | 77 // Fired when a removable storage is detached from the system. |
| 76 static void onDetached(DOMString id); | 78 static void onDetached(DOMString id); |
| 77 }; | 79 }; |
| 78 | 80 |
| 79 }; | 81 }; |
| 80 | 82 |
| OLD | NEW |