| 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 "ui/ozone/public/ozone_gpu_test_helper.h" | 5 #include "ui/ozone/public/ozone_gpu_test_helper.h" |
| 6 | 6 |
| 7 #include "base/threading/thread.h" | 7 #include "base/threading/thread.h" |
| 8 #include "base/threading/thread_task_runner_handle.h" | 8 #include "base/threading/thread_task_runner_handle.h" |
| 9 #include "ipc/ipc_listener.h" | 9 #include "ipc/ipc_listener.h" |
| 10 #include "ipc/ipc_message.h" | 10 #include "ipc/ipc_message.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 void InitOnIO() { | 81 void InitOnIO() { |
| 82 base::Callback<void(IPC::Message*)> sender = | 82 base::Callback<void(IPC::Message*)> sender = |
| 83 base::Bind(&DispatchToGpuPlatformSupportTaskOnIO); | 83 base::Bind(&DispatchToGpuPlatformSupportTaskOnIO); |
| 84 | 84 |
| 85 ui::OzonePlatform::GetInstance() | 85 ui::OzonePlatform::GetInstance() |
| 86 ->GetGpuPlatformSupportHost() | 86 ->GetGpuPlatformSupportHost() |
| 87 ->OnGpuProcessLaunched(kGpuProcessHostId, gpu_io_task_runner_, sender); | 87 ->OnGpuProcessLaunched(kGpuProcessHostId, gpu_io_task_runner_, sender); |
| 88 } | 88 } |
| 89 | 89 |
| 90 void InitOnUI() { | |
| 91 ui::OzonePlatform::GetInstance() | |
| 92 ->GetGpuPlatformSupportHost() | |
| 93 ->OnChannelEstablished(); | |
| 94 } | |
| 95 | |
| 96 private: | 90 private: |
| 97 scoped_refptr<base::SingleThreadTaskRunner> gpu_task_runner_; | 91 scoped_refptr<base::SingleThreadTaskRunner> gpu_task_runner_; |
| 98 scoped_refptr<base::SingleThreadTaskRunner> gpu_io_task_runner_; | 92 scoped_refptr<base::SingleThreadTaskRunner> gpu_io_task_runner_; |
| 99 }; | 93 }; |
| 100 | 94 |
| 101 OzoneGpuTestHelper::OzoneGpuTestHelper() { | 95 OzoneGpuTestHelper::OzoneGpuTestHelper() { |
| 102 } | 96 } |
| 103 | 97 |
| 104 OzoneGpuTestHelper::~OzoneGpuTestHelper() { | 98 OzoneGpuTestHelper::~OzoneGpuTestHelper() { |
| 105 } | 99 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 117 FROM_HERE, base::Bind(&FakeGpuProcess::InitOnIO, | 111 FROM_HERE, base::Bind(&FakeGpuProcess::InitOnIO, |
| 118 base::Unretained(fake_gpu_process_.get()))); | 112 base::Unretained(fake_gpu_process_.get()))); |
| 119 | 113 |
| 120 fake_gpu_process_host_.reset(new FakeGpuProcessHost( | 114 fake_gpu_process_host_.reset(new FakeGpuProcessHost( |
| 121 gpu_task_runner, io_helper_thread_->task_runner())); | 115 gpu_task_runner, io_helper_thread_->task_runner())); |
| 122 io_helper_thread_->task_runner()->PostTask( | 116 io_helper_thread_->task_runner()->PostTask( |
| 123 FROM_HERE, base::Bind(&FakeGpuProcessHost::InitOnIO, | 117 FROM_HERE, base::Bind(&FakeGpuProcessHost::InitOnIO, |
| 124 base::Unretained(fake_gpu_process_host_.get()))); | 118 base::Unretained(fake_gpu_process_host_.get()))); |
| 125 io_helper_thread_->FlushForTesting(); | 119 io_helper_thread_->FlushForTesting(); |
| 126 | 120 |
| 127 fake_gpu_process_host_->InitOnUI(); | |
| 128 return true; | 121 return true; |
| 129 } | 122 } |
| 130 | 123 |
| 131 } // namespace ui | 124 } // namespace ui |
| OLD | NEW |