| 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 "config.h" | 5 #include "config.h" |
| 6 #include "modules/bluetooth/BluetoothDevice.h" | 6 #include "modules/bluetooth/BluetoothDevice.h" |
| 7 | 7 |
| 8 #include "public/platform/WebBluetoothDevice.h" | |
| 9 #include "wtf/OwnPtr.h" | 8 #include "wtf/OwnPtr.h" |
| 10 | 9 |
| 11 namespace blink { | 10 namespace blink { |
| 12 | 11 |
| 13 BluetoothDevice::BluetoothDevice(const String& instanceId) | 12 BluetoothDevice::BluetoothDevice(const WebBluetoothDevice& webDevice) |
| 14 : m_instanceId(instanceId) | 13 : m_webDevice(webDevice) |
| 15 { | 14 { |
| 16 } | 15 } |
| 17 | 16 |
| 18 BluetoothDevice* BluetoothDevice::create(const WebBluetoothDevice& webDevice) | 17 BluetoothDevice* BluetoothDevice::create(const WebBluetoothDevice& webDevice) |
| 19 { | 18 { |
| 20 return new BluetoothDevice(webDevice.instanceId); | 19 return new BluetoothDevice(webDevice); |
| 21 } | 20 } |
| 22 | 21 |
| 23 BluetoothDevice* BluetoothDevice::take(ScriptPromiseResolver*, WebBluetoothDevic
e* webDeviceRawPointer) | 22 BluetoothDevice* BluetoothDevice::take(ScriptPromiseResolver*, WebBluetoothDevic
e* webDeviceRawPointer) |
| 24 { | 23 { |
| 25 OwnPtr<WebBluetoothDevice> webDevice = adoptPtr(webDeviceRawPointer); | 24 OwnPtr<WebBluetoothDevice> webDevice = adoptPtr(webDeviceRawPointer); |
| 26 return BluetoothDevice::create(*webDevice); | 25 return BluetoothDevice::create(*webDevice); |
| 27 } | 26 } |
| 28 | 27 |
| 29 void BluetoothDevice::dispose(WebBluetoothDevice* webDeviceRaw) | 28 void BluetoothDevice::dispose(WebBluetoothDevice* webDeviceRaw) |
| 30 { | 29 { |
| 31 delete webDeviceRaw; | 30 delete webDeviceRaw; |
| 32 } | 31 } |
| 33 | 32 |
| 34 } // namespace blink | 33 } // namespace blink |
| 35 | 34 |
| OLD | NEW |