| 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 #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/common/gpu/gpu_channel.h" | 9 #include "content/common/gpu/gpu_channel.h" |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 return transport_textures_.Lookup(route_id); | 60 return transport_textures_.Lookup(route_id); |
| 61 } | 61 } |
| 62 | 62 |
| 63 void GpuChannel::DestroyTransportTexture(int32 route_id) { | 63 void GpuChannel::DestroyTransportTexture(int32 route_id) { |
| 64 transport_textures_.Remove(route_id); | 64 transport_textures_.Remove(route_id); |
| 65 router_.RemoveRoute(route_id); | 65 router_.RemoveRoute(route_id); |
| 66 } | 66 } |
| 67 | 67 |
| 68 bool GpuChannel::OnMessageReceived(const IPC::Message& message) { | 68 bool GpuChannel::OnMessageReceived(const IPC::Message& message) { |
| 69 if (log_messages_) { | 69 if (log_messages_) { |
| 70 VLOG(1) << "received message @" << &message << " on channel @" << this | 70 DVLOG(1) << "received message @" << &message << " on channel @" << this |
| 71 << " with type " << message.type(); | 71 << " with type " << message.type(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 // Control messages are not deferred and can be handled out of order with | 74 // Control messages are not deferred and can be handled out of order with |
| 75 // respect to routed ones. Except for Echo, which must be deferred in order | 75 // respect to routed ones. Except for Echo, which must be deferred in order |
| 76 // to respect the asynchronous Mac SwapBuffers. | 76 // to respect the asynchronous Mac SwapBuffers. |
| 77 if (message.routing_id() == MSG_ROUTING_CONTROL && | 77 if (message.routing_id() == MSG_ROUTING_CONTROL && |
| 78 message.type() != GpuChannelMsg_Echo::ID) | 78 message.type() != GpuChannelMsg_Echo::ID) |
| 79 return OnControlMessageReceived(message); | 79 return OnControlMessageReceived(message); |
| 80 | 80 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 98 | 98 |
| 99 void GpuChannel::OnChannelConnected(int32 peer_pid) { | 99 void GpuChannel::OnChannelConnected(int32 peer_pid) { |
| 100 renderer_pid_ = peer_pid; | 100 renderer_pid_ = peer_pid; |
| 101 } | 101 } |
| 102 | 102 |
| 103 bool GpuChannel::Send(IPC::Message* message) { | 103 bool GpuChannel::Send(IPC::Message* message) { |
| 104 // The GPU process must never send a synchronous IPC message to the renderer | 104 // The GPU process must never send a synchronous IPC message to the renderer |
| 105 // process. This could result in deadlock. | 105 // process. This could result in deadlock. |
| 106 DCHECK(!message->is_sync()); | 106 DCHECK(!message->is_sync()); |
| 107 if (log_messages_) { | 107 if (log_messages_) { |
| 108 VLOG(1) << "sending message @" << message << " on channel @" << this | 108 DVLOG(1) << "sending message @" << message << " on channel @" << this |
| 109 << " with type " << message->type(); | 109 << " with type " << message->type(); |
| 110 } | 110 } |
| 111 | 111 |
| 112 if (!channel_.get()) { | 112 if (!channel_.get()) { |
| 113 delete message; | 113 delete message; |
| 114 return false; | 114 return false; |
| 115 } | 115 } |
| 116 | 116 |
| 117 return channel_->Send(message); | 117 return channel_->Send(message); |
| 118 } | 118 } |
| 119 | 119 |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 | 439 |
| 440 #if defined(OS_POSIX) | 440 #if defined(OS_POSIX) |
| 441 int GpuChannel::TakeRendererFileDescriptor() { | 441 int GpuChannel::TakeRendererFileDescriptor() { |
| 442 if (!channel_.get()) { | 442 if (!channel_.get()) { |
| 443 NOTREACHED(); | 443 NOTREACHED(); |
| 444 return -1; | 444 return -1; |
| 445 } | 445 } |
| 446 return channel_->TakeClientFileDescriptor(); | 446 return channel_->TakeClientFileDescriptor(); |
| 447 } | 447 } |
| 448 #endif // defined(OS_POSIX) | 448 #endif // defined(OS_POSIX) |
| OLD | NEW |