Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/logging.h" | 6 #include "base/logging.h" |
| 7 #include "base/trace_event/trace_event.h" | 7 #include "base/trace_event/trace_event.h" |
| 8 #include "ui/events/devices/device_data_manager.h" | 8 #include "ui/events/devices/device_data_manager.h" |
| 9 #include "ui/ozone/platform_object.h" | 9 #include "ui/ozone/platform_object.h" |
| 10 #include "ui/ozone/platform_selection.h" | 10 #include "ui/ozone/platform_selection.h" |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 instance_ = this; | 25 instance_ = this; |
| 26 g_platform_initialized_ui = false; | 26 g_platform_initialized_ui = false; |
| 27 g_platform_initialized_gpu = false; | 27 g_platform_initialized_gpu = false; |
| 28 } | 28 } |
| 29 | 29 |
| 30 OzonePlatform::~OzonePlatform() { | 30 OzonePlatform::~OzonePlatform() { |
| 31 DCHECK_EQ(instance_, this); | 31 DCHECK_EQ(instance_, this); |
| 32 instance_ = NULL; | 32 instance_ = NULL; |
| 33 } | 33 } |
| 34 | 34 |
| 35 base::MessageLoop::Type OzonePlatform::GetMessageLoopTypeForGpu() { | |
|
kylechar
2017/02/07 17:41:47
This should be ordered the same as the ozone_platf
tonikitoo
2017/02/07 19:36:41
Done.
| |
| 36 return base::MessageLoop::TYPE_DEFAULT; | |
| 37 } | |
| 38 | |
| 35 // static | 39 // static |
| 36 void OzonePlatform::InitializeForUI() { | 40 void OzonePlatform::InitializeForUI() { |
| 37 const InitParams params; | 41 const InitParams params; |
| 38 OzonePlatform::InitializeForUI(params); | 42 OzonePlatform::InitializeForUI(params); |
| 39 } | 43 } |
| 40 | 44 |
| 41 // static | 45 // static |
| 42 void OzonePlatform::InitializeForUI(const InitParams& args) { | 46 void OzonePlatform::InitializeForUI(const InitParams& args) { |
| 43 CreateInstance(); | 47 CreateInstance(); |
| 44 if (g_platform_initialized_ui) | 48 if (g_platform_initialized_ui) |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 65 instance_->InitializeGPU(args); | 69 instance_->InitializeGPU(args); |
| 66 } | 70 } |
| 67 | 71 |
| 68 // static | 72 // static |
| 69 OzonePlatform* OzonePlatform::GetInstance() { | 73 OzonePlatform* OzonePlatform::GetInstance() { |
| 70 DCHECK(instance_) << "OzonePlatform is not initialized"; | 74 DCHECK(instance_) << "OzonePlatform is not initialized"; |
| 71 return instance_; | 75 return instance_; |
| 72 } | 76 } |
| 73 | 77 |
| 74 // static | 78 // static |
| 75 void OzonePlatform::CreateInstance() { | 79 void OzonePlatform::CreateInstance() { |
|
kylechar
2017/02/07 17:41:47
Change order to match .h.
| |
| 76 if (!instance_) { | 80 if (!instance_) { |
| 77 TRACE_EVENT1("ozone", | 81 TRACE_EVENT1("ozone", |
| 78 "OzonePlatform::Initialize", | 82 "OzonePlatform::Initialize", |
| 79 "platform", | 83 "platform", |
| 80 GetOzonePlatformName()); | 84 GetOzonePlatformName()); |
| 81 std::unique_ptr<OzonePlatform> platform = | 85 std::unique_ptr<OzonePlatform> platform = |
| 82 PlatformObject<OzonePlatform>::Create(); | 86 PlatformObject<OzonePlatform>::Create(); |
| 83 | 87 |
| 84 // TODO(spang): Currently need to leak this object. | 88 // TODO(spang): Currently need to leak this object. |
| 85 OzonePlatform* pl = platform.release(); | 89 OzonePlatform* pl = platform.release(); |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 98 InitializeGPU(); | 102 InitializeGPU(); |
| 99 } | 103 } |
| 100 | 104 |
| 101 IPC::MessageFilter* OzonePlatform::GetGpuMessageFilter() { | 105 IPC::MessageFilter* OzonePlatform::GetGpuMessageFilter() { |
| 102 return nullptr; | 106 return nullptr; |
| 103 } | 107 } |
| 104 void OzonePlatform::AddInterfaces( | 108 void OzonePlatform::AddInterfaces( |
| 105 service_manager::InterfaceRegistry* registry) {} | 109 service_manager::InterfaceRegistry* registry) {} |
| 106 | 110 |
| 107 } // namespace ui | 111 } // namespace ui |
| OLD | NEW |