mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-02-09 00:28:59 +01:00
Remove Singleton patches which are no longer required (issue #2362)
This commit is contained in:
parent
52427ce97f
commit
a4f7e361be
@ -129,12 +129,6 @@ patches = [
|
|||||||
# https://codereview.chromium.org/208313009
|
# https://codereview.chromium.org/208313009
|
||||||
'name': 'ui_dragdrop_355390',
|
'name': 'ui_dragdrop_355390',
|
||||||
},
|
},
|
||||||
{
|
|
||||||
# Windows: Fix AtExitManager assertion on *ServiceFactory destruction during
|
|
||||||
# multi-threaded message loop shutdown.
|
|
||||||
# https://bitbucket.org/chromiumembedded/cef/issues/1680
|
|
||||||
'name': 'service_factory_1680',
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
# Make URLRequest::set_is_pending() public so that it can be called from
|
# Make URLRequest::set_is_pending() public so that it can be called from
|
||||||
# CefRequestInterceptor::MaybeInterceptResponse().
|
# CefRequestInterceptor::MaybeInterceptResponse().
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
diff --git chrome/browser/plugins/plugin_info_host_impl.cc chrome/browser/plugins/plugin_info_host_impl.cc
|
diff --git chrome/browser/plugins/plugin_info_host_impl.cc chrome/browser/plugins/plugin_info_host_impl.cc
|
||||||
index 484e07af5a98..0e62e20095c7 100644
|
index 484e07af5a98..d9807243e2b5 100644
|
||||||
--- chrome/browser/plugins/plugin_info_host_impl.cc
|
--- chrome/browser/plugins/plugin_info_host_impl.cc
|
||||||
+++ chrome/browser/plugins/plugin_info_host_impl.cc
|
+++ chrome/browser/plugins/plugin_info_host_impl.cc
|
||||||
@@ -16,6 +16,7 @@
|
@@ -16,6 +16,7 @@
|
||||||
@ -22,39 +22,7 @@ index 484e07af5a98..0e62e20095c7 100644
|
|||||||
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
||||||
#include "components/guest_view/browser/guest_view_base.h"
|
#include "components/guest_view/browser/guest_view_base.h"
|
||||||
#include "extensions/browser/extension_registry.h"
|
#include "extensions/browser/extension_registry.h"
|
||||||
@@ -74,12 +80,10 @@ namespace {
|
@@ -99,6 +105,9 @@ bool IsPluginLoadingAccessibleResourceInWebView(
|
||||||
class PluginInfoHostImplShutdownNotifierFactory
|
|
||||||
: public BrowserContextKeyedServiceShutdownNotifierFactory {
|
|
||||||
public:
|
|
||||||
- static PluginInfoHostImplShutdownNotifierFactory* GetInstance() {
|
|
||||||
- return base::Singleton<PluginInfoHostImplShutdownNotifierFactory>::get();
|
|
||||||
- }
|
|
||||||
+ static PluginInfoHostImplShutdownNotifierFactory* GetInstance();
|
|
||||||
|
|
||||||
private:
|
|
||||||
- friend struct base::DefaultSingletonTraits<
|
|
||||||
+ friend struct base::LazyInstanceTraitsBase<
|
|
||||||
PluginInfoHostImplShutdownNotifierFactory>;
|
|
||||||
|
|
||||||
PluginInfoHostImplShutdownNotifierFactory()
|
|
||||||
@@ -91,6 +95,16 @@ class PluginInfoHostImplShutdownNotifierFactory
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(PluginInfoHostImplShutdownNotifierFactory);
|
|
||||||
};
|
|
||||||
|
|
||||||
+base::LazyInstance<PluginInfoHostImplShutdownNotifierFactory>::Leaky
|
|
||||||
+ g_plugin_info_host_impl_shutdown_notifier_factory =
|
|
||||||
+ LAZY_INSTANCE_INITIALIZER;
|
|
||||||
+
|
|
||||||
+// static
|
|
||||||
+PluginInfoHostImplShutdownNotifierFactory*
|
|
||||||
+PluginInfoHostImplShutdownNotifierFactory::GetInstance() {
|
|
||||||
+ return g_plugin_info_host_impl_shutdown_notifier_factory.Pointer();
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
|
||||||
// Returns whether a request from a plugin to load |resource| from a renderer
|
|
||||||
// with process id |process_id| is a request for an internal resource by an app
|
|
||||||
@@ -99,6 +113,9 @@ bool IsPluginLoadingAccessibleResourceInWebView(
|
|
||||||
extensions::ExtensionRegistry* extension_registry,
|
extensions::ExtensionRegistry* extension_registry,
|
||||||
int process_id,
|
int process_id,
|
||||||
const GURL& resource) {
|
const GURL& resource) {
|
||||||
@ -64,7 +32,7 @@ index 484e07af5a98..0e62e20095c7 100644
|
|||||||
extensions::WebViewRendererState* renderer_state =
|
extensions::WebViewRendererState* renderer_state =
|
||||||
extensions::WebViewRendererState::GetInstance();
|
extensions::WebViewRendererState::GetInstance();
|
||||||
std::string partition_id;
|
std::string partition_id;
|
||||||
@@ -128,12 +145,16 @@ bool IsPluginLoadingAccessibleResourceInWebView(
|
@@ -128,12 +137,16 @@ bool IsPluginLoadingAccessibleResourceInWebView(
|
||||||
PluginInfoHostImpl::Context::Context(int render_process_id, Profile* profile)
|
PluginInfoHostImpl::Context::Context(int render_process_id, Profile* profile)
|
||||||
: render_process_id_(render_process_id),
|
: render_process_id_(render_process_id),
|
||||||
resource_context_(profile->GetResourceContext()),
|
resource_context_(profile->GetResourceContext()),
|
||||||
@ -84,7 +52,7 @@ index 484e07af5a98..0e62e20095c7 100644
|
|||||||
allow_outdated_plugins_.Init(prefs::kPluginsAllowOutdated,
|
allow_outdated_plugins_.Init(prefs::kPluginsAllowOutdated,
|
||||||
profile->GetPrefs());
|
profile->GetPrefs());
|
||||||
allow_outdated_plugins_.MoveToThread(
|
allow_outdated_plugins_.MoveToThread(
|
||||||
@@ -232,6 +253,7 @@ void PluginInfoHostImpl::PluginsLoaded(
|
@@ -232,6 +245,7 @@ void PluginInfoHostImpl::PluginsLoaded(
|
||||||
plugin_metadata->identifier(), &output->status);
|
plugin_metadata->identifier(), &output->status);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,7 +60,7 @@ index 484e07af5a98..0e62e20095c7 100644
|
|||||||
if (output->status == chrome::mojom::PluginStatus::kNotFound) {
|
if (output->status == chrome::mojom::PluginStatus::kNotFound) {
|
||||||
// Check to see if the component updater can fetch an implementation.
|
// Check to see if the component updater can fetch an implementation.
|
||||||
base::PostTaskAndReplyWithResult(
|
base::PostTaskAndReplyWithResult(
|
||||||
@@ -243,7 +265,9 @@ void PluginInfoHostImpl::PluginsLoaded(
|
@@ -243,7 +257,9 @@ void PluginInfoHostImpl::PluginsLoaded(
|
||||||
base::BindOnce(&PluginInfoHostImpl::ComponentPluginLookupDone, this,
|
base::BindOnce(&PluginInfoHostImpl::ComponentPluginLookupDone, this,
|
||||||
params, std::move(output), std::move(callback),
|
params, std::move(output), std::move(callback),
|
||||||
std::move(plugin_metadata)));
|
std::move(plugin_metadata)));
|
||||||
@ -103,7 +71,7 @@ index 484e07af5a98..0e62e20095c7 100644
|
|||||||
GetPluginInfoFinish(params, std::move(output), std::move(callback),
|
GetPluginInfoFinish(params, std::move(output), std::move(callback),
|
||||||
std::move(plugin_metadata));
|
std::move(plugin_metadata));
|
||||||
}
|
}
|
||||||
@@ -256,6 +280,14 @@ void PluginInfoHostImpl::Context::DecidePluginStatus(
|
@@ -256,6 +272,14 @@ void PluginInfoHostImpl::Context::DecidePluginStatus(
|
||||||
PluginMetadata::SecurityStatus security_status,
|
PluginMetadata::SecurityStatus security_status,
|
||||||
const std::string& plugin_identifier,
|
const std::string& plugin_identifier,
|
||||||
chrome::mojom::PluginStatus* status) const {
|
chrome::mojom::PluginStatus* status) const {
|
||||||
@ -118,7 +86,7 @@ index 484e07af5a98..0e62e20095c7 100644
|
|||||||
if (security_status == PluginMetadata::SECURITY_STATUS_FULLY_TRUSTED) {
|
if (security_status == PluginMetadata::SECURITY_STATUS_FULLY_TRUSTED) {
|
||||||
*status = chrome::mojom::PluginStatus::kAllowed;
|
*status = chrome::mojom::PluginStatus::kAllowed;
|
||||||
return;
|
return;
|
||||||
@@ -380,16 +412,36 @@ bool PluginInfoHostImpl::Context::FindEnabledPlugin(
|
@@ -380,16 +404,36 @@ bool PluginInfoHostImpl::Context::FindEnabledPlugin(
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,146 +0,0 @@
|
|||||||
diff --git chrome/browser/spellchecker/spellcheck_factory.cc chrome/browser/spellchecker/spellcheck_factory.cc
|
|
||||||
index 64b5243d510a..8ae3001f85fc 100644
|
|
||||||
--- chrome/browser/spellchecker/spellcheck_factory.cc
|
|
||||||
+++ chrome/browser/spellchecker/spellcheck_factory.cc
|
|
||||||
@@ -17,6 +17,13 @@
|
|
||||||
#include "services/service_manager/public/cpp/identity.h"
|
|
||||||
#include "ui/base/l10n/l10n_util.h"
|
|
||||||
|
|
||||||
+namespace {
|
|
||||||
+
|
|
||||||
+static base::LazyInstance<SpellcheckServiceFactory>::Leaky
|
|
||||||
+ g_spellcheck_service_factory = LAZY_INSTANCE_INITIALIZER;
|
|
||||||
+
|
|
||||||
+} // namespace
|
|
||||||
+
|
|
||||||
// static
|
|
||||||
SpellcheckService* SpellcheckServiceFactory::GetForContext(
|
|
||||||
content::BrowserContext* context) {
|
|
||||||
@@ -37,7 +44,7 @@ SpellcheckService* SpellcheckServiceFactory::GetForRenderer(
|
|
||||||
|
|
||||||
// static
|
|
||||||
SpellcheckServiceFactory* SpellcheckServiceFactory::GetInstance() {
|
|
||||||
- return base::Singleton<SpellcheckServiceFactory>::get();
|
|
||||||
+ return g_spellcheck_service_factory.Pointer();
|
|
||||||
}
|
|
||||||
|
|
||||||
SpellcheckServiceFactory::SpellcheckServiceFactory()
|
|
||||||
diff --git chrome/browser/spellchecker/spellcheck_factory.h chrome/browser/spellchecker/spellcheck_factory.h
|
|
||||||
index fd4e6643725c..fcdbb8e4db88 100644
|
|
||||||
--- chrome/browser/spellchecker/spellcheck_factory.h
|
|
||||||
+++ chrome/browser/spellchecker/spellcheck_factory.h
|
|
||||||
@@ -7,7 +7,7 @@
|
|
||||||
|
|
||||||
#include "base/gtest_prod_util.h"
|
|
||||||
#include "base/macros.h"
|
|
||||||
-#include "base/memory/singleton.h"
|
|
||||||
+#include "base/lazy_instance.h"
|
|
||||||
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
|
|
||||||
|
|
||||||
class SpellcheckService;
|
|
||||||
@@ -31,7 +31,7 @@ class SpellcheckServiceFactory : public BrowserContextKeyedServiceFactory {
|
|
||||||
static SpellcheckServiceFactory* GetInstance();
|
|
||||||
|
|
||||||
private:
|
|
||||||
- friend struct base::DefaultSingletonTraits<SpellcheckServiceFactory>;
|
|
||||||
+ friend struct base::LazyInstanceTraitsBase<SpellcheckServiceFactory>;
|
|
||||||
|
|
||||||
SpellcheckServiceFactory();
|
|
||||||
~SpellcheckServiceFactory() override;
|
|
||||||
diff --git chrome/browser/supervised_user/supervised_user_settings_service_factory.cc chrome/browser/supervised_user/supervised_user_settings_service_factory.cc
|
|
||||||
index 173ac3132161..473e56161cca 100644
|
|
||||||
--- chrome/browser/supervised_user/supervised_user_settings_service_factory.cc
|
|
||||||
+++ chrome/browser/supervised_user/supervised_user_settings_service_factory.cc
|
|
||||||
@@ -9,6 +9,13 @@
|
|
||||||
#include "chrome/browser/supervised_user/supervised_user_settings_service.h"
|
|
||||||
#include "components/keyed_service/content/browser_context_dependency_manager.h"
|
|
||||||
|
|
||||||
+namespace {
|
|
||||||
+
|
|
||||||
+base::LazyInstance<SupervisedUserSettingsServiceFactory>::Leaky
|
|
||||||
+ g_service_factory = LAZY_INSTANCE_INITIALIZER;
|
|
||||||
+
|
|
||||||
+} // namespace
|
|
||||||
+
|
|
||||||
// static
|
|
||||||
SupervisedUserSettingsService*
|
|
||||||
SupervisedUserSettingsServiceFactory::GetForProfile(Profile* profile) {
|
|
||||||
@@ -19,7 +26,7 @@ SupervisedUserSettingsServiceFactory::GetForProfile(Profile* profile) {
|
|
||||||
// static
|
|
||||||
SupervisedUserSettingsServiceFactory*
|
|
||||||
SupervisedUserSettingsServiceFactory::GetInstance() {
|
|
||||||
- return base::Singleton<SupervisedUserSettingsServiceFactory>::get();
|
|
||||||
+ return g_service_factory.Pointer();
|
|
||||||
}
|
|
||||||
|
|
||||||
SupervisedUserSettingsServiceFactory::SupervisedUserSettingsServiceFactory()
|
|
||||||
diff --git chrome/browser/supervised_user/supervised_user_settings_service_factory.h chrome/browser/supervised_user/supervised_user_settings_service_factory.h
|
|
||||||
index 2907619549ba..f941fba363b5 100644
|
|
||||||
--- chrome/browser/supervised_user/supervised_user_settings_service_factory.h
|
|
||||||
+++ chrome/browser/supervised_user/supervised_user_settings_service_factory.h
|
|
||||||
@@ -5,7 +5,7 @@
|
|
||||||
#ifndef CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SETTINGS_SERVICE_FACTORY_H_
|
|
||||||
#define CHROME_BROWSER_SUPERVISED_USER_SUPERVISED_USER_SETTINGS_SERVICE_FACTORY_H_
|
|
||||||
|
|
||||||
-#include "base/memory/singleton.h"
|
|
||||||
+#include "base/lazy_instance.h"
|
|
||||||
#include "chrome/browser/supervised_user/supervised_users.h"
|
|
||||||
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
|
|
||||||
|
|
||||||
@@ -20,7 +20,7 @@ class SupervisedUserSettingsServiceFactory
|
|
||||||
static SupervisedUserSettingsServiceFactory* GetInstance();
|
|
||||||
|
|
||||||
private:
|
|
||||||
- friend struct base::DefaultSingletonTraits<
|
|
||||||
+ friend struct base::LazyInstanceTraitsBase<
|
|
||||||
SupervisedUserSettingsServiceFactory>;
|
|
||||||
|
|
||||||
SupervisedUserSettingsServiceFactory();
|
|
||||||
diff --git chrome/browser/ui/prefs/prefs_tab_helper.cc chrome/browser/ui/prefs/prefs_tab_helper.cc
|
|
||||||
index b9b2f059f694..a7b11cb75f22 100644
|
|
||||||
--- chrome/browser/ui/prefs/prefs_tab_helper.cc
|
|
||||||
+++ chrome/browser/ui/prefs/prefs_tab_helper.cc
|
|
||||||
@@ -11,8 +11,8 @@
|
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include "base/command_line.h"
|
|
||||||
+#include "base/lazy_instance.h"
|
|
||||||
#include "base/macros.h"
|
|
||||||
-#include "base/memory/singleton.h"
|
|
||||||
#include "base/strings/string_number_conversions.h"
|
|
||||||
#include "base/strings/string_util.h"
|
|
||||||
#include "base/strings/stringprintf.h"
|
|
||||||
@@ -389,12 +389,10 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory {
|
|
||||||
GetInstance()->GetServiceForBrowserContext(profile, true));
|
|
||||||
}
|
|
||||||
|
|
||||||
- static PrefWatcherFactory* GetInstance() {
|
|
||||||
- return base::Singleton<PrefWatcherFactory>::get();
|
|
||||||
- }
|
|
||||||
+ static PrefWatcherFactory* GetInstance();
|
|
||||||
|
|
||||||
private:
|
|
||||||
- friend struct base::DefaultSingletonTraits<PrefWatcherFactory>;
|
|
||||||
+ friend struct base::LazyInstanceTraitsBase<PrefWatcherFactory>;
|
|
||||||
|
|
||||||
PrefWatcherFactory() : BrowserContextKeyedServiceFactory(
|
|
||||||
"PrefWatcher",
|
|
||||||
@@ -415,6 +413,18 @@ class PrefWatcherFactory : public BrowserContextKeyedServiceFactory {
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
+namespace {
|
|
||||||
+
|
|
||||||
+base::LazyInstance<PrefWatcherFactory>::Leaky g_pref_watcher_factory =
|
|
||||||
+ LAZY_INSTANCE_INITIALIZER;
|
|
||||||
+
|
|
||||||
+} // namespace
|
|
||||||
+
|
|
||||||
+// static
|
|
||||||
+PrefWatcherFactory* PrefWatcherFactory::GetInstance() {
|
|
||||||
+ return g_pref_watcher_factory.Pointer();
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
// static
|
|
||||||
PrefWatcher* PrefWatcher::Get(Profile* profile) {
|
|
||||||
return PrefWatcherFactory::GetForProfile(profile);
|
|
Loading…
x
Reference in New Issue
Block a user