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

Side by Side Diff: webrtc/p2p/base/basicpacketsocketfactory.cc

Issue 1556743002: Bind a socket to a network if the network handle is set. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fix a compiling issue for Windows Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright 2011 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2011 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/p2p/base/basicpacketsocketfactory.h" 11 #include "webrtc/p2p/base/basicpacketsocketfactory.h"
12 12
13 #include "webrtc/p2p/base/asyncstuntcpsocket.h" 13 #include "webrtc/p2p/base/asyncstuntcpsocket.h"
14 #include "webrtc/p2p/base/stun.h" 14 #include "webrtc/p2p/base/stun.h"
15 #include "webrtc/base/asynctcpsocket.h" 15 #include "webrtc/base/asynctcpsocket.h"
16 #include "webrtc/base/asyncudpsocket.h" 16 #include "webrtc/base/asyncudpsocket.h"
17 #include "webrtc/base/logging.h" 17 #include "webrtc/base/logging.h"
18 #include "webrtc/base/nethelpers.h" 18 #include "webrtc/base/nethelpers.h"
19 #include "webrtc/base/physicalsocketserver.h" 19 #include "webrtc/base/physicalsocketserver.h"
20 #include "webrtc/base/scoped_ptr.h" 20 #include "webrtc/base/scoped_ptr.h"
21 #include "webrtc/base/socketadapters.h" 21 #include "webrtc/base/socketadapters.h"
22 #include "webrtc/base/ssladapter.h" 22 #include "webrtc/base/ssladapter.h"
23 #include "webrtc/base/thread.h" 23 #include "webrtc/base/thread.h"
24 24
25 namespace rtc { 25 namespace rtc {
26 26
27 BasicPacketSocketFactory::BasicPacketSocketFactory() 27 BasicPacketSocketFactory::BasicPacketSocketFactory()
28 : thread_(Thread::Current()), 28 : thread_(Thread::Current()),
29 socket_factory_(NULL) { 29 socket_factory_(NULL) {
30 thread_->socketserver()->MaybeSetNetworkBinder();
30 } 31 }
31 32
32 BasicPacketSocketFactory::BasicPacketSocketFactory(Thread* thread) 33 BasicPacketSocketFactory::BasicPacketSocketFactory(Thread* thread)
33 : thread_(thread), 34 : thread_(thread),
34 socket_factory_(NULL) { 35 socket_factory_(NULL) {
36 thread_->socketserver()->MaybeSetNetworkBinder();
35 } 37 }
36 38
37 BasicPacketSocketFactory::BasicPacketSocketFactory( 39 BasicPacketSocketFactory::BasicPacketSocketFactory(
38 SocketFactory* socket_factory) 40 SocketFactory* socket_factory)
39 : thread_(NULL), 41 : thread_(NULL),
40 socket_factory_(socket_factory) { 42 socket_factory_(socket_factory) {
41 } 43 }
42 44
43 BasicPacketSocketFactory::~BasicPacketSocketFactory() { 45 BasicPacketSocketFactory::~BasicPacketSocketFactory() {
44 } 46 }
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 SocketFactory* BasicPacketSocketFactory::socket_factory() { 202 SocketFactory* BasicPacketSocketFactory::socket_factory() {
201 if (thread_) { 203 if (thread_) {
202 ASSERT(thread_ == Thread::Current()); 204 ASSERT(thread_ == Thread::Current());
203 return thread_->socketserver(); 205 return thread_->socketserver();
204 } else { 206 } else {
205 return socket_factory_; 207 return socket_factory_;
206 } 208 }
207 } 209 }
208 210
209 } // namespace rtc 211 } // namespace rtc
OLDNEW
« webrtc/base/physicalsocketserver.cc ('K') | « webrtc/examples/androidapp/AndroidManifest.xml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698