OLD | NEW |
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 Loading... |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |