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

Side by Side Diff: chrome/browser/extensions/api/processes/processes_api.cc

Issue 165153003: Add process title and nacl debug port fields to the processes api. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/extensions/api/processes/processes_api_constants.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/extensions/api/processes/processes_api.h" 5 #include "chrome/browser/extensions/api/processes/processes_api.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 base::DictionaryValue* CreateProcessFromModel(int process_id, 139 base::DictionaryValue* CreateProcessFromModel(int process_id,
140 TaskManagerModel* model, 140 TaskManagerModel* model,
141 int index, 141 int index,
142 bool include_optional) { 142 bool include_optional) {
143 base::DictionaryValue* result = new base::DictionaryValue(); 143 base::DictionaryValue* result = new base::DictionaryValue();
144 size_t mem; 144 size_t mem;
145 145
146 result->SetInteger(keys::kIdKey, process_id); 146 result->SetInteger(keys::kIdKey, process_id);
147 result->SetInteger(keys::kOsProcessIdKey, model->GetProcessId(index)); 147 result->SetInteger(keys::kOsProcessIdKey, model->GetProcessId(index));
148 SetProcessType(result, model, index); 148 SetProcessType(result, model, index);
149 result->SetString(keys::kTitleKey, model->GetResourceTitle(index));
149 result->SetString(keys::kProfileKey, 150 result->SetString(keys::kProfileKey,
150 model->GetResourceProfileName(index)); 151 model->GetResourceProfileName(index));
152 result->SetInteger(keys::kNaClDebugPortKey,
153 model->GetNaClDebugStubPort(index));
151 154
152 result->Set(keys::kTabsListKey, GetTabsForProcess(process_id)); 155 result->Set(keys::kTabsListKey, GetTabsForProcess(process_id));
153 156
154 // If we don't need to include the optional properties, just return now. 157 // If we don't need to include the optional properties, just return now.
155 if (!include_optional) 158 if (!include_optional)
156 return result; 159 return result;
157 160
158 result->SetDouble(keys::kCpuKey, model->GetCPUUsage(index)); 161 result->SetDouble(keys::kCpuKey, model->GetCPUUsage(index));
159 162
160 if (model->GetV8Memory(index, &mem)) 163 if (model->GetV8Memory(index, &mem))
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 761
759 SetResult(processes); 762 SetResult(processes);
760 SendResponse(true); 763 SendResponse(true);
761 764
762 // Balance the AddRef in the RunImpl. 765 // Balance the AddRef in the RunImpl.
763 Release(); 766 Release();
764 #endif // defined(ENABLE_TASK_MANAGER) 767 #endif // defined(ENABLE_TASK_MANAGER)
765 } 768 }
766 769
767 } // namespace extensions 770 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/processes/processes_api_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698