| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/common/gpu/gpu_channel_manager.h" | 5 #include "content/common/gpu/gpu_channel_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "content/common/child_thread.h" | 8 #include "content/common/child_thread.h" |
| 9 #include "content/common/gpu/gpu_channel.h" | 9 #include "content/common/gpu/gpu_channel.h" |
| 10 #include "content/common/gpu/gpu_messages.h" | 10 #include "content/common/gpu/gpu_messages.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 bool GpuChannelManager::OnMessageReceived(const IPC::Message& msg) { | 56 bool GpuChannelManager::OnMessageReceived(const IPC::Message& msg) { |
| 57 bool msg_is_ok = true; | 57 bool msg_is_ok = true; |
| 58 bool handled = true; | 58 bool handled = true; |
| 59 IPC_BEGIN_MESSAGE_MAP_EX(GpuChannelManager, msg, msg_is_ok) | 59 IPC_BEGIN_MESSAGE_MAP_EX(GpuChannelManager, msg, msg_is_ok) |
| 60 IPC_MESSAGE_HANDLER(GpuMsg_EstablishChannel, OnEstablishChannel) | 60 IPC_MESSAGE_HANDLER(GpuMsg_EstablishChannel, OnEstablishChannel) |
| 61 IPC_MESSAGE_HANDLER(GpuMsg_CloseChannel, OnCloseChannel) | 61 IPC_MESSAGE_HANDLER(GpuMsg_CloseChannel, OnCloseChannel) |
| 62 IPC_MESSAGE_HANDLER(GpuMsg_CreateViewCommandBuffer, | 62 IPC_MESSAGE_HANDLER(GpuMsg_CreateViewCommandBuffer, |
| 63 OnCreateViewCommandBuffer) | 63 OnCreateViewCommandBuffer) |
| 64 IPC_MESSAGE_HANDLER(GpuMsg_VisibilityChanged, OnVisibilityChanged) | 64 IPC_MESSAGE_HANDLER(GpuMsg_VisibilityChanged, OnVisibilityChanged) |
| 65 #if defined(TOOLKIT_USES_GTK) && !defined(TOUCH_UI) || defined(OS_WIN) | 65 #if defined(TOOLKIT_USES_GTK) || defined(OS_WIN) |
| 66 IPC_MESSAGE_HANDLER(GpuMsg_ResizeViewACK, OnResizeViewACK); | 66 IPC_MESSAGE_HANDLER(GpuMsg_ResizeViewACK, OnResizeViewACK); |
| 67 #endif | 67 #endif |
| 68 IPC_MESSAGE_UNHANDLED(handled = false) | 68 IPC_MESSAGE_UNHANDLED(handled = false) |
| 69 IPC_END_MESSAGE_MAP_EX() | 69 IPC_END_MESSAGE_MAP_EX() |
| 70 return handled; | 70 return handled; |
| 71 } | 71 } |
| 72 | 72 |
| 73 bool GpuChannelManager::Send(IPC::Message* msg) { | 73 bool GpuChannelManager::Send(IPC::Message* msg) { |
| 74 return gpu_child_thread_->Send(msg); | 74 return gpu_child_thread_->Send(msg); |
| 75 } | 75 } |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 void GpuChannelManager::LoseAllContexts() { | 151 void GpuChannelManager::LoseAllContexts() { |
| 152 MessageLoop::current()->PostTask( | 152 MessageLoop::current()->PostTask( |
| 153 FROM_HERE, | 153 FROM_HERE, |
| 154 base::Bind(&GpuChannelManager::OnLoseAllContexts, | 154 base::Bind(&GpuChannelManager::OnLoseAllContexts, |
| 155 weak_factory_.GetWeakPtr())); | 155 weak_factory_.GetWeakPtr())); |
| 156 } | 156 } |
| 157 | 157 |
| 158 void GpuChannelManager::OnLoseAllContexts() { | 158 void GpuChannelManager::OnLoseAllContexts() { |
| 159 gpu_channels_.clear(); | 159 gpu_channels_.clear(); |
| 160 } | 160 } |
| OLD | NEW |