OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "net/quic/quic_stream_factory.h" | 5 #include "net/quic/quic_stream_factory.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 client_socket_factory_->CreateDatagramClientSocket( | 366 client_socket_factory_->CreateDatagramClientSocket( |
367 DatagramSocket::DEFAULT_BIND, base::Bind(&base::RandInt), | 367 DatagramSocket::DEFAULT_BIND, base::Bind(&base::RandInt), |
368 net_log.net_log(), net_log.source()); | 368 net_log.net_log(), net_log.source()); |
369 socket->Connect(addr); | 369 socket->Connect(addr); |
370 socket->GetLocalAddress(&addr); | 370 socket->GetLocalAddress(&addr); |
371 | 371 |
372 QuicConnectionHelper* helper = new QuicConnectionHelper( | 372 QuicConnectionHelper* helper = new QuicConnectionHelper( |
373 MessageLoop::current()->message_loop_proxy(), | 373 MessageLoop::current()->message_loop_proxy(), |
374 clock_.get(), random_generator_, socket); | 374 clock_.get(), random_generator_, socket); |
375 | 375 |
376 QuicConnection* connection = new QuicConnection(guid, addr, helper); | 376 QuicConnection* connection = new QuicConnection(guid, addr, helper, false); |
377 QuicClientSession* session = new QuicClientSession(connection, helper, this, | 377 QuicClientSession* session = new QuicClientSession(connection, helper, this, |
378 host, net_log.net_log()); | 378 host, net_log.net_log()); |
379 all_sessions_.insert(session); // owning pointer | 379 all_sessions_.insert(session); // owning pointer |
380 return session; | 380 return session; |
381 } | 381 } |
382 | 382 |
383 bool QuicStreamFactory::HasActiveJob( | 383 bool QuicStreamFactory::HasActiveJob( |
384 const HostPortProxyPair& host_port_proxy_pair) { | 384 const HostPortProxyPair& host_port_proxy_pair) { |
385 return ContainsKey(active_jobs_, host_port_proxy_pair); | 385 return ContainsKey(active_jobs_, host_port_proxy_pair); |
386 } | 386 } |
387 | 387 |
388 void QuicStreamFactory::ActivateSession( | 388 void QuicStreamFactory::ActivateSession( |
389 const HostPortProxyPair& host_port_proxy_pair, | 389 const HostPortProxyPair& host_port_proxy_pair, |
390 QuicClientSession* session) { | 390 QuicClientSession* session) { |
391 DCHECK(!HasActiveSession(host_port_proxy_pair)); | 391 DCHECK(!HasActiveSession(host_port_proxy_pair)); |
392 active_sessions_[host_port_proxy_pair] = session; | 392 active_sessions_[host_port_proxy_pair] = session; |
393 session_aliases_[session].insert(host_port_proxy_pair); | 393 session_aliases_[session].insert(host_port_proxy_pair); |
394 } | 394 } |
395 | 395 |
396 | 396 |
397 } // namespace net | 397 } // namespace net |
OLD | NEW |