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

Unified Diff: content/common/socket_stream_dispatcher.cc

Issue 9677031: Bind RenderViewImpl routing_id to SocketStreamHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 9 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/common/socket_stream_dispatcher.cc
diff --git a/content/common/socket_stream_dispatcher.cc b/content/common/socket_stream_dispatcher.cc
index 640a15b83dba608df5bc434012bfbf45a72cb1a6..7d6dbf37c24c2ae6b72ad3a3a0448fd7e4823121 100644
--- a/content/common/socket_stream_dispatcher.cc
+++ b/content/common/socket_stream_dispatcher.cc
@@ -14,9 +14,11 @@
#include "content/common/child_thread.h"
#include "content/common/socket_stream.h"
#include "content/common/socket_stream_messages.h"
+#include "content/renderer/websocketstreamhandle_impl_extradata_impl.h"
#include "googleurl/src/gurl.h"
#include "webkit/glue/websocketstreamhandle_bridge.h"
#include "webkit/glue/websocketstreamhandle_delegate.h"
+#include "webkit/glue/websocketstreamhandle_impl.h"
// IPCWebSocketStreamHandleBridge is owned by each SocketStreamHandle.
// It communicates with the main browser process via SocketStreamDispatcher.
@@ -146,8 +148,19 @@ void IPCWebSocketStreamHandleBridge::DoConnect(const GURL& url) {
socket_id_ = all_bridges.Get().Add(this);
DCHECK_NE(socket_id_, content::kNoSocketId);
+ int render_view_id = MSG_ROUTING_NONE;
+ webkit_glue::WebSocketStreamHandleImpl* handle =
darin (slow to review) 2012/03/19 20:58:28 you might consider hiding some of this goop behind
Takashi Toyoshima 2012/03/19 22:58:44 Is doing static cast in SocketHandleData::ForHandl
+ static_cast<webkit_glue::WebSocketStreamHandleImpl*>(handle_);
+ if (handle) {
+ const WebSocketStreamHandleImplExtraDataImpl* data =
+ static_cast<const WebSocketStreamHandleImplExtraDataImpl*>(
+ handle->extraData());
+ if (data)
+ render_view_id = data->render_view_id();
+ }
AddRef(); // Released in OnClosed().
- if (child_thread_->Send(new SocketStreamHostMsg_Connect(url, socket_id_))) {
+ if (child_thread_->Send(
+ new SocketStreamHostMsg_Connect(render_view_id, url, socket_id_))) {
DVLOG(1) << "Connect socket_id=" << socket_id_;
// TODO(ukai): timeout to OnConnected.
} else {

Powered by Google App Engine
This is Rietveld 408576698