OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "device/hid/hid_connection_win.h" | 5 #include "device/hid/hid_connection_win.h" |
6 | 6 |
7 #include <cstring> | 7 #include <cstring> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 watcher_.StartWatching(event_.Get(), this); | 84 watcher_.StartWatching(event_.Get(), this); |
85 } else { | 85 } else { |
86 VPLOG(1) << "HID transfer failed"; | 86 VPLOG(1) << "HID transfer failed"; |
87 callback_.Run(this, false); | 87 callback_.Run(this, false); |
88 } | 88 } |
89 } | 89 } |
90 | 90 |
91 void PendingHidTransfer::OnObjectSignaled(HANDLE event_handle) { | 91 void PendingHidTransfer::OnObjectSignaled(HANDLE event_handle) { |
92 // TODO(vadimt): Remove ScopedTracker below once crbug.com/418183 is fixed. | 92 // TODO(vadimt): Remove ScopedTracker below once crbug.com/418183 is fixed. |
93 tracked_objects::ScopedTracker tracking_profile( | 93 tracked_objects::ScopedTracker tracking_profile( |
94 FROM_HERE_WITH_EXPLICIT_FUNCTION("PendingHidTransfer_OnObjectSignaled")); | 94 FROM_HERE_WITH_EXPLICIT_FUNCTION( |
| 95 "418183 PendingHidTransfer::OnObjectSignaled")); |
95 | 96 |
96 callback_.Run(this, true); | 97 callback_.Run(this, true); |
97 Release(); | 98 Release(); |
98 } | 99 } |
99 | 100 |
100 void PendingHidTransfer::WillDestroyCurrentMessageLoop() { | 101 void PendingHidTransfer::WillDestroyCurrentMessageLoop() { |
101 watcher_.StopWatching(); | 102 watcher_.StopWatching(); |
102 callback_.Run(this, false); | 103 callback_.Run(this, false); |
103 } | 104 } |
104 | 105 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 if (GetOverlappedResult( | 242 if (GetOverlappedResult( |
242 file_.Get(), transfer->GetOverlapped(), &bytes_transferred, FALSE)) { | 243 file_.Get(), transfer->GetOverlapped(), &bytes_transferred, FALSE)) { |
243 callback.Run(true); | 244 callback.Run(true); |
244 } else { | 245 } else { |
245 VPLOG(1) << "HID write failed"; | 246 VPLOG(1) << "HID write failed"; |
246 callback.Run(false); | 247 callback.Run(false); |
247 } | 248 } |
248 } | 249 } |
249 | 250 |
250 } // namespace device | 251 } // namespace device |
OLD | NEW |