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

Side by Side Diff: base/trace_event/memory_dump_manager.cc

Issue 1232313004: Add Tracing.requestMemoryDump method to DevTools API (tracing handler) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase after stubs landed Created 5 years, 4 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 | content/browser/devtools/protocol/tracing_handler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "base/trace_event/memory_dump_manager.h" 5 #include "base/trace_event/memory_dump_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/atomic_sequence_num.h" 9 #include "base/atomic_sequence_num.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 pmd_async_state->task_runner, 269 pmd_async_state->task_runner,
270 pmd_async_state->req_args.dump_guid); 270 pmd_async_state->req_args.dump_guid);
271 } 271 }
272 272
273 auto* mdp_info = &*pmd_async_state->next_dump_provider; 273 auto* mdp_info = &*pmd_async_state->next_dump_provider;
274 mdp = mdp_info->dump_provider; 274 mdp = mdp_info->dump_provider;
275 if (mdp_info->disabled) { 275 if (mdp_info->disabled) {
276 skip_dump = true; 276 skip_dump = true;
277 } else if (mdp == g_mmaps_dump_provider && 277 } else if (mdp == g_mmaps_dump_provider &&
278 pmd_async_state->req_args.dump_type != 278 pmd_async_state->req_args.dump_type !=
279 MemoryDumpType::PERIODIC_INTERVAL_WITH_MMAPS) { 279 MemoryDumpType::PERIODIC_INTERVAL_WITH_MMAPS &&
280 pmd_async_state->req_args.dump_type !=
281 MemoryDumpType::EXPLICITLY_TRIGGERED) {
280 // Mmaps dumping is very heavyweight and cannot be performed at the same 282 // Mmaps dumping is very heavyweight and cannot be performed at the same
281 // rate of other dumps. TODO(primiano): this is a hack and should be 283 // rate of other dumps. TODO(primiano): this is a hack and should be
282 // cleaned up as part of crbug.com/499731. 284 // cleaned up as part of crbug.com/499731.
283 skip_dump = true; 285 skip_dump = true;
284 } else if (mdp_info->task_runner && 286 } else if (mdp_info->task_runner &&
285 !mdp_info->task_runner->BelongsToCurrentThread()) { 287 !mdp_info->task_runner->BelongsToCurrentThread()) {
286 // It's time to hop onto another thread. 288 // It's time to hop onto another thread.
287 289
288 // Copy the callback + arguments just for the unlikley case in which 290 // Copy the callback + arguments just for the unlikley case in which
289 // PostTask fails. In such case the Bind helper will destroy the 291 // PostTask fails. In such case the Bind helper will destroy the
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 next_dump_provider(next_dump_provider), 481 next_dump_provider(next_dump_provider),
480 callback(callback), 482 callback(callback),
481 task_runner(MessageLoop::current()->task_runner()) { 483 task_runner(MessageLoop::current()->task_runner()) {
482 } 484 }
483 485
484 MemoryDumpManager::ProcessMemoryDumpAsyncState::~ProcessMemoryDumpAsyncState() { 486 MemoryDumpManager::ProcessMemoryDumpAsyncState::~ProcessMemoryDumpAsyncState() {
485 } 487 }
486 488
487 } // namespace trace_event 489 } // namespace trace_event
488 } // namespace base 490 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | content/browser/devtools/protocol/tracing_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698