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

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

Issue 2132623002: Landing Recent QUIC changes until 2016-07-02 02:45 UTC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing comment about RPCs Created 4 years, 5 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_chromium_packet_reader.cc ('k') | net/quic/quic_client_session_base.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) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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_client_promised_info.h" 5 #include "net/quic/quic_client_promised_info.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "net/quic/spdy_utils.h" 8 #include "net/quic/spdy_utils.h"
9 9
10 using net::SpdyHeaderBlock; 10 using net::SpdyHeaderBlock;
(...skipping 14 matching lines...) Expand all
25 25
26 void QuicClientPromisedInfo::CleanupAlarm::OnAlarm() { 26 void QuicClientPromisedInfo::CleanupAlarm::OnAlarm() {
27 DVLOG(1) << "self GC alarm for stream " << promised_->id_; 27 DVLOG(1) << "self GC alarm for stream " << promised_->id_;
28 promised_->Reset(QUIC_STREAM_CANCELLED); 28 promised_->Reset(QUIC_STREAM_CANCELLED);
29 } 29 }
30 30
31 void QuicClientPromisedInfo::Init() { 31 void QuicClientPromisedInfo::Init() {
32 cleanup_alarm_.reset(session_->connection()->alarm_factory()->CreateAlarm( 32 cleanup_alarm_.reset(session_->connection()->alarm_factory()->CreateAlarm(
33 new QuicClientPromisedInfo::CleanupAlarm(this))); 33 new QuicClientPromisedInfo::CleanupAlarm(this)));
34 cleanup_alarm_->Set( 34 cleanup_alarm_->Set(
35 session_->connection()->helper()->GetClock()->ApproximateNow().Add( 35 session_->connection()->helper()->GetClock()->ApproximateNow() +
36 QuicTime::Delta::FromSeconds(kPushPromiseTimeoutSecs))); 36 QuicTime::Delta::FromSeconds(kPushPromiseTimeoutSecs));
37 } 37 }
38 38
39 void QuicClientPromisedInfo::OnPromiseHeaders(const SpdyHeaderBlock& headers) { 39 void QuicClientPromisedInfo::OnPromiseHeaders(const SpdyHeaderBlock& headers) {
40 // RFC7540, Section 8.2, requests MUST be safe [RFC7231], Section 40 // RFC7540, Section 8.2, requests MUST be safe [RFC7231], Section
41 // 4.2.1. GET and HEAD are the methods that are safe and required. 41 // 4.2.1. GET and HEAD are the methods that are safe and required.
42 SpdyHeaderBlock::const_iterator it = headers.find(":method"); 42 SpdyHeaderBlock::const_iterator it = headers.find(":method");
43 DCHECK(it != headers.end()); 43 DCHECK(it != headers.end());
44 if (!(it->second == "GET" || it->second == "HEAD")) { 44 if (!(it->second == "GET" || it->second == "HEAD")) {
45 DVLOG(1) << "Promise for stream " << id_ << " has invalid method " 45 DVLOG(1) << "Promise for stream " << id_ << " has invalid method "
46 << it->second; 46 << it->second;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 return FinalValidation(); 114 return FinalValidation();
115 } 115 }
116 116
117 void QuicClientPromisedInfo::Cancel() { 117 void QuicClientPromisedInfo::Cancel() {
118 // Don't fire OnRendezvousResult() for client initiated cancel. 118 // Don't fire OnRendezvousResult() for client initiated cancel.
119 client_request_delegate_ = nullptr; 119 client_request_delegate_ = nullptr;
120 Reset(QUIC_STREAM_CANCELLED); 120 Reset(QUIC_STREAM_CANCELLED);
121 } 121 }
122 122
123 } // namespace net 123 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_chromium_packet_reader.cc ('k') | net/quic/quic_client_session_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698