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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 next_stream_id_.GetNext(); | 62 next_stream_id_.GetNext(); |
63 } | 63 } |
64 | 64 |
65 void GpuChannelHost::Connect(const IPC::ChannelHandle& channel_handle, | 65 void GpuChannelHost::Connect(const IPC::ChannelHandle& channel_handle, |
66 base::WaitableEvent* shutdown_event) { | 66 base::WaitableEvent* shutdown_event) { |
67 DCHECK(factory_->IsMainThread()); | 67 DCHECK(factory_->IsMainThread()); |
68 // Open a channel to the GPU process. We pass NULL as the main listener here | 68 // Open a channel to the GPU process. We pass NULL as the main listener here |
69 // since we need to filter everything to route it to the right thread. | 69 // since we need to filter everything to route it to the right thread. |
70 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = | 70 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner = |
71 factory_->GetIOThreadTaskRunner(); | 71 factory_->GetIOThreadTaskRunner(); |
72 channel_ = IPC::SyncChannel::Create( | 72 channel_ = |
73 channel_handle, IPC::Channel::MODE_CLIENT, NULL, io_task_runner.get(), | 73 IPC::SyncChannel::Create(channel_handle, IPC::Channel::MODE_CLIENT, NULL, |
74 true, shutdown_event, factory_->GetAttachmentBroker()); | 74 io_task_runner.get(), true, shutdown_event); |
75 | 75 |
76 sync_filter_ = channel_->CreateSyncMessageFilter(); | 76 sync_filter_ = channel_->CreateSyncMessageFilter(); |
77 | 77 |
78 channel_filter_ = new MessageFilter(); | 78 channel_filter_ = new MessageFilter(); |
79 | 79 |
80 // Install the filter last, because we intercept all leftover | 80 // Install the filter last, because we intercept all leftover |
81 // messages. | 81 // messages. |
82 channel_->AddFilter(channel_filter_.get()); | 82 channel_->AddFilter(channel_filter_.get()); |
83 } | 83 } |
84 | 84 |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 | 445 |
446 listeners_.clear(); | 446 listeners_.clear(); |
447 } | 447 } |
448 | 448 |
449 bool GpuChannelHost::MessageFilter::IsLost() const { | 449 bool GpuChannelHost::MessageFilter::IsLost() const { |
450 AutoLock lock(lock_); | 450 AutoLock lock(lock_); |
451 return lost_; | 451 return lost_; |
452 } | 452 } |
453 | 453 |
454 } // namespace content | 454 } // namespace content |
OLD | NEW |