Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / components / storage_monitor / test_volume_mount_watcher_win.cc
index f5591f5..77ea57b 100644 (file)
@@ -12,6 +12,8 @@
 #include "base/strings/utf_string_conversions.h"
 #include "components/storage_monitor/storage_info.h"
 
+namespace storage_monitor {
+
 namespace {
 
 base::FilePath GetTempRoot() {
@@ -60,7 +62,8 @@ bool GetMassStorageDeviceDetails(const base::FilePath& device_path,
   base::FilePath path(device_path);
   if (device_path.value().length() > 3)
     path = base::FilePath(device_path.value().substr(0, 3));
-  if (path.value()[0] < L'A' || path.value()[0] > L'Z')
+  base::FilePath::CharType drive_letter = path.value()[0];
+  if (drive_letter < L'A' || drive_letter > L'Z')
     return false;
 
   StorageInfo::Type type = StorageInfo::FIXED_MASS_STORAGE;
@@ -71,11 +74,11 @@ bool GetMassStorageDeviceDetails(const base::FilePath& device_path,
   }
   std::string unique_id =
       "\\\\?\\Volume{00000000-0000-0000-0000-000000000000}\\";
-  unique_id[11] = device_path.value()[0];
+  unique_id[11] = static_cast<char>(drive_letter);
   std::string device_id = StorageInfo::MakeDeviceId(type, unique_id);
   base::string16 storage_label = path.Append(L" Drive").LossyDisplayName();
-  *info = StorageInfo(device_id, base::string16(), path.value(), storage_label,
-                      base::string16(), base::string16(), 1000000);
+  *info = StorageInfo(device_id, path.value(), storage_label, base::string16(),
+                      base::string16(), 1000000);
 
   return true;
 }
@@ -93,11 +96,10 @@ TestVolumeMountWatcherWin::~TestVolumeMountWatcherWin() {
 void TestVolumeMountWatcherWin::AddDeviceForTesting(
     const base::FilePath& device_path,
     const std::string& device_id,
-    const base::string16& device_name,
+    const base::string16& storage_label,
     uint64 total_size_in_bytes) {
-  StorageInfo info(device_id, device_name, device_path.value(),
-                   base::string16(), base::string16(), base::string16(),
-                   total_size_in_bytes);
+  StorageInfo info(device_id, device_path.value(), storage_label,
+                   base::string16(), base::string16(), total_size_in_bytes);
   HandleDeviceAttachEventOnUIThread(device_path, info);
 }
 
@@ -151,3 +153,5 @@ VolumeMountWatcherWin::GetAttachedDevicesCallbackType
 void TestVolumeMountWatcherWin::ShutdownWorkerPool() {
   device_info_worker_pool_->Shutdown();
 }
+
+}  // namespace storage_monitor