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

Side by Side Diff: net/tools/quic/quic_simple_server_session.cc

Issue 2481923002: [WIP] make GURL::path() return a StringPiece (Closed)
Patch Set: thanks asan Created 4 years, 1 month 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
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/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
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
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
OLDNEW
« no previous file with comments | « net/tools/quic/quic_in_memory_cache_test.cc ('k') | net/url_request/sdch_dictionary_fetcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698