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

Unified Diff: chrome/browser/extensions/crx_installer.cc

Issue 6965018: Install CRX updates one at a time. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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
Index: chrome/browser/extensions/crx_installer.cc
diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc
index 19285453ed3cc6c2797febdc69710957ed460acc..cde1514786a9ce57ab05c7fd0998baf4329e194a 100644
--- a/chrome/browser/extensions/crx_installer.cc
+++ b/chrome/browser/extensions/crx_installer.cc
@@ -113,9 +113,8 @@ bool CrxInstaller::ClearWhitelistedInstallId(const std::string& id) {
CrxInstaller::CrxInstaller(base::WeakPtr<ExtensionService> frontend_weak,
ExtensionInstallUI* client)
- : install_directory_(frontend_weak->install_directory()),
- install_source_(Extension::INTERNAL),
- extensions_enabled_(frontend_weak->extensions_enabled()),
+ : install_source_(Extension::INTERNAL),
+ extensions_enabled_(false), // Will be set again in body of this method.
delete_source_(false),
is_gallery_install_(false),
create_app_shortcut_(false),
@@ -124,6 +123,13 @@ CrxInstaller::CrxInstaller(base::WeakPtr<ExtensionService> frontend_weak,
apps_require_extension_mime_type_(false),
allow_silent_install_(false),
install_cause_(extension_misc::INSTALL_CAUSE_UNSET) {
+
+ // |frontend_weak| can be NULL at this point in unit tests.
Matt Perry 2011/05/31 21:34:25 Can we instead pass in a mock ExtensionService in
Sam Kerner (Chrome) 2011/05/31 23:16:15 There is ExtensionServiceInterface, which allows e
Matt Perry 2011/05/31 23:41:38 But I'm confused.. The rest of the code does not N
Sam Kerner (Chrome) 2011/06/01 00:15:11 Not sure what you mean: There are checks for fron
Matt Perry 2011/06/01 00:20:20 Ah, of course, sorry. That makes sense.
+ if (!frontend_weak.get())
+ return;
+
+ install_directory_ = frontend_weak->install_directory();
+ extensions_enabled_ = frontend_weak->extensions_enabled();
}
CrxInstaller::~CrxInstaller() {

Powered by Google App Engine
This is Rietveld 408576698