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

Unified Diff: device/hid/hid_connection_win.h

Issue 2573683002: Fix leak of HID transfers and handles on Windows. (Closed)
Patch Set: Created 4 years 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_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/hid/hid_connection_win.h
diff --git a/device/hid/hid_connection_win.h b/device/hid/hid_connection_win.h
index fe906eb7201b43b5d3b355608393724a9de38b6d..a131f5ce08d7c39f72fdc8cffbd5fe5018c5cbc5 100644
--- a/device/hid/hid_connection_win.h
+++ b/device/hid/hid_connection_win.h
@@ -9,7 +9,7 @@
#include <stddef.h>
#include <stdint.h>
-#include <set>
+#include <list>
#include "base/macros.h"
#include "base/win/scoped_handle.h"
@@ -17,7 +17,7 @@
namespace device {
-struct PendingHidTransfer;
+class PendingHidTransfer;
class HidConnectionWin : public HidConnection {
public:
@@ -26,7 +26,7 @@ class HidConnectionWin : public HidConnection {
private:
friend class HidServiceWin;
- friend struct PendingHidTransfer;
+ friend class PendingHidTransfer;
~HidConnectionWin() override;
@@ -54,9 +54,12 @@ class HidConnectionWin : public HidConnection {
PendingHidTransfer* transfer,
bool signaled);
+ std::unique_ptr<PendingHidTransfer> UnlinkTransfer(
+ PendingHidTransfer* transfer);
+
base::win::ScopedHandle file_;
- std::set<scoped_refptr<PendingHidTransfer> > transfers_;
+ std::list<std::unique_ptr<PendingHidTransfer>> transfers_;
DISALLOW_COPY_AND_ASSIGN(HidConnectionWin);
};
« no previous file with comments | « no previous file | device/hid/hid_connection_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698