blob: fac5098d9fa589dc1676973d4106e5dfb837aa6a [file] [log] [blame]
// Copyright 2015 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 USBEndpoint_h
#define USBEndpoint_h
#include "bindings/core/v8/ScriptWrappable.h"
#include "platform/heap/Heap.h"
#include "public/platform/modules/webusb/WebUSBDeviceInfo.h"
namespace blink {
class ExceptionState;
class USBAlternateInterface;
class USBEndpoint
: public GarbageCollected<USBEndpoint>
, public ScriptWrappable {
DEFINE_WRAPPERTYPEINFO();
public:
static USBEndpoint* create(const USBAlternateInterface*, size_t endpointIndex);
static USBEndpoint* create(const USBAlternateInterface*, size_t endpointNumber, const String& direction, ExceptionState&);
USBEndpoint(const USBAlternateInterface*, size_t endpointIndex);
const WebUSBDeviceInfo::Endpoint& info() const;
uint8_t endpointNumber() const;
String direction() const;
String type() const;
unsigned packetSize() const;
DECLARE_TRACE();
private:
Member<const USBAlternateInterface> m_alternate;
const size_t m_endpointIndex;
};
} // namespace blink
#endif // USBEndpoint_h