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

Unified Diff: content/public/browser/websocket_handshake_request_info.h

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
Index: content/public/browser/websocket_handshake_request_info.h
diff --git a/content/public/browser/websocket_handshake_request_info.h b/content/public/browser/websocket_handshake_request_info.h
new file mode 100644
index 0000000000000000000000000000000000000000..9dcb2c89a55ec8f5ac67e35168b8f58c485e6a42
--- /dev/null
+++ b/content/public/browser/websocket_handshake_request_info.h
@@ -0,0 +1,34 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_PUBLIC_BROWSER_WEBSOCKET_HANDSHAKE_REQUEST_INFO_H_
+#define CONTENT_PUBLIC_BROWSER_WEBSOCKET_HANDSHAKE_REQUEST_INFO_H_
+
+#include "content/common/content_export.h"
+
+namespace net {
+class URLRequest;
+} // namespace net
+
+namespace content {
+
+// WebSocketHandshakeRequestInfo provides additional information attached to
+// a net::URLRequest.
+class WebSocketHandshakeRequestInfo {
+ public:
+ virtual ~WebSocketHandshakeRequestInfo() {}
+ // Returns the ID of the child process where the WebSocket connection lives.
+ virtual int GetChildId() const = 0;
+ // Returns the ID of the renderrer frame where the WebSocket connection lives.
jam 2016/10/12 15:59:28 nit: renderer
yhirano 2016/10/13 05:55:18 Done.
+ virtual int GetFrameId() const = 0;
jam 2016/10/12 15:59:28 call this GetRenderFrameID() to make it clear that
yhirano 2016/10/13 05:55:18 Done.
+
+ // Returns the WebSocketHandshakeRequestInfo instance attached to the given
+ // URLRequest. Returns nullptr when no instance is attached.
+ CONTENT_EXPORT static const WebSocketHandshakeRequestInfo* ForRequest(
+ const net::URLRequest* request);
+};
+
+} // namespace content
+
+#endif // CONTENT_PUBLIC_BROWSER_WEBSOCKET_HANDSHAKE_REQUEST_INFO_H_

Powered by Google App Engine
This is Rietveld 408576698