| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 : gpu_task_runner_(gpu_task_runner), | 99 : gpu_task_runner_(gpu_task_runner), |
| 100 gpu_io_task_runner_(gpu_io_task_runner) {} | 100 gpu_io_task_runner_(gpu_io_task_runner) {} |
| 101 ~FakeGpuProcessHost() {} | 101 ~FakeGpuProcessHost() {} |
| 102 | 102 |
| 103 void Init() { | 103 void Init() { |
| 104 base::Callback<void(IPC::Message*)> sender = | 104 base::Callback<void(IPC::Message*)> sender = |
| 105 base::Bind(&DispatchToGpuPlatformSupportTaskOnIO); | 105 base::Bind(&DispatchToGpuPlatformSupportTaskOnIO); |
| 106 | 106 |
| 107 ui::OzonePlatform::GetInstance() | 107 ui::OzonePlatform::GetInstance() |
| 108 ->GetGpuPlatformSupportHost() | 108 ->GetGpuPlatformSupportHost() |
| 109 ->OnChannelEstablished(kGpuProcessHostId, gpu_io_task_runner_, sender); | 109 ->OnGpuProcessLaunched(kGpuProcessHostId, gpu_io_task_runner_, sender); |
| 110 |
| 111 ui::OzonePlatform::GetInstance() |
| 112 ->GetGpuPlatformSupportHost() |
| 113 ->OnChannelEstablished(); |
| 110 } | 114 } |
| 111 | 115 |
| 112 private: | 116 private: |
| 113 scoped_refptr<base::SingleThreadTaskRunner> gpu_task_runner_; | 117 scoped_refptr<base::SingleThreadTaskRunner> gpu_task_runner_; |
| 114 scoped_refptr<base::SingleThreadTaskRunner> gpu_io_task_runner_; | 118 scoped_refptr<base::SingleThreadTaskRunner> gpu_io_task_runner_; |
| 115 }; | 119 }; |
| 116 | 120 |
| 117 OzoneGpuTestHelper::OzoneGpuTestHelper() { | 121 OzoneGpuTestHelper::OzoneGpuTestHelper() { |
| 118 } | 122 } |
| 119 | 123 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 134 base::Unretained(fake_gpu_process_.get()))); | 138 base::Unretained(fake_gpu_process_.get()))); |
| 135 | 139 |
| 136 fake_gpu_process_host_.reset(new FakeGpuProcessHost( | 140 fake_gpu_process_host_.reset(new FakeGpuProcessHost( |
| 137 gpu_task_runner, io_helper_thread_->task_runner())); | 141 gpu_task_runner, io_helper_thread_->task_runner())); |
| 138 fake_gpu_process_host_->Init(); | 142 fake_gpu_process_host_->Init(); |
| 139 | 143 |
| 140 return true; | 144 return true; |
| 141 } | 145 } |
| 142 | 146 |
| 143 } // namespace ui | 147 } // namespace ui |
| OLD | NEW |