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

Unified Diff: ui/ozone/public/surface_factory_ozone.cc

Issue 1167533007: Revert of ozone: Remove singleton pattern for SurfaceFactoryOzone. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « ui/ozone/public/surface_factory_ozone.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/public/surface_factory_ozone.cc
diff --git a/ui/ozone/public/surface_factory_ozone.cc b/ui/ozone/public/surface_factory_ozone.cc
index 09344c430c79e4a6a4a6af772e3b72d527a0c3ee..c4efc06111748619fa2e2540c955fc580ef431fb 100644
--- a/ui/ozone/public/surface_factory_ozone.cc
+++ b/ui/ozone/public/surface_factory_ozone.cc
@@ -13,10 +13,22 @@
namespace ui {
+// static
+SurfaceFactoryOzone* SurfaceFactoryOzone::impl_ = NULL;
+
SurfaceFactoryOzone::SurfaceFactoryOzone() {
+ DCHECK(!impl_) << "There should only be a single SurfaceFactoryOzone.";
+ impl_ = this;
}
SurfaceFactoryOzone::~SurfaceFactoryOzone() {
+ DCHECK_EQ(impl_, this);
+ impl_ = NULL;
+}
+
+SurfaceFactoryOzone* SurfaceFactoryOzone::GetInstance() {
+ DCHECK(impl_) << "No SurfaceFactoryOzone implementation set.";
+ return impl_;
}
intptr_t SurfaceFactoryOzone::GetNativeDisplay() {
« no previous file with comments | « ui/ozone/public/surface_factory_ozone.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698