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

Unified Diff: device/hid/hid_connection_mac.h

Issue 499713002: Don't pass buffers to HidConnection::Read because it knows the size. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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
Index: device/hid/hid_connection_mac.h
diff --git a/device/hid/hid_connection_mac.h b/device/hid/hid_connection_mac.h
index 02dde044d66e5d98302443d8bc231f841cb78dd1..ee3372c11d72d192c60099fc1321c71f633f8957 100644
--- a/device/hid/hid_connection_mac.h
+++ b/device/hid/hid_connection_mac.h
@@ -29,19 +29,16 @@ class HidConnectionMac : public HidConnection {
explicit HidConnectionMac(HidDeviceInfo device_info);
// HidConnection implementation.
- virtual void PlatformRead(scoped_refptr<net::IOBufferWithSize> buffer,
- const IOCallback& callback) OVERRIDE;
- virtual void PlatformWrite(uint8_t report_id,
- scoped_refptr<net::IOBufferWithSize> buffer,
- const IOCallback& callback) OVERRIDE;
- virtual void PlatformGetFeatureReport(
- uint8_t report_id,
- scoped_refptr<net::IOBufferWithSize> buffer,
- const IOCallback& callback) OVERRIDE;
+ virtual void PlatformRead(const ReadCallback& callback) OVERRIDE;
+ virtual void PlatformWrite(scoped_refptr<net::IOBuffer> buffer,
+ size_t size,
+ const WriteCallback& callback) OVERRIDE;
+ virtual void PlatformGetFeatureReport(uint8_t report_id,
+ const ReadCallback& callback) OVERRIDE;
virtual void PlatformSendFeatureReport(
- uint8_t report_id,
- scoped_refptr<net::IOBufferWithSize> buffer,
- const IOCallback& callback) OVERRIDE;
+ scoped_refptr<net::IOBuffer> buffer,
+ size_t size,
+ const WriteCallback& callback) OVERRIDE;
private:
virtual ~HidConnectionMac();
@@ -55,9 +52,9 @@ class HidConnectionMac : public HidConnection {
CFIndex report_length);
void WriteReport(IOHIDReportType type,
- uint8_t report_id,
- scoped_refptr<net::IOBufferWithSize> buffer,
- const IOCallback& callback);
+ scoped_refptr<net::IOBuffer> buffer,
+ size_t size,
+ const WriteCallback& callback);
void Flush();
void ProcessInputReport(scoped_refptr<net::IOBufferWithSize> buffer);
@@ -65,7 +62,7 @@ class HidConnectionMac : public HidConnection {
base::ScopedCFTypeRef<IOHIDDeviceRef> device_;
scoped_refptr<base::MessageLoopProxy> message_loop_;
- scoped_ptr<uint8_t, base::FreeDeleter> inbound_buffer_;
+ scoped_ptr<uint8_t[]> inbound_buffer_;
std::queue<PendingHidReport> pending_reports_;
std::queue<PendingHidRead> pending_reads_;

Powered by Google App Engine
This is Rietveld 408576698