| 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/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 pmd_async_state->task_runner, | 265 pmd_async_state->task_runner, |
| 266 pmd_async_state->req_args.dump_guid); | 266 pmd_async_state->req_args.dump_guid); |
| 267 } | 267 } |
| 268 | 268 |
| 269 auto* mdp_info = &*pmd_async_state->next_dump_provider; | 269 auto* mdp_info = &*pmd_async_state->next_dump_provider; |
| 270 mdp = mdp_info->dump_provider; | 270 mdp = mdp_info->dump_provider; |
| 271 if (mdp_info->disabled) { | 271 if (mdp_info->disabled) { |
| 272 skip_dump = true; | 272 skip_dump = true; |
| 273 } else if (mdp == g_mmaps_dump_provider && | 273 } else if (mdp == g_mmaps_dump_provider && |
| 274 pmd_async_state->req_args.dump_type != | 274 pmd_async_state->req_args.dump_type != |
| 275 MemoryDumpType::PERIODIC_INTERVAL_WITH_MMAPS) { | 275 MemoryDumpType::PERIODIC_INTERVAL_WITH_MMAPS && |
| 276 pmd_async_state->req_args.dump_type != |
| 277 MemoryDumpType::EXPLICITLY_TRIGGERED) { |
| 276 // Mmaps dumping is very heavyweight and cannot be performed at the same | 278 // Mmaps dumping is very heavyweight and cannot be performed at the same |
| 277 // rate of other dumps. TODO(primiano): this is a hack and should be | 279 // rate of other dumps. TODO(primiano): this is a hack and should be |
| 278 // cleaned up as part of crbug.com/499731. | 280 // cleaned up as part of crbug.com/499731. |
| 279 skip_dump = true; | 281 skip_dump = true; |
| 280 } else if (mdp_info->task_runner && | 282 } else if (mdp_info->task_runner && |
| 281 !mdp_info->task_runner->BelongsToCurrentThread()) { | 283 !mdp_info->task_runner->BelongsToCurrentThread()) { |
| 282 // It's time to hop onto another thread. | 284 // It's time to hop onto another thread. |
| 283 | 285 |
| 284 // Copy the callback + arguments just for the unlikley case in which | 286 // Copy the callback + arguments just for the unlikley case in which |
| 285 // PostTask fails. In such case the Bind helper will destroy the | 287 // PostTask fails. In such case the Bind helper will destroy the |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 next_dump_provider(next_dump_provider), | 472 next_dump_provider(next_dump_provider), |
| 471 callback(callback), | 473 callback(callback), |
| 472 task_runner(MessageLoop::current()->task_runner()) { | 474 task_runner(MessageLoop::current()->task_runner()) { |
| 473 } | 475 } |
| 474 | 476 |
| 475 MemoryDumpManager::ProcessMemoryDumpAsyncState::~ProcessMemoryDumpAsyncState() { | 477 MemoryDumpManager::ProcessMemoryDumpAsyncState::~ProcessMemoryDumpAsyncState() { |
| 476 } | 478 } |
| 477 | 479 |
| 478 } // namespace trace_event | 480 } // namespace trace_event |
| 479 } // namespace base | 481 } // namespace base |
| OLD | NEW |