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

Unified Diff: content/common/socket_stream_handle_data.h

Issue 9677031: Bind RenderViewImpl routing_id to SocketStreamHost (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add CONTENT_EXPORT to ForHandle() 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
« no previous file with comments | « content/common/socket_stream_dispatcher.cc ('k') | content/common/socket_stream_handle_data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/socket_stream_handle_data.h
diff --git a/content/common/socket_stream_handle_data.h b/content/common/socket_stream_handle_data.h
new file mode 100644
index 0000000000000000000000000000000000000000..1c50dacf322993a6d4d87ee6f5cc221c3b1437e8
--- /dev/null
+++ b/content/common/socket_stream_handle_data.h
@@ -0,0 +1,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_
« no previous file with comments | « content/common/socket_stream_dispatcher.cc ('k') | content/common/socket_stream_handle_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698