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

Unified Diff: Source/modules/bluetooth/BluetoothGATTRemoteServer.cpp

Issue 1148283009: bluetooth: Remove deep copying of structs by using OwnPtr. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@bluetooth-get-primary-service-implementation
Patch Set: Created 5 years, 7 months 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 side-by-side diff with in-line comments
Download patch
Index: Source/modules/bluetooth/BluetoothGATTRemoteServer.cpp
diff --git a/Source/modules/bluetooth/BluetoothGATTRemoteServer.cpp b/Source/modules/bluetooth/BluetoothGATTRemoteServer.cpp
index b2a55a09286a3cc57ac09cd736205fe1a48c0fe5..98a0f610333cc511b72ef3ba4acefa178bba1ebf 100644
--- a/Source/modules/bluetooth/BluetoothGATTRemoteServer.cpp
+++ b/Source/modules/bluetooth/BluetoothGATTRemoteServer.cpp
@@ -18,15 +18,14 @@
namespace blink {
-BluetoothGATTRemoteServer::BluetoothGATTRemoteServer(const WebBluetoothGATTRemoteServer& webGATT)
+BluetoothGATTRemoteServer::BluetoothGATTRemoteServer(PassOwnPtr<WebBluetoothGATTRemoteServer> webGATT)
: m_webGATT(webGATT)
{
}
BluetoothGATTRemoteServer* BluetoothGATTRemoteServer::take(ScriptPromiseResolver*, WebBluetoothGATTRemoteServer* webGATTRawPointer)
{
- OwnPtr<WebBluetoothGATTRemoteServer> webGATT = adoptPtr(webGATTRawPointer);
- return new BluetoothGATTRemoteServer(*webGATT);
+ return new BluetoothGATTRemoteServer(adoptPtr(webGATTRawPointer));
}
void BluetoothGATTRemoteServer::dispose(WebBluetoothGATTRemoteServer* webGATTRaw)
@@ -42,7 +41,7 @@ ScriptPromise BluetoothGATTRemoteServer::getPrimaryService(ScriptState* scriptSt
RefPtrWillBeRawPtr<ScriptPromiseResolver> resolver = ScriptPromiseResolver::create(scriptState);
ScriptPromise promise = resolver->promise();
- webbluetooth->getPrimaryService(m_webGATT.deviceInstanceID, serviceUUID, new CallbackPromiseAdapter<BluetoothGATTService, BluetoothError>(resolver));
+ webbluetooth->getPrimaryService(m_webGATT->deviceInstanceID, serviceUUID, new CallbackPromiseAdapter<BluetoothGATTService, BluetoothError>(resolver));
return promise;
}

Powered by Google App Engine
This is Rietveld 408576698