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

Side by Side Diff: base/debug/activity_tracker.cc

Issue 2791243002: Rewrite base::Bind into base::BindOnce on trivial cases in base (Closed)
Patch Set: rebase Created 3 years, 8 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 | base/debug/activity_tracker_unittest.cc » ('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 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
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
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
OLDNEW
« no previous file with comments | « no previous file | base/debug/activity_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698