diff options
author | jackhou@chromium.org <jackhou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-08 04:19:49 +0000 |
---|---|---|
committer | jackhou@chromium.org <jackhou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-08 04:19:49 +0000 |
commit | 559106f492065a0b3d9f5541bfc29f2bec49567f (patch) | |
tree | 12409bec9892565a3f76d25402aceecb3220e60d /apps/app_shim | |
parent | 83b0c24c16bd8fabbfc6d4004a301d757db00bc1 (diff) | |
download | chromium_src-559106f492065a0b3d9f5541bfc29f2bec49567f.zip chromium_src-559106f492065a0b3d9f5541bfc29f2bec49567f.tar.gz chromium_src-559106f492065a0b3d9f5541bfc29f2bec49567f.tar.bz2 |
Delete AppShimHostManager on UI thread. (Mac)
This has been crashing on shutdown due to a CHECK in
NotificationServiceImpl::RemoveObserver from:
- content::NotificationRegistrar::~NotificationRegistrar()
- apps::ExtensionAppShimHandler::~ExtensionAppShimHandler()
- AppShimHostManager::~AppShimHostManager()
As per the comments in RemoveObserver, the fix is to delete the
NotificationRegistrar on the same thread that created it.
BUG=304197
Review URL: https://codereview.chromium.org/26398003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@227461 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'apps/app_shim')
-rw-r--r-- | apps/app_shim/app_shim_host_manager_mac.h | 7 | ||||
-rw-r--r-- | apps/app_shim/app_shim_host_manager_mac.mm | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/apps/app_shim/app_shim_host_manager_mac.h b/apps/app_shim/app_shim_host_manager_mac.h index 73381ef..1d18352 100644 --- a/apps/app_shim/app_shim_host_manager_mac.h +++ b/apps/app_shim/app_shim_host_manager_mac.h @@ -7,6 +7,7 @@ #include "apps/app_shim/extension_app_shim_handler_mac.h" #include "base/memory/ref_counted.h" +#include "content/public/browser/browser_thread.h" #include "ipc/ipc_channel_factory.h" namespace base { @@ -21,7 +22,8 @@ class AppShimHostManagerTestApi; // socket (|factory_|) and creates a helper object to manage the connection. class AppShimHostManager : public IPC::ChannelFactory::Delegate, - public base::RefCountedThreadSafe<AppShimHostManager> { + public base::RefCountedThreadSafe< + AppShimHostManager, content::BrowserThread::DeleteOnUIThread> { public: AppShimHostManager(); @@ -36,6 +38,9 @@ class AppShimHostManager private: friend class base::RefCountedThreadSafe<AppShimHostManager>; + friend struct content::BrowserThread::DeleteOnThread< + content::BrowserThread::UI>; + friend class base::DeleteHelper<AppShimHostManager>; friend class test::AppShimHostManagerTestApi; virtual ~AppShimHostManager(); diff --git a/apps/app_shim/app_shim_host_manager_mac.mm b/apps/app_shim/app_shim_host_manager_mac.mm index e28970e..3e1772a 100644 --- a/apps/app_shim/app_shim_host_manager_mac.mm +++ b/apps/app_shim/app_shim_host_manager_mac.mm @@ -12,7 +12,6 @@ #include "base/path_service.h" #include "chrome/browser/browser_process.h" #include "chrome/common/chrome_paths.h" -#include "content/public/browser/browser_thread.h" #include "chrome/common/mac/app_mode_common.h" using content::BrowserThread; |