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

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

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 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/ozone_platform.h ('k') | ui/ozone/public/ozone_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/public/ozone_platform.cc
diff --git a/ui/ozone/public/ozone_platform.cc b/ui/ozone/public/ozone_platform.cc
deleted file mode 100644
index 5af0099e1ea1ce77750ac2e5c50016d18a9d3c5d..0000000000000000000000000000000000000000
--- a/ui/ozone/public/ozone_platform.cc
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/command_line.h"
-#include "base/debug/trace_event.h"
-#include "base/logging.h"
-#include "ui/events/device_data_manager.h"
-#include "ui/ozone/platform_object.h"
-#include "ui/ozone/platform_selection.h"
-#include "ui/ozone/public/ozone_platform.h"
-#include "ui/ozone/public/ozone_switches.h"
-
-namespace ui {
-
-namespace {
-
-bool g_platform_initialized_ui = false;
-bool g_platform_initialized_gpu = false;
-
-}
-
-OzonePlatform::OzonePlatform() {
- DCHECK(!instance_) << "There should only be a single OzonePlatform.";
- instance_ = this;
- g_platform_initialized_ui = false;
- g_platform_initialized_gpu = false;
-}
-
-OzonePlatform::~OzonePlatform() {
- DCHECK_EQ(instance_, this);
- instance_ = NULL;
-}
-
-// static
-void OzonePlatform::InitializeForUI() {
- CreateInstance();
- if (g_platform_initialized_ui)
- return;
- g_platform_initialized_ui = true;
- instance_->InitializeUI();
- // This is deliberately created after initializing so that the platform can
- // create its own version of DDM.
- DeviceDataManager::CreateInstance();
-}
-
-// static
-void OzonePlatform::InitializeForGPU() {
- CreateInstance();
- if (g_platform_initialized_gpu)
- return;
- g_platform_initialized_gpu = true;
- instance_->InitializeGPU();
-}
-
-// static
-OzonePlatform* OzonePlatform::GetInstance() {
- DCHECK(instance_) << "OzonePlatform is not initialized";
- return instance_;
-}
-
-// static
-void OzonePlatform::CreateInstance() {
- if (!instance_) {
- TRACE_EVENT1("ozone",
- "OzonePlatform::Initialize",
- "platform",
- GetOzonePlatformName());
- scoped_ptr<OzonePlatform> platform =
- PlatformObject<OzonePlatform>::Create();
-
- // TODO(spang): Currently need to leak this object.
- OzonePlatform* pl = platform.release();
- DCHECK_EQ(instance_, pl);
- }
-}
-
-// static
-OzonePlatform* OzonePlatform::instance_;
-
-} // namespace ui
« no previous file with comments | « ui/ozone/public/ozone_platform.h ('k') | ui/ozone/public/ozone_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698