| 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/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 next_stream_id_.GetNext(); | 72 next_stream_id_.GetNext(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 void GpuChannelHost::Connect(const IPC::ChannelHandle& channel_handle, | 75 void GpuChannelHost::Connect(const IPC::ChannelHandle& channel_handle, |
| 76 base::WaitableEvent* shutdown_event) { | 76 base::WaitableEvent* shutdown_event) { |
| 77 DCHECK(factory_->IsMainThread()); | 77 DCHECK(factory_->IsMainThread()); |
| 78 // Open a channel to the GPU process. We pass NULL as the main listener here | 78 // Open a channel to the GPU process. We pass NULL as the main listener here |
| 79 // since we need to filter everything to route it to the right thread. | 79 // since we need to filter everything to route it to the right thread. |
| 80 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = | 80 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = |
| 81 factory_->GetIOThreadTaskRunner(); | 81 factory_->GetIOThreadTaskRunner(); |
| 82 channel_ = IPC::SyncChannel::Create( | 82 channel_ = |
| 83 channel_handle, IPC::Channel::MODE_CLIENT, NULL, io_task_runner.get(), | 83 IPC::SyncChannel::Create(channel_handle, IPC::Channel::MODE_CLIENT, NULL, |
| 84 true, shutdown_event, factory_->GetAttachmentBroker()); | 84 io_task_runner.get(), true, shutdown_event); |
| 85 | 85 |
| 86 sync_filter_ = channel_->CreateSyncMessageFilter(); | 86 sync_filter_ = channel_->CreateSyncMessageFilter(); |
| 87 | 87 |
| 88 channel_filter_ = new MessageFilter(); | 88 channel_filter_ = new MessageFilter(); |
| 89 | 89 |
| 90 // Install the filter last, because we intercept all leftover | 90 // Install the filter last, because we intercept all leftover |
| 91 // messages. | 91 // messages. |
| 92 channel_->AddFilter(channel_filter_.get()); | 92 channel_->AddFilter(channel_filter_.get()); |
| 93 } | 93 } |
| 94 | 94 |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 | 461 |
| 462 listeners_.clear(); | 462 listeners_.clear(); |
| 463 } | 463 } |
| 464 | 464 |
| 465 bool GpuChannelHost::MessageFilter::IsLost() const { | 465 bool GpuChannelHost::MessageFilter::IsLost() const { |
| 466 AutoLock lock(lock_); | 466 AutoLock lock(lock_); |
| 467 return lost_; | 467 return lost_; |
| 468 } | 468 } |
| 469 | 469 |
| 470 } // namespace content | 470 } // namespace content |
| OLD | NEW |