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

Side by Side Diff: content/common/gpu/gpu_channel_manager.cc

Issue 1544293002: Convert Pass()→std::move() in //content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « content/common/gpu/gpu_channel.cc ('k') | content/common/gpu/gpu_command_buffer_stub.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/gpu_channel_manager.h" 5 #include "content/common/gpu/gpu_channel_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility>
8 9
9 #include "base/bind.h" 10 #include "base/bind.h"
10 #include "base/command_line.h" 11 #include "base/command_line.h"
11 #include "base/location.h" 12 #include "base/location.h"
12 #include "base/single_thread_task_runner.h" 13 #include "base/single_thread_task_runner.h"
13 #include "base/thread_task_runner_handle.h" 14 #include "base/thread_task_runner_handle.h"
14 #include "build/build_config.h" 15 #include "build/build_config.h"
15 #include "content/common/gpu/gpu_channel.h" 16 #include "content/common/gpu/gpu_channel.h"
16 #include "content/common/gpu/gpu_memory_buffer_factory.h" 17 #include "content/common/gpu/gpu_memory_buffer_factory.h"
17 #include "content/common/gpu/gpu_memory_manager.h" 18 #include "content/common/gpu/gpu_memory_manager.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 void GpuChannelManager::OnEstablishChannel( 174 void GpuChannelManager::OnEstablishChannel(
174 const GpuMsg_EstablishChannel_Params& params) { 175 const GpuMsg_EstablishChannel_Params& params) {
175 DCHECK(!params.preempts || !params.preempted); 176 DCHECK(!params.preempts || !params.preempted);
176 scoped_ptr<GpuChannel> channel(CreateGpuChannel( 177 scoped_ptr<GpuChannel> channel(CreateGpuChannel(
177 params.client_id, params.client_tracing_id, params.preempts, 178 params.client_id, params.client_tracing_id, params.preempts,
178 params.allow_future_sync_points, params.allow_real_time_streams)); 179 params.allow_future_sync_points, params.allow_real_time_streams));
179 if (params.preempted) 180 if (params.preempted)
180 channel->SetPreemptByFlag(preemption_flag_.get()); 181 channel->SetPreemptByFlag(preemption_flag_.get());
181 IPC::ChannelHandle channel_handle = channel->Init(shutdown_event_); 182 IPC::ChannelHandle channel_handle = channel->Init(shutdown_event_);
182 183
183 gpu_channels_.set(params.client_id, channel.Pass()); 184 gpu_channels_.set(params.client_id, std::move(channel));
184 185
185 Send(new GpuHostMsg_ChannelEstablished(channel_handle)); 186 Send(new GpuHostMsg_ChannelEstablished(channel_handle));
186 } 187 }
187 188
188 void GpuChannelManager::OnCloseChannel( 189 void GpuChannelManager::OnCloseChannel(
189 const IPC::ChannelHandle& channel_handle) { 190 const IPC::ChannelHandle& channel_handle) {
190 for (auto it = gpu_channels_.begin(); it != gpu_channels_.end(); ++it) { 191 for (auto it = gpu_channels_.begin(); it != gpu_channels_.end(); ++it) {
191 if (it->second->channel_id() == channel_handle.name) { 192 if (it->second->channel_id() == channel_handle.name) {
192 gpu_channels_.erase(it); 193 gpu_channels_.erase(it);
193 return; 194 return;
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 } 340 }
340 } 341 }
341 if (!stub || !stub->decoder()->MakeCurrent()) 342 if (!stub || !stub->decoder()->MakeCurrent())
342 return; 343 return;
343 glFinish(); 344 glFinish();
344 DidAccessGpu(); 345 DidAccessGpu();
345 } 346 }
346 #endif 347 #endif
347 348
348 } // namespace content 349 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/gpu_channel.cc ('k') | content/common/gpu/gpu_command_buffer_stub.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698