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

Unified Diff: content/public/browser/bluetooth_allowed_devices_map_base.cc

Issue 2658473002: Refactor BluetoothAllowedDevicesMap (Closed)
Patch Set: set --similarity=20 when did git cl upload Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698