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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 // impl we are actually calling from the main thread (discard message then). | 110 // impl we are actually calling from the main thread (discard message then). |
111 // | 111 // |
112 // TODO: Can we just always use sync_filter_ since we setup the channel | 112 // TODO: Can we just always use sync_filter_ since we setup the channel |
113 // without a main listener? | 113 // without a main listener? |
114 if (factory_->IsMainThread()) { | 114 if (factory_->IsMainThread()) { |
115 if (channel_) { | 115 if (channel_) { |
116 // http://crbug.com/125264 | 116 // http://crbug.com/125264 |
117 base::ThreadRestrictions::ScopedAllowWait allow_wait; | 117 base::ThreadRestrictions::ScopedAllowWait allow_wait; |
118 return channel_->Send(message); | 118 return channel_->Send(message); |
119 } | 119 } |
120 } else if (MessageLoop::current()) { | 120 } else if (base::MessageLoop::current()) { |
121 return sync_filter_->Send(message); | 121 return sync_filter_->Send(message); |
122 } | 122 } |
123 | 123 |
124 // Callee takes ownership of message, regardless of whether Send is | 124 // Callee takes ownership of message, regardless of whether Send is |
125 // successful. See IPC::Sender. | 125 // successful. See IPC::Sender. |
126 delete message; | 126 delete message; |
127 return false; | 127 return false; |
128 } | 128 } |
129 | 129 |
130 CommandBufferProxyImpl* GpuChannelHost::CreateViewCommandBuffer( | 130 CommandBufferProxyImpl* GpuChannelHost::CreateViewCommandBuffer( |
(...skipping 259 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 |