OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/debug/activity_tracker.h" | 5 #include "base/debug/activity_tracker.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 1445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1456 | 1456 |
1457 // Use the current time to differentiate the process that just exited | 1457 // Use the current time to differentiate the process that just exited |
1458 // from any that might be created in the future with the same ID. | 1458 // from any that might be created in the future with the same ID. |
1459 int64_t now_stamp = Time::Now().ToInternalValue(); | 1459 int64_t now_stamp = Time::Now().ToInternalValue(); |
1460 | 1460 |
1461 // The persistent allocator is thread-safe so run the iteration and | 1461 // The persistent allocator is thread-safe so run the iteration and |
1462 // adjustments on a worker thread if one was provided. | 1462 // adjustments on a worker thread if one was provided. |
1463 if (task_runner && !task_runner->RunsTasksOnCurrentThread()) { | 1463 if (task_runner && !task_runner->RunsTasksOnCurrentThread()) { |
1464 task_runner->PostTask( | 1464 task_runner->PostTask( |
1465 FROM_HERE, | 1465 FROM_HERE, |
1466 Bind(&GlobalActivityTracker::CleanupAfterProcess, Unretained(this), pid, | 1466 BindOnce(&GlobalActivityTracker::CleanupAfterProcess, Unretained(this), |
1467 now_stamp, exit_code, Passed(&command_line))); | 1467 pid, now_stamp, exit_code, Passed(&command_line))); |
1468 return; | 1468 return; |
1469 } | 1469 } |
1470 | 1470 |
1471 CleanupAfterProcess(pid, now_stamp, exit_code, std::move(command_line)); | 1471 CleanupAfterProcess(pid, now_stamp, exit_code, std::move(command_line)); |
1472 } | 1472 } |
1473 | 1473 |
1474 void GlobalActivityTracker::SetProcessPhase(ProcessPhase phase) { | 1474 void GlobalActivityTracker::SetProcessPhase(ProcessPhase phase) { |
1475 process_data().SetInt(kProcessPhaseDataKey, phase); | 1475 process_data().SetInt(kProcessPhaseDataKey, phase); |
1476 } | 1476 } |
1477 | 1477 |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1783 : GlobalActivityTracker::ScopedThreadActivity( | 1783 : GlobalActivityTracker::ScopedThreadActivity( |
1784 program_counter, | 1784 program_counter, |
1785 nullptr, | 1785 nullptr, |
1786 Activity::ACT_PROCESS_WAIT, | 1786 Activity::ACT_PROCESS_WAIT, |
1787 ActivityData::ForProcess(process->Pid()), | 1787 ActivityData::ForProcess(process->Pid()), |
1788 /*lock_allowed=*/true) {} | 1788 /*lock_allowed=*/true) {} |
1789 #endif | 1789 #endif |
1790 | 1790 |
1791 } // namespace debug | 1791 } // namespace debug |
1792 } // namespace base | 1792 } // namespace base |
OLD | NEW |