Windows should animate when they are about to get docked at screen edges.
[chromium-blink-merge.git] / net / tools / quic / quic_client_session.cc
blobc41df6702b59502c221e022cb220b0aec87cf935
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
3 // found in the LICENSE file.
5 #include "net/tools/quic/quic_client_session.h"
7 #include "base/logging.h"
8 #include "net/quic/crypto/crypto_protocol.h"
9 #include "net/tools/quic/quic_reliable_client_stream.h"
10 #include "net/tools/quic/quic_spdy_client_stream.h"
12 using std::string;
14 namespace net {
15 namespace tools {
17 QuicClientSession::QuicClientSession(
18 const string& server_hostname,
19 const QuicConfig& config,
20 QuicConnection* connection,
21 QuicCryptoClientConfig* crypto_config)
22 : QuicSession(connection, config, false),
23 crypto_stream_(server_hostname, this, crypto_config) {
26 QuicClientSession::~QuicClientSession() {
29 QuicReliableClientStream* QuicClientSession::CreateOutgoingReliableStream() {
30 if (!crypto_stream_.encryption_established()) {
31 DLOG(INFO) << "Encryption not active so no outgoing stream created.";
32 return NULL;
34 if (GetNumOpenStreams() >= get_max_open_streams()) {
35 DLOG(INFO) << "Failed to create a new outgoing stream. "
36 << "Already " << GetNumOpenStreams() << " open.";
37 return NULL;
39 if (goaway_received()) {
40 DLOG(INFO) << "Failed to create a new outgoing stream. "
41 << "Already received goaway.";
42 return NULL;
44 QuicReliableClientStream* stream
45 = new QuicSpdyClientStream(GetNextStreamId(), this);
46 ActivateStream(stream);
47 return stream;
50 QuicCryptoClientStream* QuicClientSession::GetCryptoStream() {
51 return &crypto_stream_;
54 bool QuicClientSession::CryptoConnect() {
55 return crypto_stream_.CryptoConnect();
58 ReliableQuicStream* QuicClientSession::CreateIncomingReliableStream(
59 QuicStreamId id) {
60 DLOG(ERROR) << "Server push not supported";
61 return NULL;
64 } // namespace tools
65 } // namespace net