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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 net_log.net_log(), net_log.source()); | 371 net_log.net_log(), net_log.source()); |
372 socket->Connect(addr); | 372 socket->Connect(addr); |
373 socket->GetLocalAddress(&addr); | 373 socket->GetLocalAddress(&addr); |
374 | 374 |
375 QuicConnectionHelper* helper = new QuicConnectionHelper( | 375 QuicConnectionHelper* helper = new QuicConnectionHelper( |
376 MessageLoop::current()->message_loop_proxy(), | 376 MessageLoop::current()->message_loop_proxy(), |
377 clock_.get(), random_generator_, socket); | 377 clock_.get(), random_generator_, socket); |
378 | 378 |
379 QuicConnection* connection = new QuicConnection(guid, addr, helper); | 379 QuicConnection* connection = new QuicConnection(guid, addr, helper); |
380 QuicClientSession* session = new QuicClientSession(connection, helper, this, | 380 QuicClientSession* session = new QuicClientSession(connection, helper, this, |
381 host); | 381 host, net_log.net_log()); |
382 all_sessions_.insert(session); // owning pointer | 382 all_sessions_.insert(session); // owning pointer |
383 return session; | 383 return session; |
384 } | 384 } |
385 | 385 |
386 bool QuicStreamFactory::HasActiveJob( | 386 bool QuicStreamFactory::HasActiveJob( |
387 const HostPortProxyPair& host_port_proxy_pair) { | 387 const HostPortProxyPair& host_port_proxy_pair) { |
388 return ContainsKey(active_jobs_, host_port_proxy_pair); | 388 return ContainsKey(active_jobs_, host_port_proxy_pair); |
389 } | 389 } |
390 | 390 |
391 void QuicStreamFactory::ActivateSession( | 391 void QuicStreamFactory::ActivateSession( |
392 const HostPortProxyPair& host_port_proxy_pair, | 392 const HostPortProxyPair& host_port_proxy_pair, |
393 QuicClientSession* session) { | 393 QuicClientSession* session) { |
394 DCHECK(!HasActiveSession(host_port_proxy_pair)); | 394 DCHECK(!HasActiveSession(host_port_proxy_pair)); |
395 active_sessions_[host_port_proxy_pair] = session; | 395 active_sessions_[host_port_proxy_pair] = session; |
396 session_aliases_[session].insert(host_port_proxy_pair); | 396 session_aliases_[session].insert(host_port_proxy_pair); |
397 } | 397 } |
398 | 398 |
399 | 399 |
400 } // namespace net | 400 } // namespace net |
OLD | NEW |