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

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

Issue 1000373002: favor DCHECK_CURRENTLY_ON for better logs in content/browser/[f-p]* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase on master Created 5 years, 9 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 "content/browser/gpu/browser_gpu_channel_host_factory.h" 5 #include "content/browser/gpu/browser_gpu_channel_host_factory.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/profiler/scoped_tracker.h" 10 #include "base/profiler/scoped_tracker.h"
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 for (size_t n = 0; n < established_callbacks_.size(); n++) 445 for (size_t n = 0; n < established_callbacks_.size(); n++)
446 established_callbacks_[n].Run(); 446 established_callbacks_[n].Run();
447 447
448 established_callbacks_.clear(); 448 established_callbacks_.clear();
449 } 449 }
450 450
451 // static 451 // static
452 void BrowserGpuChannelHostFactory::AddFilterOnIO( 452 void BrowserGpuChannelHostFactory::AddFilterOnIO(
453 int host_id, 453 int host_id,
454 scoped_refptr<IPC::MessageFilter> filter) { 454 scoped_refptr<IPC::MessageFilter> filter) {
455 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 455 DCHECK_CURRENTLY_ON(BrowserThread::IO);
456 456
457 GpuProcessHost* host = GpuProcessHost::FromID(host_id); 457 GpuProcessHost* host = GpuProcessHost::FromID(host_id);
458 if (host) 458 if (host)
459 host->AddFilter(filter.get()); 459 host->AddFilter(filter.get());
460 } 460 }
461 461
462 bool BrowserGpuChannelHostFactory::IsGpuMemoryBufferConfigurationSupported( 462 bool BrowserGpuChannelHostFactory::IsGpuMemoryBufferConfigurationSupported(
463 gfx::GpuMemoryBuffer::Format format, 463 gfx::GpuMemoryBuffer::Format format,
464 gfx::GpuMemoryBuffer::Usage usage) { 464 gfx::GpuMemoryBuffer::Usage usage) {
465 // Return early if usage is not enabled. 465 // Return early if usage is not enabled.
(...skipping 30 matching lines...) Expand all
496 } 496 }
497 497
498 void BrowserGpuChannelHostFactory::CreateGpuMemoryBuffer( 498 void BrowserGpuChannelHostFactory::CreateGpuMemoryBuffer(
499 gfx::GpuMemoryBufferId id, 499 gfx::GpuMemoryBufferId id,
500 const gfx::Size& size, 500 const gfx::Size& size,
501 gfx::GpuMemoryBuffer::Format format, 501 gfx::GpuMemoryBuffer::Format format,
502 gfx::GpuMemoryBuffer::Usage usage, 502 gfx::GpuMemoryBuffer::Usage usage,
503 int client_id, 503 int client_id,
504 int32 surface_id, 504 int32 surface_id,
505 const CreateGpuMemoryBufferCallback& callback) { 505 const CreateGpuMemoryBufferCallback& callback) {
506 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 506 DCHECK_CURRENTLY_ON(BrowserThread::IO);
507 507
508 GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_); 508 GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_);
509 if (!host) { 509 if (!host) {
510 callback.Run(gfx::GpuMemoryBufferHandle()); 510 callback.Run(gfx::GpuMemoryBufferHandle());
511 return; 511 return;
512 } 512 }
513 513
514 uint32 request_id = next_create_gpu_memory_buffer_request_id_++; 514 uint32 request_id = next_create_gpu_memory_buffer_request_id_++;
515 create_gpu_memory_buffer_requests_[request_id] = callback; 515 create_gpu_memory_buffer_requests_[request_id] = callback;
516 516
(...skipping 14 matching lines...) Expand all
531 base::Unretained(this), 531 base::Unretained(this),
532 id, 532 id,
533 client_id, 533 client_id,
534 sync_point)); 534 sync_point));
535 } 535 }
536 536
537 void BrowserGpuChannelHostFactory::DestroyGpuMemoryBufferOnIO( 537 void BrowserGpuChannelHostFactory::DestroyGpuMemoryBufferOnIO(
538 gfx::GpuMemoryBufferId id, 538 gfx::GpuMemoryBufferId id,
539 int client_id, 539 int client_id,
540 int32 sync_point) { 540 int32 sync_point) {
541 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 541 DCHECK_CURRENTLY_ON(BrowserThread::IO);
542 542
543 GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_); 543 GpuProcessHost* host = GpuProcessHost::FromID(gpu_host_id_);
544 if (!host) 544 if (!host)
545 return; 545 return;
546 546
547 host->DestroyGpuMemoryBuffer(id, client_id, sync_point); 547 host->DestroyGpuMemoryBuffer(id, client_id, sync_point);
548 } 548 }
549 549
550 void BrowserGpuChannelHostFactory::OnGpuMemoryBufferCreated( 550 void BrowserGpuChannelHostFactory::OnGpuMemoryBufferCreated(
551 uint32 request_id, 551 uint32 request_id,
552 const gfx::GpuMemoryBufferHandle& handle) { 552 const gfx::GpuMemoryBufferHandle& handle) {
553 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 553 DCHECK_CURRENTLY_ON(BrowserThread::IO);
554 554
555 CreateGpuMemoryBufferCallbackMap::iterator iter = 555 CreateGpuMemoryBufferCallbackMap::iterator iter =
556 create_gpu_memory_buffer_requests_.find(request_id); 556 create_gpu_memory_buffer_requests_.find(request_id);
557 DCHECK(iter != create_gpu_memory_buffer_requests_.end()); 557 DCHECK(iter != create_gpu_memory_buffer_requests_.end());
558 iter->second.Run(handle); 558 iter->second.Run(handle);
559 create_gpu_memory_buffer_requests_.erase(iter); 559 create_gpu_memory_buffer_requests_.erase(iter);
560 } 560 }
561 561
562 } // namespace content 562 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/geolocation/geolocation_provider_impl.cc ('k') | content/browser/gpu/browser_gpu_memory_buffer_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698