| Index: content/browser/websockets/websocket_handshake_request_info_impl.cc
|
| diff --git a/content/browser/websockets/websocket_handshake_request_info_impl.cc b/content/browser/websockets/websocket_handshake_request_info_impl.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..14bb5cb184b011dc9b957dacf589722809afb9a3
|
| --- /dev/null
|
| +++ b/content/browser/websockets/websocket_handshake_request_info_impl.cc
|
| @@ -0,0 +1,46 @@
|
| +// 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.
|
| +
|
| +#include "content/browser/websockets/websocket_handshake_request_info_impl.h"
|
| +
|
| +#include "net/url_request/url_request.h"
|
| +
|
| +namespace content {
|
| +
|
| +namespace {
|
| +
|
| +constexpr int g_tag = 0;
|
| +
|
| +} // namesapce
|
| +
|
| +WebSocketHandshakeRequestInfoImpl::WebSocketHandshakeRequestInfoImpl(
|
| + int child_id,
|
| + int render_frame_id)
|
| + : child_id_(child_id), render_frame_id_(render_frame_id) {}
|
| +
|
| +WebSocketHandshakeRequestInfoImpl::~WebSocketHandshakeRequestInfoImpl() {}
|
| +
|
| +void WebSocketHandshakeRequestInfoImpl::CreateInfoAndAssociateWithRequest(
|
| + int child_id,
|
| + int render_frame_id,
|
| + net::URLRequest* request) {
|
| + request->SetUserData(
|
| + &g_tag, new WebSocketHandshakeRequestInfoImpl(child_id, render_frame_id));
|
| +}
|
| +
|
| +int WebSocketHandshakeRequestInfoImpl::GetChildId() const {
|
| + return child_id_;
|
| +}
|
| +
|
| +int WebSocketHandshakeRequestInfoImpl::GetRenderFrameId() const {
|
| + return render_frame_id_;
|
| +}
|
| +
|
| +const WebSocketHandshakeRequestInfo* WebSocketHandshakeRequestInfo::ForRequest(
|
| + const net::URLRequest* request) {
|
| + return static_cast<WebSocketHandshakeRequestInfoImpl*>(
|
| + request->GetUserData(&g_tag));
|
| +}
|
| +
|
| +} // namespace content
|
|
|