OLD | NEW |
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 CONTENT_PPAPI_PLUGIN_BROKER_PROCESS_DISPATCHER_H_ | 5 #ifndef CONTENT_PPAPI_PLUGIN_BROKER_PROCESS_DISPATCHER_H_ |
6 #define CONTENT_PPAPI_PLUGIN_BROKER_PROCESS_DISPATCHER_H_ | 6 #define CONTENT_PPAPI_PLUGIN_BROKER_PROCESS_DISPATCHER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "ppapi/c/ppp.h" | 9 #include "ppapi/c/ppp.h" |
10 #include "ppapi/proxy/broker_dispatcher.h" | 10 #include "ppapi/proxy/broker_dispatcher.h" |
11 | 11 |
12 // Wrapper around a BrokerDispatcher that provides the necessary integration | 12 // Wrapper around a BrokerDispatcher that provides the necessary integration |
13 // for plugin process management. This class is to avoid direct dependencies | 13 // for plugin process management. This class is to avoid direct dependencies |
14 // from the PPAPI proxy on the Chrome multiprocess infrastructure. | 14 // from the PPAPI proxy on the Chrome multiprocess infrastructure. |
15 class BrokerProcessDispatcher : public ppapi::proxy::BrokerSideDispatcher { | 15 class BrokerProcessDispatcher : public ppapi::proxy::BrokerSideDispatcher { |
16 public: | 16 public: |
17 BrokerProcessDispatcher(base::ProcessHandle remote_process_handle, | 17 BrokerProcessDispatcher(PP_GetInterface_Func get_plugin_interface, |
18 PP_GetInterface_Func get_plugin_interface, | |
19 PP_ConnectInstance_Func connect_instance); | 18 PP_ConnectInstance_Func connect_instance); |
20 virtual ~BrokerProcessDispatcher(); | 19 virtual ~BrokerProcessDispatcher(); |
21 | 20 |
22 // IPC::Channel::Listener overrides. | 21 // IPC::Channel::Listener overrides. |
23 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 22 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
24 | 23 |
25 private: | 24 private: |
26 void OnMsgClearSiteData(const FilePath& plugin_data_path, | 25 void OnMsgClearSiteData(const FilePath& plugin_data_path, |
27 const std::string& site, | 26 const std::string& site, |
28 uint64 flags, | 27 uint64 flags, |
29 uint64 max_age); | 28 uint64 max_age); |
30 | 29 |
31 // Requests that the plugin clear data, returning true on success. | 30 // Requests that the plugin clear data, returning true on success. |
32 bool ClearSiteData(const FilePath& plugin_data_path, | 31 bool ClearSiteData(const FilePath& plugin_data_path, |
33 const std::string& site, | 32 const std::string& site, |
34 uint64 flags, | 33 uint64 flags, |
35 uint64 max_age); | 34 uint64 max_age); |
36 | 35 |
37 PP_GetInterface_Func get_plugin_interface_; | 36 PP_GetInterface_Func get_plugin_interface_; |
38 | 37 |
39 DISALLOW_COPY_AND_ASSIGN(BrokerProcessDispatcher); | 38 DISALLOW_COPY_AND_ASSIGN(BrokerProcessDispatcher); |
40 }; | 39 }; |
41 | 40 |
42 #endif // CONTENT_PPAPI_PLUGIN_BROKER_PROCESS_DISPATCHER_H_ | 41 #endif // CONTENT_PPAPI_PLUGIN_BROKER_PROCESS_DISPATCHER_H_ |
OLD | NEW |