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

Side by Side Diff: content/common/gpu/client/context_provider_command_buffer.cc

Issue 2567283003: Fix memory dumping for command buffers with no gr_context_. (Closed)
Patch Set: Created 4 years 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/common/gpu/client/context_provider_command_buffer.h" 5 #include "content/common/gpu/client/context_provider_command_buffer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 DCHECK(context_thread_checker_.CalledOnValidThread()); 440 DCHECK(context_thread_checker_.CalledOnValidThread());
441 DCHECK(lost_context_callback_.is_null() || 441 DCHECK(lost_context_callback_.is_null() ||
442 lost_context_callback.is_null()); 442 lost_context_callback.is_null());
443 lost_context_callback_ = lost_context_callback; 443 lost_context_callback_ = lost_context_callback;
444 } 444 }
445 445
446 bool ContextProviderCommandBuffer::OnMemoryDump( 446 bool ContextProviderCommandBuffer::OnMemoryDump(
447 const base::trace_event::MemoryDumpArgs& args, 447 const base::trace_event::MemoryDumpArgs& args,
448 base::trace_event::ProcessMemoryDump* pmd) { 448 base::trace_event::ProcessMemoryDump* pmd) {
449 DCHECK(bind_succeeded_); 449 DCHECK(bind_succeeded_);
450 if (!gr_context_)
451 return false;
452 450
453 base::Optional<base::AutoLock> hold; 451 base::Optional<base::AutoLock> hold;
454 if (support_locking_) 452 if (support_locking_)
455 hold.emplace(context_lock_); 453 hold.emplace(context_lock_);
456 454
457 gles2_impl_->OnMemoryDump(args, pmd); 455 gles2_impl_->OnMemoryDump(args, pmd);
458 gles2_helper_->OnMemoryDump(args, pmd); 456 gles2_helper_->OnMemoryDump(args, pmd);
459 457
460 context_thread_checker_.DetachFromThread(); 458 if (gr_context_) {
461 SkiaGpuTraceMemoryDump trace_memory_dump( 459 context_thread_checker_.DetachFromThread();
462 pmd, gles2_impl_->ShareGroupTracingGUID()); 460 SkiaGpuTraceMemoryDump trace_memory_dump(
463 gr_context_->get()->dumpMemoryStatistics(&trace_memory_dump); 461 pmd, gles2_impl_->ShareGroupTracingGUID());
464 context_thread_checker_.DetachFromThread(); 462 gr_context_->get()->dumpMemoryStatistics(&trace_memory_dump);
463 context_thread_checker_.DetachFromThread();
464 }
465 return true; 465 return true;
466 } 466 }
467 467
468 } // namespace content 468 } // 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