as discussed with robert@ and sthen@, chromium is big, and electron is mostly an independent port, so tieing up dpb twice is no fun, even if electron is slightly smaller. this is mostly a simplified carbon-copy of the www/chromium,electron port. I still want to give it another look before switching to that one.
41 lines
1.2 KiB
C++
41 lines
1.2 KiB
C++
// Copyright 2020 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 SERVICE_DEVICE_HID_HID_SERVICE_FIDO_H_
|
|
#define SERVICE_DEVICE_HID_HID_SERVICE_FIDO_H_
|
|
|
|
#include <string>
|
|
|
|
#include "base/macros.h"
|
|
#include "base/memory/ref_counted.h"
|
|
#include "base/memory/weak_ptr.h"
|
|
#include "services/device/hid/hid_service.h"
|
|
|
|
namespace device {
|
|
|
|
class HidServiceFido : public HidService {
|
|
public:
|
|
HidServiceFido();
|
|
~HidServiceFido() override;
|
|
|
|
void Connect(const std::string &device_guid,
|
|
const ConnectCallback &connect) override;
|
|
base::WeakPtr<HidService> GetWeakPtr() override;
|
|
|
|
private:
|
|
class BlockingTaskHelper;
|
|
const scoped_refptr<base::SequencedTaskRunner> task_runner_;
|
|
const scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_;
|
|
base::WeakPtrFactory<HidServiceFido> weak_factory_;
|
|
// |helper_| lives on the sequence |blocking_task_runner_| posts to and holds
|
|
// a weak reference back to the service that owns it.
|
|
std::unique_ptr<BlockingTaskHelper> helper_;
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(HidServiceFido);
|
|
};
|
|
|
|
} // namespace device
|
|
|
|
#endif // SERVICE_DEVICE_HID_HID_SERVICE_FIDO_H_
|