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

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

Issue 2035943002: Remove use of deprecated MessageLoop methods in gpu. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « no previous file | no next file » | 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 "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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 "keep_awake_time", (now - begin_wake_up_time_).InMilliseconds()); 257 "keep_awake_time", (now - begin_wake_up_time_).InMilliseconds());
258 if (now - last_gpu_access_time_ < 258 if (now - last_gpu_access_time_ <
259 base::TimeDelta::FromMilliseconds(kMaxGpuIdleTimeMs)) 259 base::TimeDelta::FromMilliseconds(kMaxGpuIdleTimeMs))
260 return; 260 return;
261 if (now - begin_wake_up_time_ > 261 if (now - begin_wake_up_time_ >
262 base::TimeDelta::FromMilliseconds(kMaxKeepAliveTimeMs)) 262 base::TimeDelta::FromMilliseconds(kMaxKeepAliveTimeMs))
263 return; 263 return;
264 264
265 DoWakeUpGpu(); 265 DoWakeUpGpu();
266 266
267 base::MessageLoop::current()->PostDelayedTask( 267 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
268 FROM_HERE, base::Bind(&GpuChannelManager::ScheduleWakeUpGpu, 268 FROM_HERE, base::Bind(&GpuChannelManager::ScheduleWakeUpGpu,
269 weak_factory_.GetWeakPtr()), 269 weak_factory_.GetWeakPtr()),
270 base::TimeDelta::FromMilliseconds(kMaxGpuIdleTimeMs)); 270 base::TimeDelta::FromMilliseconds(kMaxGpuIdleTimeMs));
271 } 271 }
272 272
273 void GpuChannelManager::DoWakeUpGpu() { 273 void GpuChannelManager::DoWakeUpGpu() {
274 const GpuCommandBufferStub* stub = nullptr; 274 const GpuCommandBufferStub* stub = nullptr;
275 for (const auto& kv : gpu_channels_) { 275 for (const auto& kv : gpu_channels_) {
276 const GpuChannel* channel = kv.second; 276 const GpuChannel* channel = kv.second;
277 stub = channel->GetOneStub(); 277 stub = channel->GetOneStub();
278 if (stub) { 278 if (stub) {
279 DCHECK(stub->decoder()); 279 DCHECK(stub->decoder());
280 break; 280 break;
281 } 281 }
282 } 282 }
283 if (!stub || !stub->decoder()->MakeCurrent()) 283 if (!stub || !stub->decoder()->MakeCurrent())
284 return; 284 return;
285 glFinish(); 285 glFinish();
286 DidAccessGpu(); 286 DidAccessGpu();
287 } 287 }
288 #endif 288 #endif
289 289
290 } // namespace gpu 290 } // namespace gpu
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698