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

Side by Side Diff: content/browser/bluetooth/bluetooth_device_chooser_controller.cc

Issue 2228403003: content: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 4 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "content/browser/bluetooth/bluetooth_device_chooser_controller.h" 5 #include "content/browser/bluetooth/bluetooth_device_chooser_controller.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <unordered_set> 9 #include <unordered_set>
10 10
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 if (!base::StartsWith(device.GetName().value(), filter->name_prefix.get(), 103 if (!base::StartsWith(device.GetName().value(), filter->name_prefix.get(),
104 base::CompareCase::SENSITIVE)) 104 base::CompareCase::SENSITIVE))
105 return false; 105 return false;
106 } 106 }
107 107
108 if (!filter->services.is_null()) { 108 if (!filter->services.is_null()) {
109 const auto& device_uuid_list = device.GetUUIDs(); 109 const auto& device_uuid_list = device.GetUUIDs();
110 const std::unordered_set<BluetoothUUID, device::BluetoothUUIDHash> 110 const std::unordered_set<BluetoothUUID, device::BluetoothUUIDHash>
111 device_uuids(device_uuid_list.begin(), device_uuid_list.end()); 111 device_uuids(device_uuid_list.begin(), device_uuid_list.end());
112 for (const base::Optional<BluetoothUUID>& service : filter->services) { 112 for (const base::Optional<BluetoothUUID>& service : filter->services) {
113 if (!ContainsKey(device_uuids, service.value())) { 113 if (!base::ContainsKey(device_uuids, service.value())) {
114 return false; 114 return false;
115 } 115 }
116 } 116 }
117 } 117 }
118 118
119 return true; 119 return true;
120 } 120 }
121 121
122 bool MatchesFilters( 122 bool MatchesFilters(
123 const device::BluetoothDevice& device, 123 const device::BluetoothDevice& device,
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 487
488 void BluetoothDeviceChooserController::PostErrorCallback( 488 void BluetoothDeviceChooserController::PostErrorCallback(
489 blink::mojom::WebBluetoothError error) { 489 blink::mojom::WebBluetoothError error) {
490 if (!base::ThreadTaskRunnerHandle::Get()->PostTask( 490 if (!base::ThreadTaskRunnerHandle::Get()->PostTask(
491 FROM_HERE, base::Bind(error_callback_, error))) { 491 FROM_HERE, base::Bind(error_callback_, error))) {
492 LOG(WARNING) << "No TaskRunner."; 492 LOG(WARNING) << "No TaskRunner.";
493 } 493 }
494 } 494 }
495 495
496 } // namespace content 496 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/bluetooth/bluetooth_allowed_devices_map.cc ('k') | content/browser/bluetooth/web_bluetooth_service_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698