Chromium Code Reviews| Index: ui/ozone/public/ozone_platform.cc |
| diff --git a/ui/ozone/public/ozone_platform.cc b/ui/ozone/public/ozone_platform.cc |
| index b69bc28927d76d800321b2f58b2c26c66759d21d..0ca3e4ac1c15cd0916cb6b039d0f6d0198292c3d 100644 |
| --- a/ui/ozone/public/ozone_platform.cc |
| +++ b/ui/ozone/public/ozone_platform.cc |
| @@ -17,6 +17,7 @@ namespace { |
| bool g_platform_initialized_ui = false; |
| bool g_platform_initialized_gpu = false; |
| +bool g_platform_initialized_gpu_post_main_loop = false; |
| } |
| @@ -25,6 +26,7 @@ OzonePlatform::OzonePlatform() { |
| instance_ = this; |
| g_platform_initialized_ui = false; |
| g_platform_initialized_gpu = false; |
| + g_platform_initialized_gpu_post_main_loop = false; |
| } |
| OzonePlatform::~OzonePlatform() { |
| @@ -54,6 +56,18 @@ void OzonePlatform::InitializeForGPU() { |
| } |
| // static |
| +void OzonePlatform::InitializeForGPUPostMainLoop() { |
| + CHECK(instance_ && g_platform_initialized_gpu) |
| + << "OzonePlatform is not initialized"; |
|
spang
2015/03/31 20:58:49
DCHECK per the style guide (it says never use CHEC
vignatti (out of this project)
2015/04/01 16:26:11
Done.
|
| + |
| + if (g_platform_initialized_gpu_post_main_loop) |
| + return; |
| + g_platform_initialized_gpu_post_main_loop = true; |
| + |
| + instance_->InitializeGPUPostMainLoop(); |
| +} |
| + |
| +// static |
| OzonePlatform* OzonePlatform::GetInstance() { |
| DCHECK(instance_) << "OzonePlatform is not initialized"; |
| return instance_; |