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

Side by Side Diff: webrtc/examples/peerconnection/client/main_wnd.h

Issue 1937693002: Replace scoped_ptr with unique_ptr everywhere (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@unique5
Patch Set: Created 4 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright 2012 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2012 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #ifndef WEBRTC_EXAMPLES_PEERCONNECTION_CLIENT_MAIN_WND_H_ 11 #ifndef WEBRTC_EXAMPLES_PEERCONNECTION_CLIENT_MAIN_WND_H_
12 #define WEBRTC_EXAMPLES_PEERCONNECTION_CLIENT_MAIN_WND_H_ 12 #define WEBRTC_EXAMPLES_PEERCONNECTION_CLIENT_MAIN_WND_H_
13 #pragma once 13 #pragma once
14 14
15 #include <map> 15 #include <map>
16 #include <memory>
16 #include <string> 17 #include <string>
17 18
18 #include "webrtc/api/mediastreaminterface.h" 19 #include "webrtc/api/mediastreaminterface.h"
19 #include "webrtc/base/win32.h" 20 #include "webrtc/base/win32.h"
20 #include "webrtc/examples/peerconnection/client/peer_connection_client.h" 21 #include "webrtc/examples/peerconnection/client/peer_connection_client.h"
21 #include "webrtc/media/base/mediachannel.h" 22 #include "webrtc/media/base/mediachannel.h"
22 #include "webrtc/media/base/videocommon.h" 23 #include "webrtc/media/base/videocommon.h"
23 #include "webrtc/media/base/videoframe.h" 24 #include "webrtc/media/base/videoframe.h"
24 25
25 class MainWndCallback { 26 class MainWndCallback {
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 protected: 125 protected:
125 void SetSize(int width, int height); 126 void SetSize(int width, int height);
126 127
127 enum { 128 enum {
128 SET_SIZE, 129 SET_SIZE,
129 RENDER_FRAME, 130 RENDER_FRAME,
130 }; 131 };
131 132
132 HWND wnd_; 133 HWND wnd_;
133 BITMAPINFO bmi_; 134 BITMAPINFO bmi_;
134 rtc::scoped_ptr<uint8_t[]> image_; 135 std::unique_ptr<uint8_t[]> image_;
135 CRITICAL_SECTION buffer_lock_; 136 CRITICAL_SECTION buffer_lock_;
136 rtc::scoped_refptr<webrtc::VideoTrackInterface> rendered_track_; 137 rtc::scoped_refptr<webrtc::VideoTrackInterface> rendered_track_;
137 }; 138 };
138 139
139 // A little helper class to make sure we always to proper locking and 140 // A little helper class to make sure we always to proper locking and
140 // unlocking when working with VideoRenderer buffers. 141 // unlocking when working with VideoRenderer buffers.
141 template <typename T> 142 template <typename T>
142 class AutoLock { 143 class AutoLock {
143 public: 144 public:
144 explicit AutoLock(T* obj) : obj_(obj) { obj_->Lock(); } 145 explicit AutoLock(T* obj) : obj_(obj) { obj_->Lock(); }
(...skipping 24 matching lines...) Expand all
169 void CreateChildWindow(HWND* wnd, ChildWindowID id, const wchar_t* class_name, 170 void CreateChildWindow(HWND* wnd, ChildWindowID id, const wchar_t* class_name,
170 DWORD control_style, DWORD ex_style); 171 DWORD control_style, DWORD ex_style);
171 void CreateChildWindows(); 172 void CreateChildWindows();
172 173
173 void LayoutConnectUI(bool show); 174 void LayoutConnectUI(bool show);
174 void LayoutPeerListUI(bool show); 175 void LayoutPeerListUI(bool show);
175 176
176 void HandleTabbing(); 177 void HandleTabbing();
177 178
178 private: 179 private:
179 rtc::scoped_ptr<VideoRenderer> local_renderer_; 180 std::unique_ptr<VideoRenderer> local_renderer_;
180 rtc::scoped_ptr<VideoRenderer> remote_renderer_; 181 std::unique_ptr<VideoRenderer> remote_renderer_;
181 UI ui_; 182 UI ui_;
182 HWND wnd_; 183 HWND wnd_;
183 DWORD ui_thread_id_; 184 DWORD ui_thread_id_;
184 HWND edit1_; 185 HWND edit1_;
185 HWND edit2_; 186 HWND edit2_;
186 HWND label1_; 187 HWND label1_;
187 HWND label2_; 188 HWND label2_;
188 HWND button_; 189 HWND button_;
189 HWND listbox_; 190 HWND listbox_;
190 bool destroyed_; 191 bool destroyed_;
191 void* nested_msg_; 192 void* nested_msg_;
192 MainWndCallback* callback_; 193 MainWndCallback* callback_;
193 static ATOM wnd_class_; 194 static ATOM wnd_class_;
194 std::string server_; 195 std::string server_;
195 std::string port_; 196 std::string port_;
196 bool auto_connect_; 197 bool auto_connect_;
197 bool auto_call_; 198 bool auto_call_;
198 }; 199 };
199 #endif // WIN32 200 #endif // WIN32
200 201
201 #endif // WEBRTC_EXAMPLES_PEERCONNECTION_CLIENT_MAIN_WND_H_ 202 #endif // WEBRTC_EXAMPLES_PEERCONNECTION_CLIENT_MAIN_WND_H_
OLDNEW
« no previous file with comments | « webrtc/examples/peerconnection/client/linux/main_wnd.h ('k') | webrtc/examples/peerconnection/client/peer_connection_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698