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

Unified Diff: ui/events/ozone/event_factory_ozone.cc

Issue 291473002: ozone: Initialize a subsystem only if necessary. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-r270817 Created 6 years, 7 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/events/ozone/event_factory_ozone.h ('k') | ui/gfx/ozone/surface_factory_ozone.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/ozone/event_factory_ozone.cc
diff --git a/ui/events/ozone/event_factory_ozone.cc b/ui/events/ozone/event_factory_ozone.cc
index 0cc699e04ebe334d7bbd1167d522b40febb2f4c1..3a56ddc968fefcfac468ba4e22bd72c7b8b4316c 100644
--- a/ui/events/ozone/event_factory_ozone.cc
+++ b/ui/events/ozone/event_factory_ozone.cc
@@ -11,17 +11,21 @@ namespace ui {
// static
EventFactoryOzone* EventFactoryOzone::impl_ = NULL;
-EventFactoryOzone::EventFactoryOzone() {}
+EventFactoryOzone::EventFactoryOzone() {
+ CHECK(!impl_) << "There should only be a single EventFactoryOzone";
+ impl_ = this;
+}
-EventFactoryOzone::~EventFactoryOzone() {}
+EventFactoryOzone::~EventFactoryOzone() {
+ CHECK_EQ(impl_, this);
+ impl_ = NULL;
+}
EventFactoryOzone* EventFactoryOzone::GetInstance() {
CHECK(impl_) << "No EventFactoryOzone implementation set.";
return impl_;
}
-void EventFactoryOzone::SetInstance(EventFactoryOzone* impl) { impl_ = impl; }
-
void EventFactoryOzone::StartProcessingEvents() {}
void EventFactoryOzone::WarpCursorTo(gfx::AcceleratedWidget widget,
« no previous file with comments | « ui/events/ozone/event_factory_ozone.h ('k') | ui/gfx/ozone/surface_factory_ozone.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698