blob: a4eeeaf83ea2c72023539b56c74c6c73f9fb4f83 [file]
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_BLUETOOTH_BLUETOOTH_MANUFACTURER_DATA_MAP_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_BLUETOOTH_BLUETOOTH_MANUFACTURER_DATA_MAP_H_
#include "third_party/blink/renderer/bindings/core/v8/maplike.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"
#include "third_party/blink/renderer/core/typed_arrays/dom_data_view.h"
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
namespace blink {
class BluetoothManufacturerDataMap final
: public ScriptWrappable,
public Maplike<unsigned short, Member<DOMDataView>> {
DEFINE_WRAPPERTYPEINFO();
public:
using MapType = HashMap<unsigned short, WTF::Vector<unsigned char>>;
explicit BluetoothManufacturerDataMap(const MapType&);
~BluetoothManufacturerDataMap() override;
const MapType& Map() const { return parameter_map_; }
// IDL attributes / methods
uint32_t size() const { return parameter_map_.size(); }
private:
PairIterable<unsigned short, Member<DOMDataView>>::IterationSource*
StartIteration(ScriptState*, ExceptionState&) override;
bool GetMapEntry(ScriptState*,
const unsigned short& key,
Member<DOMDataView>&,
ExceptionState&) override;
const MapType parameter_map_;
};
} // namespace blink
#endif