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..b27c25040ea31cbb797e89f20da3574cc39b4b18 100644 |
--- a/chrome/browser/plugin_data_remover.h |
+++ b/chrome/browser/plugin_data_remover.h |
@@ -18,16 +18,28 @@ namespace base { |
class MessageLoopProxy; |
} |
-class PluginDataRemover : public PluginProcessHost::Client, |
+class PluginDataRemover : public base::RefCountedThreadSafe<PluginDataRemover>, |
+ public PluginProcessHost::Client, |
public IPC::Channel::Listener { |
public: |
PluginDataRemover(); |
~PluginDataRemover(); |
jam
2010/12/14 17:34:19
nit: ref counted objects should have a private con
Bernhard Bauer
2010/12/14 20:38:37
Right, done.
|
- // 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); |
+ // 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(); |
+ |
+ bool is_removing() { return is_removing_; } |
jam
2010/12/14 17:34:19
nit: const
Bernhard Bauer
2010/12/14 20:38:37
Done.
|
+ |
+ // 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); } |
+ |
// PluginProcessHost::Client methods |
virtual int ID(); |
virtual bool OffTheRecord(); |
@@ -41,17 +53,20 @@ class PluginDataRemover : public PluginProcessHost::Client, |
private: |
void SignalDone(); |
- void SignalError(); |
+ void ConnectToChannel(const IPC::ChannelHandle& handle); |
void OnClearSiteDataResult(bool success); |
void OnTimeout(); |
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_; |
// 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_ |