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

Side by Side Diff: content/common/socket_stream_handle_data.h

Issue 185553014: Revert "Revert 254514 "Revert 254507 "Reland "Move WebKitPlatformSupport..."" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/common/DEPS ('k') | content/common/socket_stream_handle_data.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_RENDERER_SOCKET_STREAM_HANDLE_DATA_H_ 5 #ifndef CONTENT_RENDERER_SOCKET_STREAM_HANDLE_DATA_H_
6 #define CONTENT_RENDERER_SOCKET_STREAM_HANDLE_DATA_H_ 6 #define CONTENT_RENDERER_SOCKET_STREAM_HANDLE_DATA_H_
7 7
8 #include "base/supports_user_data.h" 8 #include "base/supports_user_data.h"
9 #include "content/common/content_export.h" 9 #include "content_export.h"
10
11 namespace blink {
12 class WebSocketStreamHandle;
13 }
10 14
11 namespace content { 15 namespace content {
12 16
13 // User data stored in each WebSocketStreamHandleImpl. 17 // User data stored in each WebSocketStreamHandleImpl.
14 class SocketStreamHandleData : public base::SupportsUserData::Data { 18 class SocketStreamHandleData : public base::SupportsUserData::Data {
15 public: 19 public:
16 explicit SocketStreamHandleData(int render_frame_id)
17 : render_frame_id_(render_frame_id) {}
18 virtual ~SocketStreamHandleData() {} 20 virtual ~SocketStreamHandleData() {}
19 21
20 int render_frame_id() const { return render_frame_id_; } 22 int render_frame_id() const { return render_frame_id_; }
21 23
24 // Creates SocketStreamHandleData object with |render_frame_id| and store it
25 // to |handle|.
26 static void AddToHandle(
27 blink::WebSocketStreamHandle* handle, int render_frame_id);
28
29 // Retrieves the stored user data from blink::WebSocketStreamHandle object.
30 // |handle| must actually be a WebSocketStreamHandleImpl object.
31 CONTENT_EXPORT static const SocketStreamHandleData* ForHandle(
32 blink::WebSocketStreamHandle* handle);
33
22 private: 34 private:
35 explicit SocketStreamHandleData(int render_frame_id)
36 : render_frame_id_(render_frame_id) {
37 }
38
23 int render_frame_id_; 39 int render_frame_id_;
24 40
25 DISALLOW_COPY_AND_ASSIGN(SocketStreamHandleData); 41 DISALLOW_COPY_AND_ASSIGN(SocketStreamHandleData);
26 }; 42 };
27 43
28 } // namespace content 44 } // namespace content
29 45
30 #endif // CONTENT_RENDERER_SOCKET_STREAM_HANDLE_DATA_H_ 46 #endif // CONTENT_RENDERER_SOCKET_STREAM_HANDLE_DATA_H_
OLDNEW
« no previous file with comments | « content/common/DEPS ('k') | content/common/socket_stream_handle_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698