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

Unified Diff: chrome/browser/plugin_data_remover_helper.cc

Issue 8071013: Finish moving plugin probing out of process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/plugin_data_remover.cc ('k') | chrome/browser/plugin_prefs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugin_data_remover_helper.cc
diff --git a/chrome/browser/plugin_data_remover_helper.cc b/chrome/browser/plugin_data_remover_helper.cc
index d3ad02ab486cdd7bf3e9903cc6343f9def6297ec..ed73884f67677f97223c0895b5e85fbcc5660f14 100644
--- a/chrome/browser/plugin_data_remover_helper.cc
+++ b/chrome/browser/plugin_data_remover_helper.cc
@@ -7,6 +7,7 @@
#include <string>
#include "base/bind.h"
+#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "chrome/browser/plugin_data_remover.h"
#include "chrome/browser/plugin_prefs.h"
@@ -14,9 +15,12 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_notification_types.h"
#include "content/browser/browser_thread.h"
+#include "content/browser/plugin_service.h"
#include "content/common/notification_service.h"
// The internal class is refcounted so it can outlive PluginDataRemoverHelper.
+// TODO(bauerb): Replace with a WeakPtrFactory now that plugin callbacks run on
+// the UI thread.
class PluginDataRemoverHelper::Internal
: public base::RefCountedThreadSafe<PluginDataRemoverHelper::Internal> {
public:
@@ -24,12 +28,9 @@ class PluginDataRemoverHelper::Internal
: pref_name_(pref_name), profile_(profile) {}
void StartUpdate() {
- BrowserThread::PostTask(
- BrowserThread::FILE,
- FROM_HERE,
- base::Bind(&PluginDataRemoverHelper::Internal::UpdateOnFileThread,
- this,
- make_scoped_refptr(PluginPrefs::GetForProfile(profile_))));
+ PluginService::GetInstance()->GetPlugins(
+ base::Bind(&PluginDataRemoverHelper::Internal::GotPlugins, this,
+ make_scoped_refptr(PluginPrefs::GetForProfile(profile_))));
}
void Invalidate() {
@@ -41,8 +42,8 @@ class PluginDataRemoverHelper::Internal
~Internal() {}
- void UpdateOnFileThread(scoped_refptr<PluginPrefs> plugin_prefs) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+ void GotPlugins(scoped_refptr<PluginPrefs> plugin_prefs,
+ const std::vector<webkit::WebPluginInfo>& plugins) {
bool result = PluginDataRemover::IsSupported(plugin_prefs);
BrowserThread::PostTask(
BrowserThread::UI,
« no previous file with comments | « chrome/browser/plugin_data_remover.cc ('k') | chrome/browser/plugin_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698