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

Side by Side Diff: webrtc/base/win32socketserver.h

Issue 2828223002: Delete method MessageQueue::set_socketserver (Closed)
Patch Set: Rebase. Created 3 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
« no previous file with comments | « webrtc/base/virtualsocket_unittest.cc ('k') | webrtc/base/win32socketserver.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 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 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
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 struct DnsLookup; 86 struct DnsLookup;
87 DnsLookup * dns_; 87 DnsLookup * dns_;
88 }; 88 };
89 89
90 /////////////////////////////////////////////////////////////////////////////// 90 ///////////////////////////////////////////////////////////////////////////////
91 // Win32SocketServer 91 // Win32SocketServer
92 /////////////////////////////////////////////////////////////////////////////// 92 ///////////////////////////////////////////////////////////////////////////////
93 93
94 class Win32SocketServer : public SocketServer { 94 class Win32SocketServer : public SocketServer {
95 public: 95 public:
96 explicit Win32SocketServer(MessageQueue* message_queue); 96 Win32SocketServer();
97 virtual ~Win32SocketServer(); 97 virtual ~Win32SocketServer();
98 98
99 void set_modeless_dialog(HWND hdlg) { 99 void set_modeless_dialog(HWND hdlg) {
100 hdlg_ = hdlg; 100 hdlg_ = hdlg;
101 } 101 }
102 102
103 // SocketServer Interface 103 // SocketServer Interface
104 virtual Socket* CreateSocket(int type); 104 virtual Socket* CreateSocket(int type);
105 virtual Socket* CreateSocket(int family, int type); 105 virtual Socket* CreateSocket(int family, int type);
106 106
(...skipping 24 matching lines...) Expand all
131 bool posted_; 131 bool posted_;
132 HWND hdlg_; 132 HWND hdlg_;
133 }; 133 };
134 134
135 /////////////////////////////////////////////////////////////////////////////// 135 ///////////////////////////////////////////////////////////////////////////////
136 // Win32Thread. Automatically pumps Windows messages. 136 // Win32Thread. Automatically pumps Windows messages.
137 /////////////////////////////////////////////////////////////////////////////// 137 ///////////////////////////////////////////////////////////////////////////////
138 138
139 class Win32Thread : public Thread { 139 class Win32Thread : public Thread {
140 public: 140 public:
141 Win32Thread() : ss_(this), id_(0) { 141 explicit Win32Thread(SocketServer* ss) : Thread(ss), id_(0) {}
142 set_socketserver(&ss_);
143 }
144 virtual ~Win32Thread() { 142 virtual ~Win32Thread() {
145 Stop(); 143 Stop();
146 set_socketserver(nullptr);
147 } 144 }
148 virtual void Run() { 145 virtual void Run() {
149 id_ = GetCurrentThreadId(); 146 id_ = GetCurrentThreadId();
150 Thread::Run(); 147 Thread::Run();
151 id_ = 0; 148 id_ = 0;
152 } 149 }
153 virtual void Quit() { 150 virtual void Quit() {
154 PostThreadMessage(id_, WM_QUIT, 0, 0); 151 PostThreadMessage(id_, WM_QUIT, 0, 0);
155 } 152 }
156 private: 153 private:
157 Win32SocketServer ss_;
158 DWORD id_; 154 DWORD id_;
159 }; 155 };
160 156
161 /////////////////////////////////////////////////////////////////////////////// 157 ///////////////////////////////////////////////////////////////////////////////
162 158
163 } // namespace rtc 159 } // namespace rtc
164 160
165 #endif // WEBRTC_WIN 161 #endif // WEBRTC_WIN
166 162
167 #endif // WEBRTC_BASE_WIN32SOCKETSERVER_H_ 163 #endif // WEBRTC_BASE_WIN32SOCKETSERVER_H_
OLDNEW
« no previous file with comments | « webrtc/base/virtualsocket_unittest.cc ('k') | webrtc/base/win32socketserver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698