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

Unified Diff: chrome/browser/plugin_data_remover.h

Issue 4832002: Add PluginDataRemover. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: foo Created 10 years, 1 month 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') | no next file with comments »
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
new file mode 100644
index 0000000000000000000000000000000000000000..177dfaf2d7e158658b2cb9ac9c8b183ab6076e8a
--- /dev/null
+++ b/chrome/browser/plugin_data_remover.h
@@ -0,0 +1,58 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_PLUGIN_DATA_REMOVER_H_
+#define CHROME_BROWSER_PLUGIN_DATA_REMOVER_H_
+#pragma once
+
+#include "base/ref_counted.h"
+#include "base/time.h"
+#include "chrome/browser/plugin_process_host.h"
+#include "ipc/ipc_channel_proxy.h"
+#include "ipc/ipc_message.h"
+
+class Task;
+
+namespace base {
+class MessageLoopProxy;
+}
+
+class PluginDataRemover : public PluginProcessHost::Client,
+ public 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.
+ 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();
+
+ // IPC::ChannelProxy::MessageFilter methods
+ virtual void OnMessageReceived(const IPC::Message& message);
+ virtual void OnChannelError();
+
+ private:
+ void SignalDone();
+ void SignalError();
+ void OnClearSiteDataResult(bool success);
+ void OnTimeout();
+
+ scoped_refptr<base::MessageLoopProxy> message_loop_;
+ scoped_ptr<Task> done_task_;
+ 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_;
+ Lock task_lock_;
+};
+
+#endif // CHROME_BROWSER_PLUGIN_DATA_REMOVER_H_
« no previous file with comments | « no previous file | chrome/browser/plugin_data_remover.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698