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

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

Issue 2565913002: [Onion Soup] Move WebBluetoothImpl from //content/renderer/bluetooth to Blink's bluetooth module (Closed)
Patch Set: renamed BluetoothUUID.typemap to Bluetooth.typemap Created 3 years, 12 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 97c5126c5b0ab213edf28cb6c0905089ba622659..4f0135d6aa892e7e4030c5e21aeea9d4c957c5c6 100644
--- a/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.h
+++ b/third_party/WebKit/Source/modules/bluetooth/BluetoothRemoteGATTCharacteristic.h
@@ -12,14 +12,14 @@
#include "modules/EventTargetModules.h"
#include "modules/bluetooth/BluetoothRemoteGATTService.h"
#include "platform/heap/Handle.h"
-#include "public/platform/modules/bluetooth/WebBluetoothRemoteGATTCharacteristic.h"
-#include "public/platform/modules/bluetooth/WebBluetoothRemoteGATTCharacteristicInit.h"
+#include "public/platform/modules/bluetooth/web_bluetooth.mojom-blink.h"
#include "wtf/text/WTFString.h"
#include <memory>
namespace blink {
class BluetoothCharacteristicProperties;
+class BluetoothDevice;
class ExecutionContext;
class ScriptPromise;
class ScriptState;
@@ -34,8 +34,7 @@ class ScriptState;
// CallbackPromiseAdapter class comments.
class BluetoothRemoteGATTCharacteristic final
: public EventTargetWithInlineData,
- public ContextLifecycleObserver,
- public WebBluetoothRemoteGATTCharacteristic {
+ public ContextLifecycleObserver {
USING_PRE_FINALIZER(BluetoothRemoteGATTCharacteristic, dispose);
DEFINE_WRAPPERTYPEINFO();
USING_GARBAGE_COLLECTED_MIXIN(BluetoothRemoteGATTCharacteristic);
@@ -43,19 +42,26 @@ class BluetoothRemoteGATTCharacteristic final
public:
explicit BluetoothRemoteGATTCharacteristic(
ExecutionContext*,
- std::unique_ptr<WebBluetoothRemoteGATTCharacteristicInit>,
- BluetoothRemoteGATTService*);
+ const String& characteristicInstanceId,
+ const String& serviceInstanceId,
+ const String& uuid,
+ uint32_t characteristicProperties,
+ BluetoothRemoteGATTService*,
+ BluetoothDevice*);
static BluetoothRemoteGATTCharacteristic* create(
ExecutionContext*,
- std::unique_ptr<WebBluetoothRemoteGATTCharacteristicInit>,
- BluetoothRemoteGATTService*);
+ const String& characteristicInstanceId,
+ const String& serviceInstanceId,
+ const String& uuid,
+ uint32_t characteristicProperties,
+ BluetoothRemoteGATTService*,
+ BluetoothDevice*);
// Save value.
void setValue(DOMDataView*);
- // WebBluetoothRemoteGATTCharacteristic interface:
- void dispatchCharacteristicValueChanged(const WebVector<uint8_t>&) override;
+ void dispatchCharacteristicValueChanged(const Vector<uint8_t>& value);
// ContextLifecycleObserver interface.
void contextDestroyed() override;
@@ -77,7 +83,7 @@ class BluetoothRemoteGATTCharacteristic final
// IDL exposed interface:
BluetoothRemoteGATTService* service() { return m_service; }
- String uuid() { return m_webCharacteristic->uuid; }
+ String uuid() { return m_uuid; }
BluetoothCharacteristicProperties* properties() { return m_properties; }
DOMDataView* value() const { return m_value; }
ScriptPromise readValue(ScriptState*);
@@ -93,17 +99,26 @@ class BluetoothRemoteGATTCharacteristic final
RegisteredEventListener&) override;
private:
- friend class ReadValueCallback;
- friend class WriteValueCallback;
- friend class NotificationsCallback;
-
BluetoothRemoteGATTServer* gatt() { return m_service->device()->gatt(); }
- std::unique_ptr<WebBluetoothRemoteGATTCharacteristicInit> m_webCharacteristic;
+ void ReadValueCallback(ScriptPromiseResolver*,
+ mojom::blink::WebBluetoothResult,
+ const Optional<Vector<uint8_t>>& value);
+ void WriteValueCallback(ScriptPromiseResolver*,
+ const Vector<uint8_t>& value,
+ mojom::blink::WebBluetoothResult);
+ void NotificationsCallback(ScriptPromiseResolver*,
+ mojom::blink::WebBluetoothResult);
+
+ const String m_characteristicInstanceId;
+ const String m_serviceInstanceId;
+ const String m_uuid;
+ const uint32_t m_characteristicProperties;
Member<BluetoothRemoteGATTService> m_service;
bool m_stopped;
Member<BluetoothCharacteristicProperties> m_properties;
Member<DOMDataView> m_value;
+ Member<BluetoothDevice> m_device;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698