summaryrefslogtreecommitdiffstats
path: root/content/ppapi_plugin
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-07 03:59:44 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-07 03:59:44 +0000
commitbe69a96b15059a4fc79c17437ba12b72c1935d1f (patch)
treed33b1e174170abbd85c9bff6f474bd5390fd050e /content/ppapi_plugin
parentad5bb8a9ffbbdbfe4ac04206e61dd4456b7ff614 (diff)
downloadchromium_src-be69a96b15059a4fc79c17437ba12b72c1935d1f.zip
chromium_src-be69a96b15059a4fc79c17437ba12b72c1935d1f.tar.gz
chromium_src-be69a96b15059a4fc79c17437ba12b72c1935d1f.tar.bz2
Pepper Flash: Make ClearSiteData work with PPP_Flash_BrowserOperations 1.1.
It should try the 1.1 interface, and if that's not available, fall back to 1.0. TEST=clear site data still works in Pepper Flash BUG=131395 Review URL: https://chromiumcodereview.appspot.com/10535042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140948 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/ppapi_plugin')
-rw-r--r--content/ppapi_plugin/broker_process_dispatcher.cc33
1 files changed, 24 insertions, 9 deletions
diff --git a/content/ppapi_plugin/broker_process_dispatcher.cc b/content/ppapi_plugin/broker_process_dispatcher.cc
index 7844639..e4b4cb3 100644
--- a/content/ppapi_plugin/broker_process_dispatcher.cc
+++ b/content/ppapi_plugin/broker_process_dispatcher.cc
@@ -82,17 +82,32 @@ bool BrokerProcessDispatcher::ClearSiteData(const FilePath& plugin_data_path,
uint64 max_age) {
if (!get_plugin_interface_)
return false;
- const PPP_Flash_BrowserOperations_1_0* browser_interface =
+
+ const PPP_Flash_BrowserOperations_1_1* browser_interface =
+ static_cast<const PPP_Flash_BrowserOperations_1_1*>(
+ get_plugin_interface_(PPP_FLASH_BROWSEROPERATIONS_INTERFACE_1_1));
+ if (browser_interface) {
+ std::string data_str = ConvertPluginDataPath(plugin_data_path);
+ browser_interface->ClearSiteData(data_str.c_str(),
+ site.empty() ? NULL : site.c_str(),
+ flags, max_age);
+ return true;
+ }
+
+ // TODO(viettrungluu): Remove this (and the 1.0 interface) sometime after M21
+ // goes to Stable.
+ const PPP_Flash_BrowserOperations_1_0* browser_interface_1_0 =
static_cast<const PPP_Flash_BrowserOperations_1_0*>(
get_plugin_interface_(PPP_FLASH_BROWSEROPERATIONS_INTERFACE_1_0));
- if (!browser_interface)
- return false;
-
- std::string data_str = ConvertPluginDataPath(plugin_data_path);
- browser_interface->ClearSiteData(data_str.c_str(),
- site.empty() ? NULL : site.c_str(),
- flags, max_age);
- return true;
+ if (browser_interface_1_0) {
+ std::string data_str = ConvertPluginDataPath(plugin_data_path);
+ browser_interface_1_0->ClearSiteData(data_str.c_str(),
+ site.empty() ? NULL : site.c_str(),
+ flags, max_age);
+ return true;
+ }
+
+ return false;
}
bool BrokerProcessDispatcher::DeauthorizeContentLicenses(