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

Side by Side Diff: content/browser/gpu/browser_gpu_channel_host_factory.cc

Issue 654223006: Cleanup GpuMemoryBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 "content/browser/gpu/browser_gpu_channel_host_factory.h" 5 #include "content/browser/gpu/browser_gpu_channel_host_factory.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "base/synchronization/waitable_event.h" 9 #include "base/synchronization/waitable_event.h"
10 #include "base/threading/thread_restrictions.h" 10 #include "base/threading/thread_restrictions.h"
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 // In this case we need to wait for this before we can show any UI /anyway/, 302 // In this case we need to wait for this before we can show any UI /anyway/,
303 // so it won't cause additional jank. 303 // so it won't cause additional jank.
304 // TODO(piman): Make this asynchronous (http://crbug.com/125248). 304 // TODO(piman): Make this asynchronous (http://crbug.com/125248).
305 TRACE_EVENT0("browser", 305 TRACE_EVENT0("browser",
306 "BrowserGpuChannelHostFactory::CreateViewCommandBuffer"); 306 "BrowserGpuChannelHostFactory::CreateViewCommandBuffer");
307 base::ThreadRestrictions::ScopedAllowWait allow_wait; 307 base::ThreadRestrictions::ScopedAllowWait allow_wait;
308 request.event.Wait(); 308 request.event.Wait();
309 return request.result; 309 return request.result;
310 } 310 }
311 311
312 void BrowserGpuChannelHostFactory::WaitForPendingGpuMemoryBufferUsageToComplete(
313 const base::Closure& callback) {
314 GpuChannelHost* host = GetGpuChannel();
315 if (!host) {
316 callback.Run();
317 return;
318 }
319
320 host->WaitForPendingGpuMemoryBufferUsageToComplete(callback);
321 }
322
312 GpuChannelHost* BrowserGpuChannelHostFactory::EstablishGpuChannelSync( 323 GpuChannelHost* BrowserGpuChannelHostFactory::EstablishGpuChannelSync(
313 CauseForGpuLaunch cause_for_gpu_launch) { 324 CauseForGpuLaunch cause_for_gpu_launch) {
314 EstablishGpuChannel(cause_for_gpu_launch, base::Closure()); 325 EstablishGpuChannel(cause_for_gpu_launch, base::Closure());
315 326
316 if (pending_request_.get()) 327 if (pending_request_.get())
317 pending_request_->Wait(); 328 pending_request_->Wait();
318 329
319 return gpu_channel_.get(); 330 return gpu_channel_.get();
320 } 331 }
321 332
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 filter->AddRoute(MSG_ROUTING_CONTROL, handler); 412 filter->AddRoute(MSG_ROUTING_CONTROL, handler);
402 413
403 GetIOLoopProxy()->PostTask( 414 GetIOLoopProxy()->PostTask(
404 FROM_HERE, 415 FROM_HERE,
405 base::Bind(&BrowserGpuChannelHostFactory::AddFilterOnIO, 416 base::Bind(&BrowserGpuChannelHostFactory::AddFilterOnIO,
406 gpu_host_id_, 417 gpu_host_id_,
407 filter)); 418 filter));
408 } 419 }
409 420
410 } // namespace content 421 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698