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 e922479acf1aeb247793220726ca8597dbd8414a..61be9732d67ca6f6704f6ba276f10f11cd33c37a 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. |
Sorin Jianu
2014/07/29 18:04:47
I wonder if the new code can be refactored and imp
|
+ if (translate::CldDataSource::GetName() != "component") { |
Sorin Jianu
2014/07/29 18:04:47
Do we have concerns re: hard coded literal "compon
|
+ // This is a serious build-time configuration error. |
+ LOG(ERROR) << "Wrong CLD data source: " << |
jochen (gone - plz use gerrit)
2014/07/29 15:30:01
why not LOG(FATAL)?
|
+ 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"; |