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/common/gpu/client/gpu_channel_host.h" | 5 #include "content/common/gpu/client/gpu_channel_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // Install the filter last, because we intercept all leftover | 59 // Install the filter last, because we intercept all leftover |
60 // messages. | 60 // messages. |
61 channel_->AddFilter(channel_filter_.get()); | 61 channel_->AddFilter(channel_filter_.get()); |
62 | 62 |
63 // It is safe to send IPC messages before the channel completes the connection | 63 // It is safe to send IPC messages before the channel completes the connection |
64 // and receives the hello message from the GPU process. The messages get | 64 // and receives the hello message from the GPU process. The messages get |
65 // cached. | 65 // cached. |
66 state_ = kConnected; | 66 state_ = kConnected; |
67 } | 67 } |
68 | 68 |
69 void GpuChannelHost::set_gpu_info(const GPUInfo& gpu_info) { | 69 void GpuChannelHost::set_gpu_info(const gpu::GPUInfo& gpu_info) { |
70 gpu_info_ = gpu_info; | 70 gpu_info_ = gpu_info; |
71 } | 71 } |
72 | 72 |
73 void GpuChannelHost::SetStateLost() { | 73 void GpuChannelHost::SetStateLost() { |
74 state_ = kLost; | 74 state_ = kLost; |
75 } | 75 } |
76 | 76 |
77 const GPUInfo& GpuChannelHost::gpu_info() const { | 77 const gpu::GPUInfo& GpuChannelHost::gpu_info() const { |
78 return gpu_info_; | 78 return gpu_info_; |
79 } | 79 } |
80 | 80 |
81 void GpuChannelHost::OnMessageReceived(const IPC::Message& message) { | 81 void GpuChannelHost::OnMessageReceived(const IPC::Message& message) { |
82 bool handled = true; | 82 bool handled = true; |
83 | 83 |
84 IPC_BEGIN_MESSAGE_MAP(GpuChannelHost, message) | 84 IPC_BEGIN_MESSAGE_MAP(GpuChannelHost, message) |
85 IPC_MESSAGE_HANDLER(GpuChannelMsg_GenerateMailboxNamesReply, | 85 IPC_MESSAGE_HANDLER(GpuChannelMsg_GenerateMailboxNamesReply, |
86 OnGenerateMailboxNamesReply) | 86 OnGenerateMailboxNamesReply) |
87 IPC_MESSAGE_UNHANDLED(handled = false) | 87 IPC_MESSAGE_UNHANDLED(handled = false) |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 const GpuListenerInfo& info = it->second; | 390 const GpuListenerInfo& info = it->second; |
391 info.loop->PostTask( | 391 info.loop->PostTask( |
392 FROM_HERE, | 392 FROM_HERE, |
393 base::Bind(&IPC::Listener::OnChannelError, info.listener)); | 393 base::Bind(&IPC::Listener::OnChannelError, info.listener)); |
394 } | 394 } |
395 | 395 |
396 listeners_.clear(); | 396 listeners_.clear(); |
397 } | 397 } |
398 | 398 |
399 } // namespace content | 399 } // namespace content |
OLD | NEW |