summaryrefslogtreecommitdiffstats
path: root/chrome/browser/plugin_data_remover.cc
diff options
context:
space:
mode:
authorbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-11 12:43:36 +0000
committerbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-11 12:43:36 +0000
commita4b146fa78f4676a695f93ad4f27a7d6661cbdd3 (patch)
tree2bb81cd065fa9f50632b12c0d462af5fbd89364f /chrome/browser/plugin_data_remover.cc
parentbb7f4d3e98d48d9930502dcbf9b8eaf6f58f174d (diff)
downloadchromium_src-a4b146fa78f4676a695f93ad4f27a7d6661cbdd3.zip
chromium_src-a4b146fa78f4676a695f93ad4f27a7d6661cbdd3.tar.gz
chromium_src-a4b146fa78f4676a695f93ad4f27a7d6661cbdd3.tar.bz2
Update our use of the NPAPI ClearSiteData API.
BUG=58235 TEST=none Review URL: http://codereview.chromium.org/6148006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71039 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/plugin_data_remover.cc')
-rw-r--r--chrome/browser/plugin_data_remover.cc25
1 files changed, 13 insertions, 12 deletions
diff --git a/chrome/browser/plugin_data_remover.cc b/chrome/browser/plugin_data_remover.cc
index 2baf0d0..4e6ac7f 100644
--- a/chrome/browser/plugin_data_remover.cc
+++ b/chrome/browser/plugin_data_remover.cc
@@ -18,11 +18,12 @@
#endif
namespace {
-const char* g_flash_mime_type = "application/x-shockwave-flash";
+const char* kFlashMimeType = "application/x-shockwave-flash";
// TODO(bauerb): Update minimum required Flash version as soon as there is one
// implementing the API.
-const char* g_min_flash_version = "100";
-const int64 g_timeout_ms = 10000;
+const char* kMinFlashVersion = "100";
+const int64 kRemovalTimeoutMs = 10000;
+const uint64 kClearAllData = 0;
} // namespace
PluginDataRemover::PluginDataRemover()
@@ -47,13 +48,13 @@ void PluginDataRemover::StartRemoving(base::Time begin_time, Task* done_task) {
AddRef();
PluginService::GetInstance()->OpenChannelToPlugin(
- GURL(), g_flash_mime_type, this);
+ GURL(), kFlashMimeType, this);
BrowserThread::PostDelayedTask(
BrowserThread::IO,
FROM_HERE,
NewRunnableMethod(this, &PluginDataRemover::OnTimeout),
- g_timeout_ms);
+ kRemovalTimeoutMs);
}
int PluginDataRemover::ID() {
@@ -90,7 +91,9 @@ void PluginDataRemover::ConnectToChannel(const IPC::ChannelHandle& handle) {
}
if (!channel_->Send(
- new PluginMsg_ClearSiteData(0, std::string(), begin_time_))) {
+ new PluginMsg_ClearSiteData(std::string(),
+ kClearAllData,
+ begin_time_))) {
LOG(DFATAL) << "Couldn't send ClearSiteData message";
SignalDone();
}
@@ -147,16 +150,14 @@ bool PluginDataRemover::IsSupported() {
bool allow_wildcard = false;
webkit::npapi::WebPluginInfo plugin;
std::string mime_type;
- if (!webkit::npapi::PluginList::Singleton()->GetPluginInfo(GURL(),
- g_flash_mime_type,
- allow_wildcard,
- &plugin,
- &mime_type))
+ if (!webkit::npapi::PluginList::Singleton()->GetPluginInfo(
+ GURL(), kFlashMimeType, allow_wildcard, &plugin, &mime_type)) {
return false;
+ }
scoped_ptr<Version> version(
webkit::npapi::PluginGroup::CreateVersionFromString(plugin.version));
scoped_ptr<Version> min_version(
- Version::GetVersionFromString(g_min_flash_version));
+ Version::GetVersionFromString(kMinFlashVersion));
return plugin.enabled &&
version.get() &&
min_version->CompareTo(*version) == -1;