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

Unified Diff: components/translate/content/browser/browser_cld_data_provider_factory.cc

Issue 2034413003: Delete the non-static CLD data source logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase to latest master Created 4 years, 6 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: components/translate/content/browser/browser_cld_data_provider_factory.cc
diff --git a/components/translate/content/browser/browser_cld_data_provider_factory.cc b/components/translate/content/browser/browser_cld_data_provider_factory.cc
deleted file mode 100644
index 260aed3879672ea4f01034781e70838177e844ed..0000000000000000000000000000000000000000
--- a/components/translate/content/browser/browser_cld_data_provider_factory.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// NOT DEAD CODE!
-// This code isn't dead, even if it isn't currently being used. Please refer to:
-// https://www.chromium.org/developers/how-tos/compact-language-detector-cld-data-source-configuration
-
-#include "components/translate/content/browser/browser_cld_data_provider_factory.h"
-
-#include "base/lazy_instance.h"
-#include "base/memory/ptr_util.h"
-#include "components/translate/content/browser/browser_cld_data_provider.h"
-
-namespace {
-
-// The global instance, alive for the entire lifetime of the process.
-translate::BrowserCldDataProviderFactory* g_instance = NULL;
-
-// The default factory, which produces no-op instances of BrowserCldDataProvider
-// suitable for use when CLD data is statically-linked.
-base::LazyInstance<translate::BrowserCldDataProviderFactory>::Leaky
- g_wrapped_default = LAZY_INSTANCE_INITIALIZER;
-
-} // namespace
-
-
-namespace translate {
-
-std::unique_ptr<BrowserCldDataProvider>
-BrowserCldDataProviderFactory::CreateBrowserCldDataProvider(
- content::WebContents* web_contents) {
- return base::WrapUnique(new BrowserCldDataProvider);
-}
-
-// static
-bool BrowserCldDataProviderFactory::IsInitialized() {
- return g_instance != NULL;
-}
-
-// static
-void BrowserCldDataProviderFactory::SetDefault(
- BrowserCldDataProviderFactory* instance) {
- if (!IsInitialized()) Set(instance);
-}
-
-// static
-void BrowserCldDataProviderFactory::Set(
- BrowserCldDataProviderFactory* instance) {
- g_instance = instance;
-}
-
-// static
-BrowserCldDataProviderFactory* BrowserCldDataProviderFactory::Get() {
- if (IsInitialized()) return g_instance;
- return &g_wrapped_default.Get();
-}
-
-} // namespace translate

Powered by Google App Engine
This is Rietveld 408576698