Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "content/public/browser/bluetooth_allowed_devices_map_base.h" | |
| 6 | |
| 7 #include <utility> | |
| 8 | |
| 9 #include "content/browser/bluetooth/bluetooth_allowed_devices.h" | |
| 10 | |
| 11 namespace content { | |
| 12 | |
| 13 BluetoothAllowedDevicesMapBase::BluetoothAllowedDevicesMapBase() {} | |
| 14 | |
| 15 BluetoothAllowedDevicesMapBase::~BluetoothAllowedDevicesMapBase() {} | |
| 16 | |
| 17 content::BluetoothAllowedDevices* | |
| 18 BluetoothAllowedDevicesMapBase::GetOrCreateAllowedDevices(url::Origin origin) { | |
|
jam
2017/02/01 01:18:24
See https://www.chromium.org/developers/content-mo
juncai
2017/02/01 05:19:27
Here are some context:
This CL makes each browser
jam
2017/02/02 06:13:27
This doesn't appear to be used outside of content
juncai
2017/02/03 04:47:55
Thanks for the suggestion!
Done.
| |
| 19 // "Unique" Origins generate the same key in maps, therefore are not | |
| 20 // supported. | |
| 21 CHECK(!origin.unique()); | |
|
dcheng
2017/02/02 05:26:03
Why is this a CHECK()? This appears to be directly
juncai
2017/02/03 04:47:55
When the WebBluetooth requestDevice() function is
| |
| 22 auto iter = origin_to_allowed_devices_map_.find(origin); | |
| 23 if (iter == origin_to_allowed_devices_map_.end()) { | |
| 24 iter = origin_to_allowed_devices_map_.insert( | |
| 25 iter, std::make_pair(origin, content::BluetoothAllowedDevices())); | |
| 26 } | |
| 27 return &(iter->second); | |
| 28 } | |
| 29 | |
| 30 } // namespace content | |
| OLD | NEW |