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

Unified Diff: content/browser/plugin_data_remover_impl.h

Issue 8603012: Fix race in PluginDataRemoverImpl going away while it's still being used on the IO thread... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Move Context class to cc file Created 9 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 | content/browser/plugin_data_remover_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/plugin_data_remover_impl.h
===================================================================
--- content/browser/plugin_data_remover_impl.h (revision 110950)
+++ content/browser/plugin_data_remover_impl.h (working copy)
@@ -9,14 +9,10 @@
#include <string>
#include "base/compiler_specific.h"
-#include "base/memory/weak_ptr.h"
-#include "content/browser/plugin_process_host.h"
+#include "base/memory/ref_counted.h"
#include "content/public/browser/plugin_data_remover.h"
-class CONTENT_EXPORT PluginDataRemoverImpl
- : public content::PluginDataRemover,
- public NON_EXPORTED_BASE(PluginProcessHost::Client),
- public IPC::Channel::Listener {
+class CONTENT_EXPORT PluginDataRemoverImpl : public content::PluginDataRemover {
public:
explicit PluginDataRemoverImpl(
const content::ResourceContext& resource_context);
@@ -30,48 +26,16 @@
// different plug-in (for example in tests).
void set_mime_type(const std::string& mime_type) { mime_type_ = mime_type; }
- // PluginProcessHost::Client methods.
- virtual int ID() OVERRIDE;
- virtual bool OffTheRecord() OVERRIDE;
- virtual const content::ResourceContext& GetResourceContext() OVERRIDE;
- virtual void SetPluginInfo(const webkit::WebPluginInfo& info) OVERRIDE;
- virtual void OnFoundPluginProcessHost(PluginProcessHost* host) OVERRIDE;
- virtual void OnSentPluginChannelRequest() OVERRIDE;
- virtual void OnChannelOpened(const IPC::ChannelHandle& handle) OVERRIDE;
- virtual void OnError() OVERRIDE;
-
- // IPC::Channel::Listener methods.
- virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
- virtual void OnChannelError() OVERRIDE;
-
private:
- // Signals that we are finished with removing data (successful or not). This
- // method is safe to call multiple times.
- void SignalDone();
- // Connects the client side of a newly opened plug-in channel.
- void ConnectToChannel(const IPC::ChannelHandle& handle);
- // Handles the PluginHostMsg_ClearSiteDataResult message.
- void OnClearSiteDataResult(bool success);
- // Called when a timeout happens in order not to block the client
- // indefinitely.
- void OnTimeout();
+ class Context;
std::string mime_type_;
- bool is_starting_process_;
- bool is_removing_;
- // 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_;
// The resource context for the profile.
- const content::ResourceContext& context_;
- scoped_ptr<base::WaitableEvent> event_;
- // We own the channel, but it's used on the IO thread, so it needs to be
- // deleted there. It's NULL until we have opened a connection to the plug-in
- // process.
- IPC::Channel* channel_;
+ const content::ResourceContext& resource_context_;
- base::WeakPtrFactory<PluginDataRemoverImpl> weak_factory_;
+ // This allows this object to be deleted on the UI thread while it's still
+ // being used on the IO thread.
+ scoped_refptr<Context> context_;
DISALLOW_COPY_AND_ASSIGN(PluginDataRemoverImpl);
};
« no previous file with comments | « no previous file | content/browser/plugin_data_remover_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698