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

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

Issue 2718583002: Refactor WebBluetoothServiceClient in the web_bluetooth.mojom (Closed)
Patch Set: fix content unit tests Created 3 years, 10 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: third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.h
diff --git a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.h b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.h
index c4aaabd9435bbdd1197e7893c019e1d64242794c..51042611cbe40a222141a98ac7a5546c51258f58 100644
--- a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.h
+++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.h
@@ -11,6 +11,7 @@
#include "core/dom/DOMDataView.h"
#include "modules/EventTargetModules.h"
#include "modules/bluetooth/BluetoothRemoteGATTService.h"
+#include "mojo/public/cpp/bindings/associated_binding.h"
#include "platform/heap/Handle.h"
#include "public/platform/modules/bluetooth/web_bluetooth.mojom-blink.h"
#include "wtf/text/WTFString.h"
@@ -34,7 +35,8 @@ class ScriptState;
// CallbackPromiseAdapter class comments.
class BluetoothRemoteGATTCharacteristic final
: public EventTargetWithInlineData,
- public ContextLifecycleObserver {
+ public ContextLifecycleObserver,
+ public mojom::blink::WebBluetoothCharacteristicClient {
USING_PRE_FINALIZER(BluetoothRemoteGATTCharacteristic, dispose);
DEFINE_WRAPPERTYPEINFO();
USING_GARBAGE_COLLECTED_MIXIN(BluetoothRemoteGATTCharacteristic);
@@ -55,11 +57,13 @@ class BluetoothRemoteGATTCharacteristic final
// Save value.
void setValue(DOMDataView*);
- void dispatchCharacteristicValueChanged(const Vector<uint8_t>& value);
-
// ContextLifecycleObserver interface.
void contextDestroyed(ExecutionContext*) override;
+ // mojom::blink::WebBluetoothCharacteristicClient:
+ void RemoteCharacteristicValueChanged(
+ const WTF::Vector<uint8_t>& value) override;
+
// USING_PRE_FINALIZER interface.
// Called before the object gets garbage collected.
void dispose();
@@ -110,8 +114,10 @@ class BluetoothRemoteGATTCharacteristic final
void WriteValueCallback(ScriptPromiseResolver*,
const Vector<uint8_t>& value,
mojom::blink::WebBluetoothResult);
- void NotificationsCallback(ScriptPromiseResolver*,
- mojom::blink::WebBluetoothResult);
+ void NotificationsCallback(
+ ScriptPromiseResolver*,
+ mojom::blink::WebBluetoothResult,
+ mojom::blink::WebBluetoothCharacteristicClientAssociatedRequest);
ScriptPromise getDescriptorsImpl(ScriptState*,
mojom::blink::WebBluetoothGATTQueryQuantity,
@@ -127,6 +133,8 @@ class BluetoothRemoteGATTCharacteristic final
mojom::blink::WebBluetoothRemoteGATTCharacteristicPtr m_characteristic;
Member<BluetoothRemoteGATTService> m_service;
+ mojo::AssociatedBinding<mojom::blink::WebBluetoothCharacteristicClient>
+ m_clientBinding;
bool m_stopped;
Member<BluetoothCharacteristicProperties> m_properties;
Member<DOMDataView> m_value;

Powered by Google App Engine
This is Rietveld 408576698