| 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 3ec1f595e63dec2dfdbf71ac4ce59db7796bc49d..92878874692d079da7dd0e9f2bb179d407e08057 100644
|
| --- a/chrome/browser/component_updater/cld_component_installer.cc
|
| +++ b/chrome/browser/component_updater/cld_component_installer.cc
|
| @@ -15,8 +15,8 @@
|
| #include "base/path_service.h"
|
| #include "base/platform_file.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| -#include "chrome/common/chrome_constants.h"
|
| #include "chrome/common/chrome_paths.h"
|
| +#include "components/translate/content/browser/data_file_browser_cld_data_provider.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "net/ssl/ssl_config_service.h"
|
|
|
| @@ -28,11 +28,13 @@ namespace {
|
| // Once we have acquired a valid file from the component installer, we need to
|
| // make the path available to other parts of the system such as the
|
| // translation libraries. We create a global to hold onto the path, and a
|
| -// lock to guard it. See GetLatestCldDataFile(...) for more info.
|
| +// lock to guard it.
|
| base::LazyInstance<base::Lock> cld_file_lock = LAZY_INSTANCE_INITIALIZER;
|
| base::LazyInstance<base::FilePath> cld_file = LAZY_INSTANCE_INITIALIZER;
|
| +const base::FilePath::CharType kCLDDataFilename[] =
|
| + FILE_PATH_LITERAL("cld2_data.bin");
|
|
|
| -}
|
| +} // namespace
|
|
|
| namespace component_updater {
|
|
|
| @@ -67,7 +69,7 @@ base::FilePath CldComponentInstallerTraits::GetInstalledPath(
|
| // NB: This may change when 64-bit is officially supported.
|
| return base.Append(FILE_PATH_LITERAL("_platform_specific"))
|
| .Append(FILE_PATH_LITERAL("all"))
|
| - .Append(chrome::kCLDDataFilename);
|
| + .Append(kCLDDataFilename);
|
| }
|
|
|
| void CldComponentInstallerTraits::ComponentReady(
|
| @@ -118,14 +120,16 @@ void RegisterCldComponent(ComponentUpdateService* cus) {
|
| void CldComponentInstallerTraits::SetLatestCldDataFile(
|
| const base::FilePath& path) {
|
| VLOG(1) << "Setting CLD data file location: " << path.value();
|
| - base::AutoLock lock(cld_file_lock.Get());
|
| - cld_file.Get() = path;
|
| + {
|
| + base::AutoLock lock(cld_file_lock.Get());
|
| + cld_file.Get() = path;
|
| + }
|
| + translate::DataFileBrowserCldDataProvider::SetCldDataFilePath(path);
|
| }
|
|
|
| -base::FilePath GetLatestCldDataFile() {
|
| - base::AutoLock lock(cld_file_lock.Get());
|
| - // cld_file is an empty path by default, meaning "file not available yet".
|
| - return cld_file.Get();
|
| +const base::FilePath::CharType*
|
| + CldComponentInstallerTraits::GetCldDataFileName() {
|
| + return kCLDDataFilename;
|
| }
|
|
|
| } // namespace component_updater
|
|
|