| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/plugin_data_remover.h" | 5 #include "chrome/browser/plugin_data_remover.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/message_loop_proxy.h" | 8 #include "base/message_loop_proxy.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/version.h" | 10 #include "base/version.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 base::WaitableEvent* PluginDataRemover::StartRemoving( | 43 base::WaitableEvent* PluginDataRemover::StartRemoving( |
| 44 const base::Time& begin_time) { | 44 const base::Time& begin_time) { |
| 45 DCHECK(!is_removing_); | 45 DCHECK(!is_removing_); |
| 46 remove_start_time_ = base::Time::Now(); | 46 remove_start_time_ = base::Time::Now(); |
| 47 begin_time_ = begin_time; | 47 begin_time_ = begin_time; |
| 48 | 48 |
| 49 is_removing_ = true; | 49 is_removing_ = true; |
| 50 | 50 |
| 51 AddRef(); | 51 AddRef(); |
| 52 PluginService::GetInstance()->OpenChannelToPlugin( | 52 PluginService::GetInstance()->OpenChannelToNpapiPlugin( |
| 53 0, 0, GURL(), mime_type_, this); | 53 0, 0, GURL(), mime_type_, this); |
| 54 | 54 |
| 55 BrowserThread::PostDelayedTask( | 55 BrowserThread::PostDelayedTask( |
| 56 BrowserThread::IO, | 56 BrowserThread::IO, |
| 57 FROM_HERE, | 57 FROM_HERE, |
| 58 NewRunnableMethod(this, &PluginDataRemover::OnTimeout), | 58 NewRunnableMethod(this, &PluginDataRemover::OnTimeout), |
| 59 kRemovalTimeoutMs); | 59 kRemovalTimeoutMs); |
| 60 | 60 |
| 61 return event_.get(); | 61 return event_.get(); |
| 62 } | 62 } |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 webkit::npapi::PluginGroup::CreateVersionFromString(plugin.version)); | 173 webkit::npapi::PluginGroup::CreateVersionFromString(plugin.version)); |
| 174 scoped_ptr<Version> min_version(Version::GetVersionFromString( | 174 scoped_ptr<Version> min_version(Version::GetVersionFromString( |
| 175 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 175 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 176 switches::kMinClearSiteDataFlashVersion))); | 176 switches::kMinClearSiteDataFlashVersion))); |
| 177 if (!min_version.get()) | 177 if (!min_version.get()) |
| 178 min_version.reset(Version::GetVersionFromString(kMinFlashVersion)); | 178 min_version.reset(Version::GetVersionFromString(kMinFlashVersion)); |
| 179 return webkit::npapi::IsPluginEnabled(plugin) && | 179 return webkit::npapi::IsPluginEnabled(plugin) && |
| 180 version.get() && | 180 version.get() && |
| 181 min_version->CompareTo(*version) == -1; | 181 min_version->CompareTo(*version) == -1; |
| 182 } | 182 } |
| OLD | NEW |