Chromium Code Reviews| 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 "chrome/browser/task_management/test_task_manager.h" | 5 #include "chrome/browser/task_management/test_task_manager.h" |
| 6 | 6 |
| 7 namespace task_management { | 7 namespace task_management { |
| 8 | 8 |
| 9 TestTaskManager::TestTaskManager() | 9 TestTaskManager::TestTaskManager() |
| 10 : handle_(base::kNullProcessHandle), | 10 : handle_(base::kNullProcessHandle), |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 90 } | 90 } |
| 91 | 91 |
| 92 const base::ProcessId& TestTaskManager::GetProcessId(TaskId task_id) const { | 92 const base::ProcessId& TestTaskManager::GetProcessId(TaskId task_id) const { |
| 93 return pid_; | 93 return pid_; |
| 94 } | 94 } |
| 95 | 95 |
| 96 Task::Type TestTaskManager::GetType(TaskId task_id) const { | 96 Task::Type TestTaskManager::GetType(TaskId task_id) const { |
| 97 return Task::UNKNOWN; | 97 return Task::UNKNOWN; |
| 98 } | 98 } |
| 99 | 99 |
| 100 int TestTaskManager::GetTabId(TaskId task_id) const { | |
| 101 return -1; | |
| 102 } | |
| 103 | |
| 104 int TestTaskManager::GetChildProcessUniqueID(TaskId task_id) const { | |
| 105 return 0; | |
| 106 } | |
| 107 | |
| 108 void TestTaskManager::GetTerminationStatus(TaskId task_id, | |
| 109 base::TerminationStatus* out_status, | |
| 110 int* out_error_code) const { | |
|
ncarter (slow)
2016/02/02 22:16:53
I'd write the out params here, to avoid nondetermi
afakhry
2016/02/05 19:51:14
Done.
| |
| 111 } | |
| 112 | |
| 100 int64_t TestTaskManager::GetNetworkUsage(TaskId task_id) const { | 113 int64_t TestTaskManager::GetNetworkUsage(TaskId task_id) const { |
| 101 return -1; | 114 return -1; |
| 102 } | 115 } |
| 103 | 116 |
| 104 int64_t TestTaskManager::GetProcessTotalNetworkUsage(TaskId task_id) const { | 117 int64_t TestTaskManager::GetProcessTotalNetworkUsage(TaskId task_id) const { |
| 105 return -1; | 118 return -1; |
| 106 } | 119 } |
| 107 | 120 |
| 108 int64_t TestTaskManager::GetSqliteMemoryUsed(TaskId task_id) const { | 121 int64_t TestTaskManager::GetSqliteMemoryUsed(TaskId task_id) const { |
| 109 return -1; | 122 return -1; |
| 110 } | 123 } |
| 111 | 124 |
| 112 bool TestTaskManager::GetV8Memory(TaskId task_id, | 125 bool TestTaskManager::GetV8Memory(TaskId task_id, |
| 113 int64_t* allocated, | 126 int64_t* allocated, |
| 114 int64_t* used) const { | 127 int64_t* used) const { |
| 115 return false; | 128 return false; |
| 116 } | 129 } |
| 117 | 130 |
| 118 bool TestTaskManager::GetWebCacheStats( | 131 bool TestTaskManager::GetWebCacheStats( |
| 119 TaskId task_id, | 132 TaskId task_id, |
| 120 blink::WebCache::ResourceTypeStats* stats) const { | 133 blink::WebCache::ResourceTypeStats* stats) const { |
| 121 return false; | 134 return false; |
| 122 } | 135 } |
| 123 | 136 |
| 124 const TaskIdList& TestTaskManager::GetTaskIdsList() const { | 137 const TaskIdList& TestTaskManager::GetTaskIdsList() const { |
| 125 return ids_; | 138 return ids_; |
| 126 } | 139 } |
| 127 | 140 |
| 141 const TaskIdList TestTaskManager::GetIdsOfTasksSharingSameProcess( | |
| 142 TaskId task_id) const { | |
| 143 TaskIdList result; | |
| 144 result.push_back(task_id); | |
| 145 return result; | |
| 146 } | |
| 147 | |
| 128 size_t TestTaskManager::GetNumberOfTasksOnSameProcess(TaskId task_id) const { | 148 size_t TestTaskManager::GetNumberOfTasksOnSameProcess(TaskId task_id) const { |
| 129 return 1; | 149 return 1; |
| 130 } | 150 } |
| 131 | 151 |
| 132 base::TimeDelta TestTaskManager::GetRefreshTime() { | 152 base::TimeDelta TestTaskManager::GetRefreshTime() { |
| 133 return GetCurrentRefreshTime(); | 153 return GetCurrentRefreshTime(); |
| 134 } | 154 } |
| 135 | 155 |
| 136 int64_t TestTaskManager::GetEnabledFlags() { | 156 int64_t TestTaskManager::GetEnabledFlags() { |
| 137 return enabled_resources_flags(); | 157 return enabled_resources_flags(); |
| 138 } | 158 } |
| 139 | 159 |
| 140 } // namespace task_management | 160 } // namespace task_management |
| OLD | NEW |