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

Side by Side Diff: remoting/host/clipboard_win.cc

Issue 810133003: replace NULL->nullptr in src/remoting. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « remoting/host/clipboard_mac.mm ('k') | remoting/host/clipboard_x11.cc » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "remoting/host/clipboard.h" 5 #include "remoting/host/clipboard.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 // The caller must not close the handle that ::SetClipboardData returns. 81 // The caller must not close the handle that ::SetClipboardData returns.
82 ::SetClipboardData(uFormat, hMem); 82 ::SetClipboardData(uFormat, hMem);
83 } 83 }
84 84
85 // The caller must not free the handle. The caller should lock the handle, 85 // The caller must not free the handle. The caller should lock the handle,
86 // copy the clipboard data, and unlock the handle. All this must be done 86 // copy the clipboard data, and unlock the handle. All this must be done
87 // before this ScopedClipboard is destroyed. 87 // before this ScopedClipboard is destroyed.
88 HANDLE GetData(UINT format) { 88 HANDLE GetData(UINT format) {
89 if (!opened_) { 89 if (!opened_) {
90 NOTREACHED(); 90 NOTREACHED();
91 return NULL; 91 return nullptr;
92 } 92 }
93 return ::GetClipboardData(format); 93 return ::GetClipboardData(format);
94 } 94 }
95 95
96 private: 96 private:
97 bool opened_; 97 bool opened_;
98 }; 98 };
99 99
100 typedef BOOL (WINAPI AddClipboardFormatListenerFn)(HWND); 100 typedef BOOL (WINAPI AddClipboardFormatListenerFn)(HWND);
101 typedef BOOL (WINAPI RemoveClipboardFormatListenerFn)(HWND); 101 typedef BOOL (WINAPI RemoveClipboardFormatListenerFn)(HWND);
(...skipping 25 matching lines...) Expand all
127 AddClipboardFormatListenerFn* add_clipboard_format_listener_; 127 AddClipboardFormatListenerFn* add_clipboard_format_listener_;
128 RemoveClipboardFormatListenerFn* remove_clipboard_format_listener_; 128 RemoveClipboardFormatListenerFn* remove_clipboard_format_listener_;
129 129
130 // Used to subscribe to WM_CLIPBOARDUPDATE messages. 130 // Used to subscribe to WM_CLIPBOARDUPDATE messages.
131 scoped_ptr<base::win::MessageWindow> window_; 131 scoped_ptr<base::win::MessageWindow> window_;
132 132
133 DISALLOW_COPY_AND_ASSIGN(ClipboardWin); 133 DISALLOW_COPY_AND_ASSIGN(ClipboardWin);
134 }; 134 };
135 135
136 ClipboardWin::ClipboardWin() 136 ClipboardWin::ClipboardWin()
137 : add_clipboard_format_listener_(NULL), 137 : add_clipboard_format_listener_(nullptr),
138 remove_clipboard_format_listener_(NULL) { 138 remove_clipboard_format_listener_(nullptr) {
139 } 139 }
140 140
141 void ClipboardWin::Start( 141 void ClipboardWin::Start(
142 scoped_ptr<protocol::ClipboardStub> client_clipboard) { 142 scoped_ptr<protocol::ClipboardStub> client_clipboard) {
143 DCHECK(!add_clipboard_format_listener_); 143 DCHECK(!add_clipboard_format_listener_);
144 DCHECK(!remove_clipboard_format_listener_); 144 DCHECK(!remove_clipboard_format_listener_);
145 DCHECK(!window_); 145 DCHECK(!window_);
146 146
147 client_clipboard_.swap(client_clipboard); 147 client_clipboard_.swap(client_clipboard);
148 148
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 } 275 }
276 276
277 return false; 277 return false;
278 } 278 }
279 279
280 scoped_ptr<Clipboard> Clipboard::Create() { 280 scoped_ptr<Clipboard> Clipboard::Create() {
281 return make_scoped_ptr(new ClipboardWin()); 281 return make_scoped_ptr(new ClipboardWin());
282 } 282 }
283 283
284 } // namespace remoting 284 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/clipboard_mac.mm ('k') | remoting/host/clipboard_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698