Check USB device path access when prompting users to select a device.
[chromium-blink-merge.git] / net / tools / quic / quic_client_session.cc
blob92eec0415df0840d686f19f746973183d6f83dde
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/quic/quic_server_id.h"
10 #include "net/tools/quic/quic_spdy_client_stream.h"
12 using std::string;
14 namespace net {
15 namespace tools {
17 QuicClientSession::QuicClientSession(const QuicConfig& config,
18 QuicConnection* connection)
19 : QuicClientSessionBase(connection, config), respect_goaway_(true) {
22 QuicClientSession::~QuicClientSession() {
25 void QuicClientSession::InitializeSession(
26 const QuicServerId& server_id,
27 QuicCryptoClientConfig* crypto_config) {
28 crypto_stream_.reset(
29 new QuicCryptoClientStream(server_id, this, nullptr, crypto_config));
30 QuicClientSessionBase::InitializeSession();
33 void QuicClientSession::OnProofValid(
34 const QuicCryptoClientConfig::CachedState& /*cached*/) {}
36 void QuicClientSession::OnProofVerifyDetailsAvailable(
37 const ProofVerifyDetails& /*verify_details*/) {}
39 QuicSpdyClientStream* QuicClientSession::CreateOutgoingDataStream() {
40 if (!crypto_stream_->encryption_established()) {
41 DVLOG(1) << "Encryption not active so no outgoing stream created.";
42 return nullptr;
44 if (GetNumOpenStreams() >= get_max_open_streams()) {
45 DVLOG(1) << "Failed to create a new outgoing stream. "
46 << "Already " << GetNumOpenStreams() << " open.";
47 return nullptr;
49 if (goaway_received() && respect_goaway_) {
50 DVLOG(1) << "Failed to create a new outgoing stream. "
51 << "Already received goaway.";
52 return nullptr;
54 QuicSpdyClientStream* stream
55 = new QuicSpdyClientStream(GetNextStreamId(), this);
56 ActivateStream(stream);
57 return stream;
60 QuicCryptoClientStream* QuicClientSession::GetCryptoStream() {
61 return crypto_stream_.get();
64 void QuicClientSession::CryptoConnect() {
65 DCHECK(flow_controller());
66 crypto_stream_->CryptoConnect();
69 int QuicClientSession::GetNumSentClientHellos() const {
70 return crypto_stream_->num_sent_client_hellos();
73 QuicDataStream* QuicClientSession::CreateIncomingDataStream(
74 QuicStreamId id) {
75 DLOG(ERROR) << "Server push not supported";
76 return nullptr;
79 } // namespace tools
80 } // namespace net