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

Side by Side Diff: ppapi/proxy/broker_dispatcher.h

Issue 10378057: Broker out PPAPI handle duplication (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 7 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/renderer/render_view_impl.cc ('k') | ppapi/proxy/broker_dispatcher.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) 2011 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 PPAPI_PROXY_BROKER_DISPATCHER_H_ 5 #ifndef PPAPI_PROXY_BROKER_DISPATCHER_H_
6 #define PPAPI_PROXY_BROKER_DISPATCHER_H_ 6 #define PPAPI_PROXY_BROKER_DISPATCHER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "ppapi/c/trusted/ppp_broker.h" 10 #include "ppapi/c/trusted/ppp_broker.h"
11 #include "ppapi/proxy/proxy_channel.h" 11 #include "ppapi/proxy/proxy_channel.h"
(...skipping 10 matching lines...) Expand all
22 // transferred. 22 // transferred.
23 virtual bool InitBrokerWithChannel(ProxyChannel::Delegate* delegate, 23 virtual bool InitBrokerWithChannel(ProxyChannel::Delegate* delegate,
24 const IPC::ChannelHandle& channel_handle, 24 const IPC::ChannelHandle& channel_handle,
25 bool is_client); 25 bool is_client);
26 26
27 // IPC::Channel::Listener implementation. 27 // IPC::Channel::Listener implementation.
28 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; 28 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
29 29
30 protected: 30 protected:
31 // You must call InitBrokerWithChannel after the constructor. 31 // You must call InitBrokerWithChannel after the constructor.
32 BrokerDispatcher(base::ProcessHandle remote_process_handle, 32 explicit BrokerDispatcher(PP_ConnectInstance_Func connect_instance);
33 PP_ConnectInstance_Func connect_instance);
34 33
35 void OnMsgConnectToPlugin(PP_Instance instance, 34 void OnMsgConnectToPlugin(PP_Instance instance,
36 IPC::PlatformFileForTransit handle, 35 IPC::PlatformFileForTransit handle,
37 int32_t* result); 36 int32_t* result);
38 37
39 PP_ConnectInstance_Func connect_instance_; 38 PP_ConnectInstance_Func connect_instance_;
40 39
41 private: 40 private:
42 DISALLOW_COPY_AND_ASSIGN(BrokerDispatcher); 41 DISALLOW_COPY_AND_ASSIGN(BrokerDispatcher);
43 }; 42 };
44 43
45 // The dispatcher for the browser side of the broker channel. 44 // The dispatcher for the browser side of the broker channel.
46 class PPAPI_PROXY_EXPORT BrokerHostDispatcher : public BrokerDispatcher { 45 class PPAPI_PROXY_EXPORT BrokerHostDispatcher : public BrokerDispatcher {
47 public: 46 public:
48 BrokerHostDispatcher(base::ProcessHandle remote_process_handle); 47 BrokerHostDispatcher();
49 48
50 // IPC::Channel::Listener implementation. 49 // IPC::Channel::Listener implementation.
51 virtual void OnChannelError() OVERRIDE; 50 virtual void OnChannelError() OVERRIDE;
52 }; 51 };
53 52
54 // The dispatcher for the broker side of the broker channel. 53 // The dispatcher for the broker side of the broker channel.
55 class PPAPI_PROXY_EXPORT BrokerSideDispatcher : public BrokerDispatcher { 54 class PPAPI_PROXY_EXPORT BrokerSideDispatcher : public BrokerDispatcher {
56 public: 55 public:
57 BrokerSideDispatcher(base::ProcessHandle remote_process_handle, 56 explicit BrokerSideDispatcher(PP_ConnectInstance_Func connect_instance);
58 PP_ConnectInstance_Func connect_instance);
59 57
60 // IPC::Channel::Listener implementation. 58 // IPC::Channel::Listener implementation.
61 virtual void OnChannelError() OVERRIDE; 59 virtual void OnChannelError() OVERRIDE;
62 }; 60 };
63 61
64 } // namespace proxy 62 } // namespace proxy
65 } // namespace ppapi 63 } // namespace ppapi
66 64
67 #endif // PPAPI_PROXY_BROKER_DISPATCHER_H_ 65 #endif // PPAPI_PROXY_BROKER_DISPATCHER_H_
OLDNEW
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | ppapi/proxy/broker_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698