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

Unified Diff: device/hid/hid_connection_win.cc

Issue 825523003: Convert HidDeviceInfo from a struct to a refcounted class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added TODO to remove friend class definitions. Created 5 years, 11 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 | « device/hid/hid_connection_win.h ('k') | device/hid/hid_device_filter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/hid/hid_connection_win.cc
diff --git a/device/hid/hid_connection_win.cc b/device/hid/hid_connection_win.cc
index 5db7ed4c570b06e3b3ccf2e7060ff2f97be40240..a0c8a506b954079c41acd10c988290ad4ef3efbf 100644
--- a/device/hid/hid_connection_win.cc
+++ b/device/hid/hid_connection_win.cc
@@ -102,7 +102,7 @@ void PendingHidTransfer::WillDestroyCurrentMessageLoop() {
callback_.Run(this, false);
}
-HidConnectionWin::HidConnectionWin(const HidDeviceInfo& device_info,
+HidConnectionWin::HidConnectionWin(scoped_refptr<HidDeviceInfo> device_info,
base::win::ScopedHandle file)
: HidConnection(device_info) {
file_ = file.Pass();
@@ -120,7 +120,7 @@ void HidConnectionWin::PlatformRead(
// Windows will always include the report ID (including zero if report IDs
// are not in use) in the buffer.
scoped_refptr<net::IOBufferWithSize> buffer = new net::IOBufferWithSize(
- base::checked_cast<int>(device_info().max_input_report_size + 1));
+ base::checked_cast<int>(device_info()->max_input_report_size() + 1));
scoped_refptr<PendingHidTransfer> transfer(new PendingHidTransfer(
buffer,
base::Bind(&HidConnectionWin::OnReadComplete, this, buffer, callback)));
@@ -152,7 +152,7 @@ void HidConnectionWin::PlatformGetFeatureReport(uint8_t report_id,
const ReadCallback& callback) {
// The first byte of the destination buffer is the report ID being requested.
scoped_refptr<net::IOBufferWithSize> buffer = new net::IOBufferWithSize(
- base::checked_cast<int>(device_info().max_feature_report_size + 1));
+ base::checked_cast<int>(device_info()->max_feature_report_size() + 1));
buffer->data()[0] = report_id;
scoped_refptr<PendingHidTransfer> transfer(new PendingHidTransfer(
« no previous file with comments | « device/hid/hid_connection_win.h ('k') | device/hid/hid_device_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698