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

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

Issue 1003033002: Instrument BrowserGpuChannelHostFactory::EstablishRequest::FinishOnMain Codepaths to Find Jank (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« 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 "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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 413
414 return NULL; 414 return NULL;
415 } 415 }
416 416
417 void BrowserGpuChannelHostFactory::GpuChannelEstablished() { 417 void BrowserGpuChannelHostFactory::GpuChannelEstablished() {
418 DCHECK(IsMainThread()); 418 DCHECK(IsMainThread());
419 DCHECK(pending_request_.get()); 419 DCHECK(pending_request_.get());
420 if (pending_request_->channel_handle().name.empty()) { 420 if (pending_request_->channel_handle().name.empty()) {
421 DCHECK(!gpu_channel_.get()); 421 DCHECK(!gpu_channel_.get());
422 } else { 422 } else {
423 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/466866
424 // is fixed.
425 tracked_objects::ScopedTracker tracking_profile1(
426 FROM_HERE_WITH_EXPLICIT_FUNCTION(
427 "466866 BrowserGpuChannelHostFactory::GpuChannelEstablished1"));
423 GetContentClient()->SetGpuInfo(pending_request_->gpu_info()); 428 GetContentClient()->SetGpuInfo(pending_request_->gpu_info());
424 gpu_channel_ = 429 gpu_channel_ =
425 GpuChannelHost::Create(this, 430 GpuChannelHost::Create(this,
426 pending_request_->gpu_info(), 431 pending_request_->gpu_info(),
427 pending_request_->channel_handle(), 432 pending_request_->channel_handle(),
428 shutdown_event_.get(), 433 shutdown_event_.get(),
429 BrowserGpuMemoryBufferManager::current()); 434 BrowserGpuMemoryBufferManager::current());
430 } 435 }
431 gpu_host_id_ = pending_request_->gpu_host_id(); 436 gpu_host_id_ = pending_request_->gpu_host_id();
432 pending_request_ = NULL; 437 pending_request_ = NULL;
433 438
439 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/466866 is
440 // fixed.
441 tracked_objects::ScopedTracker tracking_profile2(
442 FROM_HERE_WITH_EXPLICIT_FUNCTION(
443 "466866 BrowserGpuChannelHostFactory::GpuChannelEstablished2"));
444
434 for (size_t n = 0; n < established_callbacks_.size(); n++) 445 for (size_t n = 0; n < established_callbacks_.size(); n++)
435 established_callbacks_[n].Run(); 446 established_callbacks_[n].Run();
436 447
437 established_callbacks_.clear(); 448 established_callbacks_.clear();
438 } 449 }
439 450
440 // static 451 // static
441 void BrowserGpuChannelHostFactory::AddFilterOnIO( 452 void BrowserGpuChannelHostFactory::AddFilterOnIO(
442 int host_id, 453 int host_id,
443 scoped_refptr<IPC::MessageFilter> filter) { 454 scoped_refptr<IPC::MessageFilter> filter) {
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 553 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
543 554
544 CreateGpuMemoryBufferCallbackMap::iterator iter = 555 CreateGpuMemoryBufferCallbackMap::iterator iter =
545 create_gpu_memory_buffer_requests_.find(request_id); 556 create_gpu_memory_buffer_requests_.find(request_id);
546 DCHECK(iter != create_gpu_memory_buffer_requests_.end()); 557 DCHECK(iter != create_gpu_memory_buffer_requests_.end());
547 iter->second.Run(handle); 558 iter->second.Run(handle);
548 create_gpu_memory_buffer_requests_.erase(iter); 559 create_gpu_memory_buffer_requests_.erase(iter);
549 } 560 }
550 561
551 } // namespace content 562 } // namespace content
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