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

Unified Diff: content/ppapi_plugin/ppapi_thread.cc

Issue 9981015: Add an interface for Flash to clear its data. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
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..b779bda2276aac8046dce56eeb2a4bec2c5d5ee8 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_clear_site_data.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,13 @@ void PpapiThread::OnMsgCreateChannel(base::ProcessHandle host_process_handle,
Send(new PpapiHostMsg_ChannelCreated(channel_handle));
}
+void PpapiThread::OnMsgClearSiteData(const std::string& site,
+ uint64 flags,
+ uint64 max_age) {
+ Send(new PpapiHostMsg_ClearSiteDataResult(
+ ClearSiteData(site, flags, max_age)));
+}
+
void PpapiThread::OnMsgSetNetworkState(bool online) {
if (!get_plugin_interface_)
return;
@@ -278,6 +288,22 @@ void PpapiThread::OnPluginDispatcherMessageReceived(const IPC::Message& msg) {
dispatcher->second->OnMessageReceived(msg);
}
+bool PpapiThread::ClearSiteData(const std::string& site,
+ uint64 flags,
+ uint64 max_age) {
+ if (!get_plugin_interface_)
+ return false;
+ const PPP_Flash_ClearSiteData_1_0* clear_interface =
+ static_cast<const PPP_Flash_ClearSiteData_1_0*>(
+ get_plugin_interface_(PPP_FLASH_CLEARSITEDATA_INTERFACE_1_0));
+ if (!clear_interface)
+ return false;
+
+ clear_interface->ClearSiteData(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) {

Powered by Google App Engine
This is Rietveld 408576698