| Index: content/ppapi_plugin/ppapi_thread.cc
|
| diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc
|
| index 54f9af8104e173a185b856edb49bed3590769af0..1ff3671904bd10da8947b51f670d44407ea10f03 100644
|
| --- a/content/ppapi_plugin/ppapi_thread.cc
|
| +++ b/content/ppapi_plugin/ppapi_thread.cc
|
| @@ -21,6 +21,7 @@
|
| #include "ipc/ipc_sync_channel.h"
|
| #include "ppapi/c/dev/ppp_network_state_dev.h"
|
| #include "ppapi/c/pp_errors.h"
|
| +#include "ppapi/c/private/ppp_flash_browser_operations.h"
|
| #include "ppapi/c/ppp.h"
|
| #include "ppapi/proxy/plugin_globals.h"
|
| #include "ppapi/proxy/ppapi_messages.h"
|
| @@ -83,6 +84,8 @@ bool PpapiThread::OnMessageReceived(const IPC::Message& msg) {
|
| IPC_BEGIN_MESSAGE_MAP(PpapiThread, msg)
|
| IPC_MESSAGE_HANDLER(PpapiMsg_LoadPlugin, OnMsgLoadPlugin)
|
| IPC_MESSAGE_HANDLER(PpapiMsg_CreateChannel, OnMsgCreateChannel)
|
| + IPC_MESSAGE_HANDLER(PpapiMsg_ClearSiteData, OnMsgClearSiteData)
|
| +
|
| IPC_MESSAGE_HANDLER_GENERIC(PpapiMsg_PPBTCPServerSocket_ListenACK,
|
| OnPluginDispatcherMessageReceived(msg))
|
| IPC_MESSAGE_HANDLER_GENERIC(PpapiMsg_PPBTCPServerSocket_AcceptACK,
|
| @@ -255,6 +258,14 @@ void PpapiThread::OnMsgCreateChannel(base::ProcessHandle host_process_handle,
|
| Send(new PpapiHostMsg_ChannelCreated(channel_handle));
|
| }
|
|
|
| +void PpapiThread::OnMsgClearSiteData(const FilePath& profile_path,
|
| + const std::string& site,
|
| + uint64 flags,
|
| + uint64 max_age) {
|
| + Send(new PpapiHostMsg_ClearSiteDataResult(
|
| + ClearSiteData(profile_path, site, flags, max_age)));
|
| +}
|
| +
|
| void PpapiThread::OnMsgSetNetworkState(bool online) {
|
| if (!get_plugin_interface_)
|
| return;
|
| @@ -278,6 +289,31 @@ void PpapiThread::OnPluginDispatcherMessageReceived(const IPC::Message& msg) {
|
| dispatcher->second->OnMessageReceived(msg);
|
| }
|
|
|
| +bool PpapiThread::ClearSiteData(const FilePath& profile_path,
|
| + const std::string& site,
|
| + uint64 flags,
|
| + uint64 max_age) {
|
| + if (!get_plugin_interface_)
|
| + return false;
|
| + const PPP_Flash_BrowserOperations_1_0* browser_interface =
|
| + static_cast<const PPP_Flash_BrowserOperations_1_0*>(
|
| + get_plugin_interface_(PPP_FLASH_BROWSEROPERATIONS_INTERFACE_1_0));
|
| + if (!browser_interface)
|
| + return false;
|
| +
|
| + // The string is always 8-bit, convert on Windows.
|
| +#if defined(OS_WIN)
|
| + std::string profile_str = WideToUTF8(profile_path.value());
|
| +#else
|
| + std::string profile_str = profile_path.value();
|
| +#endif
|
| +
|
| + browser_interface->ClearSiteData(profile_str.c_str(),
|
| + site.empty() ? NULL : site.c_str(),
|
| + flags, max_age);
|
| + return true;
|
| +}
|
| +
|
| bool PpapiThread::SetupRendererChannel(base::ProcessHandle host_process_handle,
|
| int renderer_id,
|
| IPC::ChannelHandle* handle) {
|
|
|