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

Side by Side Diff: components/storage_monitor/media_storage_util.cc

Issue 1004933003: favor DCHECK_CURRENTLY_ON for better logs in components/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 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 #include "components/storage_monitor/media_storage_util.h" 5 #include "components/storage_monitor/media_storage_util.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 for (StorageInfoList::const_iterator it = devices.begin(); 48 for (StorageInfoList::const_iterator it = devices.begin();
49 it != devices.end(); ++it) { 49 it != devices.end(); ++it) {
50 if (it->device_id() == device_id 50 if (it->device_id() == device_id
51 && StorageInfo::IsRemovableDevice(device_id)) 51 && StorageInfo::IsRemovableDevice(device_id))
52 return it->location(); 52 return it->location();
53 } 53 }
54 return base::FilePath::StringType(); 54 return base::FilePath::StringType();
55 } 55 }
56 56
57 void FilterAttachedDevicesOnFileThread(MediaStorageUtil::DeviceIdSet* devices) { 57 void FilterAttachedDevicesOnFileThread(MediaStorageUtil::DeviceIdSet* devices) {
58 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 58 DCHECK_CURRENTLY_ON(BrowserThread::FILE);
59 MediaStorageUtil::DeviceIdSet missing_devices; 59 MediaStorageUtil::DeviceIdSet missing_devices;
60 60
61 for (MediaStorageUtil::DeviceIdSet::const_iterator it = devices->begin(); 61 for (MediaStorageUtil::DeviceIdSet::const_iterator it = devices->begin();
62 it != devices->end(); 62 it != devices->end();
63 ++it) { 63 ++it) {
64 StorageInfo::Type type; 64 StorageInfo::Type type;
65 std::string unique_id; 65 std::string unique_id;
66 if (!StorageInfo::CrackDeviceId(*it, &type, &unique_id)) { 66 if (!StorageInfo::CrackDeviceId(*it, &type, &unique_id)) {
67 missing_devices.insert(*it); 67 missing_devices.insert(*it);
68 continue; 68 continue;
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 StorageMonitor::GetInstance()->GetAllAvailableStorages(); 241 StorageMonitor::GetInstance()->GetAllAvailableStorages();
242 for (StorageInfoList::const_iterator it = devices.begin(); 242 for (StorageInfoList::const_iterator it = devices.begin();
243 it != devices.end(); ++it) { 243 it != devices.end(); ++it) {
244 if (StorageInfo::IsRemovableDevice(id) && it->device_id() == id) 244 if (StorageInfo::IsRemovableDevice(id) && it->device_id() == id)
245 return true; 245 return true;
246 } 246 }
247 return false; 247 return false;
248 } 248 }
249 249
250 } // namespace storage_monitor 250 } // namespace storage_monitor
OLDNEW
« no previous file with comments | « components/precache/content/precache_manager.cc ('k') | components/storage_monitor/storage_monitor_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698