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

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

Issue 2102993002: Fix WebSocket to set first party for cookies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update testRunner calls to setBlockThirdPartyCookies() Created 4 years, 5 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
« no previous file with comments | « net/websockets/websocket_end_to_end_test.cc ('k') | net/websockets/websocket_stream.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef NET_WEBSOCKETS_WEBSOCKET_STREAM_H_ 5 #ifndef NET_WEBSOCKETS_WEBSOCKET_STREAM_H_
6 #define NET_WEBSOCKETS_WEBSOCKET_STREAM_H_ 6 #define NET_WEBSOCKETS_WEBSOCKET_STREAM_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 // the returned WebSocketStreamRequest object will cancel the connection, in 101 // the returned WebSocketStreamRequest object will cancel the connection, in
102 // which case the |connect_delegate| object that the caller passed will be 102 // which case the |connect_delegate| object that the caller passed will be
103 // deleted without any of its methods being called. Unless cancellation is 103 // deleted without any of its methods being called. Unless cancellation is
104 // required, the caller should keep the WebSocketStreamRequest object alive 104 // required, the caller should keep the WebSocketStreamRequest object alive
105 // until connect_delegate->OnSuccess() or OnFailure() have been called, then 105 // until connect_delegate->OnSuccess() or OnFailure() have been called, then
106 // it is safe to delete. 106 // it is safe to delete.
107 static std::unique_ptr<WebSocketStreamRequest> CreateAndConnectStream( 107 static std::unique_ptr<WebSocketStreamRequest> CreateAndConnectStream(
108 const GURL& socket_url, 108 const GURL& socket_url,
109 const std::vector<std::string>& requested_subprotocols, 109 const std::vector<std::string>& requested_subprotocols,
110 const url::Origin& origin, 110 const url::Origin& origin,
111 const GURL& first_party_for_cookies,
111 const std::string& additional_headers, 112 const std::string& additional_headers,
112 URLRequestContext* url_request_context, 113 URLRequestContext* url_request_context,
113 const BoundNetLog& net_log, 114 const BoundNetLog& net_log,
114 std::unique_ptr<ConnectDelegate> connect_delegate); 115 std::unique_ptr<ConnectDelegate> connect_delegate);
115 116
116 // Derived classes must make sure Close() is called when the stream is not 117 // Derived classes must make sure Close() is called when the stream is not
117 // closed on destruction. 118 // closed on destruction.
118 virtual ~WebSocketStream(); 119 virtual ~WebSocketStream();
119 120
120 // Reads WebSocket frame data. This operation finishes when new frame data 121 // Reads WebSocket frame data. This operation finishes when new frame data
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 218
218 // Alternate version of WebSocketStream::CreateAndConnectStream() for testing 219 // Alternate version of WebSocketStream::CreateAndConnectStream() for testing
219 // use only. The differences are the use of a |create_helper| argument in place 220 // use only. The differences are the use of a |create_helper| argument in place
220 // of |requested_subprotocols| and taking |timer| as the handshake timeout 221 // of |requested_subprotocols| and taking |timer| as the handshake timeout
221 // timer. Implemented in websocket_stream.cc. 222 // timer. Implemented in websocket_stream.cc.
222 NET_EXPORT_PRIVATE std::unique_ptr<WebSocketStreamRequest> 223 NET_EXPORT_PRIVATE std::unique_ptr<WebSocketStreamRequest>
223 CreateAndConnectStreamForTesting( 224 CreateAndConnectStreamForTesting(
224 const GURL& socket_url, 225 const GURL& socket_url,
225 std::unique_ptr<WebSocketHandshakeStreamCreateHelper> create_helper, 226 std::unique_ptr<WebSocketHandshakeStreamCreateHelper> create_helper,
226 const url::Origin& origin, 227 const url::Origin& origin,
228 const GURL& first_party_for_cookies,
227 const std::string& additional_headers, 229 const std::string& additional_headers,
228 URLRequestContext* url_request_context, 230 URLRequestContext* url_request_context,
229 const BoundNetLog& net_log, 231 const BoundNetLog& net_log,
230 std::unique_ptr<WebSocketStream::ConnectDelegate> connect_delegate, 232 std::unique_ptr<WebSocketStream::ConnectDelegate> connect_delegate,
231 std::unique_ptr<base::Timer> timer); 233 std::unique_ptr<base::Timer> timer);
232 234
233 } // namespace net 235 } // namespace net
234 236
235 #endif // NET_WEBSOCKETS_WEBSOCKET_STREAM_H_ 237 #endif // NET_WEBSOCKETS_WEBSOCKET_STREAM_H_
OLDNEW
« no previous file with comments | « net/websockets/websocket_end_to_end_test.cc ('k') | net/websockets/websocket_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698