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/spdy/spdy_session.h" | 5 #include "net/spdy/spdy_session.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <map> | 9 #include <map> |
10 #include <utility> | 10 #include <utility> |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 public: | 353 public: |
354 explicit SpdyServerPushHelper(base::WeakPtr<SpdySession> session, | 354 explicit SpdyServerPushHelper(base::WeakPtr<SpdySession> session, |
355 const GURL& url) | 355 const GURL& url) |
356 : session_(session), request_url_(url) {} | 356 : session_(session), request_url_(url) {} |
357 | 357 |
358 void Cancel() override { | 358 void Cancel() override { |
359 if (session_) | 359 if (session_) |
360 session_->CancelPush(request_url_); | 360 session_->CancelPush(request_url_); |
361 } | 361 } |
362 | 362 |
363 const GURL& GetURL() override { return request_url_; } | 363 const GURL& GetURL() const override { return request_url_; } |
364 | 364 |
365 private: | 365 private: |
366 base::WeakPtr<SpdySession> session_; | 366 base::WeakPtr<SpdySession> session_; |
367 const GURL request_url_; | 367 const GURL request_url_; |
368 }; | 368 }; |
369 | 369 |
370 } // namespace | 370 } // namespace |
371 | 371 |
372 SpdyProtocolErrorDetails MapFramerErrorToProtocolError( | 372 SpdyProtocolErrorDetails MapFramerErrorToProtocolError( |
373 SpdyFramer::SpdyFramerError err) { | 373 SpdyFramer::SpdyFramerError err) { |
(...skipping 2312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2686 | 2686 |
2687 ActiveStreamMap::iterator active_it = active_streams_.find(stream_id); | 2687 ActiveStreamMap::iterator active_it = active_streams_.find(stream_id); |
2688 if (active_it == active_streams_.end()) { | 2688 if (active_it == active_streams_.end()) { |
2689 NOTREACHED(); | 2689 NOTREACHED(); |
2690 return; | 2690 return; |
2691 } | 2691 } |
2692 | 2692 |
2693 // Notify the push_delegate that a push promise has been received. | 2693 // Notify the push_delegate that a push promise has been received. |
2694 if (push_delegate_) { | 2694 if (push_delegate_) { |
2695 push_delegate_->OnPush(base::MakeUnique<SpdyServerPushHelper>( | 2695 push_delegate_->OnPush(base::MakeUnique<SpdyServerPushHelper>( |
2696 weak_factory_.GetWeakPtr(), gurl)); | 2696 weak_factory_.GetWeakPtr(), gurl), |
| 2697 net_log_); |
2697 } | 2698 } |
2698 | 2699 |
2699 active_it->second->OnPushPromiseHeadersReceived(std::move(headers)); | 2700 active_it->second->OnPushPromiseHeadersReceived(std::move(headers)); |
2700 DCHECK(active_it->second->IsReservedRemote()); | 2701 DCHECK(active_it->second->IsReservedRemote()); |
2701 num_pushed_streams_++; | 2702 num_pushed_streams_++; |
2702 return; | 2703 return; |
2703 } | 2704 } |
2704 | 2705 |
2705 void SpdySession::OnPushPromise(SpdyStreamId stream_id, | 2706 void SpdySession::OnPushPromise(SpdyStreamId stream_id, |
2706 SpdyStreamId promised_stream_id, | 2707 SpdyStreamId promised_stream_id, |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3119 if (!queue->empty()) { | 3120 if (!queue->empty()) { |
3120 SpdyStreamId stream_id = queue->front(); | 3121 SpdyStreamId stream_id = queue->front(); |
3121 queue->pop_front(); | 3122 queue->pop_front(); |
3122 return stream_id; | 3123 return stream_id; |
3123 } | 3124 } |
3124 } | 3125 } |
3125 return 0; | 3126 return 0; |
3126 } | 3127 } |
3127 | 3128 |
3128 } // namespace net | 3129 } // namespace net |
OLD | NEW |