diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/modules/bluetooth/bluetooth_advertising_event.cc')
-rw-r--r-- | chromium/third_party/blink/renderer/modules/bluetooth/bluetooth_advertising_event.cc | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/chromium/third_party/blink/renderer/modules/bluetooth/bluetooth_advertising_event.cc b/chromium/third_party/blink/renderer/modules/bluetooth/bluetooth_advertising_event.cc index 11449f590ab..e26586d55af 100644 --- a/chromium/third_party/blink/renderer/modules/bluetooth/bluetooth_advertising_event.cc +++ b/chromium/third_party/blink/renderer/modules/bluetooth/bluetooth_advertising_event.cc @@ -3,6 +3,7 @@ // found in the LICENSE file. #include "third_party/blink/renderer/modules/bluetooth/bluetooth_advertising_event.h" + #include "third_party/blink/renderer/bindings/modules/v8/string_or_unsigned_long.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_bluetooth_advertising_event_init.h" #include "third_party/blink/renderer/core/dom/dom_exception.h" @@ -29,26 +30,27 @@ BluetoothAdvertisingEvent::BluetoothAdvertisingEvent( BluetoothAdvertisingEvent::BluetoothAdvertisingEvent( const AtomicString& event_type, BluetoothDevice* device, - const String& name, - const HeapVector<StringOrUnsignedLong>& uuids, - base::Optional<uint16_t> appearance, - base::Optional<int8_t> txPower, - base::Optional<int8_t> rssi, - BluetoothManufacturerDataMap* manufacturerData, - BluetoothServiceDataMap* serviceData) + mojom::blink::WebBluetoothAdvertisingEventPtr advertising_event) : Event(event_type, Bubbles::kYes, Cancelable::kYes), device_(std::move(device)), - name_(name), - uuids_(uuids), - appearance_(appearance), - txPower_(txPower), - rssi_(rssi), - manufacturer_data_map_(manufacturerData), - service_data_map_(serviceData) {} + name_(advertising_event->name), + appearance_(advertising_event->appearance), + txPower_(advertising_event->tx_power), + rssi_(advertising_event->rssi), + manufacturer_data_map_(MakeGarbageCollected<BluetoothManufacturerDataMap>( + advertising_event->manufacturer_data)), + service_data_map_(MakeGarbageCollected<BluetoothServiceDataMap>( + advertising_event->service_data)) { + for (const String& uuid : advertising_event->uuids) { + StringOrUnsignedLong value; + value.SetString(uuid); + uuids_.push_back(value); + } +} // namespace blink BluetoothAdvertisingEvent::~BluetoothAdvertisingEvent() {} -void BluetoothAdvertisingEvent::Trace(Visitor* visitor) { +void BluetoothAdvertisingEvent::Trace(Visitor* visitor) const { visitor->Trace(device_); visitor->Trace(uuids_); visitor->Trace(manufacturer_data_map_); |