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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop_proxy.h" | 9 #include "base/message_loop_proxy.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 BrowserThread::IO, | 64 BrowserThread::IO, |
65 FROM_HERE, | 65 FROM_HERE, |
66 base::Bind(&PluginDataRemover::OnTimeout, this), | 66 base::Bind(&PluginDataRemover::OnTimeout, this), |
67 kRemovalTimeoutMs); | 67 kRemovalTimeoutMs); |
68 | 68 |
69 return event_.get(); | 69 return event_.get(); |
70 } | 70 } |
71 | 71 |
72 void PluginDataRemover::Wait() { | 72 void PluginDataRemover::Wait() { |
73 base::Time start_time(base::Time::Now()); | 73 base::Time start_time(base::Time::Now()); |
74 bool result = true; | |
75 if (is_removing_) | 74 if (is_removing_) |
76 result = event_->Wait(); | 75 event_->Wait(); |
77 UMA_HISTOGRAM_TIMES("ClearPluginData.wait_at_shutdown", | 76 UMA_HISTOGRAM_TIMES("ClearPluginData.wait_at_shutdown", |
78 base::Time::Now() - start_time); | 77 base::Time::Now() - start_time); |
79 UMA_HISTOGRAM_TIMES("ClearPluginData.time_at_shutdown", | 78 UMA_HISTOGRAM_TIMES("ClearPluginData.time_at_shutdown", |
80 base::Time::Now() - remove_start_time_); | 79 base::Time::Now() - remove_start_time_); |
81 DCHECK(result) << "Error waiting for plugin process"; | |
82 } | 80 } |
83 | 81 |
84 int PluginDataRemover::ID() { | 82 int PluginDataRemover::ID() { |
85 // Generate a unique identifier for this PluginProcessHostClient. | 83 // Generate a unique identifier for this PluginProcessHostClient. |
86 return ChildProcessInfo::GenerateChildProcessUniqueId(); | 84 return ChildProcessInfo::GenerateChildProcessUniqueId(); |
87 } | 85 } |
88 | 86 |
89 bool PluginDataRemover::OffTheRecord() { | 87 bool PluginDataRemover::OffTheRecord() { |
90 return false; | 88 return false; |
91 } | 89 } |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 webkit::npapi::PluginGroup::CreateVersionFromString(plugin->version)); | 191 webkit::npapi::PluginGroup::CreateVersionFromString(plugin->version)); |
194 scoped_ptr<Version> min_version(Version::GetVersionFromString( | 192 scoped_ptr<Version> min_version(Version::GetVersionFromString( |
195 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 193 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
196 switches::kMinClearSiteDataFlashVersion))); | 194 switches::kMinClearSiteDataFlashVersion))); |
197 if (!min_version.get()) | 195 if (!min_version.get()) |
198 min_version.reset(Version::GetVersionFromString(kMinFlashVersion)); | 196 min_version.reset(Version::GetVersionFromString(kMinFlashVersion)); |
199 return plugin_prefs->IsPluginEnabled(*plugin) && | 197 return plugin_prefs->IsPluginEnabled(*plugin) && |
200 version.get() && | 198 version.get() && |
201 min_version->CompareTo(*version) == -1; | 199 min_version->CompareTo(*version) == -1; |
202 } | 200 } |
OLD | NEW |