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

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

Issue 196793010: Move IsStringASCII/UTF8 to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
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 // Any tasks that communicates with the portable device may take >100ms to 5 // Any tasks that communicates with the portable device may take >100ms to
6 // complete. Those tasks should be run on an blocking thread instead of the 6 // complete. Those tasks should be run on an blocking thread instead of the
7 // UI thread. 7 // UI thread.
8 8
9 #include "components/storage_monitor/portable_device_watcher_win.h" 9 #include "components/storage_monitor/portable_device_watcher_win.h"
10 10
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 return (IsEqualGUID(dev_interface->dbcc_classguid, guidDevInterface) != 0); 52 return (IsEqualGUID(dev_interface->dbcc_classguid, guidDevInterface) != 0);
53 } 53 }
54 54
55 // Returns the portable device plug and play device ID string. 55 // Returns the portable device plug and play device ID string.
56 base::string16 GetPnpDeviceId(LPARAM data) { 56 base::string16 GetPnpDeviceId(LPARAM data) {
57 DEV_BROADCAST_DEVICEINTERFACE* dev_interface = 57 DEV_BROADCAST_DEVICEINTERFACE* dev_interface =
58 reinterpret_cast<DEV_BROADCAST_DEVICEINTERFACE*>(data); 58 reinterpret_cast<DEV_BROADCAST_DEVICEINTERFACE*>(data);
59 if (!dev_interface) 59 if (!dev_interface)
60 return base::string16(); 60 return base::string16();
61 base::string16 device_id(dev_interface->dbcc_name); 61 base::string16 device_id(dev_interface->dbcc_name);
62 DCHECK(IsStringASCII(device_id)); 62 DCHECK(base::IsStringASCII(device_id));
63 return StringToLowerASCII(device_id); 63 return StringToLowerASCII(device_id);
64 } 64 }
65 65
66 // Gets the friendly name of the device specified by the |pnp_device_id|. On 66 // Gets the friendly name of the device specified by the |pnp_device_id|. On
67 // success, returns true and fills in |name|. 67 // success, returns true and fills in |name|.
68 bool GetFriendlyName(const base::string16& pnp_device_id, 68 bool GetFriendlyName(const base::string16& pnp_device_id,
69 IPortableDeviceManager* device_manager, 69 IPortableDeviceManager* device_manager,
70 base::string16* name) { 70 base::string16* name) {
71 DCHECK(device_manager); 71 DCHECK(device_manager);
72 DCHECK(name); 72 DCHECK(name);
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 if (storage_notifications_) { 663 if (storage_notifications_) {
664 storage_notifications_->ProcessDetach( 664 storage_notifications_->ProcessDetach(
665 storage_map_iter->second.device_id()); 665 storage_map_iter->second.device_id());
666 } 666 }
667 storage_map_.erase(storage_map_iter); 667 storage_map_.erase(storage_map_iter);
668 } 668 }
669 device_map_.erase(device_iter); 669 device_map_.erase(device_iter);
670 } 670 }
671 671
672 } // namespace storage_monitor 672 } // namespace storage_monitor
OLDNEW
« no previous file with comments | « components/autofill/core/browser/validation.cc ('k') | components/url_matcher/url_matcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698