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

Side by Side Diff: content/common/bluetooth/web_bluetooth_device_id.h

Issue 2506813003: Use new wrapper types for web_bluetooth.mojom (Closed)
Patch Set: updated web_bluetooth_impl.cc Created 4 years, 1 month 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef CONTENT_COMMON_BLUETOOTH_WEB_BLUETOOTH_DEVICE_ID_H_ 5 #ifndef CONTENT_COMMON_BLUETOOTH_WEB_BLUETOOTH_DEVICE_ID_H_
6 #define CONTENT_COMMON_BLUETOOTH_WEB_BLUETOOTH_DEVICE_ID_H_ 6 #define CONTENT_COMMON_BLUETOOTH_WEB_BLUETOOTH_DEVICE_ID_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "content/common/content_export.h" 10 #include "content/common/content_export.h"
(...skipping 25 matching lines...) Expand all
36 // Returns true if base64-decoding |device_id| results in a 128bit string. 36 // Returns true if base64-decoding |device_id| results in a 128bit string.
37 static bool IsValid(const std::string& device_id); 37 static bool IsValid(const std::string& device_id);
38 38
39 bool operator==(const WebBluetoothDeviceId& device_id) const; 39 bool operator==(const WebBluetoothDeviceId& device_id) const;
40 bool operator!=(const WebBluetoothDeviceId& device_id) const; 40 bool operator!=(const WebBluetoothDeviceId& device_id) const;
41 41
42 private: 42 private:
43 std::string device_id_; 43 std::string device_id_;
44 }; 44 };
45 45
46 // This is required by gtest to print a readable output on test failures.
ortuno 2016/11/21 04:42:31 Why move this? Without this tests won't be able to
juncai 2016/11/21 21:27:05 It seems that this operator<< is only used by: htt
47 CONTENT_EXPORT std::ostream& operator<<(std::ostream& out,
48 const WebBluetoothDeviceId& device_id);
49
50 struct WebBluetoothDeviceIdHash { 46 struct WebBluetoothDeviceIdHash {
51 size_t operator()(const WebBluetoothDeviceId& device_id) const { 47 size_t operator()(const WebBluetoothDeviceId& device_id) const {
52 return std::hash<std::string>()(device_id.str()); 48 return std::hash<std::string>()(device_id.str());
53 } 49 }
54 }; 50 };
55 51
56 } // namespace content 52 } // namespace content
57 53
58 #endif // CONTENT_COMMON_BLUETOOTH_WEB_BLUETOOTH_DEVICE_ID_H_ 54 #endif // CONTENT_COMMON_BLUETOOTH_WEB_BLUETOOTH_DEVICE_ID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698