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

Side by Side Diff: net/quic/quic_http_stream.cc

Issue 1393713003: Remove insecure QUIC support from Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 2 months 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
« no previous file with comments | « net/quic/quic_end_to_end_unittest.cc ('k') | net/quic/quic_network_transaction_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_http_stream.h" 5 #include "net/quic/quic_http_stream.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/metrics/histogram_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "net/base/io_buffer.h" 10 #include "net/base/io_buffer.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 const CompletionCallback& callback) { 59 const CompletionCallback& callback) {
60 DCHECK(!stream_); 60 DCHECK(!stream_);
61 if (!session_) 61 if (!session_)
62 return was_handshake_confirmed_ ? ERR_CONNECTION_CLOSED : 62 return was_handshake_confirmed_ ? ERR_CONNECTION_CLOSED :
63 ERR_QUIC_HANDSHAKE_FAILED; 63 ERR_QUIC_HANDSHAKE_FAILED;
64 64
65 stream_net_log.AddEvent( 65 stream_net_log.AddEvent(
66 NetLog::TYPE_HTTP_STREAM_REQUEST_BOUND_TO_QUIC_SESSION, 66 NetLog::TYPE_HTTP_STREAM_REQUEST_BOUND_TO_QUIC_SESSION,
67 session_->net_log().source().ToEventParametersCallback()); 67 session_->net_log().source().ToEventParametersCallback());
68 68
69 if (request_info->url.SchemeIsCryptographic()) {
70 SSLInfo ssl_info;
71 bool secure_session =
72 session_->GetSSLInfo(&ssl_info) && ssl_info.cert.get();
73 UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.SecureResourceSecureSession",
74 secure_session);
75 if (!secure_session)
76 return ERR_REQUEST_FOR_SECURE_RESOURCE_OVER_INSECURE_QUIC;
77 }
78
79 stream_net_log_ = stream_net_log; 69 stream_net_log_ = stream_net_log;
80 request_info_ = request_info; 70 request_info_ = request_info;
81 request_time_ = base::Time::Now(); 71 request_time_ = base::Time::Now();
82 priority_ = priority; 72 priority_ = priority;
83 73
84 int rv = stream_request_.StartRequest( 74 int rv = stream_request_.StartRequest(
85 session_, &stream_, base::Bind(&QuicHttpStream::OnStreamReady, 75 session_, &stream_, base::Bind(&QuicHttpStream::OnStreamReady,
86 weak_factory_.GetWeakPtr())); 76 weak_factory_.GetWeakPtr()));
87 if (rv == ERR_IO_PENDING) { 77 if (rv == ERR_IO_PENDING) {
88 callback_ = callback; 78 callback_ = callback;
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 closed_stream_sent_bytes_ = stream_->stream_bytes_written(); 548 closed_stream_sent_bytes_ = stream_->stream_bytes_written();
559 stream_ = nullptr; 549 stream_ = nullptr;
560 550
561 // If |request_body_stream_| is non-NULL, Reset it, to abort any in progress 551 // If |request_body_stream_| is non-NULL, Reset it, to abort any in progress
562 // read. 552 // read.
563 if (request_body_stream_) 553 if (request_body_stream_)
564 request_body_stream_->Reset(); 554 request_body_stream_->Reset();
565 } 555 }
566 556
567 } // namespace net 557 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_end_to_end_unittest.cc ('k') | net/quic/quic_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698