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

Side by Side Diff: gpu/ipc/service/gpu_channel_manager.cc

Issue 2814583002: Service/ClientDiscardableManager (Closed)
Patch Set: feeedback Created 3 years, 7 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
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 "gpu/ipc/service/gpu_channel_manager.h" 5 #include "gpu/ipc/service/gpu_channel_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 GpuChannel* GpuChannelManager::LookupChannel(int32_t client_id) const { 125 GpuChannel* GpuChannelManager::LookupChannel(int32_t client_id) const {
126 const auto& it = gpu_channels_.find(client_id); 126 const auto& it = gpu_channels_.find(client_id);
127 return it != gpu_channels_.end() ? it->second.get() : nullptr; 127 return it != gpu_channels_.end() ? it->second.get() : nullptr;
128 } 128 }
129 129
130 GpuChannel* GpuChannelManager::EstablishChannel(int client_id, 130 GpuChannel* GpuChannelManager::EstablishChannel(int client_id,
131 uint64_t client_tracing_id, 131 uint64_t client_tracing_id,
132 bool is_gpu_host) { 132 bool is_gpu_host) {
133 std::unique_ptr<GpuChannel> gpu_channel = base::MakeUnique<GpuChannel>( 133 std::unique_ptr<GpuChannel> gpu_channel = base::MakeUnique<GpuChannel>(
134 this, sync_point_manager_, watchdog_, share_group_, mailbox_manager_, 134 this, sync_point_manager_, watchdog_, share_group_, mailbox_manager_,
135 is_gpu_host ? preemption_flag_ : nullptr, 135 &discardable_manager_, is_gpu_host ? preemption_flag_ : nullptr,
136 is_gpu_host ? nullptr : preemption_flag_, task_runner_, io_task_runner_, 136 is_gpu_host ? nullptr : preemption_flag_, task_runner_, io_task_runner_,
137 client_id, client_tracing_id, is_gpu_host); 137 client_id, client_tracing_id, is_gpu_host);
138 138
139 GpuChannel* gpu_channel_ptr = gpu_channel.get(); 139 GpuChannel* gpu_channel_ptr = gpu_channel.get();
140 gpu_channels_[client_id] = std::move(gpu_channel); 140 gpu_channels_[client_id] = std::move(gpu_channel);
141 return gpu_channel_ptr; 141 return gpu_channel_ptr;
142 } 142 }
143 143
144 void GpuChannelManager::InternalDestroyGpuMemoryBuffer( 144 void GpuChannelManager::InternalDestroyGpuMemoryBuffer(
145 gfx::GpuMemoryBufferId id, 145 gfx::GpuMemoryBufferId id,
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 } 247 }
248 } 248 }
249 if (!stub || !stub->decoder()->MakeCurrent()) 249 if (!stub || !stub->decoder()->MakeCurrent())
250 return; 250 return;
251 glFinish(); 251 glFinish();
252 DidAccessGpu(); 252 DidAccessGpu();
253 } 253 }
254 #endif 254 #endif
255 255
256 } // namespace gpu 256 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698