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

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

Issue 424053002: Add a new "Configure" mechanism to CLD browser-side data interfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sorin@'s comments 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
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 76900cbd7462f1cdd8cab03bc203d002da25e244..e9b1d7c28ebaeb5339e6b55bf432a79e0fb88489 100644
--- a/chrome/browser/component_updater/cld_component_installer.cc
+++ b/chrome/browser/component_updater/cld_component_installer.cc
@@ -14,7 +14,7 @@
#include "base/logging.h"
#include "base/path_service.h"
#include "components/component_updater/component_updater_paths.h"
-#include "components/translate/content/browser/data_file_browser_cld_data_provider.h"
+#include "components/translate/content/browser/browser_cld_data_provider.h"
#include "content/public/browser/browser_thread.h"
#include "net/ssl/ssl_config_service.h"
@@ -25,7 +25,11 @@ namespace {
// If you change this, also update component_cld_data_harness.cc
// and cld_component_installer_unittest.cc accordingly!
const base::FilePath::CharType kCldDataFileName[] =
- FILE_PATH_LITERAL("cld2_data.bin");
+ FILE_PATH_LITERAL("cld2_data.bin");
+
+// Tracks the last value seen in SetLatestCldDataFile.
+base::LazyInstance<base::FilePath>::Leaky g_latest_cld_data_file =
+ LAZY_INSTANCE_INITIALIZER;
} // namespace
namespace component_updater {
@@ -116,7 +120,12 @@ void RegisterCldComponent(ComponentUpdateService* cus) {
void CldComponentInstallerTraits::SetLatestCldDataFile(
const base::FilePath& path) {
VLOG(1) << "Setting CLD data file location: " << path.value();
- translate::DataFileBrowserCldDataProvider::SetCldDataFilePath(path);
+ *g_latest_cld_data_file.Pointer() = path;
+ translate::SetCldDataFilePath(path);
+}
+
+base::FilePath CldComponentInstallerTraits::GetLatestCldDataFile() {
+ return *g_latest_cld_data_file.Pointer();
Sorin Jianu 2014/07/29 23:08:05 Seems the lazy instance has a member Type& Get() w
}
} // namespace component_updater

Powered by Google App Engine
This is Rietveld 408576698