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

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

Issue 10662005: Use IPC::Sender and IPC::Listener in content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_COMMON_SOCKET_STREAM_DISPATCHER_H_ 5 #ifndef CONTENT_COMMON_SOCKET_STREAM_DISPATCHER_H_
6 #define CONTENT_COMMON_SOCKET_STREAM_DISPATCHER_H_ 6 #define CONTENT_COMMON_SOCKET_STREAM_DISPATCHER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "ipc/ipc_channel.h" 12 #include "base/compiler_specific.h"
13 #include "ipc/ipc_listener.h"
13 14
14 namespace WebKit { 15 namespace WebKit {
15 class WebSocketStreamHandle; 16 class WebSocketStreamHandle;
16 } 17 }
17 18
18 namespace webkit_glue { 19 namespace webkit_glue {
19 class WebSocketStreamHandleBridge; 20 class WebSocketStreamHandleBridge;
20 class WebSocketStreamHandleDelegate; 21 class WebSocketStreamHandleDelegate;
21 } 22 }
22 23
23 // Dispatches socket stream related messages sent to a child process from the 24 // Dispatches socket stream related messages sent to a child process from the
24 // main browser process. There is one instance per child process. Messages 25 // main browser process. There is one instance per child process. Messages
25 // are dispatched on the main child thread. The RenderThread class 26 // are dispatched on the main child thread. The RenderThread class
26 // creates an instance of SocketStreamDispatcher and delegates calls to it. 27 // creates an instance of SocketStreamDispatcher and delegates calls to it.
27 class SocketStreamDispatcher : public IPC::Channel::Listener { 28 class SocketStreamDispatcher : public IPC::Listener {
28 public: 29 public:
29 SocketStreamDispatcher(); 30 SocketStreamDispatcher();
30 virtual ~SocketStreamDispatcher() {} 31 virtual ~SocketStreamDispatcher() {}
31 32
32 static webkit_glue::WebSocketStreamHandleBridge* CreateBridge( 33 static webkit_glue::WebSocketStreamHandleBridge* CreateBridge(
33 WebKit::WebSocketStreamHandle* handle, 34 WebKit::WebSocketStreamHandle* handle,
34 webkit_glue::WebSocketStreamHandleDelegate* delegate); 35 webkit_glue::WebSocketStreamHandleDelegate* delegate);
35 36
36 // IPC::Channel::Listener implementation. 37 // IPC::Listener implementation.
37 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; 38 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
38 39
39 private: 40 private:
40 void OnConnected(int socket_id, int max_amount_send_allowed); 41 void OnConnected(int socket_id, int max_amount_send_allowed);
41 void OnSentData(int socket_id, int amount_sent); 42 void OnSentData(int socket_id, int amount_sent);
42 void OnReceivedData(int socket_id, const std::vector<char>& data); 43 void OnReceivedData(int socket_id, const std::vector<char>& data);
43 void OnClosed(int socket_id); 44 void OnClosed(int socket_id);
44 45
45 DISALLOW_COPY_AND_ASSIGN(SocketStreamDispatcher); 46 DISALLOW_COPY_AND_ASSIGN(SocketStreamDispatcher);
46 }; 47 };
47 48
48 #endif // CONTENT_COMMON_SOCKET_STREAM_DISPATCHER_H_ 49 #endif // CONTENT_COMMON_SOCKET_STREAM_DISPATCHER_H_
OLDNEW
« no previous file with comments | « content/common/resource_dispatcher_unittest.cc ('k') | content/common/webmessageportchannel_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698