Index: content/ppapi_plugin/broker_process_dispatcher.cc |
diff --git a/content/ppapi_plugin/broker_process_dispatcher.cc b/content/ppapi_plugin/broker_process_dispatcher.cc |
index 56dd3a5b82f86a203a99b0b5cf63d3d090fed92d..621ef8f530ea03104a0cfde1fb021e82acb5253c 100644 |
--- a/content/ppapi_plugin/broker_process_dispatcher.cc |
+++ b/content/ppapi_plugin/broker_process_dispatcher.cc |
@@ -77,6 +77,7 @@ BrokerProcessDispatcher::BrokerProcessDispatcher( |
PP_ConnectInstance_Func connect_instance) |
: ppapi::proxy::BrokerSideDispatcher(connect_instance), |
get_plugin_interface_(get_plugin_interface), |
+ flash_browser_operations_1_3_(NULL), |
flash_browser_operations_1_2_(NULL), |
flash_browser_operations_1_0_(NULL) { |
ChildProcess::current()->AddRefProcess(); |
@@ -89,6 +90,10 @@ BrokerProcessDispatcher::BrokerProcessDispatcher( |
flash_browser_operations_1_2_ = |
static_cast<const PPP_Flash_BrowserOperations_1_2*>( |
get_plugin_interface_(PPP_FLASH_BROWSEROPERATIONS_INTERFACE_1_2)); |
+ |
+ flash_browser_operations_1_3_ = |
+ static_cast<const PPP_Flash_BrowserOperations_1_3*>( |
+ get_plugin_interface_(PPP_FLASH_BROWSEROPERATIONS_INTERFACE_1_3)); |
} |
} |
@@ -108,6 +113,7 @@ BrokerProcessDispatcher::~BrokerProcessDispatcher() { |
bool BrokerProcessDispatcher::OnMessageReceived(const IPC::Message& msg) { |
IPC_BEGIN_MESSAGE_MAP(BrokerProcessDispatcher, msg) |
+ IPC_MESSAGE_HANDLER(PpapiMsg_GetSitesWithData, OnMsgGetSitesWithData) |
IPC_MESSAGE_HANDLER(PpapiMsg_ClearSiteData, OnMsgClearSiteData) |
IPC_MESSAGE_HANDLER(PpapiMsg_DeauthorizeContentLicenses, |
OnMsgDeauthorizeContentLicenses) |
@@ -130,13 +136,22 @@ void BrokerProcessDispatcher::OnGetPermissionSettingsCompleted( |
request_id, success, default_permission, sites)); |
} |
+void BrokerProcessDispatcher::OnMsgGetSitesWithData( |
+ uint32 request_id, |
+ const FilePath& plugin_data_path) { |
+ std::vector<std::string> sites; |
+ GetSitesWithData(plugin_data_path, &sites); |
+ Send(new PpapiHostMsg_GetSitesWithDataResult(request_id, sites)); |
+} |
+ |
void BrokerProcessDispatcher::OnMsgClearSiteData( |
+ uint32 request_id, |
const FilePath& plugin_data_path, |
const std::string& site, |
uint64 flags, |
uint64 max_age) { |
Send(new PpapiHostMsg_ClearSiteDataResult( |
- ClearSiteData(plugin_data_path, site, flags, max_age))); |
+ request_id, ClearSiteData(plugin_data_path, site, flags, max_age))); |
} |
void BrokerProcessDispatcher::OnMsgDeauthorizeContentLicenses( |
@@ -186,6 +201,24 @@ void BrokerProcessDispatcher::OnMsgSetSitePermission( |
request_id, SetSitePermission(plugin_data_path, setting_type, sites))); |
} |
+void BrokerProcessDispatcher::GetSitesWithData( |
+ const FilePath& plugin_data_path, |
+ std::vector<std::string>* site_vector) { |
+ std::string data_str = ConvertPluginDataPath(plugin_data_path); |
+ if (!flash_browser_operations_1_3_) |
+ return; |
+ |
+ char** sites = NULL; |
+ flash_browser_operations_1_3_->GetSitesWithData(data_str.c_str(), &sites); |
+ if (!sites) |
+ return; |
+ |
+ for (size_t i = 0; sites[i]; ++i) |
+ site_vector->push_back(sites[i]); |
+ |
+ flash_browser_operations_1_3_->FreeSiteList(sites); |
+} |
+ |
bool BrokerProcessDispatcher::ClearSiteData(const FilePath& plugin_data_path, |
const std::string& site, |
uint64 flags, |