Chromium Code Reviews| Index: content/public/browser/bluetooth_allowed_devices_map_base.cc |
| diff --git a/content/public/browser/bluetooth_allowed_devices_map_base.cc b/content/public/browser/bluetooth_allowed_devices_map_base.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..74e205a9a52ca75dfa6d988b0a7c8ca3abd180d3 |
| --- /dev/null |
| +++ b/content/public/browser/bluetooth_allowed_devices_map_base.cc |
| @@ -0,0 +1,25 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "content/public/browser/bluetooth_allowed_devices_map_base.h" |
| + |
| +#include "content/browser/bluetooth/bluetooth_allowed_devices.h" |
| + |
| +namespace content { |
| + |
| +BluetoothAllowedDevicesMapBase::BluetoothAllowedDevicesMapBase() {} |
| + |
| +BluetoothAllowedDevicesMapBase::~BluetoothAllowedDevicesMapBase() {} |
| + |
| +content::BluetoothAllowedDevices* |
| +BluetoothAllowedDevicesMapBase::GetOrCreateAllowedDevices(url::Origin origin) { |
| + auto iter = origin_to_allowed_devices_map_.find(origin); |
| + if (iter == origin_to_allowed_devices_map_.end()) { |
| + iter = origin_to_allowed_devices_map_.insert( |
|
scheib
2017/01/26 04:27:36
The unique origin problem has been moved to here.
juncai
2017/01/30 20:34:55
Done.
|
| + iter, std::make_pair(origin, content::BluetoothAllowedDevices())); |
| + } |
| + return &(iter->second); |
| +} |
| + |
| +} // namespace content |