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

Unified Diff: content/browser/websockets/websocket_impl.cc

Issue 2397393002: Provide child/frame IDs for WebSocket handshake request (Closed)
Patch Set: fix Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/websockets/websocket_impl.h ('k') | content/browser/websockets/websocket_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/websockets/websocket_impl.cc
diff --git a/content/browser/websockets/websocket_impl.cc b/content/browser/websockets/websocket_impl.cc
index 6ea179da37116fb599c2e530ba171ee56b5bfe87..7019bc5306d6ca97b6e17afb9aba0e40a57fa7ec 100644
--- a/content/browser/websockets/websocket_impl.cc
+++ b/content/browser/websockets/websocket_impl.cc
@@ -22,6 +22,7 @@
#include "content/browser/child_process_security_policy_impl.h"
#include "content/browser/ssl/ssl_error_handler.h"
#include "content/browser/ssl/ssl_manager.h"
+#include "content/browser/websockets/websocket_handshake_request_info_impl.h"
#include "content/public/browser/storage_partition.h"
#include "ipc/ipc_message.h"
#include "net/base/io_buffer.h"
@@ -90,6 +91,7 @@ class WebSocketImpl::WebSocketEventHandler final
// net::WebSocketEventInterface implementation
+ void OnCreateURLRequest(net::URLRequest* url_request) override;
ChannelState OnAddChannelResponse(const std::string& selected_subprotocol,
const std::string& extensions) override;
ChannelState OnDataFrame(bool fin,
@@ -151,6 +153,12 @@ WebSocketImpl::WebSocketEventHandler::~WebSocketEventHandler() {
<< reinterpret_cast<void*>(this);
}
+void WebSocketImpl::WebSocketEventHandler::OnCreateURLRequest(
+ net::URLRequest* url_request) {
+ WebSocketHandshakeRequestInfoImpl::CreateInfoAndAssociateWithRequest(
+ impl_->child_id_, impl_->frame_id_, url_request);
+}
+
ChannelState WebSocketImpl::WebSocketEventHandler::OnAddChannelResponse(
const std::string& selected_protocol,
const std::string& extensions) {
@@ -354,15 +362,16 @@ void WebSocketImpl::WebSocketEventHandler::SSLErrorHandlerDelegate::
callbacks_->ContinueSSLRequest();
}
-WebSocketImpl::WebSocketImpl(
- Delegate* delegate,
- blink::mojom::WebSocketRequest request,
- int frame_id,
- base::TimeDelta delay)
+WebSocketImpl::WebSocketImpl(Delegate* delegate,
+ blink::mojom::WebSocketRequest request,
+ int child_id,
+ int frame_id,
+ base::TimeDelta delay)
: delegate_(delegate),
binding_(this, std::move(request)),
delay_(delay),
pending_flow_control_quota_(0),
+ child_id_(child_id),
frame_id_(frame_id),
handshake_succeeded_(false),
weak_ptr_factory_(this) {
« no previous file with comments | « content/browser/websockets/websocket_impl.h ('k') | content/browser/websockets/websocket_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698