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

Unified Diff: content/browser/utility_process_host.h

Issue 9235052: Fix race condition in utility process clients (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added warning comment Created 8 years, 11 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 | « content/browser/plugin_loader_posix.cc ('k') | content/browser/utility_process_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/utility_process_host.h
diff --git a/content/browser/utility_process_host.h b/content/browser/utility_process_host.h
index 779c8499f10b31d122de37739e45709315195b30..ef28fecd5a38f19378f5fe7eeff0ac2eb780189f 100644
--- a/content/browser/utility_process_host.h
+++ b/content/browser/utility_process_host.h
@@ -12,6 +12,7 @@
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/process_util.h"
+#include "base/memory/weak_ptr.h"
#include "content/common/content_export.h"
#include "content/public/browser/browser_child_process_host_delegate.h"
#include "content/public/browser/browser_thread.h"
@@ -26,9 +27,14 @@ class BrowserChildProcessHostImpl;
// If you need multiple batches of work to be done in the sandboxed process,
// use StartBatchMode(), then multiple calls to StartFooBar(p),
// then finish with EndBatchMode().
+//
+// Note: If you keep a ptr to an object of this class that is used in a task
jam 2012/01/26 23:32:15 nit: i think what you want to say here is that if
+// other than the one in which it was created, grab a weak ptr to it to avoid
+// a use after free. See http://crbug.com/108871.
class CONTENT_EXPORT UtilityProcessHost
: public content::BrowserChildProcessHostDelegate,
- public IPC::Message::Sender {
+ public IPC::Message::Sender,
+ public base::SupportsWeakPtr<UtilityProcessHost> {
public:
// An interface to be implemented by consumers of the utility process to
// get results back. All functions are called on the thread passed along
« no previous file with comments | « content/browser/plugin_loader_posix.cc ('k') | content/browser/utility_process_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698