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

Side by Side Diff: net/websockets/websocket_stream.cc

Issue 152483003: [WebSocket] Add Cache-Control to the request header. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 months 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/websockets/websocket_stream.h" 5 #include "net/websockets/websocket_stream.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "net/http/http_request_headers.h" 9 #include "net/http/http_request_headers.h"
10 #include "net/http/http_status_code.h" 10 #include "net/http/http_status_code.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 headers.SetHeader(HttpRequestHeaders::kConnection, websockets::kUpgrade); 160 headers.SetHeader(HttpRequestHeaders::kConnection, websockets::kUpgrade);
161 headers.SetHeader(HttpRequestHeaders::kOrigin, origin.spec()); 161 headers.SetHeader(HttpRequestHeaders::kOrigin, origin.spec());
162 // TODO(ricea): Move the version number to websocket_handshake_constants.h 162 // TODO(ricea): Move the version number to websocket_handshake_constants.h
163 headers.SetHeader(websockets::kSecWebSocketVersion, 163 headers.SetHeader(websockets::kSecWebSocketVersion,
164 websockets::kSupportedVersion); 164 websockets::kSupportedVersion);
165 request->url_request()->SetExtraRequestHeaders(headers); 165 request->url_request()->SetExtraRequestHeaders(headers);
166 request->url_request()->SetUserData( 166 request->url_request()->SetUserData(
167 WebSocketHandshakeStreamBase::CreateHelper::DataKey(), 167 WebSocketHandshakeStreamBase::CreateHelper::DataKey(),
168 create_helper.release()); 168 create_helper.release());
169 request->url_request()->SetLoadFlags(LOAD_DISABLE_CACHE | 169 request->url_request()->SetLoadFlags(LOAD_DISABLE_CACHE |
170 LOAD_BYPASS_CACHE |
170 LOAD_DO_NOT_PROMPT_FOR_LOGIN); 171 LOAD_DO_NOT_PROMPT_FOR_LOGIN);
171 request->url_request()->Start(); 172 request->url_request()->Start();
172 return request.PassAs<WebSocketStreamRequest>(); 173 return request.PassAs<WebSocketStreamRequest>();
173 } 174 }
174 175
175 } // namespace 176 } // namespace
176 177
177 WebSocketStreamRequest::~WebSocketStreamRequest() {} 178 WebSocketStreamRequest::~WebSocketStreamRequest() {}
178 179
179 WebSocketStream::WebSocketStream() {} 180 WebSocketStream::WebSocketStream() {}
(...skipping 29 matching lines...) Expand all
209 scoped_ptr<WebSocketStream::ConnectDelegate> connect_delegate) { 210 scoped_ptr<WebSocketStream::ConnectDelegate> connect_delegate) {
210 return CreateAndConnectStreamWithCreateHelper(socket_url, 211 return CreateAndConnectStreamWithCreateHelper(socket_url,
211 create_helper.Pass(), 212 create_helper.Pass(),
212 origin, 213 origin,
213 url_request_context, 214 url_request_context,
214 net_log, 215 net_log,
215 connect_delegate.Pass()); 216 connect_delegate.Pass());
216 } 217 }
217 218
218 } // namespace net 219 } // namespace net
OLDNEW
« no previous file with comments | « net/websockets/websocket_handshake_stream_create_helper_test.cc ('k') | net/websockets/websocket_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698