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

Side by Side Diff: content/browser/renderer_host/websocket_host.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
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 #ifndef CONTENT_BROWSER_RENDERER_HOST_WEBSOCKET_HOST_H_ 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_WEBSOCKET_HOST_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_WEBSOCKET_HOST_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_WEBSOCKET_HOST_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <string> 11 #include <string>
12 #include <vector> 12 #include <vector>
13 13
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "base/time/time.h" 16 #include "base/time/time.h"
17 #include "content/common/content_export.h" 17 #include "content/common/content_export.h"
18 #include "content/common/websocket.h" 18 #include "content/common/websocket.h"
19 19
20 class GURL; 20 class GURL;
21 struct WebSocketHostMsg_AddChannelRequest_Params;
21 22
22 namespace url { 23 namespace url {
23 class Origin; 24 class Origin;
24 } // namespace url 25 } // namespace url
25 26
26 namespace net { 27 namespace net {
27 class WebSocketChannel; 28 class WebSocketChannel;
28 class URLRequestContext; 29 class URLRequestContext;
29 } // namespace net 30 } // namespace net
30 31
(...skipping 28 matching lines...) Expand all
59 60
60 bool handshake_succeeded() const { return handshake_succeeded_; } 61 bool handshake_succeeded() const { return handshake_succeeded_; }
61 void OnHandshakeSucceeded() { handshake_succeeded_ = true; } 62 void OnHandshakeSucceeded() { handshake_succeeded_ = true; }
62 63
63 private: 64 private:
64 class WebSocketEventHandler; 65 class WebSocketEventHandler;
65 66
66 // Handlers for each message type, dispatched by OnMessageReceived(), as 67 // Handlers for each message type, dispatched by OnMessageReceived(), as
67 // defined in content/common/websocket_messages.h 68 // defined in content/common/websocket_messages.h
68 69
69 void OnAddChannelRequest(const GURL& socket_url, 70 void OnAddChannelRequest(
70 const std::vector<std::string>& requested_protocols, 71 const WebSocketHostMsg_AddChannelRequest_Params& request);
71 const url::Origin& origin,
72 const std::string& user_agent_override,
73 int render_frame_id);
74 72
75 void AddChannel(const GURL& socket_url, 73 void AddChannel(const GURL& socket_url,
76 const std::vector<std::string>& requested_protocols, 74 const std::vector<std::string>& requested_protocols,
77 const url::Origin& origin, 75 const url::Origin& origin,
76 const GURL& first_party_for_cookies,
78 const std::string& user_agent_override, 77 const std::string& user_agent_override,
79 int render_frame_id); 78 int render_frame_id);
80 79
81 void OnSendBlob(const std::string& uuid, uint64_t expected_size); 80 void OnSendBlob(const std::string& uuid, uint64_t expected_size);
82 81
83 void OnSendFrame(bool fin, 82 void OnSendFrame(bool fin,
84 WebSocketMessageType type, 83 WebSocketMessageType type,
85 const std::vector<char>& data); 84 const std::vector<char>& data);
86 85
87 void OnFlowControl(int64_t quota); 86 void OnFlowControl(int64_t quota);
(...skipping 30 matching lines...) Expand all
118 bool handshake_succeeded_; 117 bool handshake_succeeded_;
119 118
120 base::WeakPtrFactory<WebSocketHost> weak_ptr_factory_; 119 base::WeakPtrFactory<WebSocketHost> weak_ptr_factory_;
121 120
122 DISALLOW_COPY_AND_ASSIGN(WebSocketHost); 121 DISALLOW_COPY_AND_ASSIGN(WebSocketHost);
123 }; 122 };
124 123
125 } // namespace content 124 } // namespace content
126 125
127 #endif // CONTENT_BROWSER_RENDERER_HOST_WEBSOCKET_HOST_H_ 126 #endif // CONTENT_BROWSER_RENDERER_HOST_WEBSOCKET_HOST_H_
OLDNEW
« no previous file with comments | « content/browser/renderer_host/websocket_dispatcher_host_unittest.cc ('k') | content/browser/renderer_host/websocket_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698