| 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_manager/providers/browser_process_task.h" | 5 #include "chrome/browser/task_manager/providers/browser_process_task.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/browser/task_manager/task_manager_observer.h" | 8 #include "chrome/browser/task_manager/task_manager_observer.h" |
| 9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
| 10 #include "chrome/grit/generated_resources.h" | 10 #include "chrome/grit/generated_resources.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 void BrowserProcessTask::Kill() { | 63 void BrowserProcessTask::Kill() { |
| 64 // Never kill the browser process. | 64 // Never kill the browser process. |
| 65 } | 65 } |
| 66 | 66 |
| 67 void BrowserProcessTask::Refresh(const base::TimeDelta& update_interval, | 67 void BrowserProcessTask::Refresh(const base::TimeDelta& update_interval, |
| 68 int64_t refresh_flags) { | 68 int64_t refresh_flags) { |
| 69 Task::Refresh(update_interval, refresh_flags); | 69 Task::Refresh(update_interval, refresh_flags); |
| 70 | 70 |
| 71 if (reports_v8_stats_ && (refresh_flags & REFRESH_TYPE_V8_MEMORY) != 0) { | 71 if (reports_v8_stats_ && (refresh_flags & REFRESH_TYPE_V8_MEMORY) != 0) { |
| 72 #if 0 // TODO XXX |
| 72 allocated_v8_memory_ = | 73 allocated_v8_memory_ = |
| 73 static_cast<int64_t>(net::ProxyResolverV8::GetTotalHeapSize()); | 74 static_cast<int64_t>(net::ProxyResolverV8::GetTotalHeapSize()); |
| 74 used_v8_memory_ = | 75 used_v8_memory_ = |
| 75 static_cast<int64_t>(net::ProxyResolverV8::GetUsedHeapSize()); | 76 static_cast<int64_t>(net::ProxyResolverV8::GetUsedHeapSize()); |
| 77 #endif |
| 76 } | 78 } |
| 77 | 79 |
| 78 if ((refresh_flags & REFRESH_TYPE_SQLITE_MEMORY) != 0) | 80 if ((refresh_flags & REFRESH_TYPE_SQLITE_MEMORY) != 0) |
| 79 used_sqlite_memory_ = static_cast<int64_t>(sqlite3_memory_used()); | 81 used_sqlite_memory_ = static_cast<int64_t>(sqlite3_memory_used()); |
| 80 } | 82 } |
| 81 | 83 |
| 82 Task::Type BrowserProcessTask::GetType() const { | 84 Task::Type BrowserProcessTask::GetType() const { |
| 83 return Task::BROWSER; | 85 return Task::BROWSER; |
| 84 } | 86 } |
| 85 | 87 |
| 86 int BrowserProcessTask::GetChildProcessUniqueID() const { | 88 int BrowserProcessTask::GetChildProcessUniqueID() const { |
| 87 return 0; | 89 return 0; |
| 88 } | 90 } |
| 89 | 91 |
| 90 int64_t BrowserProcessTask::GetSqliteMemoryUsed() const { | 92 int64_t BrowserProcessTask::GetSqliteMemoryUsed() const { |
| 91 return used_sqlite_memory_; | 93 return used_sqlite_memory_; |
| 92 } | 94 } |
| 93 | 95 |
| 94 int64_t BrowserProcessTask::GetV8MemoryAllocated() const { | 96 int64_t BrowserProcessTask::GetV8MemoryAllocated() const { |
| 95 return allocated_v8_memory_; | 97 return allocated_v8_memory_; |
| 96 } | 98 } |
| 97 | 99 |
| 98 int64_t BrowserProcessTask::GetV8MemoryUsed() const { | 100 int64_t BrowserProcessTask::GetV8MemoryUsed() const { |
| 99 return used_v8_memory_; | 101 return used_v8_memory_; |
| 100 } | 102 } |
| 101 | 103 |
| 102 } // namespace task_manager | 104 } // namespace task_manager |
| OLD | NEW |