| 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 #if defined(OS_WIN) | 5 #if defined(OS_WIN) |
| 6 #include <windows.h> | 6 #include <windows.h> |
| 7 #endif | 7 #endif |
| 8 | 8 |
| 9 #include "content/browser/renderer_host/gpu_message_filter.h" | 9 #include "content/browser/renderer_host/gpu_message_filter.h" |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 IPC_MESSAGE_UNHANDLED(handled = false) | 37 IPC_MESSAGE_UNHANDLED(handled = false) |
| 38 IPC_END_MESSAGE_MAP() | 38 IPC_END_MESSAGE_MAP() |
| 39 return handled; | 39 return handled; |
| 40 } | 40 } |
| 41 | 41 |
| 42 void GpuMessageFilter::OnEstablishGpuChannel( | 42 void GpuMessageFilter::OnEstablishGpuChannel( |
| 43 CauseForGpuLaunch cause_for_gpu_launch, | 43 CauseForGpuLaunch cause_for_gpu_launch, |
| 44 IPC::Message* reply_ptr) { | 44 IPC::Message* reply_ptr) { |
| 45 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 45 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 46 scoped_ptr<IPC::Message> reply(reply_ptr); | 46 scoped_ptr<IPC::Message> reply(reply_ptr); |
| 47 if (!GpuDataManagerImpl::GetInstance()->CanUseGpuBrowserCompositor()) { | |
| 48 reply->set_reply_error(); | |
| 49 Send(reply.release()); | |
| 50 return; | |
| 51 } | |
| 52 | |
| 53 GpuProcessHost* host = GpuProcessHost::FromID(gpu_process_id_); | 47 GpuProcessHost* host = GpuProcessHost::FromID(gpu_process_id_); |
| 54 if (!host) { | 48 if (!host) { |
| 55 host = GpuProcessHost::Get(GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, | 49 host = GpuProcessHost::Get(GpuProcessHost::GPU_PROCESS_KIND_SANDBOXED, |
| 56 cause_for_gpu_launch); | 50 cause_for_gpu_launch); |
| 57 if (!host) { | 51 if (!host) { |
| 58 reply->set_reply_error(); | 52 reply->set_reply_error(); |
| 59 Send(reply.release()); | 53 Send(reply.release()); |
| 60 return; | 54 return; |
| 61 } | 55 } |
| 62 | 56 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 81 const IPC::ChannelHandle& channel, | 75 const IPC::ChannelHandle& channel, |
| 82 const gpu::GPUInfo& gpu_info) { | 76 const gpu::GPUInfo& gpu_info) { |
| 83 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 77 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 84 | 78 |
| 85 GpuHostMsg_EstablishGpuChannel::WriteReplyParams( | 79 GpuHostMsg_EstablishGpuChannel::WriteReplyParams( |
| 86 reply.get(), render_process_id_, channel, gpu_info); | 80 reply.get(), render_process_id_, channel, gpu_info); |
| 87 Send(reply.release()); | 81 Send(reply.release()); |
| 88 } | 82 } |
| 89 | 83 |
| 90 } // namespace content | 84 } // namespace content |
| OLD | NEW |