summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/webstore_installer.h
diff options
context:
space:
mode:
authorasargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-02 17:23:26 +0000
committerasargent@chromium.org <asargent@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-02 17:23:26 +0000
commited0757eca4ae1bd7a6a8a716ce0686c42ef37268 (patch)
treea048a5dafe8287e2a31ad911a15bd211d05c521c /chrome/browser/extensions/webstore_installer.h
parenta7a7bf9453f4999002dbc2b45c115f2d321d1c7a (diff)
downloadchromium_src-ed0757eca4ae1bd7a6a8a716ce0686c42ef37268.zip
chromium_src-ed0757eca4ae1bd7a6a8a716ce0686c42ef37268.tar.gz
chromium_src-ed0757eca4ae1bd7a6a8a716ce0686c42ef37268.tar.bz2
Ensure that the WebstoreInstaller is always deleted on the UI thread
The crash stacks show a CHECK failure when doing the unregistration due to NotificationRegistrar deletion, indicating that the WebstoreInstaller is getting deleted on a different thread from where the original notification registration took place. This CL makes the ref counting infrastructure always do the delete on the UI thread instead of whichever thread happened to do the last Release, which should hopefully fix the problem. BUG=125485 TEST=CHECK failures with a stack matching the signature in the bug report should stop appearing Review URL: https://chromiumcodereview.appspot.com/10832105 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149646 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/webstore_installer.h')
-rw-r--r--chrome/browser/extensions/webstore_installer.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/chrome/browser/extensions/webstore_installer.h b/chrome/browser/extensions/webstore_installer.h
index 8d2ebb1..aaf95fb 100644
--- a/chrome/browser/extensions/webstore_installer.h
+++ b/chrome/browser/extensions/webstore_installer.h
@@ -12,6 +12,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/values.h"
+#include "content/public/browser/browser_thread.h"
#include "content/public/browser/download_id.h"
#include "content/public/browser/download_item.h"
#include "content/public/browser/notification_observer.h"
@@ -29,9 +30,10 @@ class NavigationController;
namespace extensions {
// Downloads and installs extensions from the web store.
-class WebstoreInstaller : public content::NotificationObserver,
- public content::DownloadItem::Observer,
- public base::RefCounted<WebstoreInstaller> {
+class WebstoreInstaller :public content::NotificationObserver,
+ public content::DownloadItem::Observer,
+ public base::RefCountedThreadSafe<
+ WebstoreInstaller, content::BrowserThread::DeleteOnUIThread> {
public:
enum Flag {
FLAG_NONE = 0,
@@ -125,7 +127,9 @@ class WebstoreInstaller : public content::NotificationObserver,
static void SetDownloadDirectoryForTests(FilePath* directory);
private:
- friend class base::RefCounted<WebstoreInstaller>;
+ friend struct content::BrowserThread::DeleteOnThread<
+ content::BrowserThread::UI>;
+ friend class base::DeleteHelper<WebstoreInstaller>;
virtual ~WebstoreInstaller();
// DownloadManager::DownloadUrl callback.