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

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: 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 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";
« 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