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/base_switches.h" | 10 #include "base/base_switches.h" |
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 consecutive_failures(0), | 610 consecutive_failures(0), |
611 disabled(false), | 611 disabled(false), |
612 unregistered(false) {} | 612 unregistered(false) {} |
613 | 613 |
614 MemoryDumpManager::MemoryDumpProviderInfo::~MemoryDumpProviderInfo() {} | 614 MemoryDumpManager::MemoryDumpProviderInfo::~MemoryDumpProviderInfo() {} |
615 | 615 |
616 bool MemoryDumpManager::MemoryDumpProviderInfo::operator<( | 616 bool MemoryDumpManager::MemoryDumpProviderInfo::operator<( |
617 const MemoryDumpProviderInfo& other) const { | 617 const MemoryDumpProviderInfo& other) const { |
618 if (task_runner == other.task_runner) | 618 if (task_runner == other.task_runner) |
619 return dump_provider < other.dump_provider; | 619 return dump_provider < other.dump_provider; |
620 // Ensure that unbound providers (task_runner == nullptr) always run last. | 620 // TODO(ssid): Ensure that unbound providers (task_runner == nullptr) |
621 return !(task_runner < other.task_runner); | 621 // always run last. Currently it runs first so that it doesn't cause |
| 622 // regression in perf bots due to change in measurement time. |
| 623 // crbug.com/555584. |
| 624 return task_runner < other.task_runner; |
622 } | 625 } |
623 | 626 |
624 MemoryDumpManager::ProcessMemoryDumpAsyncState::ProcessMemoryDumpAsyncState( | 627 MemoryDumpManager::ProcessMemoryDumpAsyncState::ProcessMemoryDumpAsyncState( |
625 MemoryDumpRequestArgs req_args, | 628 MemoryDumpRequestArgs req_args, |
626 MemoryDumpProviderInfoSet::iterator next_dump_provider, | 629 MemoryDumpProviderInfoSet::iterator next_dump_provider, |
627 const scoped_refptr<MemoryDumpSessionState>& session_state, | 630 const scoped_refptr<MemoryDumpSessionState>& session_state, |
628 MemoryDumpCallback callback, | 631 MemoryDumpCallback callback, |
629 const scoped_refptr<SingleThreadTaskRunner>& dump_thread_task_runner) | 632 const scoped_refptr<SingleThreadTaskRunner>& dump_thread_task_runner) |
630 : req_args(req_args), | 633 : req_args(req_args), |
631 next_dump_provider(next_dump_provider), | 634 next_dump_provider(next_dump_provider), |
(...skipping 10 matching lines...) Expand all Loading... |
642 auto iter = process_dumps.find(pid); | 645 auto iter = process_dumps.find(pid); |
643 if (iter == process_dumps.end()) { | 646 if (iter == process_dumps.end()) { |
644 scoped_ptr<ProcessMemoryDump> new_pmd(new ProcessMemoryDump(session_state)); | 647 scoped_ptr<ProcessMemoryDump> new_pmd(new ProcessMemoryDump(session_state)); |
645 iter = process_dumps.insert(pid, new_pmd.Pass()).first; | 648 iter = process_dumps.insert(pid, new_pmd.Pass()).first; |
646 } | 649 } |
647 return iter->second; | 650 return iter->second; |
648 } | 651 } |
649 | 652 |
650 } // namespace trace_event | 653 } // namespace trace_event |
651 } // namespace base | 654 } // namespace base |
OLD | NEW |