Chromium Code Reviews| Index: content/public/browser/bluetooth_allowed_devices_map_base.h |
| diff --git a/content/public/browser/bluetooth_allowed_devices_map_base.h b/content/public/browser/bluetooth_allowed_devices_map_base.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d281df0d146a1fd08f99f066226dd17ecf599160 |
| --- /dev/null |
| +++ b/content/public/browser/bluetooth_allowed_devices_map_base.h |
| @@ -0,0 +1,38 @@ |
| +// 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. |
| + |
| +#ifndef CONTENT_PUBLIC_BROWSER_BLUETOOTH_ALLOWED_DEVICES_MAP_BASE_H_ |
| +#define CONTENT_PUBLIC_BROWSER_BLUETOOTH_ALLOWED_DEVICES_MAP_BASE_H_ |
| + |
| +#include <map> |
| + |
| +#include "content/common/content_export.h" |
| +#include "url/origin.h" |
| + |
| +namespace content { |
| + |
| +class BluetoothAllowedDevices; |
| + |
| +// Base class for keeping track of which origins are allowed to access which |
| +// Bluetooth devices and their services. This class is used with KeyedService |
| +// to make sure there is only one instance of this class for each browser |
| +// profile. |
| +class CONTENT_EXPORT BluetoothAllowedDevicesMapBase { |
| + public: |
| + BluetoothAllowedDevicesMapBase(); |
| + virtual ~BluetoothAllowedDevicesMapBase(); |
| + |
| + // Gets a BluetoothAllowedDevices for each origin; creates one if it doesn't |
| + // exist. |
| + content::BluetoothAllowedDevices* GetOrCreateAllowedDevices( |
| + url::Origin origin); |
|
dcheng
2017/02/01 07:54:09
const url::Origin&
dcheng
2017/02/02 05:26:03
I think this comment still hasn't been addressed.
juncai
2017/02/03 04:47:55
Done.
juncai
2017/02/03 04:47:55
Done.
|
| + |
| + private: |
| + std::map<url::Origin, content::BluetoothAllowedDevices> |
| + origin_to_allowed_devices_map_; |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_PUBLIC_BROWSER_BLUETOOTH_ALLOWED_DEVICES_MAP_BASE_H_ |