2014-10-07 22:44:33 +02:00
|
|
|
diff --git spellcheck_factory.cc spellcheck_factory.cc
|
2016-08-31 13:25:56 +02:00
|
|
|
index 3857256..3d1562c 100644
|
2014-10-07 22:44:33 +02:00
|
|
|
--- spellcheck_factory.cc
|
|
|
|
+++ spellcheck_factory.cc
|
2015-04-23 12:03:42 +02:00
|
|
|
@@ -16,6 +16,13 @@
|
2014-10-07 22:44:33 +02:00
|
|
|
#include "content/public/browser/render_process_host.h"
|
2014-12-13 21:18:31 +01:00
|
|
|
#include "ui/base/l10n/l10n_util.h"
|
2014-10-07 22:44:33 +02:00
|
|
|
|
|
|
|
+namespace {
|
|
|
|
+
|
|
|
|
+static base::LazyInstance<SpellcheckServiceFactory>::Leaky
|
|
|
|
+ g_spellcheck_service_factory = LAZY_INSTANCE_INITIALIZER;
|
|
|
|
+
|
|
|
|
+} // namespace
|
|
|
|
+
|
|
|
|
// static
|
|
|
|
SpellcheckService* SpellcheckServiceFactory::GetForContext(
|
|
|
|
content::BrowserContext* context) {
|
2015-04-23 12:03:42 +02:00
|
|
|
@@ -38,7 +45,7 @@ SpellcheckService* SpellcheckServiceFactory::GetForRenderProcessId(
|
2014-10-07 22:44:33 +02:00
|
|
|
|
|
|
|
// static
|
|
|
|
SpellcheckServiceFactory* SpellcheckServiceFactory::GetInstance() {
|
2015-10-09 17:23:12 +02:00
|
|
|
- return base::Singleton<SpellcheckServiceFactory>::get();
|
2014-10-07 22:44:33 +02:00
|
|
|
+ return g_spellcheck_service_factory.Pointer();
|
|
|
|
}
|
|
|
|
|
|
|
|
SpellcheckServiceFactory::SpellcheckServiceFactory()
|
|
|
|
diff --git spellcheck_factory.h spellcheck_factory.h
|
2016-01-06 20:20:54 +01:00
|
|
|
index e8eb9f7..48126000 100644
|
2014-10-07 22:44:33 +02:00
|
|
|
--- spellcheck_factory.h
|
|
|
|
+++ spellcheck_factory.h
|
|
|
|
@@ -7,7 +7,7 @@
|
|
|
|
|
|
|
|
#include "base/gtest_prod_util.h"
|
2016-01-06 20:20:54 +01:00
|
|
|
#include "base/macros.h"
|
2014-10-07 22:44:33 +02:00
|
|
|
-#include "base/memory/singleton.h"
|
|
|
|
+#include "base/lazy_instance.h"
|
|
|
|
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
|
|
|
|
|
|
|
|
class SpellcheckService;
|
|
|
|
@@ -26,7 +26,7 @@ class SpellcheckServiceFactory : public BrowserContextKeyedServiceFactory {
|
|
|
|
static SpellcheckServiceFactory* GetInstance();
|
|
|
|
|
|
|
|
private:
|
2015-10-09 17:23:12 +02:00
|
|
|
- friend struct base::DefaultSingletonTraits<SpellcheckServiceFactory>;
|
2014-10-07 22:44:33 +02:00
|
|
|
+ friend struct base::DefaultLazyInstanceTraits<SpellcheckServiceFactory>;
|
|
|
|
|
|
|
|
SpellcheckServiceFactory();
|
2014-11-12 20:25:15 +01:00
|
|
|
~SpellcheckServiceFactory() override;
|