| 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/common/gpu/gpu_channel.h" | 9 #include "content/common/gpu/gpu_channel.h" |
| 10 | 10 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 bool handled = false; | 105 bool handled = false; |
| 106 if ((message.type() == GpuCommandBufferMsg_RetireSyncPoint::ID) && | 106 if ((message.type() == GpuCommandBufferMsg_RetireSyncPoint::ID) && |
| 107 !future_sync_points_) { | 107 !future_sync_points_) { |
| 108 DLOG(ERROR) << "Untrusted client should not send " | 108 DLOG(ERROR) << "Untrusted client should not send " |
| 109 "GpuCommandBufferMsg_RetireSyncPoint message"; | 109 "GpuCommandBufferMsg_RetireSyncPoint message"; |
| 110 return true; | 110 return true; |
| 111 } | 111 } |
| 112 | 112 |
| 113 if (message.type() == GpuCommandBufferMsg_InsertSyncPoint::ID) { | 113 if (message.type() == GpuCommandBufferMsg_InsertSyncPoint::ID) { |
| 114 Tuple1<bool> retire; | 114 Tuple<bool> retire; |
| 115 IPC::Message* reply = IPC::SyncMessage::GenerateReply(&message); | 115 IPC::Message* reply = IPC::SyncMessage::GenerateReply(&message); |
| 116 if (!GpuCommandBufferMsg_InsertSyncPoint::ReadSendParam(&message, | 116 if (!GpuCommandBufferMsg_InsertSyncPoint::ReadSendParam(&message, |
| 117 &retire)) { | 117 &retire)) { |
| 118 reply->set_reply_error(); | 118 reply->set_reply_error(); |
| 119 Send(reply); | 119 Send(reply); |
| 120 return true; | 120 return true; |
| 121 } | 121 } |
| 122 if (!future_sync_points_ && !retire.a) { | 122 if (!future_sync_points_ && !get<0>(retire)) { |
| 123 LOG(ERROR) << "Untrusted contexts can't create future sync points"; | 123 LOG(ERROR) << "Untrusted contexts can't create future sync points"; |
| 124 reply->set_reply_error(); | 124 reply->set_reply_error(); |
| 125 Send(reply); | 125 Send(reply); |
| 126 return true; | 126 return true; |
| 127 } | 127 } |
| 128 uint32 sync_point = sync_point_manager_->GenerateSyncPoint(); | 128 uint32 sync_point = sync_point_manager_->GenerateSyncPoint(); |
| 129 GpuCommandBufferMsg_InsertSyncPoint::WriteReplyParams(reply, sync_point); | 129 GpuCommandBufferMsg_InsertSyncPoint::WriteReplyParams(reply, sync_point); |
| 130 Send(reply); | 130 Send(reply); |
| 131 message_loop_->PostTask( | 131 message_loop_->PostTask( |
| 132 FROM_HERE, | 132 FROM_HERE, |
| 133 base::Bind(&GpuChannelMessageFilter::InsertSyncPointOnMainThread, | 133 base::Bind(&GpuChannelMessageFilter::InsertSyncPointOnMainThread, |
| 134 gpu_channel_, | 134 gpu_channel_, |
| 135 sync_point_manager_, | 135 sync_point_manager_, |
| 136 message.routing_id(), | 136 message.routing_id(), |
| 137 retire.a, | 137 get<0>(retire), |
| 138 sync_point)); | 138 sync_point)); |
| 139 handled = true; | 139 handled = true; |
| 140 } | 140 } |
| 141 | 141 |
| 142 // All other messages get processed by the GpuChannel. | 142 // All other messages get processed by the GpuChannel. |
| 143 messages_forwarded_to_channel_++; | 143 messages_forwarded_to_channel_++; |
| 144 if (preempting_flag_.get()) | 144 if (preempting_flag_.get()) |
| 145 pending_messages_.push(PendingMessage(messages_forwarded_to_channel_)); | 145 pending_messages_.push(PendingMessage(messages_forwarded_to_channel_)); |
| 146 UpdatePreemptionState(); | 146 UpdatePreemptionState(); |
| 147 | 147 |
| (...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 872 } | 872 } |
| 873 } | 873 } |
| 874 } | 874 } |
| 875 | 875 |
| 876 void GpuChannel::HandleUpdateValueState( | 876 void GpuChannel::HandleUpdateValueState( |
| 877 unsigned int target, const gpu::ValueState& state) { | 877 unsigned int target, const gpu::ValueState& state) { |
| 878 pending_valuebuffer_state_->UpdateState(target, state); | 878 pending_valuebuffer_state_->UpdateState(target, state); |
| 879 } | 879 } |
| 880 | 880 |
| 881 } // namespace content | 881 } // namespace content |
| OLD | NEW |