Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: content/common/gpu/client/gpu_channel_host.cc

Issue 310853003: Add IPC::ChannelProxy::Create() and IPC::SyncChannel::Create() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Landing Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/child/npapi/np_channel_base.cc ('k') | content/common/gpu/gpu_channel.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 next_transfer_buffer_id_.GetNext(); 66 next_transfer_buffer_id_.GetNext();
67 next_gpu_memory_buffer_id_.GetNext(); 67 next_gpu_memory_buffer_id_.GetNext();
68 next_route_id_.GetNext(); 68 next_route_id_.GetNext();
69 } 69 }
70 70
71 void GpuChannelHost::Connect(const IPC::ChannelHandle& channel_handle, 71 void GpuChannelHost::Connect(const IPC::ChannelHandle& channel_handle,
72 base::WaitableEvent* shutdown_event) { 72 base::WaitableEvent* shutdown_event) {
73 // Open a channel to the GPU process. We pass NULL as the main listener here 73 // Open a channel to the GPU process. We pass NULL as the main listener here
74 // since we need to filter everything to route it to the right thread. 74 // since we need to filter everything to route it to the right thread.
75 scoped_refptr<base::MessageLoopProxy> io_loop = factory_->GetIOLoopProxy(); 75 scoped_refptr<base::MessageLoopProxy> io_loop = factory_->GetIOLoopProxy();
76 channel_.reset(new IPC::SyncChannel(channel_handle, 76 channel_ = IPC::SyncChannel::Create(channel_handle,
77 IPC::Channel::MODE_CLIENT, 77 IPC::Channel::MODE_CLIENT,
78 NULL, 78 NULL,
79 io_loop.get(), 79 io_loop.get(),
80 true, 80 true,
81 shutdown_event)); 81 shutdown_event);
82 82
83 sync_filter_ = new IPC::SyncMessageFilter(shutdown_event); 83 sync_filter_ = new IPC::SyncMessageFilter(shutdown_event);
84 84
85 channel_->AddFilter(sync_filter_.get()); 85 channel_->AddFilter(sync_filter_.get());
86 86
87 channel_filter_ = new MessageFilter(); 87 channel_filter_ = new MessageFilter();
88 88
89 // Install the filter last, because we intercept all leftover 89 // Install the filter last, because we intercept all leftover
90 // messages. 90 // messages.
91 channel_->AddFilter(channel_filter_.get()); 91 channel_->AddFilter(channel_filter_.get());
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 390
391 listeners_.clear(); 391 listeners_.clear();
392 } 392 }
393 393
394 bool GpuChannelHost::MessageFilter::IsLost() const { 394 bool GpuChannelHost::MessageFilter::IsLost() const {
395 AutoLock lock(lock_); 395 AutoLock lock(lock_);
396 return lost_; 396 return lost_;
397 } 397 }
398 398
399 } // namespace content 399 } // namespace content
OLDNEW
« no previous file with comments | « content/child/npapi/np_channel_base.cc ('k') | content/common/gpu/gpu_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698