Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2167)

Unified Diff: device/hid/hid_connection_mac.h

Issue 161823002: Clean up HID backend and API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: linux headers Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | device/hid/hid_connection_mac.cc » ('j') | device/hid/hid_connection_mac.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/hid/hid_connection_mac.h
diff --git a/device/hid/hid_connection_mac.h b/device/hid/hid_connection_mac.h
index 730eeae5452a67fc0c93ba6bb3a45bf969cabce0..5447644ea48d5eb23d034af1f80f4f70317eb205 100644
--- a/device/hid/hid_connection_mac.h
+++ b/device/hid/hid_connection_mac.h
@@ -5,12 +5,15 @@
#ifndef DEVICE_HID_HID_CONNECTION_MAC_H_
#define DEVICE_HID_HID_CONNECTION_MAC_H_
-#include "base/callback.h"
+#include <CoreFoundation/CoreFoundation.h>
+#include <IOKit/hid/IOHIDManager.h>
+#include <queue>
Mark Mentovai 2014/02/19 22:48:15 Chrome always puts a blank line between the C syst
Ken Rockot(use gerrit already) 2014/02/21 02:15:36 Done.
+
+#include "base/mac/foundation_util.h"
#include "base/memory/ref_counted.h"
#include "base/tuple.h"
#include "device/hid/hid_connection.h"
#include "device/hid/hid_device_info.h"
-#include "device/hid/hid_service_mac.h"
namespace net {
class IOBuffer;
@@ -18,6 +21,25 @@ class IOBuffer;
namespace device {
+struct PendingHidReport {
+ PendingHidReport();
+ ~PendingHidReport();
+
+ scoped_refptr<net::IOBuffer> buffer;
Mark Mentovai 2014/02/19 22:48:15 net::IOBuffer + size = net::IOBufferWithSize? Sam
Ken Rockot(use gerrit already) 2014/02/21 02:15:36 Done all over the place.
+ size_t size;
+};
+
+struct PendingHidRead {
+ PendingHidRead();
+ ~PendingHidRead();
+
+ scoped_refptr<net::IOBuffer> buffer;
+ size_t size;
+ HidConnection::IOCallback callback;
+};
+
+class HidServiceMac;
+
class HidConnectionMac : public HidConnection {
public:
HidConnectionMac(HidServiceMac* service,
@@ -40,16 +62,16 @@ class HidConnectionMac : public HidConnection {
private:
virtual ~HidConnectionMac();
- static void InputReportCallback(void * context,
+ static void InputReportCallback(void* context,
IOReturn result,
- void * sender,
+ void* sender,
IOHIDReportType type,
- uint32_t reportID,
- uint8_t * report,
+ uint32_t report_id,
+ uint8_t* report_bytes,
CFIndex reportLength);
Mark Mentovai 2014/02/19 22:48:15 report_length. Same on line 75 and in the .cc file
Ken Rockot(use gerrit already) 2014/02/21 02:15:36 Done.
void ProcessReadQueue();
void ProcessInputReport(IOHIDReportType type,
- scoped_refptr<net::IOBuffer> report,
+ scoped_refptr<net::IOBuffer> buffer,
CFIndex reportLength);
void WriteReport(IOHIDReportType type,
@@ -57,16 +79,16 @@ class HidConnectionMac : public HidConnection {
size_t size,
const IOCallback& callback);
+ // The HidService that created this connection. Not owned.
HidServiceMac* service_;
+
scoped_refptr<base::MessageLoopProxy> message_loop_;
+
base::ScopedCFTypeRef<IOHIDDeviceRef> device_;
scoped_ptr_malloc<uint8_t> inbound_buffer_;
Mark Mentovai 2014/02/19 22:48:15 #include "base/memory/scoped_ptr.h" to be able to
Ken Rockot(use gerrit already) 2014/02/21 02:15:36 Done.
- bool disconnected_;
- typedef std::pair<scoped_refptr<net::IOBuffer>, size_t> PendingReport;
- std::queue<PendingReport> input_reports_;
- typedef Tuple3<scoped_refptr<net::IOBuffer>, size_t, IOCallback> PendingRead;
- std::queue<PendingRead> read_queue_;
+ std::queue<PendingHidReport> pending_reports_;
+ std::queue<PendingHidRead> pending_reads_;
DISALLOW_COPY_AND_ASSIGN(HidConnectionMac);
};
« no previous file with comments | « no previous file | device/hid/hid_connection_mac.cc » ('j') | device/hid/hid_connection_mac.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698