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

Side by Side Diff: chrome/browser/extensions/webstore_installer.cc

Issue 10832105: Ensure that the WebstoreInstaller is always deleted on the UI thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/webstore_installer.h" 5 #include "chrome/browser/extensions/webstore_installer.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 controller_(controller), 181 controller_(controller),
182 id_(id), 182 id_(id),
183 download_item_(NULL), 183 download_item_(NULL),
184 flags_(flags), 184 flags_(flags),
185 approval_(approval.release()) { 185 approval_(approval.release()) {
186 // TODO(benjhayden): Change this CHECK to DCHECK after http://crbug.com/126013 186 // TODO(benjhayden): Change this CHECK to DCHECK after http://crbug.com/126013
187 CHECK(controller_); 187 CHECK(controller_);
188 download_url_ = GetWebstoreInstallURL(id, flags & FLAG_INLINE_INSTALL ? 188 download_url_ = GetWebstoreInstallURL(id, flags & FLAG_INLINE_INSTALL ?
189 kInlineInstallSource : kDefaultInstallSource); 189 kInlineInstallSource : kDefaultInstallSource);
190 190
191 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
191 registrar_.Add(this, chrome::NOTIFICATION_CRX_INSTALLER_DONE, 192 registrar_.Add(this, chrome::NOTIFICATION_CRX_INSTALLER_DONE,
192 content::NotificationService::AllSources()); 193 content::NotificationService::AllSources());
193 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_INSTALLED, 194 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_INSTALLED,
194 content::Source<Profile>(profile->GetOriginalProfile())); 195 content::Source<Profile>(profile->GetOriginalProfile()));
195 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR, 196 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR,
196 content::Source<CrxInstaller>(NULL)); 197 content::Source<CrxInstaller>(NULL));
197 } 198 }
198 199
199 void WebstoreInstaller::Start() { 200 void WebstoreInstaller::Start() {
200 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 201 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 void WebstoreInstaller::ReportSuccess() { 354 void WebstoreInstaller::ReportSuccess() {
354 if (delegate_) { 355 if (delegate_) {
355 delegate_->OnExtensionInstallSuccess(id_); 356 delegate_->OnExtensionInstallSuccess(id_);
356 delegate_ = NULL; 357 delegate_ = NULL;
357 } 358 }
358 359
359 Release(); // Balanced in Start(). 360 Release(); // Balanced in Start().
360 } 361 }
361 362
362 } // namespace extensions 363 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698