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

Unified Diff: chrome/browser/extensions/extension_message_service.h

Issue 440012: Fixing 27834 by always deleting ExtensionMessageService on... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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
Index: chrome/browser/extensions/extension_message_service.h
===================================================================
--- chrome/browser/extensions/extension_message_service.h (revision 32822)
+++ chrome/browser/extensions/extension_message_service.h (working copy)
@@ -12,6 +12,7 @@
#include "base/lock.h"
#include "base/ref_counted.h"
#include "chrome/common/notification_registrar.h"
+#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/extensions/extension_devtools_manager.h"
#include "ipc/ipc_message.h"
@@ -44,7 +45,8 @@
// case that the port is a tab). The Sender is usually either a
// RenderProcessHost or a RenderViewHost.
class ExtensionMessageService
- : public base::RefCountedThreadSafe<ExtensionMessageService>,
+ : public base::RefCountedThreadSafe<
+ ExtensionMessageService, ChromeThread::DeleteOnUIThread>,
public NotificationObserver {
public:
// Javascript function name constants.
@@ -127,7 +129,8 @@
ResourceMessageFilter* source);
private:
- friend class base::RefCountedThreadSafe<ExtensionMessageService>;
+ friend class ChromeThread;
+ friend class DeleteTask<ExtensionMessageService>;
// A map of channel ID to its channel object.
typedef std::map<int, MessageChannel*> MessageChannelMap;
@@ -195,6 +198,9 @@
// used on the IO thread or the UI thread.
Lock next_port_id_lock_;
+ // The thread creating this object. Should be UI thread.
+ ChromeThread::ID thread_id_;
+
DISALLOW_COPY_AND_ASSIGN(ExtensionMessageService);
};

Powered by Google App Engine
This is Rietveld 408576698