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( |
| 453 GpuDataManagerImpl::GetInstance()->GetWindowCount())); |
450 } | 454 } |
451 | 455 |
452 void GpuProcessHost::RouteOnUIThread(const IPC::Message& message) { | 456 void GpuProcessHost::RouteOnUIThread(const IPC::Message& message) { |
453 BrowserThread::PostTask( | 457 BrowserThread::PostTask( |
454 BrowserThread::UI, | 458 BrowserThread::UI, |
455 FROM_HERE, | 459 FROM_HERE, |
456 base::Bind(&RouteToGpuProcessHostUIShimTask, host_id_, message)); | 460 base::Bind(&RouteToGpuProcessHostUIShimTask, host_id_, message)); |
457 } | 461 } |
458 | 462 |
459 bool GpuProcessHost::Send(IPC::Message* msg) { | 463 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, | 909 const IPC::ChannelHandle& channel_handle, |
906 base::ProcessHandle renderer_process_for_gpu, | 910 base::ProcessHandle renderer_process_for_gpu, |
907 const content::GPUInfo& gpu_info) { | 911 const content::GPUInfo& gpu_info) { |
908 callback.Run(channel_handle, gpu_info); | 912 callback.Run(channel_handle, gpu_info); |
909 } | 913 } |
910 | 914 |
911 void GpuProcessHost::CreateCommandBufferError( | 915 void GpuProcessHost::CreateCommandBufferError( |
912 const CreateCommandBufferCallback& callback, int32 route_id) { | 916 const CreateCommandBufferCallback& callback, int32 route_id) { |
913 callback.Run(route_id); | 917 callback.Run(route_id); |
914 } | 918 } |
OLD | NEW |