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

Unified Diff: chrome/browser/plugin_data_remover.h

Issue 5715001: Clean up PluginDataRemover. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: plugingroup Created 10 years 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 | « no previous file | chrome/browser/plugin_data_remover.cc » ('j') | chrome/browser/plugin_data_remover.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugin_data_remover.h
diff --git a/chrome/browser/plugin_data_remover.h b/chrome/browser/plugin_data_remover.h
index cbc255678aeac711efbf95dc7f7251ec00185cc2..fe31848a2e7206fd98424868e62dbfc58fa03ec6 100644
--- a/chrome/browser/plugin_data_remover.h
+++ b/chrome/browser/plugin_data_remover.h
@@ -7,10 +7,10 @@
#pragma once
#include "base/ref_counted.h"
+#include "base/scoped_ptr.h"
+#include "base/task.h"
#include "base/time.h"
-#include "chrome/browser/plugin_process_host.h"
-#include "ipc/ipc_channel_proxy.h"
-#include "ipc/ipc_message.h"
+#include "ipc/ipc_channel.h"
class Task;
@@ -18,40 +18,52 @@ namespace base {
class MessageLoopProxy;
}
-class PluginDataRemover : public PluginProcessHost::Client,
- public IPC::Channel::Listener {
+namespace IPC {
+class ChannelHandle;
+}
+
+class PluginDataRemover : IPC::Channel::Listener {
public:
PluginDataRemover();
~PluginDataRemover();
- // Starts removing plug-in data stored since |begin_time| and calls
- // |done_task| on the current thread when finished.
+ // Starts removing plug-in data stored since |begin_time|. If |done_task| is
+ // not NULL, it is run on the current thread when removing has finished.
void StartRemoving(base::Time begin_time, Task* done_task);
- // PluginProcessHost::Client methods
- virtual int ID();
- virtual bool OffTheRecord();
- virtual void SetPluginInfo(const WebPluginInfo& info);
- virtual void OnChannelOpened(const IPC::ChannelHandle& handle);
- virtual void OnError();
+ // Returns whether there is a plug-in installed that supports removing
+ // LSO data. Because this method possibly has to load the plug-in list, it
+ // should only be called on the FILE thread.
+ static bool IsSupported();
- // IPC::ChannelProxy::MessageFilter methods
- virtual void OnMessageReceived(const IPC::Message& message);
- virtual void OnChannelError();
+ bool is_removing() { return is_removing_; }
+
+ // Sets the task to run when removing has finished. Takes ownership of
+ // the passed task.
+ void set_done_task(Task* task) { done_task_.reset(task); }
private:
- void SignalDone();
- void SignalError();
+ class Internal;
+
+ void OnChannelOpened(const IPC::ChannelHandle& handle);
void OnClearSiteDataResult(bool success);
- void OnTimeout();
+ void SignalDone();
+
+ // IPC::ChannelProxy::MessageFilter methods
+ virtual void OnMessageReceived(const IPC::Message& message);
+ virtual void OnChannelError();
scoped_refptr<base::MessageLoopProxy> message_loop_;
+ bool is_removing_;
scoped_ptr<Task> done_task_;
+ // The point in time when we start removing data.
+ base::Time remove_start_time_;
+ // The point in time from which on we remove data.
base::Time begin_time_;
+ scoped_refptr<Internal> internal_;
// We own the channel, but it's used on the IO thread, so it needs to be
// deleted there as well.
IPC::Channel* channel_;
- ScopedRunnableMethodFactory<PluginDataRemover> method_factory_;
};
#endif // CHROME_BROWSER_PLUGIN_DATA_REMOVER_H_
« no previous file with comments | « no previous file | chrome/browser/plugin_data_remover.cc » ('j') | chrome/browser/plugin_data_remover.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698