1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "content/common/socket_stream_handle_data.h"
7 #include "webkit/child/websocketstreamhandle_impl.h"
9 using webkit_glue::WebSocketStreamHandleImpl
;
10 using blink::WebSocketStreamHandle
;
15 void SocketStreamHandleData::AddToHandle(
16 WebSocketStreamHandle
* handle
, int render_frame_id
) {
21 WebSocketStreamHandleImpl
* impl
=
22 static_cast<WebSocketStreamHandleImpl
*>(handle
);
23 impl
->SetUserData(handle
, new SocketStreamHandleData(render_frame_id
));
27 const SocketStreamHandleData
* SocketStreamHandleData::ForHandle(
28 WebSocketStreamHandle
* handle
) {
31 WebSocketStreamHandleImpl
* impl
=
32 static_cast<WebSocketStreamHandleImpl
*>(handle
);
33 return static_cast<SocketStreamHandleData
*>(impl
->GetUserData(handle
));
36 } // namespace content