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

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

Issue 2716583003: Rename Origin.unique() to opaque().
Patch Set: Update new uses post-rebase Created 3 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 2017 The Chromium Authors. All rights reserved. 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 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_allowed_devices_map.h" 5 #include "content/browser/bluetooth/bluetooth_allowed_devices_map.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "content/browser/bluetooth/bluetooth_allowed_devices.h" 9 #include "content/browser/bluetooth/bluetooth_allowed_devices.h"
10 10
11 namespace content { 11 namespace content {
12 12
13 BluetoothAllowedDevicesMap::BluetoothAllowedDevicesMap() {} 13 BluetoothAllowedDevicesMap::BluetoothAllowedDevicesMap() {}
14 14
15 BluetoothAllowedDevicesMap::~BluetoothAllowedDevicesMap() {} 15 BluetoothAllowedDevicesMap::~BluetoothAllowedDevicesMap() {}
16 16
17 content::BluetoothAllowedDevices& 17 content::BluetoothAllowedDevices&
18 BluetoothAllowedDevicesMap::GetOrCreateAllowedDevices( 18 BluetoothAllowedDevicesMap::GetOrCreateAllowedDevices(
19 const url::Origin& origin) { 19 const url::Origin& origin) {
20 // "Unique" Origins generate the same key in maps, therefore are not 20 // Opaque origins generate the same key in maps, therefore are not
21 // supported. 21 // supported.
22 CHECK(!origin.unique()); 22 CHECK(!origin.opaque());
23 auto iter = origin_to_allowed_devices_map_.find(origin); 23 auto iter = origin_to_allowed_devices_map_.find(origin);
24 if (iter == origin_to_allowed_devices_map_.end()) { 24 if (iter == origin_to_allowed_devices_map_.end()) {
25 iter = origin_to_allowed_devices_map_.insert( 25 iter = origin_to_allowed_devices_map_.insert(
26 iter, std::make_pair(origin, content::BluetoothAllowedDevices())); 26 iter, std::make_pair(origin, content::BluetoothAllowedDevices()));
27 } 27 }
28 return iter->second; 28 return iter->second;
29 } 29 }
30 30
31 void BluetoothAllowedDevicesMap::Clear() { 31 void BluetoothAllowedDevicesMap::Clear() {
32 origin_to_allowed_devices_map_.clear(); 32 origin_to_allowed_devices_map_.clear();
33 } 33 }
34 34
35 } // namespace content 35 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698