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

Side by Side Diff: device/hid/hid_connection_win.cc

Issue 1107433002: Update {virtual,override} to follow C++11 style in device. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync and git cl format Created 5 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 unified diff | Download patch
« no previous file with comments | « device/hid/hid_connection_win.h ('k') | device/hid/hid_service_win.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 22 matching lines...) Expand all
33 typedef base::Callback<void(PendingHidTransfer*, bool)> Callback; 33 typedef base::Callback<void(PendingHidTransfer*, bool)> Callback;
34 34
35 PendingHidTransfer(scoped_refptr<net::IOBuffer> buffer, 35 PendingHidTransfer(scoped_refptr<net::IOBuffer> buffer,
36 const Callback& callback); 36 const Callback& callback);
37 37
38 void TakeResultFromWindowsAPI(BOOL result); 38 void TakeResultFromWindowsAPI(BOOL result);
39 39
40 OVERLAPPED* GetOverlapped() { return &overlapped_; } 40 OVERLAPPED* GetOverlapped() { return &overlapped_; }
41 41
42 // Implements base::win::ObjectWatcher::Delegate. 42 // Implements base::win::ObjectWatcher::Delegate.
43 virtual void OnObjectSignaled(HANDLE object) override; 43 void OnObjectSignaled(HANDLE object) override;
44 44
45 // Implements base::MessageLoop::DestructionObserver 45 // Implements base::MessageLoop::DestructionObserver
46 virtual void WillDestroyCurrentMessageLoop() override; 46 void WillDestroyCurrentMessageLoop() override;
47 47
48 // The buffer isn't used by this object but it's important that a reference 48 // The buffer isn't used by this object but it's important that a reference
49 // to it is held until the transfer completes. 49 // to it is held until the transfer completes.
50 scoped_refptr<net::IOBuffer> buffer_; 50 scoped_refptr<net::IOBuffer> buffer_;
51 Callback callback_; 51 Callback callback_;
52 OVERLAPPED overlapped_; 52 OVERLAPPED overlapped_;
53 base::win::ScopedHandle event_; 53 base::win::ScopedHandle event_;
54 base::win::ObjectWatcher watcher_; 54 base::win::ObjectWatcher watcher_;
55 55
56 private: 56 private:
57 friend class base::RefCounted<PendingHidTransfer>; 57 friend class base::RefCounted<PendingHidTransfer>;
58 58
59 virtual ~PendingHidTransfer(); 59 ~PendingHidTransfer() override;
60 60
61 DISALLOW_COPY_AND_ASSIGN(PendingHidTransfer); 61 DISALLOW_COPY_AND_ASSIGN(PendingHidTransfer);
62 }; 62 };
63 63
64 PendingHidTransfer::PendingHidTransfer( 64 PendingHidTransfer::PendingHidTransfer(
65 scoped_refptr<net::IOBuffer> buffer, 65 scoped_refptr<net::IOBuffer> buffer,
66 const PendingHidTransfer::Callback& callback) 66 const PendingHidTransfer::Callback& callback)
67 : buffer_(buffer), 67 : buffer_(buffer),
68 callback_(callback), 68 callback_(callback),
69 event_(CreateEvent(NULL, FALSE, FALSE, NULL)) { 69 event_(CreateEvent(NULL, FALSE, FALSE, NULL)) {
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 if (GetOverlappedResult( 248 if (GetOverlappedResult(
249 file_.Get(), transfer->GetOverlapped(), &bytes_transferred, FALSE)) { 249 file_.Get(), transfer->GetOverlapped(), &bytes_transferred, FALSE)) {
250 callback.Run(true); 250 callback.Run(true);
251 } else { 251 } else {
252 HID_PLOG(EVENT) << "HID write failed"; 252 HID_PLOG(EVENT) << "HID write failed";
253 callback.Run(false); 253 callback.Run(false);
254 } 254 }
255 } 255 }
256 256
257 } // namespace device 257 } // namespace device
OLDNEW
« no previous file with comments | « device/hid/hid_connection_win.h ('k') | device/hid/hid_service_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698