| 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 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1256 std::unique_ptr<PersistentMemoryAllocator> allocator, | 1256 std::unique_ptr<PersistentMemoryAllocator> allocator, |
| 1257 int stack_depth, | 1257 int stack_depth, |
| 1258 int64_t process_id) { | 1258 int64_t process_id) { |
| 1259 // There's no need to do anything with the result. It is self-managing. | 1259 // There's no need to do anything with the result. It is self-managing. |
| 1260 GlobalActivityTracker* global_tracker = | 1260 GlobalActivityTracker* global_tracker = |
| 1261 new GlobalActivityTracker(std::move(allocator), stack_depth, process_id); | 1261 new GlobalActivityTracker(std::move(allocator), stack_depth, process_id); |
| 1262 // Create a tracker for this thread since it is known. | 1262 // Create a tracker for this thread since it is known. |
| 1263 global_tracker->CreateTrackerForCurrentThread(); | 1263 global_tracker->CreateTrackerForCurrentThread(); |
| 1264 } | 1264 } |
| 1265 | 1265 |
| 1266 #if !defined(OS_NACL) | 1266 #if !defined(OS_NACL) && !defined(OS_FUCHSIA) |
| 1267 // static | 1267 // static |
| 1268 void GlobalActivityTracker::CreateWithFile(const FilePath& file_path, | 1268 void GlobalActivityTracker::CreateWithFile(const FilePath& file_path, |
| 1269 size_t size, | 1269 size_t size, |
| 1270 uint64_t id, | 1270 uint64_t id, |
| 1271 StringPiece name, | 1271 StringPiece name, |
| 1272 int stack_depth) { | 1272 int stack_depth) { |
| 1273 DCHECK(!file_path.empty()); | 1273 DCHECK(!file_path.empty()); |
| 1274 DCHECK_GE(static_cast<uint64_t>(std::numeric_limits<int64_t>::max()), size); | 1274 DCHECK_GE(static_cast<uint64_t>(std::numeric_limits<int64_t>::max()), size); |
| 1275 | 1275 |
| 1276 // Create and map the file into memory and make it globally available. | 1276 // Create and map the file into memory and make it globally available. |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1777 : GlobalActivityTracker::ScopedThreadActivity( | 1777 : GlobalActivityTracker::ScopedThreadActivity( |
| 1778 program_counter, | 1778 program_counter, |
| 1779 nullptr, | 1779 nullptr, |
| 1780 Activity::ACT_PROCESS_WAIT, | 1780 Activity::ACT_PROCESS_WAIT, |
| 1781 ActivityData::ForProcess(process->Pid()), | 1781 ActivityData::ForProcess(process->Pid()), |
| 1782 /*lock_allowed=*/true) {} | 1782 /*lock_allowed=*/true) {} |
| 1783 #endif | 1783 #endif |
| 1784 | 1784 |
| 1785 } // namespace debug | 1785 } // namespace debug |
| 1786 } // namespace base | 1786 } // namespace base |
| OLD | NEW |