Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "config.h" | |
| 6 #include "modules/bluetooth/BluetoothGATTService.h" | |
| 7 | |
| 8 #include "public/platform/modules/bluetooth/WebBluetoothGATTRemoteServer.h" | |
| 9 #include "wtf/OwnPtr.h" | |
| 10 | |
| 11 namespace blink { | |
| 12 | |
| 13 BluetoothGATTService::BluetoothGATTService(const WebBluetoothGATTService& webSer vice) | |
| 14 : m_webService(webService) | |
| 15 { | |
| 16 } | |
| 17 | |
| 18 BluetoothGATTService* BluetoothGATTService::take(ScriptPromiseResolver*, WebBlue toothGATTService* webServiceRawPointer) | |
| 19 { | |
| 20 if (!webServiceRawPointer) { | |
| 21 return nullptr; | |
| 22 } | |
| 23 OwnPtr<WebBluetoothGATTService> webService = adoptPtr(webServiceRawPointer); | |
|
haraken
2015/05/24 00:13:50
We should avoid the adoptPtr(raw_pointer) pattern
yhirano
2015/05/25 02:30:00
To: haraken@
Yeah, I agree that this is ugly, but
haraken
2015/05/26 11:45:33
I'm curious why we can't make CallbackPromiseAdapt
| |
| 24 return new BluetoothGATTService(*webService); | |
| 25 } | |
| 26 | |
| 27 void BluetoothGATTService::dispose(WebBluetoothGATTService* webService) | |
| 28 { | |
| 29 delete webService; | |
|
haraken
2015/05/24 00:13:51
Manually deleting an object looks terrible :)
Can
yhirano
2015/05/25 02:30:00
To: haraken@
ditto
| |
| 30 } | |
| 31 | |
| 32 } // namespace blink | |
| OLD | NEW |