| 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/tools/quic/quic_simple_server_session.h" | 5 #include "net/tools/quic/quic_simple_server_session.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 promised_streams_[index].is_cancelled = true; | 144 promised_streams_[index].is_cancelled = true; |
| 145 connection()->SendRstStream(frame.stream_id, QUIC_RST_ACKNOWLEDGEMENT, 0); | 145 connection()->SendRstStream(frame.stream_id, QUIC_RST_ACKNOWLEDGEMENT, 0); |
| 146 } | 146 } |
| 147 } | 147 } |
| 148 | 148 |
| 149 SpdyHeaderBlock QuicSimpleServerSession::SynthesizePushRequestHeaders( | 149 SpdyHeaderBlock QuicSimpleServerSession::SynthesizePushRequestHeaders( |
| 150 string request_url, | 150 string request_url, |
| 151 QuicInMemoryCache::ServerPushInfo resource, | 151 QuicInMemoryCache::ServerPushInfo resource, |
| 152 const SpdyHeaderBlock& original_request_headers) { | 152 const SpdyHeaderBlock& original_request_headers) { |
| 153 GURL push_request_url = resource.request_url; | 153 GURL push_request_url = resource.request_url; |
| 154 string path = push_request_url.path(); | 154 string path = push_request_url.path().as_string(); |
| 155 | 155 |
| 156 SpdyHeaderBlock spdy_headers = original_request_headers.Clone(); | 156 SpdyHeaderBlock spdy_headers = original_request_headers.Clone(); |
| 157 // :authority could be different from original request. | 157 // :authority could be different from original request. |
| 158 spdy_headers[":authority"] = push_request_url.host(); | 158 spdy_headers[":authority"] = push_request_url.host(); |
| 159 spdy_headers[":path"] = path; | 159 spdy_headers[":path"] = path; |
| 160 // Push request always use GET. | 160 // Push request always use GET. |
| 161 spdy_headers[":method"] = "GET"; | 161 spdy_headers[":method"] = "GET"; |
| 162 spdy_headers["referer"] = request_url; | 162 spdy_headers["referer"] = request_url; |
| 163 spdy_headers[":scheme"] = push_request_url.scheme(); | 163 spdy_headers[":scheme"] = push_request_url.scheme(); |
| 164 // It is not possible to push a response to a request that includes a request | 164 // It is not possible to push a response to a request that includes a request |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 DVLOG(1) << "created server push stream " << promised_stream->id(); | 199 DVLOG(1) << "created server push stream " << promised_stream->id(); |
| 200 | 200 |
| 201 SpdyHeaderBlock request_headers(std::move(promised_info.request_headers)); | 201 SpdyHeaderBlock request_headers(std::move(promised_info.request_headers)); |
| 202 | 202 |
| 203 promised_streams_.pop_front(); | 203 promised_streams_.pop_front(); |
| 204 promised_stream->PushResponse(std::move(request_headers)); | 204 promised_stream->PushResponse(std::move(request_headers)); |
| 205 } | 205 } |
| 206 } | 206 } |
| 207 | 207 |
| 208 } // namespace net | 208 } // namespace net |
| OLD | NEW |