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

Unified Diff: chrome/browser/component_updater/cld_component_installer.cc

Issue 424123003: Replace the use of CLD_DATA_FROM* and CLD-related ifdefs with runtime checks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 5 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
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/translate/chrome_translate_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/component_updater/cld_component_installer.cc
diff --git a/chrome/browser/component_updater/cld_component_installer.cc b/chrome/browser/component_updater/cld_component_installer.cc
index c81c4b946f7475c1edf2d7ea867e58ff059d5257..7c61f94834fe55dde6d405f24ea7b406714adb74 100644
--- a/chrome/browser/component_updater/cld_component_installer.cc
+++ b/chrome/browser/component_updater/cld_component_installer.cc
@@ -15,6 +15,7 @@
#include "base/path_service.h"
#include "components/component_updater/component_updater_paths.h"
#include "components/translate/content/browser/browser_cld_data_provider.h"
+#include "components/translate/content/common/cld_data_source.h"
#include "content/public/browser/browser_thread.h"
#include "net/ssl/ssl_config_service.h"
@@ -105,6 +106,15 @@ std::string CldComponentInstallerTraits::GetName() const {
}
void RegisterCldComponent(ComponentUpdateService* cus) {
+ // Make sure we don't start up if the CLD data source isn't compatible.
+ if (!translate::CldDataSource::ShouldRegisterForComponentUpdates()) {
+ // This is a serious build-time configuration error.
+ LOG(ERROR) << "Wrong CLD data source: " <<
+ translate::CldDataSource::GetName();
+ NOTREACHED();
+ return;
+ }
+
// This log line is to help with determining which kind of provider has been
// configured. See also: chrome://translate-internals
VLOG(1) << "Registering CLD component with the component update service";
« no previous file with comments | « chrome/browser/chrome_browser_main.cc ('k') | chrome/browser/translate/chrome_translate_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698