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

Side by Side Diff: chrome/common/child_process_info.cc

Issue 3165041: Give GPU process a name in the task manager (Closed)
Patch Set: '' Created 10 years, 4 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
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | no next file » | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/common/child_process_info.h" 5 #include "chrome/common/child_process_info.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "base/atomicops.h" 10 #include "base/atomicops.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 } else if (type_ == ChildProcessInfo::WORKER_PROCESS) { 90 } else if (type_ == ChildProcessInfo::WORKER_PROCESS) {
91 message_id = IDS_TASK_MANAGER_WORKER_PREFIX; 91 message_id = IDS_TASK_MANAGER_WORKER_PREFIX;
92 } else if (type_ == ChildProcessInfo::UTILITY_PROCESS) { 92 } else if (type_ == ChildProcessInfo::UTILITY_PROCESS) {
93 message_id = IDS_TASK_MANAGER_UTILITY_PREFIX; 93 message_id = IDS_TASK_MANAGER_UTILITY_PREFIX;
94 } else if (type_ == ChildProcessInfo::PROFILE_IMPORT_PROCESS) { 94 } else if (type_ == ChildProcessInfo::PROFILE_IMPORT_PROCESS) {
95 message_id = IDS_TASK_MANAGER_PROFILE_IMPORT_PREFIX; 95 message_id = IDS_TASK_MANAGER_PROFILE_IMPORT_PREFIX;
96 } else if (type_ == ChildProcessInfo::NACL_LOADER_PROCESS) { 96 } else if (type_ == ChildProcessInfo::NACL_LOADER_PROCESS) {
97 message_id = IDS_TASK_MANAGER_NACL_PREFIX; 97 message_id = IDS_TASK_MANAGER_NACL_PREFIX;
98 } else if (type_ == ChildProcessInfo::NACL_BROKER_PROCESS) { 98 } else if (type_ == ChildProcessInfo::NACL_BROKER_PROCESS) {
99 message_id = IDS_TASK_MANAGER_NACL_BROKER_PREFIX; 99 message_id = IDS_TASK_MANAGER_NACL_BROKER_PREFIX;
100 } else if (type_ == ChildProcessInfo::GPU_PROCESS) {
101 message_id = IDS_TASK_MANAGER_GPU_PREFIX;
100 } else { 102 } else {
101 DCHECK(false) << "Need localized name for child process type."; 103 DCHECK(false) << "Need localized name for child process type.";
102 return title; 104 return title;
103 } 105 }
104 106
105 return l10n_util::GetStringFUTF16(message_id, title); 107 return l10n_util::GetStringFUTF16(message_id, title);
106 } 108 }
107 109
108 ChildProcessInfo::ChildProcessInfo(ProcessType type, int id) : type_(type) { 110 ChildProcessInfo::ChildProcessInfo(ProcessType type, int id) : type_(type) {
109 if (id == -1) 111 if (id == -1)
(...skipping 13 matching lines...) Expand all
123 base::GetCurrentProcId(), instance, 125 base::GetCurrentProcId(), instance,
124 base::RandInt(0, std::numeric_limits<int>::max())); 126 base::RandInt(0, std::numeric_limits<int>::max()));
125 } 127 }
126 128
127 // static 129 // static
128 int ChildProcessInfo::GenerateChildProcessUniqueId() { 130 int ChildProcessInfo::GenerateChildProcessUniqueId() {
129 // This function must be threadsafe. 131 // This function must be threadsafe.
130 static base::subtle::Atomic32 last_unique_child_id = 0; 132 static base::subtle::Atomic32 last_unique_child_id = 0;
131 return base::subtle::NoBarrier_AtomicIncrement(&last_unique_child_id, 1); 133 return base::subtle::NoBarrier_AtomicIncrement(&last_unique_child_id, 1);
132 } 134 }
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698