Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/browser/gpu/gpu_process_host.h" | 5 #include "content/browser/gpu/gpu_process_host.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 439 #else | 439 #else |
| 440 options.message_loop_type = MessageLoop::TYPE_IO; | 440 options.message_loop_type = MessageLoop::TYPE_IO; |
| 441 #endif | 441 #endif |
| 442 in_process_gpu_thread_->StartWithOptions(options); | 442 in_process_gpu_thread_->StartWithOptions(options); |
| 443 | 443 |
| 444 OnProcessLaunched(); // Fake a callback that the process is ready. | 444 OnProcessLaunched(); // Fake a callback that the process is ready. |
| 445 } else if (!LaunchGpuProcess(channel_id)) { | 445 } else if (!LaunchGpuProcess(channel_id)) { |
| 446 return false; | 446 return false; |
| 447 } | 447 } |
| 448 | 448 |
| 449 return Send(new GpuMsg_Initialize()); | 449 if (!Send(new GpuMsg_Initialize())) |
| 450 return false; | |
| 451 | |
| 452 return Send(new GpuMsg_SetVideoMemoryWindowCount(0)); | |
|
ccameron
2012/10/03 20:29:59
Could we call gpu_util::GetBrowserMonitorWindowCou
| |
| 450 } | 453 } |
| 451 | 454 |
| 452 void GpuProcessHost::RouteOnUIThread(const IPC::Message& message) { | 455 void GpuProcessHost::RouteOnUIThread(const IPC::Message& message) { |
| 453 BrowserThread::PostTask( | 456 BrowserThread::PostTask( |
| 454 BrowserThread::UI, | 457 BrowserThread::UI, |
| 455 FROM_HERE, | 458 FROM_HERE, |
| 456 base::Bind(&RouteToGpuProcessHostUIShimTask, host_id_, message)); | 459 base::Bind(&RouteToGpuProcessHostUIShimTask, host_id_, message)); |
| 457 } | 460 } |
| 458 | 461 |
| 459 bool GpuProcessHost::Send(IPC::Message* msg) { | 462 bool GpuProcessHost::Send(IPC::Message* msg) { |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 905 const IPC::ChannelHandle& channel_handle, | 908 const IPC::ChannelHandle& channel_handle, |
| 906 base::ProcessHandle renderer_process_for_gpu, | 909 base::ProcessHandle renderer_process_for_gpu, |
| 907 const content::GPUInfo& gpu_info) { | 910 const content::GPUInfo& gpu_info) { |
| 908 callback.Run(channel_handle, gpu_info); | 911 callback.Run(channel_handle, gpu_info); |
| 909 } | 912 } |
| 910 | 913 |
| 911 void GpuProcessHost::CreateCommandBufferError( | 914 void GpuProcessHost::CreateCommandBufferError( |
| 912 const CreateCommandBufferCallback& callback, int32 route_id) { | 915 const CreateCommandBufferCallback& callback, int32 route_id) { |
| 913 callback.Run(route_id); | 916 callback.Run(route_id); |
| 914 } | 917 } |
| OLD | NEW |