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

Side by Side Diff: net/quic/chromium/quic_chromium_client_session.cc

Issue 2675343002: Server push cancellation: add NetLogs to track cache lookup transaction (Closed)
Patch Set: fix typo Created 3 years, 10 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/log/net_log_source_type_list.h ('k') | net/spdy/server_push_delegate.h » ('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/chromium/quic_chromium_client_session.h" 5 #include "net/quic/chromium/quic_chromium_client_session.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/callback_helpers.h" 9 #include "base/callback_helpers.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 base::WeakPtr<QuicChromiumClientSession> session, 170 base::WeakPtr<QuicChromiumClientSession> session,
171 const GURL& url) 171 const GURL& url)
172 : session_(session), request_url_(url) {} 172 : session_(session), request_url_(url) {}
173 173
174 void Cancel() override { 174 void Cancel() override {
175 if (session_) { 175 if (session_) {
176 session_->CancelPush(request_url_); 176 session_->CancelPush(request_url_);
177 } 177 }
178 } 178 }
179 179
180 const GURL& GetURL() override { return request_url_; } 180 const GURL& GetURL() const override { return request_url_; }
181 181
182 private: 182 private:
183 base::WeakPtr<QuicChromiumClientSession> session_; 183 base::WeakPtr<QuicChromiumClientSession> session_;
184 const GURL request_url_; 184 const GURL request_url_;
185 }; 185 };
186 186
187 } // namespace 187 } // namespace
188 188
189 QuicChromiumClientSession::StreamRequest::StreamRequest() : stream_(nullptr) {} 189 QuicChromiumClientSession::StreamRequest::StreamRequest() : stream_(nullptr) {}
190 190
(...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after
1459 bool QuicChromiumClientSession::HandlePromised(QuicStreamId id, 1459 bool QuicChromiumClientSession::HandlePromised(QuicStreamId id,
1460 QuicStreamId promised_id, 1460 QuicStreamId promised_id,
1461 const SpdyHeaderBlock& headers) { 1461 const SpdyHeaderBlock& headers) {
1462 bool result = QuicClientSessionBase::HandlePromised(id, promised_id, headers); 1462 bool result = QuicClientSessionBase::HandlePromised(id, promised_id, headers);
1463 if (result) { 1463 if (result) {
1464 // The push promise is accepted, notify the push_delegate that a push 1464 // The push promise is accepted, notify the push_delegate that a push
1465 // promise has been received. 1465 // promise has been received.
1466 GURL pushed_url = GetUrlFromHeaderBlock(headers); 1466 GURL pushed_url = GetUrlFromHeaderBlock(headers);
1467 if (push_delegate_) { 1467 if (push_delegate_) {
1468 push_delegate_->OnPush(base::MakeUnique<QuicServerPushHelper>( 1468 push_delegate_->OnPush(base::MakeUnique<QuicServerPushHelper>(
1469 weak_factory_.GetWeakPtr(), pushed_url)); 1469 weak_factory_.GetWeakPtr(), pushed_url),
1470 net_log_);
1470 } 1471 }
1471 } 1472 }
1472 net_log_.AddEvent(NetLogEventType::QUIC_SESSION_PUSH_PROMISE_RECEIVED, 1473 net_log_.AddEvent(NetLogEventType::QUIC_SESSION_PUSH_PROMISE_RECEIVED,
1473 base::Bind(&NetLogQuicPushPromiseReceivedCallback, &headers, 1474 base::Bind(&NetLogQuicPushPromiseReceivedCallback, &headers,
1474 id, promised_id)); 1475 id, promised_id));
1475 return result; 1476 return result;
1476 } 1477 }
1477 1478
1478 void QuicChromiumClientSession::DeletePromised( 1479 void QuicChromiumClientSession::DeletePromised(
1479 QuicClientPromisedInfo* promised) { 1480 QuicClientPromisedInfo* promised) {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
1520 } 1521 }
1521 1522
1522 size_t QuicChromiumClientSession::EstimateMemoryUsage() const { 1523 size_t QuicChromiumClientSession::EstimateMemoryUsage() const {
1523 // TODO(xunjieli): Estimate |crypto_stream_|, QuicSpdySession's 1524 // TODO(xunjieli): Estimate |crypto_stream_|, QuicSpdySession's
1524 // QuicHeaderList, QuicSession's QuiCWriteBlockedList, open streams and 1525 // QuicHeaderList, QuicSession's QuiCWriteBlockedList, open streams and
1525 // unacked packet map. 1526 // unacked packet map.
1526 return base::trace_event::EstimateMemoryUsage(packet_readers_); 1527 return base::trace_event::EstimateMemoryUsage(packet_readers_);
1527 } 1528 }
1528 1529
1529 } // namespace net 1530 } // namespace net
OLDNEW
« no previous file with comments | « net/log/net_log_source_type_list.h ('k') | net/spdy/server_push_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698