| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_session_base.h" | 5 #include "net/quic/quic_client_session_base.h" |
| 6 | 6 |
| 7 #include "net/quic/quic_client_promised_info.h" | 7 #include "net/quic/quic_client_promised_info.h" |
| 8 #include "net/quic/quic_flags.h" | 8 #include "net/quic/quic_flags.h" |
| 9 #include "net/quic/spdy_utils.h" | 9 #include "net/quic/spdy_utils.h" |
| 10 | 10 |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 return it->second.get(); | 167 return it->second.get(); |
| 168 } | 168 } |
| 169 return nullptr; | 169 return nullptr; |
| 170 } | 170 } |
| 171 | 171 |
| 172 QuicSpdyStream* QuicClientSessionBase::GetPromisedStream( | 172 QuicSpdyStream* QuicClientSessionBase::GetPromisedStream( |
| 173 const QuicStreamId id) { | 173 const QuicStreamId id) { |
| 174 if (IsClosedStream(id)) { | 174 if (IsClosedStream(id)) { |
| 175 return nullptr; | 175 return nullptr; |
| 176 } | 176 } |
| 177 StreamMap::iterator it = dynamic_streams().find(id); | 177 DynamicStreamMap::iterator it = dynamic_streams().find(id); |
| 178 if (it != dynamic_streams().end()) { | 178 if (it != dynamic_streams().end()) { |
| 179 return static_cast<QuicSpdyStream*>(it->second); | 179 return static_cast<QuicSpdyStream*>(it->second); |
| 180 } | 180 } |
| 181 QUIC_BUG << "Open promised stream " << id << " is missing!"; | 181 QUIC_BUG << "Open promised stream " << id << " is missing!"; |
| 182 return nullptr; | 182 return nullptr; |
| 183 } | 183 } |
| 184 | 184 |
| 185 void QuicClientSessionBase::DeletePromised(QuicClientPromisedInfo* promised) { | 185 void QuicClientSessionBase::DeletePromised(QuicClientPromisedInfo* promised) { |
| 186 push_promise_index_->promised_by_url()->erase(promised->url()); | 186 push_promise_index_->promised_by_url()->erase(promised->url()); |
| 187 // Since promised_by_id_ contains the unique_ptr, this will destroy | 187 // Since promised_by_id_ contains the unique_ptr, this will destroy |
| 188 // promised. | 188 // promised. |
| 189 promised_by_id_.erase(promised->id()); | 189 promised_by_id_.erase(promised->id()); |
| 190 } | 190 } |
| 191 | 191 |
| 192 void QuicClientSessionBase::ResetPromised(QuicStreamId id, | 192 void QuicClientSessionBase::ResetPromised(QuicStreamId id, |
| 193 QuicRstStreamErrorCode error_code) { | 193 QuicRstStreamErrorCode error_code) { |
| 194 SendRstStream(id, error_code, 0); | 194 SendRstStream(id, error_code, 0); |
| 195 if (!IsOpenStream(id)) { | 195 if (!IsOpenStream(id)) { |
| 196 MaybeIncreaseLargestPeerStreamId(id); | 196 MaybeIncreaseLargestPeerStreamId(id); |
| 197 InsertLocallyClosedStreamsHighestOffset(id, 0); | 197 InsertLocallyClosedStreamsHighestOffset(id, 0); |
| 198 } | 198 } |
| 199 } | 199 } |
| 200 | 200 |
| 201 } // namespace net | 201 } // namespace net |
| OLD | NEW |