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

Unified Diff: device/hid/hid_service_win.cc

Issue 1874313002: Convert device to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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_service_win.h ('k') | device/hid/input_service_linux.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/hid/hid_service_win.cc
diff --git a/device/hid/hid_service_win.cc b/device/hid/hid_service_win.cc
index 93533566c336fc939f7c74d051a176a3f63618e3..b9452dd58e3286c907fdaa8d967696801abd675e 100644
--- a/device/hid/hid_service_win.cc
+++ b/device/hid/hid_service_win.cc
@@ -4,6 +4,8 @@
#include "device/hid/hid_service_win.h"
+#include <memory>
+
#define INITGUID
#include <dbt.h>
@@ -96,7 +98,7 @@ void HidServiceWin::EnumerateOnFileThread(
SetupDiGetDeviceInterfaceDetail(device_info_set, &device_interface_data,
NULL, 0, &required_size, NULL);
- scoped_ptr<SP_DEVICE_INTERFACE_DETAIL_DATA, base::FreeDeleter>
+ std::unique_ptr<SP_DEVICE_INTERFACE_DETAIL_DATA, base::FreeDeleter>
device_interface_detail_data(
static_cast<SP_DEVICE_INTERFACE_DETAIL_DATA*>(malloc(required_size)));
device_interface_detail_data->cbSize =
@@ -129,7 +131,7 @@ void HidServiceWin::CollectInfoFromButtonCaps(
USHORT button_caps_length,
HidCollectionInfo* collection_info) {
if (button_caps_length > 0) {
- scoped_ptr<HIDP_BUTTON_CAPS[]> button_caps(
+ std::unique_ptr<HIDP_BUTTON_CAPS[]> button_caps(
new HIDP_BUTTON_CAPS[button_caps_length]);
if (HidP_GetButtonCaps(report_type,
&button_caps[0],
@@ -152,7 +154,7 @@ void HidServiceWin::CollectInfoFromValueCaps(
USHORT value_caps_length,
HidCollectionInfo* collection_info) {
if (value_caps_length > 0) {
- scoped_ptr<HIDP_VALUE_CAPS[]> value_caps(
+ std::unique_ptr<HIDP_VALUE_CAPS[]> value_caps(
new HIDP_VALUE_CAPS[value_caps_length]);
if (HidP_GetValueCaps(
report_type, &value_caps[0], &value_caps_length, preparsed_data) ==
« no previous file with comments | « device/hid/hid_service_win.h ('k') | device/hid/input_service_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698