| 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/location.h" | 10 #include "base/location.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 next_route_id_.GetNext(); | 66 next_route_id_.GetNext(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void GpuChannelHost::Connect(const IPC::ChannelHandle& channel_handle, | 69 void GpuChannelHost::Connect(const IPC::ChannelHandle& channel_handle, |
| 70 base::WaitableEvent* shutdown_event) { | 70 base::WaitableEvent* shutdown_event) { |
| 71 DCHECK(factory_->IsMainThread()); | 71 DCHECK(factory_->IsMainThread()); |
| 72 // Open a channel to the GPU process. We pass NULL as the main listener here | 72 // Open a channel to the GPU process. We pass NULL as the main listener here |
| 73 // since we need to filter everything to route it to the right thread. | 73 // since we need to filter everything to route it to the right thread. |
| 74 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = | 74 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = |
| 75 factory_->GetIOThreadTaskRunner(); | 75 factory_->GetIOThreadTaskRunner(); |
| 76 channel_ = | 76 channel_ = IPC::SyncChannel::Create( |
| 77 IPC::SyncChannel::Create(channel_handle, IPC::Channel::MODE_CLIENT, NULL, | 77 channel_handle, IPC::Channel::MODE_CLIENT, NULL, io_task_runner.get(), |
| 78 io_task_runner.get(), true, shutdown_event); | 78 true, shutdown_event, factory_->GetAttachmentBroker()); |
| 79 | 79 |
| 80 sync_filter_ = new IPC::SyncMessageFilter(shutdown_event); | 80 sync_filter_ = new IPC::SyncMessageFilter(shutdown_event); |
| 81 | 81 |
| 82 channel_->AddFilter(sync_filter_.get()); | 82 channel_->AddFilter(sync_filter_.get()); |
| 83 | 83 |
| 84 channel_filter_ = new MessageFilter(); | 84 channel_filter_ = new MessageFilter(); |
| 85 | 85 |
| 86 // Install the filter last, because we intercept all leftover | 86 // Install the filter last, because we intercept all leftover |
| 87 // messages. | 87 // messages. |
| 88 channel_->AddFilter(channel_filter_.get()); | 88 channel_->AddFilter(channel_filter_.get()); |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 | 436 |
| 437 listeners_.clear(); | 437 listeners_.clear(); |
| 438 } | 438 } |
| 439 | 439 |
| 440 bool GpuChannelHost::MessageFilter::IsLost() const { | 440 bool GpuChannelHost::MessageFilter::IsLost() const { |
| 441 AutoLock lock(lock_); | 441 AutoLock lock(lock_); |
| 442 return lost_; | 442 return lost_; |
| 443 } | 443 } |
| 444 | 444 |
| 445 } // namespace content | 445 } // namespace content |
| OLD | NEW |