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 26 matching lines...) Expand all Loading... |
37 state_(kUnconnected) { | 37 state_(kUnconnected) { |
38 next_transfer_buffer_id_.GetNext(); | 38 next_transfer_buffer_id_.GetNext(); |
39 } | 39 } |
40 | 40 |
41 void GpuChannelHost::Connect( | 41 void GpuChannelHost::Connect( |
42 const IPC::ChannelHandle& channel_handle) { | 42 const IPC::ChannelHandle& channel_handle) { |
43 DCHECK(factory_->IsMainThread()); | 43 DCHECK(factory_->IsMainThread()); |
44 // Open a channel to the GPU process. We pass NULL as the main listener here | 44 // Open a channel to the GPU process. We pass NULL as the main listener here |
45 // since we need to filter everything to route it to the right thread. | 45 // since we need to filter everything to route it to the right thread. |
46 scoped_refptr<base::MessageLoopProxy> io_loop = factory_->GetIOLoopProxy(); | 46 scoped_refptr<base::MessageLoopProxy> io_loop = factory_->GetIOLoopProxy(); |
47 channel_.reset(new IPC::SyncChannel( | 47 channel_.reset(new IPC::SyncChannel(channel_handle, |
48 channel_handle, IPC::Channel::MODE_CLIENT, NULL, | 48 IPC::Channel::MODE_CLIENT, |
49 io_loop, true, | 49 NULL, |
50 factory_->GetShutDownEvent())); | 50 io_loop.get(), |
| 51 true, |
| 52 factory_->GetShutDownEvent())); |
51 | 53 |
52 sync_filter_ = new IPC::SyncMessageFilter( | 54 sync_filter_ = new IPC::SyncMessageFilter( |
53 factory_->GetShutDownEvent()); | 55 factory_->GetShutDownEvent()); |
54 | 56 |
55 channel_->AddFilter(sync_filter_.get()); | 57 channel_->AddFilter(sync_filter_.get()); |
56 | 58 |
57 channel_filter_ = new MessageFilter(AsWeakPtr(), factory_); | 59 channel_filter_ = new MessageFilter(AsWeakPtr(), factory_); |
58 | 60 |
59 // Install the filter last, because we intercept all leftover | 61 // Install the filter last, because we intercept all leftover |
60 // messages. | 62 // messages. |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 const GpuListenerInfo& info = it->second; | 392 const GpuListenerInfo& info = it->second; |
391 info.loop->PostTask( | 393 info.loop->PostTask( |
392 FROM_HERE, | 394 FROM_HERE, |
393 base::Bind(&IPC::Listener::OnChannelError, info.listener)); | 395 base::Bind(&IPC::Listener::OnChannelError, info.listener)); |
394 } | 396 } |
395 | 397 |
396 listeners_.clear(); | 398 listeners_.clear(); |
397 } | 399 } |
398 | 400 |
399 } // namespace content | 401 } // namespace content |
OLD | NEW |