Chromium Code Reviews| Index: Source/modules/bluetooth/BluetoothGATTService.cpp |
| diff --git a/Source/modules/bluetooth/BluetoothGATTService.cpp b/Source/modules/bluetooth/BluetoothGATTService.cpp |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..620b1bce5d390a9052d02a5dfc1e901028dadfa5 |
| --- /dev/null |
| +++ b/Source/modules/bluetooth/BluetoothGATTService.cpp |
| @@ -0,0 +1,32 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "config.h" |
| +#include "modules/bluetooth/BluetoothGATTService.h" |
| + |
| +#include "public/platform/modules/bluetooth/WebBluetoothGATTRemoteServer.h" |
| +#include "wtf/OwnPtr.h" |
| + |
| +namespace blink { |
| + |
| +BluetoothGATTService::BluetoothGATTService(const WebBluetoothGATTService& webService) |
| + : m_webService(webService) |
|
haraken
2015/06/03 03:45:38
We're deep-copying the webService here. Is this in
ortuno
2015/06/03 17:02:18
No. This pattern slipped under in all of our class
|
| +{ |
| +} |
| + |
| +BluetoothGATTService* BluetoothGATTService::take(ScriptPromiseResolver*, WebBluetoothGATTService* webServiceRawPointer) |
| +{ |
| + if (!webServiceRawPointer) { |
| + return nullptr; |
| + } |
| + OwnPtr<WebBluetoothGATTService> webService = adoptPtr(webServiceRawPointer); |
| + return new BluetoothGATTService(*webService); |
|
haraken
2015/06/03 03:45:38
Maybe you want to pass in webService.learPtr() her
Jeffrey Yasskin
2015/06/03 15:10:04
I mentioned this in https://codereview.chromium.or
ortuno
2015/06/03 17:02:19
We've been mistakenly following this pattern in al
|
| +} |
| + |
| +void BluetoothGATTService::dispose(WebBluetoothGATTService* webService) |
| +{ |
| + delete webService; |
| +} |
| + |
| +} // namespace blink |