diff options
author | msimonides@opera.com <msimonides@opera.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-23 12:03:33 +0000 |
---|---|---|
committer | msimonides@opera.com <msimonides@opera.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-23 12:03:33 +0000 |
commit | 5206ae88cd5b226471a304c7f5b2740a6a7bfe79 (patch) | |
tree | 4d65e1b52b75c2a922afbeff38f02b40ada6bc9d | |
parent | cd579f088339420404891ea0cb116e95bbb1c2c1 (diff) | |
download | chromium_src-5206ae88cd5b226471a304c7f5b2740a6a7bfe79.zip chromium_src-5206ae88cd5b226471a304c7f5b2740a6a7bfe79.tar.gz chromium_src-5206ae88cd5b226471a304c7f5b2740a6a7bfe79.tar.bz2 |
Create CrxInstaller directly in WebstoreInstaller
The WebstoreInstaller needs a way to keep track of extensions being
downloaded and installed. The installation is handled by CrxInstaller
but when it used to be created automatically by the
ChromeDownloadManagerDelegate, the WebstoreInstaller had little control
over it and needed the CrxInstaller to keep the original_download_url as
sort of an identifier.
With this change the WebstoreInstaller creates the CrxInstaller itself
and keeps a pointer to it so there is no more need for
CrxInstaller::original_download_url().
This is also more robust because URLs are not unique identifiers (there
could be two installations run simultaneously for one download URL which
would have led to a crash in the old code).
BUG=360487
Review URL: https://codereview.chromium.org/226023003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@265615 0039d316-1c4b-4281-b951-d872f2087c98
18 files changed, 91 insertions, 68 deletions
diff --git a/chrome/browser/apps/ephemeral_app_browsertest.cc b/chrome/browser/apps/ephemeral_app_browsertest.cc index b7a6885..1f895c6 100644 --- a/chrome/browser/apps/ephemeral_app_browsertest.cc +++ b/chrome/browser/apps/ephemeral_app_browsertest.cc @@ -277,7 +277,7 @@ IN_PROC_BROWSER_TEST_F(EphemeralAppBrowserTest, UpdateEphemeralApp) { content::Source<extensions::CrxInstaller>(crx_installer)); ExtensionService* service = ExtensionSystem::Get(browser()->profile())->extension_service(); - EXPECT_TRUE(service->UpdateExtension(app_id, app_v2_path, true, GURL(), + EXPECT_TRUE(service->UpdateExtension(app_id, app_v2_path, true, &crx_installer)); windowed_observer.Wait(); diff --git a/chrome/browser/download/chrome_download_manager_delegate.cc b/chrome/browser/download/chrome_download_manager_delegate.cc index dd3b42a..64c93d3 100644 --- a/chrome/browser/download/chrome_download_manager_delegate.cc +++ b/chrome/browser/download/chrome_download_manager_delegate.cc @@ -35,6 +35,7 @@ #include "chrome/browser/download/save_package_file_picker.h" #include "chrome/browser/extensions/api/downloads/downloads_api.h" #include "chrome/browser/extensions/crx_installer.h" +#include "chrome/browser/extensions/webstore_installer.h" #include "chrome/browser/platform_util.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/safe_browsing/safe_browsing_service.h" @@ -369,7 +370,8 @@ bool ChromeDownloadManagerDelegate::ShouldCompleteDownload( bool ChromeDownloadManagerDelegate::ShouldOpenDownload( DownloadItem* item, const content::DownloadOpenDelayedCallback& callback) { - if (download_crx_util::IsExtensionDownload(*item)) { + if (download_crx_util::IsExtensionDownload(*item) && + !extensions::WebstoreInstaller::GetAssociatedApproval(*item)) { scoped_refptr<extensions::CrxInstaller> crx_installer = download_crx_util::OpenChromeExtension(profile_, *item); diff --git a/chrome/browser/download/download_crx_util.cc b/chrome/browser/download/download_crx_util.cc index bea0aaa..441c82b 100644 --- a/chrome/browser/download/download_crx_util.cc +++ b/chrome/browser/download/download_crx_util.cc @@ -69,11 +69,9 @@ void SetMockInstallPromptForTesting( mock_install_prompt_for_testing = mock_prompt.release(); } -scoped_refptr<extensions::CrxInstaller> OpenChromeExtension( +scoped_refptr<extensions::CrxInstaller> CreateCrxInstaller( Profile* profile, - const DownloadItem& download_item) { - DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - + const content::DownloadItem& download_item) { ExtensionService* service = extensions::ExtensionSystem::Get(profile)-> extension_service(); CHECK(service); @@ -87,6 +85,19 @@ scoped_refptr<extensions::CrxInstaller> OpenChromeExtension( installer->set_error_on_unsupported_requirements(true); installer->set_delete_source(true); installer->set_install_cause(extension_misc::INSTALL_CAUSE_USER_DOWNLOAD); + installer->set_original_mime_type(download_item.GetOriginalMimeType()); + installer->set_apps_require_extension_mime_type(true); + + return installer; +} + +scoped_refptr<extensions::CrxInstaller> OpenChromeExtension( + Profile* profile, + const DownloadItem& download_item) { + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + + scoped_refptr<extensions::CrxInstaller> installer( + CreateCrxInstaller(profile, download_item)); if (OffStoreInstallAllowedByPrefs(profile, download_item)) { installer->set_off_store_install_allow_reason( @@ -98,15 +109,7 @@ scoped_refptr<extensions::CrxInstaller> OpenChromeExtension( installer->InstallUserScript(download_item.GetFullPath(), download_item.GetURL()); } else { - bool is_gallery_download = - WebstoreInstaller::GetAssociatedApproval(download_item) != NULL; - installer->set_original_mime_type(download_item.GetOriginalMimeType()); - installer->set_apps_require_extension_mime_type(true); - installer->set_download_url(download_item.GetURL()); - installer->set_is_gallery_install(is_gallery_download); - if (is_gallery_download) - installer->set_original_download_url(download_item.GetOriginalUrl()); - installer->set_allow_silent_install(is_gallery_download); + DCHECK(!WebstoreInstaller::GetAssociatedApproval(download_item)); installer->InstallCrx(download_item.GetFullPath()); } diff --git a/chrome/browser/download/download_crx_util.h b/chrome/browser/download/download_crx_util.h index 1807a59..cc99c19 100644 --- a/chrome/browser/download/download_crx_util.h +++ b/chrome/browser/download/download_crx_util.h @@ -30,6 +30,11 @@ namespace download_crx_util { void SetMockInstallPromptForTesting( scoped_ptr<ExtensionInstallPrompt> mock_prompt); +// Create and pre-configure a CrxInstaller for a given |download_item|. +scoped_refptr<extensions::CrxInstaller> CreateCrxInstaller( + Profile* profile, + const content::DownloadItem& download_item); + // Start installing a downloaded item item as a CRX (extension, theme, app, // ...). The installer does work on the file thread, so the installation // is not complete when this function returns. Returns the object managing diff --git a/chrome/browser/download/download_crx_util_android.cc b/chrome/browser/download/download_crx_util_android.cc index 4b068a8..76c9d81 100644 --- a/chrome/browser/download/download_crx_util_android.cc +++ b/chrome/browser/download/download_crx_util_android.cc @@ -14,6 +14,15 @@ using content::DownloadItem; namespace download_crx_util { +scoped_refptr<extensions::CrxInstaller> CreateCrxInstaller( + Profile* profile, + const content::DownloadItem& download_item) { + NOTIMPLEMENTED() << "CrxInstaller not implemented on Android"; + scoped_refptr<extensions::CrxInstaller> installer( + extensions::CrxInstaller::CreateSilent(NULL)); + return installer; +} + void SetMockInstallPromptForTesting(ExtensionInstallPrompt* mock_prompt) { NOTIMPLEMENTED(); } diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc index 3ef646a..57d2a36 100644 --- a/chrome/browser/extensions/crx_installer.cc +++ b/chrome/browser/extensions/crx_installer.cc @@ -167,6 +167,7 @@ CrxInstaller::CrxInstaller( } CrxInstaller::~CrxInstaller() { + LOG(WARNING) << "Destroying"; // Make sure the UI is deleted on the ui thread. if (client_) { BrowserThread::DeleteSoon(BrowserThread::UI, FROM_HERE, client_); @@ -836,6 +837,7 @@ void CrxInstaller::NotifyCrxInstallComplete(bool success) { void CrxInstaller::CleanupTempFiles() { if (!installer_task_runner_->RunsTasksOnCurrentThread()) { + LOG(WARNING) << "Post CleanupTempFiles"; if (!installer_task_runner_->PostTask( FROM_HERE, base::Bind(&CrxInstaller::CleanupTempFiles, this))) { @@ -844,6 +846,7 @@ void CrxInstaller::CleanupTempFiles() { return; } + LOG(WARNING) << "CleanupTempFiles"; // Delete the temp directory and crx file as necessary. if (!temp_dir_.value().empty()) { file_util::DeleteFile(temp_dir_, true); diff --git a/chrome/browser/extensions/crx_installer.h b/chrome/browser/extensions/crx_installer.h index 4d0b965..8e3575b 100644 --- a/chrome/browser/extensions/crx_installer.h +++ b/chrome/browser/extensions/crx_installer.h @@ -110,9 +110,6 @@ class CrxInstaller int creation_flags() const { return creation_flags_; } void set_creation_flags(int val) { creation_flags_ = val; } - const GURL& download_url() const { return download_url_; } - void set_download_url(const GURL& val) { download_url_ = val; } - const base::FilePath& source_file() const { return source_file_; } Manifest::Location install_source() const { @@ -146,14 +143,6 @@ class CrxInstaller creation_flags_ &= ~Extension::FROM_WEBSTORE; } - // The original download URL should be set when the WebstoreInstaller is - // tracking the installation. The WebstoreInstaller uses this URL to match - // failure notifications to the extension. - const GURL& original_download_url() const { return original_download_url_; } - void set_original_download_url(const GURL& url) { - original_download_url_ = url; - } - // If |apps_require_extension_mime_type_| is set to true, be sure to set // |original_mime_type_| as well. void set_apps_require_extension_mime_type( @@ -314,9 +303,6 @@ class CrxInstaller // to false. bool delete_source_; - // The download URL, before redirects, if this is a gallery install. - GURL original_download_url_; - // Whether to create an app shortcut after successful installation. This is // set based on the user's selection in the UI and can only ever be true for // apps. diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc index ee477c1..4ef8413 100644 --- a/chrome/browser/extensions/extension_service.cc +++ b/chrome/browser/extensions/extension_service.cc @@ -503,7 +503,6 @@ void ExtensionService::LoadGreylistFromPrefs() { bool ExtensionService::UpdateExtension(const std::string& id, const base::FilePath& extension_path, bool file_ownership_passed, - const GURL& download_url, CrxInstaller** out_crx_installer) { CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (browser_terminating_) { @@ -583,7 +582,6 @@ bool ExtensionService::UpdateExtension(const std::string& id, installer->set_creation_flags(creation_flags); installer->set_delete_source(file_ownership_passed); - installer->set_download_url(download_url); installer->set_install_cause(extension_misc::INSTALL_CAUSE_UPDATE); installer->InstallCrx(extension_path); diff --git a/chrome/browser/extensions/extension_service.h b/chrome/browser/extensions/extension_service.h index 926e888..09a8795 100644 --- a/chrome/browser/extensions/extension_service.h +++ b/chrome/browser/extensions/extension_service.h @@ -84,7 +84,6 @@ class ExtensionServiceInterface const std::string& id, const base::FilePath& path, bool file_ownership_passed, - const GURL& download_url, extensions::CrxInstaller** out_crx_installer) = 0; virtual const extensions::Extension* GetExtensionById( const std::string& id, @@ -190,7 +189,6 @@ class ExtensionService const std::string& id, const base::FilePath& extension_path, bool file_ownership_passed, - const GURL& download_url, extensions::CrxInstaller** out_crx_installer) OVERRIDE; // Reloads the specified extension, sending the onLaunched() event to it if it diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc index ee5039f..bbbff27 100644 --- a/chrome/browser/extensions/extension_service_unittest.cc +++ b/chrome/browser/extensions/extension_service_unittest.cc @@ -981,7 +981,7 @@ class ExtensionServiceTest content::WindowedNotificationObserver observer( chrome::NOTIFICATION_CRX_INSTALLER_DONE, base::Bind(&IsCrxInstallerDone, &installer)); - service_->UpdateExtension(id, path, true, GURL(), &installer); + service_->UpdateExtension(id, path, true, &installer); if (installer) observer.Wait(); @@ -2789,7 +2789,7 @@ TEST_F(ExtensionServiceTest, UpdateExtensionDuringShutdown) { // Update should fail and extension should not be updated. path = data_dir_.AppendASCII("good2.crx"); - bool updated = service_->UpdateExtension(good_crx, path, true, GURL(), NULL); + bool updated = service_->UpdateExtension(good_crx, path, true, NULL); ASSERT_FALSE(updated); ASSERT_EQ("1.0.0.0", service_->GetExtensionById(good_crx, false)-> diff --git a/chrome/browser/extensions/test_extension_service.cc b/chrome/browser/extensions/test_extension_service.cc index af82db2..e8385e4 100644 --- a/chrome/browser/extensions/test_extension_service.cc +++ b/chrome/browser/extensions/test_extension_service.cc @@ -25,7 +25,6 @@ bool TestExtensionService::UpdateExtension( const std::string& id, const base::FilePath& path, bool file_ownership_passed, - const GURL& download_url, extensions::CrxInstaller** out_crx_installer) { ADD_FAILURE(); return false; diff --git a/chrome/browser/extensions/test_extension_service.h b/chrome/browser/extensions/test_extension_service.h index e92e034..a68fe85 100644 --- a/chrome/browser/extensions/test_extension_service.h +++ b/chrome/browser/extensions/test_extension_service.h @@ -31,7 +31,6 @@ class TestExtensionService : public ExtensionServiceInterface { const std::string& id, const base::FilePath& path, bool file_ownership_passed, - const GURL& download_url, extensions::CrxInstaller** out_crx_installer) OVERRIDE; virtual const extensions::Extension* GetExtensionById( const std::string& id, bool include_disabled) const OVERRIDE; diff --git a/chrome/browser/extensions/updater/extension_updater.cc b/chrome/browser/extensions/updater/extension_updater.cc index 4afe45c..14d9934 100644 --- a/chrome/browser/extensions/updater/extension_updater.cc +++ b/chrome/browser/extensions/updater/extension_updater.cc @@ -102,16 +102,14 @@ ExtensionUpdater::FetchedCRXFile::FetchedCRXFile( const std::string& i, const base::FilePath& p, bool file_ownership_passed, - const GURL& u, const std::set<int>& request_ids) : extension_id(i), path(p), file_ownership_passed(file_ownership_passed), - download_url(u), request_ids(request_ids) {} ExtensionUpdater::FetchedCRXFile::FetchedCRXFile() - : path(), file_ownership_passed(true), download_url() {} + : path(), file_ownership_passed(true) {} ExtensionUpdater::FetchedCRXFile::~FetchedCRXFile() {} @@ -485,8 +483,7 @@ void ExtensionUpdater::OnExtensionDownloadFinished( VLOG(2) << download_url << " written to " << path.value(); - FetchedCRXFile fetched(id, path, file_ownership_passed, download_url, - request_ids); + FetchedCRXFile fetched(id, path, file_ownership_passed, request_ids); fetched_crx_files_.push(fetched); // MaybeInstallCRXFile() removes extensions from |in_progress_ids_| after @@ -560,7 +557,6 @@ void ExtensionUpdater::MaybeInstallCRXFile() { if (service_->UpdateExtension(crx_file.extension_id, crx_file.path, crx_file.file_ownership_passed, - crx_file.download_url, &installer)) { crx_install_is_running_ = true; current_crx_file_ = crx_file; diff --git a/chrome/browser/extensions/updater/extension_updater.h b/chrome/browser/extensions/updater/extension_updater.h index b6be1e1..15319dd 100644 --- a/chrome/browser/extensions/updater/extension_updater.h +++ b/chrome/browser/extensions/updater/extension_updater.h @@ -126,14 +126,12 @@ class ExtensionUpdater : public ExtensionDownloaderDelegate, FetchedCRXFile(const std::string& id, const base::FilePath& path, bool file_ownership_passed, - const GURL& download_url, const std::set<int>& request_ids); ~FetchedCRXFile(); std::string extension_id; base::FilePath path; bool file_ownership_passed; - GURL download_url; std::set<int> request_ids; }; diff --git a/chrome/browser/extensions/updater/extension_updater_unittest.cc b/chrome/browser/extensions/updater/extension_updater_unittest.cc index 195616f..6c3721c 100644 --- a/chrome/browser/extensions/updater/extension_updater_unittest.cc +++ b/chrome/browser/extensions/updater/extension_updater_unittest.cc @@ -411,11 +411,9 @@ class ServiceForDownloadTests : public MockService { const std::string& id, const base::FilePath& extension_path, bool file_ownership_passed, - const GURL& download_url, CrxInstaller** out_crx_installer) OVERRIDE { extension_id_ = id; install_path_ = extension_path; - download_url_ = download_url; if (ContainsKey(fake_crx_installers_, id)) { *out_crx_installer = fake_crx_installers_[id]; @@ -437,7 +435,6 @@ class ServiceForDownloadTests : public MockService { const std::string& extension_id() const { return extension_id_; } const base::FilePath& install_path() const { return install_path_; } - const GURL& download_url() const { return download_url_; } private: // Hold the set of ids that UpdateExtension() should fake success on. @@ -1078,7 +1075,6 @@ class ExtensionUpdaterTest : public testing::Test { EXPECT_EQ(id, service->extension_id()); base::FilePath tmpfile_path = service->install_path(); EXPECT_FALSE(tmpfile_path.empty()); - EXPECT_EQ(test_url, service->download_url()); EXPECT_EQ(extension_file_path, tmpfile_path); } } @@ -1161,7 +1157,6 @@ class ExtensionUpdaterTest : public testing::Test { EXPECT_EQ(id, service->extension_id()); base::FilePath tmpfile_path = service->install_path(); EXPECT_FALSE(tmpfile_path.empty()); - EXPECT_EQ(test_url, service->download_url()); EXPECT_EQ(extension_file_path, tmpfile_path); } } @@ -1259,7 +1254,6 @@ class ExtensionUpdaterTest : public testing::Test { base::FilePath tmpfile_path = service.install_path(); EXPECT_FALSE(tmpfile_path.empty()); EXPECT_EQ(id1, service.extension_id()); - EXPECT_EQ(url1, service.download_url()); RunUntilIdle(); // Make sure the second fetch finished and asked the service to do an @@ -1282,7 +1276,6 @@ class ExtensionUpdaterTest : public testing::Test { // The second install should not have run, because the first has not // sent a notification that it finished. EXPECT_EQ(id1, service.extension_id()); - EXPECT_EQ(url1, service.download_url()); // Fake install notice. This should start the second installation, // which will be checked below. @@ -1292,7 +1285,6 @@ class ExtensionUpdaterTest : public testing::Test { } EXPECT_EQ(id2, service.extension_id()); - EXPECT_EQ(url2, service.download_url()); EXPECT_FALSE(service.install_path().empty()); // Make sure the correct crx contents were passed for the update call. diff --git a/chrome/browser/extensions/webstore_installer.cc b/chrome/browser/extensions/webstore_installer.cc index 7cd835e..07e6e72 100644 --- a/chrome/browser/extensions/webstore_installer.cc +++ b/chrome/browser/extensions/webstore_installer.cc @@ -339,10 +339,12 @@ void WebstoreInstaller::Observe(int type, const Extension* extension = content::Details<const Extension>(details).ptr(); CrxInstaller* installer = content::Source<CrxInstaller>(source).ptr(); - if (extension == NULL && download_item_ != NULL && - installer->download_url() == download_item_->GetURL() && - installer->profile()->IsSameProfile(profile_)) { - ReportFailure(kInstallCanceledError, FAILURE_REASON_CANCELLED); + if (crx_installer_.get() == installer) { + crx_installer_ = NULL; + // ReportFailure releases a reference to this object so it must be the + // last operation in this method. + if (extension == NULL) + ReportFailure(kInstallCanceledError, FAILURE_REASON_CANCELLED); } break; } @@ -384,7 +386,7 @@ void WebstoreInstaller::Observe(int type, case chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR: { CrxInstaller* crx_installer = content::Source<CrxInstaller>(source).ptr(); CHECK(crx_installer); - if (!profile_->IsSameProfile(crx_installer->profile())) + if (crx_installer != crx_installer_.get()) return; // TODO(rdevlin.cronin): Continue removing std::string errors and @@ -392,8 +394,10 @@ void WebstoreInstaller::Observe(int type, const base::string16* error = content::Details<const base::string16>(details).ptr(); const std::string utf8_error = base::UTF16ToUTF8(*error); - if (download_url_ == crx_installer->original_download_url()) - ReportFailure(utf8_error, FAILURE_REASON_OTHER); + crx_installer_ = NULL; + // ReportFailure releases a reference to this object so it must be the + // last operation in this method. + ReportFailure(utf8_error, FAILURE_REASON_OTHER); break; } @@ -473,13 +477,19 @@ void WebstoreInstaller::OnDownloadUpdated(DownloadItem* download) { // Wait for other notifications if the download is really an extension. if (!download_crx_util::IsExtensionDownload(*download)) { ReportFailure(kInvalidDownloadError, FAILURE_REASON_OTHER); - } else if (pending_modules_.empty()) { - // The download is the last module - the extension main module. - if (delegate_) - delegate_->OnExtensionDownloadProgress(id_, download); - extensions::InstallTracker* tracker = - extensions::InstallTrackerFactory::GetForProfile(profile_); - tracker->OnDownloadProgress(id_, 100); + } else { + if (crx_installer_.get()) + return; // DownloadItemImpl calls the observer twice, ignore it. + StartCrxInstaller(*download); + + if (pending_modules_.empty()) { + // The download is the last module - the extension main module. + if (delegate_) + delegate_->OnExtensionDownloadProgress(id_, download); + extensions::InstallTracker* tracker = + extensions::InstallTrackerFactory::GetForProfile(profile_); + tracker->OnDownloadProgress(id_, 100); + } } // Stop the progress timer if it's running. download_progress_timer_.Stop(); @@ -652,6 +662,26 @@ void WebstoreInstaller::UpdateDownloadProgress() { } } +void WebstoreInstaller::StartCrxInstaller(const DownloadItem& download) { + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); + DCHECK(!crx_installer_.get()); + + ExtensionService* service = ExtensionSystem::Get(profile_)-> + extension_service(); + CHECK(service); + + const Approval* approval = GetAssociatedApproval(download); + DCHECK(approval); + + crx_installer_ = download_crx_util::CreateCrxInstaller(profile_, download); + + crx_installer_->set_expected_id(approval->extension_id); + crx_installer_->set_is_gallery_install(true); + crx_installer_->set_allow_silent_install(true); + + crx_installer_->InstallCrx(download.GetFullPath()); +} + void WebstoreInstaller::ReportFailure(const std::string& error, FailureReason reason) { if (delegate_) { diff --git a/chrome/browser/extensions/webstore_installer.h b/chrome/browser/extensions/webstore_installer.h index 25b2181..bf1da97 100644 --- a/chrome/browser/extensions/webstore_installer.h +++ b/chrome/browser/extensions/webstore_installer.h @@ -38,6 +38,7 @@ class WebContents; namespace extensions { +class CrxInstaller; class Extension; class Manifest; @@ -228,6 +229,9 @@ class WebstoreInstaller : public content::NotificationObserver, // Updates the InstallTracker with the latest download progress. void UpdateDownloadProgress(); + // Creates and starts CrxInstaller for the downloaded extension package. + void StartCrxInstaller(const content::DownloadItem& item); + // Reports an install |error| to the delegate for the given extension if this // managed its installation. This also removes the associated PendingInstall. void ReportFailure(const std::string& error, FailureReason reason); @@ -254,6 +258,7 @@ class WebstoreInstaller : public content::NotificationObserver, base::OneShotTimer<WebstoreInstaller> download_progress_timer_; scoped_ptr<Approval> approval_; GURL download_url_; + scoped_refptr<CrxInstaller> crx_installer_; // Pending modules. std::list<SharedModuleInfo::ImportInfo> pending_modules_; diff --git a/chrome/browser/performance_monitor/performance_monitor_browsertest.cc b/chrome/browser/performance_monitor/performance_monitor_browsertest.cc index 51d0133..61096ee 100644 --- a/chrome/browser/performance_monitor/performance_monitor_browsertest.cc +++ b/chrome/browser/performance_monitor/performance_monitor_browsertest.cc @@ -474,7 +474,7 @@ IN_PROC_BROWSER_TEST_F(PerformanceMonitorBrowserTest, UpdateExtensionEvent) { chrome::NOTIFICATION_CRX_INSTALLER_DONE, content::Source<extensions::CrxInstaller>(crx_installer)); ASSERT_TRUE(extension_service-> - UpdateExtension(extension->id(), path_v2_, true, GURL(), &crx_installer)); + UpdateExtension(extension->id(), path_v2_, true, &crx_installer)); windowed_observer.Wait(); extension = extension_service->GetExtensionById( |