Commit a14903e0 authored by tyoshino@chromium.org's avatar tyoshino@chromium.org

Pass render frame ID to WebSocketBridge (Chromium side)

The browser side code of the new WebSocket stack needs to
know the ID of the render frame where the corresponding
WebSocketBridge is created in order to handle certificate errors.

This CL just ports the code used by the old WebSocket
implementation to new one.

Blink side change: https://codereview.chromium.org/304113002/

BUG=364361

Review URL: https://codereview.chromium.org/308513004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274180 0039d316-1c4b-4281-b951-d872f2087c98
parent 9d5877e3
......@@ -44,7 +44,9 @@ const unsigned short kAbnormalShutdownOpCode = 1006;
} // namespace
WebSocketBridge::WebSocketBridge()
: channel_id_(kInvalidChannelId), client_(NULL) {}
: channel_id_(kInvalidChannelId),
render_frame_id_(MSG_ROUTING_NONE),
client_(NULL) {}
WebSocketBridge::~WebSocketBridge() {
if (channel_id_ != kInvalidChannelId) {
......
......@@ -45,6 +45,10 @@ class WebSocketBridge : public blink::WebSocketHandle {
virtual void Disconnect();
void set_render_frame_id(int id) {
render_frame_id_ = id;
}
private:
virtual ~WebSocketBridge();
......@@ -62,6 +66,7 @@ class WebSocketBridge : public blink::WebSocketHandle {
void DidStartClosingHandshake();
int channel_id_;
int render_frame_id_;
blink::WebSocketHandleClient* client_;
static const int kInvalidChannelId = -1;
......
......@@ -26,6 +26,7 @@
#include "content/child/service_worker/web_service_worker_provider_impl.h"
#include "content/child/web_socket_stream_handle_impl.h"
#include "content/child/webmessageportchannel_impl.h"
#include "content/child/websocket_bridge.h"
#include "content/common/clipboard_messages.h"
#include "content/common/frame_messages.h"
#include "content/common/input_messages.h"
......@@ -2741,6 +2742,11 @@ void RenderFrameImpl::willOpenSocketStream(
impl->SetUserData(handle, new SocketStreamHandleData(routing_id_));
}
void RenderFrameImpl::willOpenWebSocket(blink::WebSocketHandle* handle) {
WebSocketBridge* impl = static_cast<WebSocketBridge*>(handle);
impl->set_render_frame_id(routing_id_);
}
blink::WebGeolocationClient* RenderFrameImpl::geolocationClient() {
return render_view_->geolocationClient();
}
......
......@@ -368,6 +368,7 @@ class CONTENT_EXPORT RenderFrameImpl
blink::WebStorageQuotaCallbacks callbacks);
virtual void willOpenSocketStream(
blink::WebSocketStreamHandle* handle);
virtual void willOpenWebSocket(blink::WebSocketHandle* handle);
virtual blink::WebGeolocationClient* geolocationClient();
virtual void willStartUsingPeerConnectionHandler(
blink::WebLocalFrame* frame,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment