OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |