Commit dd76cd91 authored by Etienne Bergeron's avatar Etienne Bergeron Committed by Commit Bot

Make Fushia TTS PlatformImpl a leaky instance

This CL is making the TtsPlatformImpl instance a leaky
instance since the singleton is alive for the whole
duration of the process.

Bug: 1133813
Change-Id: Iecdf3ea3451308376412d91c3766510364caeaa9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2441965Reviewed-by: default avatarFrançois Doray <fdoray@chromium.org>
Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Etienne Bergeron <etienneb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813300}
parent 04f4e0d3
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
#include "content/browser/speech/tts_platform_impl.h" #include "content/browser/speech/tts_platform_impl.h"
#include "base/no_destructor.h"
namespace content { namespace content {
// Dummy implementation to prevent a browser crash, see crbug.com/1019511 // Dummy implementation to prevent a browser crash, see crbug.com/1019511
...@@ -11,7 +13,8 @@ namespace content { ...@@ -11,7 +13,8 @@ namespace content {
class TtsPlatformImplFuchsia : public TtsPlatformImpl { class TtsPlatformImplFuchsia : public TtsPlatformImpl {
public: public:
TtsPlatformImplFuchsia() = default; TtsPlatformImplFuchsia() = default;
~TtsPlatformImplFuchsia() override = default; TtsPlatformImplFuchsia(const TtsPlatformImplFuchsia&) = delete;
TtsPlatformImplFuchsia& operator=(const TtsPlatformImplFuchsia&) = delete;
// TtsPlatform implementation. // TtsPlatform implementation.
bool PlatformImplAvailable() override { return false; } bool PlatformImplAvailable() override { return false; }
...@@ -31,11 +34,9 @@ class TtsPlatformImplFuchsia : public TtsPlatformImpl { ...@@ -31,11 +34,9 @@ class TtsPlatformImplFuchsia : public TtsPlatformImpl {
// Get the single instance of this class. // Get the single instance of this class.
static TtsPlatformImplFuchsia* GetInstance() { static TtsPlatformImplFuchsia* GetInstance() {
return base::Singleton<TtsPlatformImplFuchsia>::get(); static base::NoDestructor<TtsPlatformImplFuchsia> tts_platform;
return tts_platform.get();
} }
private:
DISALLOW_COPY_AND_ASSIGN(TtsPlatformImplFuchsia);
}; };
// static // static
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment