| Index: ui/ozone/ozone_platform.cc
|
| diff --git a/ui/ozone/ozone_platform.cc b/ui/ozone/ozone_platform.cc
|
| index b87dc8ffcae2c8d5476a5ea638d23669a7c444f8..63b5e84fd38e3df3808dfcc05785cf8c05e4bcbb 100644
|
| --- a/ui/ozone/ozone_platform.cc
|
| +++ b/ui/ozone/ozone_platform.cc
|
| @@ -3,6 +3,7 @@
|
| // found in the LICENSE file.
|
|
|
| #include "base/command_line.h"
|
| +#include "base/debug/trace_event.h"
|
| #include "base/logging.h"
|
| #include "ui/ozone/ozone_platform.h"
|
| #include "ui/ozone/ozone_platform_list.h"
|
| @@ -14,11 +15,7 @@ namespace {
|
|
|
| // Helper to construct an OzonePlatform by name using the platform list.
|
| OzonePlatform* CreatePlatform(const std::string& platform_name) {
|
| - // The first platform is the defualt.
|
| - if (platform_name == "default" && kOzonePlatformCount > 0)
|
| - return kOzonePlatforms[0].constructor();
|
| -
|
| - // Otherwise, search for a matching platform in the list.
|
| + // Search for a matching platform in the list.
|
| for (int i = 0; i < kOzonePlatformCount; ++i)
|
| if (platform_name == kOzonePlatforms[i].name)
|
| return kOzonePlatforms[i].constructor();
|
| @@ -28,9 +25,11 @@ OzonePlatform* CreatePlatform(const std::string& platform_name) {
|
| }
|
|
|
| // Returns the name of the platform to use (value of --ozone-platform flag).
|
| -std::string GetRequestedPlatform() {
|
| - if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kOzonePlatform))
|
| - return "default";
|
| +std::string GetPlatformName() {
|
| + // The first platform is the default.
|
| + if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kOzonePlatform) &&
|
| + kOzonePlatformCount > 0)
|
| + return kOzonePlatforms[0].name;
|
| return CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
|
| switches::kOzonePlatform);
|
| }
|
| @@ -49,7 +48,11 @@ void OzonePlatform::Initialize() {
|
| if (instance_)
|
| return;
|
|
|
| - instance_ = CreatePlatform(GetRequestedPlatform());
|
| + std::string platform = GetPlatformName();
|
| +
|
| + TRACE_EVENT1("ozone", "OzonePlatform::Initialize", "platform", platform);
|
| +
|
| + instance_ = CreatePlatform(platform);
|
|
|
| // Inject ozone interfaces.
|
| gfx::SurfaceFactoryOzone::SetInstance(instance_->GetSurfaceFactoryOzone());
|
|
|