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

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

Issue 301973003: Introduce IPC::ChannelProxy::Create*() and IPC::SynChannel::Create*() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing mac build 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::CreateClient(
77 IPC::Channel::MODE_CLIENT, 77 channel_handle, NULL, io_loop.get(), true, shutdown_event);
78 NULL,
79 io_loop.get(),
80 true,
81 shutdown_event));
82 78
83 sync_filter_ = new IPC::SyncMessageFilter(shutdown_event); 79 sync_filter_ = new IPC::SyncMessageFilter(shutdown_event);
84 80
85 channel_->AddFilter(sync_filter_.get()); 81 channel_->AddFilter(sync_filter_.get());
86 82
87 channel_filter_ = new MessageFilter(); 83 channel_filter_ = new MessageFilter();
88 84
89 // Install the filter last, because we intercept all leftover 85 // Install the filter last, because we intercept all leftover
90 // messages. 86 // messages.
91 channel_->AddFilter(channel_filter_.get()); 87 channel_->AddFilter(channel_filter_.get());
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 386
391 listeners_.clear(); 387 listeners_.clear();
392 } 388 }
393 389
394 bool GpuChannelHost::MessageFilter::IsLost() const { 390 bool GpuChannelHost::MessageFilter::IsLost() const {
395 AutoLock lock(lock_); 391 AutoLock lock(lock_);
396 return lost_; 392 return lost_;
397 } 393 }
398 394
399 } // namespace content 395 } // 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