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

Unified Diff: third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp

Issue 2474863004: bluetooth: Add characteristics to the device's attribute instance map (Closed)
Patch Set: clean up Created 4 years, 1 month 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: third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp
index 53c3f395aa3b4b0021ccd28df17de8b7c31a179e..1177d433d2343380f65a46325157c8119712f8ab 100644
--- a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp
+++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.cpp
@@ -4,7 +4,6 @@
#include "modules/bluetooth/BluetoothRemoteGATTCharacteristic.h"
-#include "bindings/core/v8/CallbackPromiseAdapter.h"
#include "bindings/core/v8/ScriptPromise.h"
#include "bindings/core/v8/ScriptPromiseResolver.h"
#include "core/dom/DOMDataView.h"
@@ -52,17 +51,15 @@ BluetoothRemoteGATTCharacteristic::BluetoothRemoteGATTCharacteristic(
ThreadState::current()->registerPreFinalizer(this);
}
-BluetoothRemoteGATTCharacteristic* BluetoothRemoteGATTCharacteristic::take(
- ScriptPromiseResolver* resolver,
+BluetoothRemoteGATTCharacteristic* BluetoothRemoteGATTCharacteristic::create(
+ ExecutionContext* context,
std::unique_ptr<WebBluetoothRemoteGATTCharacteristicInit> webCharacteristic,
BluetoothRemoteGATTService* service) {
- if (!webCharacteristic) {
- return nullptr;
- }
+ DCHECK(webCharacteristic);
+
BluetoothRemoteGATTCharacteristic* characteristic =
- new BluetoothRemoteGATTCharacteristic(resolver->getExecutionContext(),
- std::move(webCharacteristic),
- service);
+ new BluetoothRemoteGATTCharacteristic(
+ context, std::move(webCharacteristic), service);
// See note in ActiveDOMObject about suspendIfNeeded.
characteristic->suspendIfNeeded();
return characteristic;

Powered by Google App Engine
This is Rietveld 408576698