blob: 1c50dacf322993a6d4d87ee6f5cc221c3b1437e8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
// Copyright (c) 2012 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_RENDERER_SOCKET_STREAM_HANDLE_DATA_H_
#define CONTENT_RENDERER_SOCKET_STREAM_HANDLE_DATA_H_
#pragma once
#include "base/supports_user_data.h"
#include "content_export.h"
namespace WebKit {
class WebSocketStreamHandle;
}
// User data stored in each WebSocketStreamHandleImpl.
class SocketStreamHandleData : public base::SupportsUserData::Data {
public:
virtual ~SocketStreamHandleData() {}
int render_view_id() const { return render_view_id_; }
// Creates SocketStreamHandleData object with |render_view_id| and store it
// to |handle|.
static void AddToHandle(
WebKit::WebSocketStreamHandle* handle, int render_view_id);
// Retrieves the stored user data from WebKit::WebSocketStreamHandle object.
// |handle| must actually be a WebSocketStreamHandleImpl object.
CONTENT_EXPORT static const SocketStreamHandleData* ForHandle(
WebKit::WebSocketStreamHandle* handle);
private:
explicit SocketStreamHandleData(int render_view_id)
: render_view_id_(render_view_id) {
}
int render_view_id_;
DISALLOW_COPY_AND_ASSIGN(SocketStreamHandleData);
};
#endif // CONTENT_RENDERER_SOCKET_STREAM_HANDLE_DATA_H_
|