| OLD | NEW |
| 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_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(PP_GetInterface_Func get_plugin_interface, | 17 BrokerProcessDispatcher(PP_GetInterface_Func get_plugin_interface, |
| 18 PP_ConnectInstance_Func connect_instance); | 18 PP_ConnectInstance_Func connect_instance); |
| 19 virtual ~BrokerProcessDispatcher(); | 19 virtual ~BrokerProcessDispatcher(); |
| 20 | 20 |
| 21 // IPC::Channel::Listener overrides. | 21 // IPC::Channel::Listener overrides. |
| 22 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 22 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
| 23 | 23 |
| 24 private: | 24 private: |
| 25 void OnMsgClearSiteData(const FilePath& plugin_data_path, | 25 void OnMsgClearSiteData(const FilePath& plugin_data_path, |
| 26 const std::string& site, | 26 const std::string& site, |
| 27 uint64 flags, | 27 uint64 flags, |
| 28 uint64 max_age); | 28 uint64 max_age); |
| 29 | 29 |
| 30 void OnMsgDeauthorizeContentLicenses(uint32 request_id, |
| 31 const FilePath& plugin_data_path); |
| 32 |
| 30 // Requests that the plugin clear data, returning true on success. | 33 // Requests that the plugin clear data, returning true on success. |
| 31 bool ClearSiteData(const FilePath& plugin_data_path, | 34 bool ClearSiteData(const FilePath& plugin_data_path, |
| 32 const std::string& site, | 35 const std::string& site, |
| 33 uint64 flags, | 36 uint64 flags, |
| 34 uint64 max_age); | 37 uint64 max_age); |
| 38 bool DeauthorizeContentLicenses(const FilePath& plugin_data_path); |
| 35 | 39 |
| 36 PP_GetInterface_Func get_plugin_interface_; | 40 PP_GetInterface_Func get_plugin_interface_; |
| 37 | 41 |
| 38 DISALLOW_COPY_AND_ASSIGN(BrokerProcessDispatcher); | 42 DISALLOW_COPY_AND_ASSIGN(BrokerProcessDispatcher); |
| 39 }; | 43 }; |
| 40 | 44 |
| 41 #endif // CONTENT_PPAPI_PLUGIN_BROKER_PROCESS_DISPATCHER_H_ | 45 #endif // CONTENT_PPAPI_PLUGIN_BROKER_PROCESS_DISPATCHER_H_ |
| OLD | NEW |