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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 // | 105 // |
106 // TODO: Can we just always use sync_filter_ since we setup the channel | 106 // TODO: Can we just always use sync_filter_ since we setup the channel |
107 // without a main listener? | 107 // without a main listener? |
108 if (factory_->IsMainThread()) { | 108 if (factory_->IsMainThread()) { |
109 // http://crbug.com/125264 | 109 // http://crbug.com/125264 |
110 base::ThreadRestrictions::ScopedAllowWait allow_wait; | 110 base::ThreadRestrictions::ScopedAllowWait allow_wait; |
111 bool result = channel_->Send(message.release()); | 111 bool result = channel_->Send(message.release()); |
112 if (!result) | 112 if (!result) |
113 DVLOG(1) << "GpuChannelHost::Send failed: Channel::Send failed"; | 113 DVLOG(1) << "GpuChannelHost::Send failed: Channel::Send failed"; |
114 return result; | 114 return result; |
115 } else if (base::MessageLoop::current()) { | |
116 bool result = sync_filter_->Send(message.release()); | |
117 if (!result) | |
118 DVLOG(1) << "GpuChannelHost::Send failed: SyncMessageFilter::Send failed"; | |
119 return result; | |
120 } | 115 } |
121 | 116 |
122 return false; | 117 bool result = sync_filter_->Send(message.release()); |
| 118 return result; |
123 } | 119 } |
124 | 120 |
125 void GpuChannelHost::OrderingBarrier( | 121 void GpuChannelHost::OrderingBarrier( |
126 int route_id, | 122 int route_id, |
127 int32 put_offset, | 123 int32 put_offset, |
128 unsigned int flush_count, | 124 unsigned int flush_count, |
129 const std::vector<ui::LatencyInfo>& latency_info, | 125 const std::vector<ui::LatencyInfo>& latency_info, |
130 bool put_offset_changed, | 126 bool put_offset_changed, |
131 bool do_flush) { | 127 bool do_flush) { |
132 AutoLock lock(context_lock_); | 128 AutoLock lock(context_lock_); |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
430 | 426 |
431 listeners_.clear(); | 427 listeners_.clear(); |
432 } | 428 } |
433 | 429 |
434 bool GpuChannelHost::MessageFilter::IsLost() const { | 430 bool GpuChannelHost::MessageFilter::IsLost() const { |
435 AutoLock lock(lock_); | 431 AutoLock lock(lock_); |
436 return lost_; | 432 return lost_; |
437 } | 433 } |
438 | 434 |
439 } // namespace content | 435 } // namespace content |
OLD | NEW |