Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(621)

Side by Side Diff: chrome/browser/plugin_data_remover.cc

Issue 8221021: Modify WaitableEvent::Wait() to return void (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed comment and style Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/net/cookie_policy_browsertest.cc ('k') | chrome/browser/process_singleton_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698