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

Side by Side Diff: jingle/glue/fake_socket_factory.cc

Issue 103143004: Update webrtc/libjingle 5268:5288. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "jingle/glue/fake_socket_factory.h" 5 #include "jingle/glue/fake_socket_factory.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "jingle/glue/utils.h" 9 #include "jingle/glue/utils.h"
10 #include "third_party/libjingle/source/talk/base/asyncpacketsocket.h"
10 #include "third_party/libjingle/source/talk/base/asyncsocket.h" 11 #include "third_party/libjingle/source/talk/base/asyncsocket.h"
11 12
12 namespace jingle_glue { 13 namespace jingle_glue {
13 14
14 FakeUDPPacketSocket::FakeUDPPacketSocket(FakeSocketManager* fake_socket_manager, 15 FakeUDPPacketSocket::FakeUDPPacketSocket(FakeSocketManager* fake_socket_manager,
15 const net::IPEndPoint& address) 16 const net::IPEndPoint& address)
16 : fake_socket_manager_(fake_socket_manager), 17 : fake_socket_manager_(fake_socket_manager),
17 endpoint_(address), state_(IS_OPEN), error_(0) { 18 endpoint_(address), state_(IS_OPEN), error_(0) {
18 CHECK(IPEndPointToSocketAddress(endpoint_, &local_address_)); 19 CHECK(IPEndPointToSocketAddress(endpoint_, &local_address_));
19 fake_socket_manager_->AddSocket(this); 20 fake_socket_manager_->AddSocket(this);
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 DCHECK(CalledOnValidThread()); 107 DCHECK(CalledOnValidThread());
107 108
108 talk_base::SocketAddress address; 109 talk_base::SocketAddress address;
109 if (!jingle_glue::IPEndPointToSocketAddress(from, &address)) { 110 if (!jingle_glue::IPEndPointToSocketAddress(from, &address)) {
110 // We should always be able to convert address here because we 111 // We should always be able to convert address here because we
111 // don't expect IPv6 address on IPv4 connections. 112 // don't expect IPv6 address on IPv4 connections.
112 NOTREACHED(); 113 NOTREACHED();
113 return; 114 return;
114 } 115 }
115 116
116 SignalReadPacket(this, &data[0], data.size(), address); 117 SignalReadPacket(this, &data[0], data.size(), address,
118 talk_base::CreatePacketTime(0));
117 } 119 }
118 120
119 FakeSocketManager::FakeSocketManager() 121 FakeSocketManager::FakeSocketManager()
120 : message_loop_(base::MessageLoop::current()) {} 122 : message_loop_(base::MessageLoop::current()) {}
121 123
122 FakeSocketManager::~FakeSocketManager() { } 124 FakeSocketManager::~FakeSocketManager() { }
123 125
124 void FakeSocketManager::SendPacket(const net::IPEndPoint& from, 126 void FakeSocketManager::SendPacket(const net::IPEndPoint& from,
125 const net::IPEndPoint& to, 127 const net::IPEndPoint& to,
126 const std::vector<char>& data) { 128 const std::vector<char>& data) {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 const talk_base::SocketAddress& local_address, 190 const talk_base::SocketAddress& local_address,
189 const talk_base::SocketAddress& remote_address, 191 const talk_base::SocketAddress& remote_address,
190 const talk_base::ProxyInfo& proxy_info, const std::string& user_agent, 192 const talk_base::ProxyInfo& proxy_info, const std::string& user_agent,
191 int opts) { 193 int opts) {
192 // TODO(sergeyu): Implement fake TCP sockets. 194 // TODO(sergeyu): Implement fake TCP sockets.
193 NOTIMPLEMENTED(); 195 NOTIMPLEMENTED();
194 return NULL; 196 return NULL;
195 } 197 }
196 198
197 } // namespace jingle_glue 199 } // namespace jingle_glue
OLDNEW
« no previous file with comments | « jingle/glue/channel_socket_adapter_unittest.cc ('k') | remoting/client/plugin/pepper_packet_socket_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698