Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Side by Side Diff: content/gpu/gpu_child_thread.cc

Issue 1808743002: Provide GpuPreferences to content gpu client hook (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/public/gpu/content_gpu_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/gpu/gpu_child_thread.h" 5 #include "content/gpu/gpu_child_thread.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 } 216 }
217 217
218 void GpuChildThread::Init(const base::Time& process_start_time) { 218 void GpuChildThread::Init(const base::Time& process_start_time) {
219 process_start_time_ = process_start_time; 219 process_start_time_ = process_start_time;
220 220
221 process_control_.reset(new GpuProcessControlImpl()); 221 process_control_.reset(new GpuProcessControlImpl());
222 // Use of base::Unretained(this) is safe here because |service_registry()| 222 // Use of base::Unretained(this) is safe here because |service_registry()|
223 // will be destroyed before GpuChildThread is destructed. 223 // will be destroyed before GpuChildThread is destructed.
224 service_registry()->AddService(base::Bind( 224 service_registry()->AddService(base::Bind(
225 &GpuChildThread::BindProcessControlRequest, base::Unretained(this))); 225 &GpuChildThread::BindProcessControlRequest, base::Unretained(this)));
226
227 if (GetContentClient()->gpu()) // NULL in tests.
228 GetContentClient()->gpu()->RegisterMojoServices(service_registry());
229 } 226 }
230 227
231 bool GpuChildThread::Send(IPC::Message* msg) { 228 bool GpuChildThread::Send(IPC::Message* msg) {
232 // The GPU process must never send a synchronous IPC message to the browser 229 // The GPU process must never send a synchronous IPC message to the browser
233 // process. This could result in deadlock. 230 // process. This could result in deadlock.
234 DCHECK(!msg->is_sync()); 231 DCHECK(!msg->is_sync());
235 232
236 return ChildThreadImpl::Send(msg); 233 return ChildThreadImpl::Send(msg);
237 } 234 }
238 235
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 // initialization has succeeded. 382 // initialization has succeeded.
386 gpu_channel_manager_.reset( 383 gpu_channel_manager_.reset(
387 new GpuChannelManager(gpu_preferences_, this, watchdog_thread_.get(), 384 new GpuChannelManager(gpu_preferences_, this, watchdog_thread_.get(),
388 base::ThreadTaskRunnerHandle::Get().get(), 385 base::ThreadTaskRunnerHandle::Get().get(),
389 ChildProcess::current()->io_task_runner(), 386 ChildProcess::current()->io_task_runner(),
390 ChildProcess::current()->GetShutDownEvent(), 387 ChildProcess::current()->GetShutDownEvent(),
391 sync_point_manager_, gpu_memory_buffer_factory_)); 388 sync_point_manager_, gpu_memory_buffer_factory_));
392 389
393 media_service_.reset(new MediaService(gpu_channel_manager_.get())); 390 media_service_.reset(new MediaService(gpu_channel_manager_.get()));
394 391
392 if (GetContentClient()->gpu()) // NULL in tests.
393 GetContentClient()->gpu()->RegisterMojoServices(service_registry(),
394 gpu_preferences_);
395
395 #if defined(USE_OZONE) 396 #if defined(USE_OZONE)
396 ui::OzonePlatform::GetInstance() 397 ui::OzonePlatform::GetInstance()
397 ->GetGpuPlatformSupport() 398 ->GetGpuPlatformSupport()
398 ->OnChannelEstablished(this); 399 ->OnChannelEstablished(this);
399 #endif 400 #endif
400 } 401 }
401 402
402 void GpuChildThread::OnFinalize() { 403 void GpuChildThread::OnFinalize() {
403 // Quit the GPU process 404 // Quit the GPU process
404 base::MessageLoop::current()->QuitWhenIdle(); 405 base::MessageLoop::current()->QuitWhenIdle();
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 562
562 void GpuChildThread::BindProcessControlRequest( 563 void GpuChildThread::BindProcessControlRequest(
563 mojo::InterfaceRequest<ProcessControl> request) { 564 mojo::InterfaceRequest<ProcessControl> request) {
564 DVLOG(1) << "GPU: Binding ProcessControl request"; 565 DVLOG(1) << "GPU: Binding ProcessControl request";
565 DCHECK(process_control_); 566 DCHECK(process_control_);
566 process_control_bindings_.AddBinding(process_control_.get(), 567 process_control_bindings_.AddBinding(process_control_.get(),
567 std::move(request)); 568 std::move(request));
568 } 569 }
569 570
570 } // namespace content 571 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/public/gpu/content_gpu_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698