| Index: trunk/src/chrome/browser/task_manager/task_manager.cc
|
| ===================================================================
|
| --- trunk/src/chrome/browser/task_manager/task_manager.cc (revision 270923)
|
| +++ trunk/src/chrome/browser/task_manager/task_manager.cc (working copy)
|
| @@ -31,7 +31,6 @@
|
| #include "chrome/browser/ui/browser_navigator.h"
|
| #include "chrome/common/pref_names.h"
|
| #include "chrome/common/url_constants.h"
|
| -#include "components/nacl/browser/nacl_browser.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "content/public/browser/gpu_data_manager.h"
|
| #include "content/public/browser/gpu_data_manager_observer.h"
|
| @@ -192,7 +191,9 @@
|
| };
|
|
|
| TaskManagerModel::PerResourceValues::PerResourceValues()
|
| - : is_title_valid(false),
|
| + : is_nacl_debug_stub_port_valid(false),
|
| + nacl_debug_stub_port(0),
|
| + is_title_valid(false),
|
| is_profile_name_valid(false),
|
| network_usage(0),
|
| is_process_id_valid(false),
|
| @@ -228,9 +229,7 @@
|
| gdi_handles_peak(0),
|
| is_user_handles_valid(0),
|
| user_handles(0),
|
| - user_handles_peak(0),
|
| - is_nacl_debug_stub_port_valid(false),
|
| - nacl_debug_stub_port(0) {}
|
| + user_handles_peak(0) {}
|
|
|
| TaskManagerModel::PerProcessValues::~PerProcessValues() {}
|
|
|
| @@ -293,10 +292,10 @@
|
| }
|
|
|
| int TaskManagerModel::GetNaClDebugStubPort(int index) const {
|
| - base::ProcessHandle handle = GetResource(index)->GetProcess();
|
| - PerProcessValues& values(per_process_cache_[handle]);
|
| + PerResourceValues& values(GetPerResourceValues(index));
|
| if (!values.is_nacl_debug_stub_port_valid) {
|
| - return nacl::kGdbDebugStubPortUnknown;
|
| + values.is_nacl_debug_stub_port_valid = true;
|
| + values.nacl_debug_stub_port = GetResource(index)->GetNaClDebugStubPort();
|
| }
|
| return values.nacl_debug_stub_port;
|
| }
|
| @@ -418,9 +417,7 @@
|
|
|
| base::string16 TaskManagerModel::GetResourceNaClDebugStubPort(int index) const {
|
| int port = GetNaClDebugStubPort(index);
|
| - if (port == nacl::kGdbDebugStubPortUnknown) {
|
| - return base::ASCIIToUTF16("Unknown");
|
| - } else if (port == nacl::kGdbDebugStubPortUnused) {
|
| + if (port == 0) {
|
| return base::ASCIIToUTF16("N/A");
|
| } else {
|
| return base::IntToString16(port);
|
| @@ -1182,10 +1179,7 @@
|
| per_resource_cache_.clear();
|
| per_process_cache_.clear();
|
|
|
| - nacl::NaClBrowser* nacl_browser = nacl::NaClBrowser::GetInstance();
|
| -
|
| - // Compute the CPU usage values and check if NaCl GDB debug stub port is
|
| - // known.
|
| + // Compute the CPU usage values.
|
| // Note that we compute the CPU usage for all resources (instead of doing it
|
| // lazily) as process_util::GetCPUUsage() returns the CPU usage since the last
|
| // time it was called, and not calling it everytime would skew the value the
|
| @@ -1195,14 +1189,6 @@
|
| iter != resources_.end(); ++iter) {
|
| base::ProcessHandle process = (*iter)->GetProcess();
|
| PerProcessValues& values(per_process_cache_[process]);
|
| - // Debug stub port doesn't change once known.
|
| - if (!values.is_nacl_debug_stub_port_valid) {
|
| - values.nacl_debug_stub_port = nacl_browser->GetProcessGdbDebugStubPort(
|
| - (*iter)->GetUniqueChildProcessId());
|
| - if (values.nacl_debug_stub_port != nacl::kGdbDebugStubPortUnknown) {
|
| - values.is_nacl_debug_stub_port_valid = true;
|
| - }
|
| - }
|
| if (values.is_cpu_usage_valid && values.is_idle_wakeups_valid)
|
| continue;
|
| MetricsMap::iterator metrics_iter = metrics_map_.find(process);
|
|
|