diff options
author | sorin <sorin@chromium.org> | 2016-03-23 17:30:37 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-24 00:36:56 +0000 |
commit | 1a34fd0293910fcb86f7c4366b8bbb6a2e3e9b6d (patch) | |
tree | 7ccdec8d02760676fbb69dbc1be27387302f1df8 | |
parent | c27742238e78f1e2f7f6fe37f101eb0d07483416 (diff) | |
download | chromium_src-1a34fd0293910fcb86f7c4366b8bbb6a2e3e9b6d.zip chromium_src-1a34fd0293910fcb86f7c4366b8bbb6a2e3e9b6d.tar.gz chromium_src-1a34fd0293910fcb86f7c4366b8bbb6a2e3e9b6d.tar.bz2 |
Add some more logging to help diagnise component update issues.
Specifically, add more logging to CDM installer.
BUG=597289
Review URL: https://codereview.chromium.org/1830023002
Cr-Commit-Position: refs/heads/master@{#382988}
-rw-r--r-- | chrome/browser/component_updater/widevine_cdm_component_installer.cc | 10 | ||||
-rw-r--r-- | components/component_updater/default_component_installer.cc | 33 |
2 files changed, 31 insertions, 12 deletions
diff --git a/chrome/browser/component_updater/widevine_cdm_component_installer.cc b/chrome/browser/component_updater/widevine_cdm_component_installer.cc index 68c6d58..8f74a94 100644 --- a/chrome/browser/component_updater/widevine_cdm_component_installer.cc +++ b/chrome/browser/component_updater/widevine_cdm_component_installer.cc @@ -280,7 +280,7 @@ void WidevineCdmComponentInstallerTraits::ComponentReady( const base::FilePath& path, scoped_ptr<base::DictionaryValue> manifest) { if (!IsCompatibleWithChrome(*manifest)) { - DLOG(WARNING) << "Installed Widevine CDM component is incompatible."; + VLOG(1) << "Installed Widevine CDM component is incompatible."; return; } @@ -328,6 +328,10 @@ void WidevineCdmComponentInstallerTraits::UpdateCdmAdapter( GetPlatformDirectory(cdm_install_dir) .AppendASCII(kWidevineCdmAdapterFileName); + VLOG(1) << "UpdateCdmAdapter: version" << cdm_version.GetString() + << " adapter_install_path=" << adapter_install_path.AsUTF8Unsafe() + << " adapter_version_path=" << adapter_version_path.AsUTF8Unsafe(); + const std::string chrome_version = version_info::GetVersionNumber(); DCHECK(!chrome_version.empty()); std::string adapter_version; @@ -338,14 +342,14 @@ void WidevineCdmComponentInstallerTraits::UpdateCdmAdapter( adapter_version_path, chrome_version.data(), chrome_version.size()); if (bytes_written < 0 || static_cast<size_t>(bytes_written) != chrome_version.size()) { - DLOG(WARNING) << "Failed to write Widevine CDM adapter version file."; + PLOG(WARNING) << "Failed to write Widevine CDM adapter version file."; // Ignore version file writing failure and try to copy the CDM adapter. } base::FilePath adapter_source_path; PathService::Get(chrome::FILE_WIDEVINE_CDM_ADAPTER, &adapter_source_path); if (!base::CopyFile(adapter_source_path, adapter_install_path)) { - DLOG(WARNING) << "Failed to copy Widevine CDM adapter."; + PLOG(WARNING) << "Failed to copy Widevine CDM adapter."; return; } } diff --git a/components/component_updater/default_component_installer.cc b/components/component_updater/default_component_installer.cc index 659da95..b286e29 100644 --- a/components/component_updater/default_component_installer.cc +++ b/components/component_updater/default_component_installer.cc @@ -74,12 +74,22 @@ bool DefaultComponentInstaller::InstallHelper( const base::DictionaryValue& manifest, const base::FilePath& unpack_path, const base::FilePath& install_path) { - if (!base::Move(unpack_path, install_path)) + VLOG(1) << "InstallHelper: unpack_path=" << unpack_path.AsUTF8Unsafe() + << " install_path=" << install_path.AsUTF8Unsafe(); + + if (!base::Move(unpack_path, install_path)) { + PLOG(ERROR) << "Move failed."; return false; - if (!installer_traits_->OnCustomInstall(manifest, install_path)) + } + if (!installer_traits_->OnCustomInstall(manifest, install_path)) { + PLOG(ERROR) << "CustomInstall failed."; return false; - if (!installer_traits_->VerifyInstallation(manifest, install_path)) + } + if (!installer_traits_->VerifyInstallation(manifest, install_path)) { + PLOG(ERROR) << "VerifyInstallation failed."; return false; + } + return true; } @@ -88,6 +98,10 @@ bool DefaultComponentInstaller::Install(const base::DictionaryValue& manifest, std::string manifest_version; manifest.GetStringASCII("version", &manifest_version); base::Version version(manifest_version); + + VLOG(1) << "Install: version=" << version.GetString() + << " current version=" << current_version_.GetString(); + if (!version.IsValid()) return false; if (current_version_.CompareTo(version) > 0) @@ -140,9 +154,9 @@ void DefaultComponentInstaller::StartRegistration(ComponentUpdateService* cus) { DCHECK(task_runner_->RunsTasksOnCurrentThread()); base::FilePath base_dir = installer_traits_->GetBaseDirectory(); if (!base::PathExists(base_dir) && !base::CreateDirectory(base_dir)) { - NOTREACHED() << "Could not create the base directory for " - << installer_traits_->GetName() << " (" - << base_dir.MaybeAsASCII() << ")."; + PLOG(ERROR) << "Could not create the base directory for " + << installer_traits_->GetName() << " (" + << base_dir.MaybeAsASCII() << ")."; return; } @@ -173,9 +187,9 @@ void DefaultComponentInstaller::StartRegistration(ComponentUpdateService* cus) { scoped_ptr<base::DictionaryValue> manifest = update_client::ReadManifest(path); if (!manifest || !installer_traits_->VerifyInstallation(*manifest, path)) { - DLOG(ERROR) << "Failed to read manifest or verify installation for " - << installer_traits_->GetName() << " (" - << path.MaybeAsASCII() << ")."; + PLOG(ERROR) << "Failed to read manifest or verify installation for " + << installer_traits_->GetName() << " (" << path.MaybeAsASCII() + << ")."; older_paths.push_back(path); continue; } @@ -270,6 +284,7 @@ void DefaultComponentInstaller::FinishRegistration( void DefaultComponentInstaller::ComponentReady( scoped_ptr<base::DictionaryValue> manifest) { + VLOG(1) << "ComponentReady"; installer_traits_->ComponentReady(current_version_, GetInstallDirectory(), std::move(manifest)); } |