OLD | NEW |
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 #include "webrtc/examples/peerconnection/client/conductor.h" | 11 #include "webrtc/examples/peerconnection/client/conductor.h" |
12 #include "webrtc/examples/peerconnection/client/flagdefs.h" | 12 #include "webrtc/examples/peerconnection/client/flagdefs.h" |
13 #include "webrtc/examples/peerconnection/client/main_wnd.h" | 13 #include "webrtc/examples/peerconnection/client/main_wnd.h" |
14 #include "webrtc/examples/peerconnection/client/peer_connection_client.h" | 14 #include "webrtc/examples/peerconnection/client/peer_connection_client.h" |
| 15 #include "webrtc/base/checks.h" |
15 #include "webrtc/base/ssladapter.h" | 16 #include "webrtc/base/ssladapter.h" |
16 #include "webrtc/base/win32socketinit.h" | 17 #include "webrtc/base/win32socketinit.h" |
17 #include "webrtc/base/win32socketserver.h" | 18 #include "webrtc/base/win32socketserver.h" |
18 | 19 |
19 | 20 |
20 int PASCAL wWinMain(HINSTANCE instance, HINSTANCE prev_instance, | 21 int PASCAL wWinMain(HINSTANCE instance, HINSTANCE prev_instance, |
21 wchar_t* cmd_line, int cmd_show) { | 22 wchar_t* cmd_line, int cmd_show) { |
22 rtc::EnsureWinsockInit(); | 23 rtc::EnsureWinsockInit(); |
23 rtc::Win32Thread w32_thread; | 24 rtc::Win32Thread w32_thread; |
24 rtc::ThreadManager::Instance()->SetCurrentThread(&w32_thread); | 25 rtc::ThreadManager::Instance()->SetCurrentThread(&w32_thread); |
(...skipping 10 matching lines...) Expand all Loading... |
35 | 36 |
36 // Abort if the user specifies a port that is outside the allowed | 37 // Abort if the user specifies a port that is outside the allowed |
37 // range [1, 65535]. | 38 // range [1, 65535]. |
38 if ((FLAG_port < 1) || (FLAG_port > 65535)) { | 39 if ((FLAG_port < 1) || (FLAG_port > 65535)) { |
39 printf("Error: %i is not a valid port.\n", FLAG_port); | 40 printf("Error: %i is not a valid port.\n", FLAG_port); |
40 return -1; | 41 return -1; |
41 } | 42 } |
42 | 43 |
43 MainWnd wnd(FLAG_server, FLAG_port, FLAG_autoconnect, FLAG_autocall); | 44 MainWnd wnd(FLAG_server, FLAG_port, FLAG_autoconnect, FLAG_autocall); |
44 if (!wnd.Create()) { | 45 if (!wnd.Create()) { |
45 ASSERT(false); | 46 RTC_NOTREACHED(); |
46 return -1; | 47 return -1; |
47 } | 48 } |
48 | 49 |
49 rtc::InitializeSSL(); | 50 rtc::InitializeSSL(); |
50 PeerConnectionClient client; | 51 PeerConnectionClient client; |
51 rtc::scoped_refptr<Conductor> conductor( | 52 rtc::scoped_refptr<Conductor> conductor( |
52 new rtc::RefCountedObject<Conductor>(&client, &wnd)); | 53 new rtc::RefCountedObject<Conductor>(&client, &wnd)); |
53 | 54 |
54 // Main loop. | 55 // Main loop. |
55 MSG msg; | 56 MSG msg; |
(...skipping 11 matching lines...) Expand all Loading... |
67 if (!wnd.PreTranslateMessage(&msg)) { | 68 if (!wnd.PreTranslateMessage(&msg)) { |
68 ::TranslateMessage(&msg); | 69 ::TranslateMessage(&msg); |
69 ::DispatchMessage(&msg); | 70 ::DispatchMessage(&msg); |
70 } | 71 } |
71 } | 72 } |
72 } | 73 } |
73 | 74 |
74 rtc::CleanupSSL(); | 75 rtc::CleanupSSL(); |
75 return 0; | 76 return 0; |
76 } | 77 } |
OLD | NEW |