| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "device/bluetooth/bluetooth_uuid.h" | 5 #include "device/bluetooth/bluetooth_uuid.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include <stddef.h> |
| 8 |
| 8 #include "base/logging.h" | 9 #include "base/logging.h" |
| 9 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| 10 #include "ipc/ipc_message.h" | 11 #include "ipc/ipc_message.h" |
| 11 | 12 |
| 12 namespace device { | 13 namespace device { |
| 13 | 14 |
| 14 namespace { | 15 namespace { |
| 15 | 16 |
| 16 const char* kCommonUuidPostfix = "-0000-1000-8000-00805f9b34fb"; | 17 const char* kCommonUuidPostfix = "-0000-1000-8000-00805f9b34fb"; |
| 17 const char* kCommonUuidPrefix = "0000"; | 18 const char* kCommonUuidPrefix = "0000"; |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // .canonical_value(). Then if browser-side code accidentally checks .value() | 112 // .canonical_value(). Then if browser-side code accidentally checks .value() |
| 112 // against a 128-bit string literal, a hostile renderer could use the 16- or | 113 // against a 128-bit string literal, a hostile renderer could use the 16- or |
| 113 // 32-bit format and evade the check. | 114 // 32-bit format and evade the check. |
| 114 return r->format() == device::BluetoothUUID::kFormat128Bit; | 115 return r->format() == device::BluetoothUUID::kFormat128Bit; |
| 115 } | 116 } |
| 116 | 117 |
| 117 void IPC::ParamTraits<device::BluetoothUUID>::Log(const param_type& p, | 118 void IPC::ParamTraits<device::BluetoothUUID>::Log(const param_type& p, |
| 118 std::string* l) { | 119 std::string* l) { |
| 119 l->append(p.canonical_value()); | 120 l->append(p.canonical_value()); |
| 120 } | 121 } |
| OLD | NEW |