FreeBSD Bugzilla – Attachment 187829 Details for
Bug 196754
www/chromium: segfaults during login with security key
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
FreeBSD UHID service stub implementation
chrome-freebsd-uhid-stub.diff (text/plain), 3.85 KB, created by
Oleksandr Tymoshenko
on 2017-11-07 21:20:54 UTC
(
hide
)
Description:
FreeBSD UHID service stub implementation
Filename:
MIME Type:
Creator:
Oleksandr Tymoshenko
Created:
2017-11-07 21:20:54 UTC
Size:
3.85 KB
patch
obsolete
>diff --git a/device/hid/BUILD.gn b/device/hid/BUILD.gn >index 6a95817..10e166b 100644 >--- a/device/hid/BUILD.gn >+++ b/device/hid/BUILD.gn >@@ -56,6 +56,17 @@ source_set("hid") { > deps += [ "//device/udev_linux" ] > } > >+ if (is_bsd) { >+ sources -= [ >+ "hid_connection_linux.cc", >+ "hid_connection_linux.h", >+ ] >+ sources += [ >+ "hid_service_freebsd.cc", >+ "hid_service_freebsd.h", >+ ] >+ } >+ > if (is_chromeos) { > deps += [ "//chromeos" ] > } >diff --git a/device/hid/hid_service.cc b/device/hid/hid_service.cc >index f129a97..7e4ee71 100644 >--- a/device/hid/hid_service.cc >+++ b/device/hid/hid_service.cc >@@ -16,6 +16,8 @@ > > #if defined(OS_LINUX) && defined(USE_UDEV) > #include "device/hid/hid_service_linux.h" >+#elif defined(OS_BSD) >+#include "device/hid/hid_service_freebsd.h" > #elif defined(OS_MACOSX) > #include "device/hid/hid_service_mac.h" > #elif defined(OS_WIN) >@@ -42,6 +44,8 @@ constexpr base::TaskTraits HidService::kBlockingTaskTraits; > std::unique_ptr<HidService> HidService::Create() { > #if defined(OS_LINUX) && defined(USE_UDEV) > return base::WrapUnique(new HidServiceLinux()); >+#elif defined(OS_BSD) >+ return base::WrapUnique(new HidServiceFreeBSD()); > #elif defined(OS_MACOSX) > return base::WrapUnique(new HidServiceMac()); > #elif defined(OS_WIN) >diff --git a/device/hid/hid_service_freebsd.cc b/device/hid/hid_service_freebsd.cc >new file mode 100644 >index 0000000..92477af >--- /dev/null >+++ b/device/hid/hid_service_freebsd.cc >@@ -0,0 +1,46 @@ >+// Copyright 2014 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. >+ >+#include "device/hid/hid_service_freebsd.h" >+ >+#include <stdint.h> >+ >+#include <set> >+#include <string> >+#include <vector> >+ >+#include "base/bind.h" >+#include "base/location.h" >+#include "base/logging.h" >+#include "base/single_thread_task_runner.h" >+#include "base/stl_util.h" >+#include "base/strings/stringprintf.h" >+#include "base/strings/sys_string_conversions.h" >+#include "base/task_scheduler/post_task.h" >+#include "base/threading/thread_restrictions.h" >+#include "base/threading/thread_task_runner_handle.h" >+#include "components/device_event_log/device_event_log.h" >+#include "device/hid/hid_connection.h" >+ >+namespace device { >+ >+HidServiceFreeBSD::HidServiceFreeBSD() : weak_factory_(this) { >+ FirstEnumerationComplete(); >+} >+ >+HidServiceFreeBSD::~HidServiceFreeBSD() {} >+ >+void HidServiceFreeBSD::Connect(const HidDeviceId& device_id, >+ const ConnectCallback& callback) { >+ DCHECK(thread_checker_.CalledOnValidThread()); >+ >+ const auto& map_entry = devices().find(device_id); >+ if (map_entry == devices().end()) { >+ base::ThreadTaskRunnerHandle::Get()->PostTask( >+ FROM_HERE, base::Bind(callback, nullptr)); >+ return; >+ } >+} >+ >+} // namespace device >diff --git a/device/hid/hid_service_freebsd.h b/device/hid/hid_service_freebsd.h >new file mode 100644 >index 0000000..ddd85e2 >--- /dev/null >+++ b/device/hid/hid_service_freebsd.h >@@ -0,0 +1,33 @@ >+// Copyright 2014 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 DEVICE_HID_HID_SERVICE_FREEBSD_H_ >+#define DEVICE_HID_HID_SERVICE_FREEBSD_H_ >+ >+#include <string> >+ >+#include "base/macros.h" >+#include "base/memory/ref_counted.h" >+#include "base/memory/weak_ptr.h" >+#include "device/hid/hid_service.h" >+ >+namespace device { >+ >+class HidServiceFreeBSD : public HidService { >+ public: >+ HidServiceFreeBSD(); >+ ~HidServiceFreeBSD() override; >+ >+ void Connect(const HidDeviceId& device_id, >+ const ConnectCallback& connect) override; >+ >+ private: >+ base::WeakPtrFactory<HidServiceFreeBSD> weak_factory_; >+ >+ DISALLOW_COPY_AND_ASSIGN(HidServiceFreeBSD); >+}; >+ >+} // namespace device >+ >+#endif // DEVICE_HID_HID_SERVICE_FREEBSD_H_
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 196754
:
183157
| 187829 |
188231
|
188273
|
188626