chromium/third_party/blink/renderer/modules/hid/hid.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/modules/hid/hid.h"

#include <utility>

#include "third_party/blink/public/mojom/permissions_policy/permissions_policy.mojom-blink.h"
#include "third_party/blink/public/mojom/service_worker/service_worker.mojom-blink.h"
#include "third_party/blink/public/platform/browser_interface_broker_proxy.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_hid_device_filter.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_hid_device_request_options.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/dom_exception.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/execution_context/navigator_base.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/modules/event_target_modules.h"
#include "third_party/blink/renderer/modules/hid/hid_connection_event.h"
#include "third_party/blink/renderer/modules/hid/hid_device.h"
#include "third_party/blink/renderer/modules/service_worker/service_worker_global_scope.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"

namespace blink {

namespace {

const char kContextGone[] =;
const char kFeaturePolicyBlocked[] =;

// Carries out basic checks for the web-exposed APIs, to make sure the minimum
// requirements for them to be served are met. Returns true if any conditions
// fail to be met, generating an appropriate exception as well. Otherwise,
// returns false to indicate the call should be allowed.
bool ShouldBlockHidServiceCall(LocalDOMWindow* window,
                               ExecutionContext* context,
                               ExceptionState* exception_state) {}

void RejectWithTypeError(const String& message,
                         ScriptPromiseResolverBase* resolver) {}

}  // namespace

const char HID::kSupplementName[] =;

HID* HID::hid(NavigatorBase& navigator) {}

HID::HID(NavigatorBase& navigator)
    :{}

HID::~HID() {}

ExecutionContext* HID::GetExecutionContext() const {}

const AtomicString& HID::InterfaceName() const {}

void HID::AddedEventListener(const AtomicString& event_type,
                             RegisteredEventListener& listener) {}

void HID::DeviceAdded(device::mojom::blink::HidDeviceInfoPtr device_info) {}

void HID::DeviceRemoved(device::mojom::blink::HidDeviceInfoPtr device_info) {}

void HID::DeviceChanged(device::mojom::blink::HidDeviceInfoPtr device_info) {}

ScriptPromise<IDLSequence<HIDDevice>> HID::getDevices(
    ScriptState* script_state,
    ExceptionState& exception_state) {}

ScriptPromise<IDLSequence<HIDDevice>> HID::requestDevice(
    ScriptState* script_state,
    const HIDDeviceRequestOptions* options,
    ExceptionState& exception_state) {}

void HID::Connect(
    const String& device_guid,
    mojo::PendingRemote<device::mojom::blink::HidConnectionClient> client,
    device::mojom::blink::HidManager::ConnectCallback callback) {}

void HID::Forget(device::mojom::blink::HidDeviceInfoPtr device_info,
                 mojom::blink::HidService::ForgetCallback callback) {}

HIDDevice* HID::GetOrCreateDevice(device::mojom::blink::HidDeviceInfoPtr info) {}

void HID::FinishGetDevices(
    HIDDeviceResolver* resolver,
    Vector<device::mojom::blink::HidDeviceInfoPtr> device_infos) {}

void HID::FinishRequestDevice(
    HIDDeviceResolver* resolver,
    Vector<device::mojom::blink::HidDeviceInfoPtr> device_infos) {}

void HID::EnsureServiceConnection() {}

void HID::CloseServiceConnection() {}

mojom::blink::HidDeviceFilterPtr HID::ConvertDeviceFilter(
    const HIDDeviceFilter& filter) {}

String HID::CheckDeviceFilterValidity(const HIDDeviceFilter& filter) {}

void HID::Trace(Visitor* visitor) const {}

}  // namespace blink