| OLD | NEW |
| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 75 |
| 76 string16 ChildProcessInfo::GetLocalizedTitle() const { | 76 string16 ChildProcessInfo::GetLocalizedTitle() const { |
| 77 string16 title = WideToUTF16Hack(name_); | 77 string16 title = WideToUTF16Hack(name_); |
| 78 if (type_ == ChildProcessInfo::PLUGIN_PROCESS && title.empty()) | 78 if (type_ == ChildProcessInfo::PLUGIN_PROCESS && title.empty()) |
| 79 title = l10n_util::GetStringUTF16(IDS_TASK_MANAGER_UNKNOWN_PLUGIN_NAME); | 79 title = l10n_util::GetStringUTF16(IDS_TASK_MANAGER_UNKNOWN_PLUGIN_NAME); |
| 80 | 80 |
| 81 // Explicitly mark name as LTR if there is no strong RTL character, | 81 // Explicitly mark name as LTR if there is no strong RTL character, |
| 82 // to avoid the wrong concatenation result similar to "!Yahoo! Mail: the | 82 // to avoid the wrong concatenation result similar to "!Yahoo! Mail: the |
| 83 // best web-based Email: NIGULP", in which "NIGULP" stands for the Hebrew | 83 // best web-based Email: NIGULP", in which "NIGULP" stands for the Hebrew |
| 84 // or Arabic word for "plugin". | 84 // or Arabic word for "plugin". |
| 85 base::i18n::AdjustStringForLocaleDirection(title, &title); | 85 base::i18n::AdjustStringForLocaleDirection(&title); |
| 86 | 86 |
| 87 switch (type_) { | 87 switch (type_) { |
| 88 case ChildProcessInfo::UTILITY_PROCESS: | 88 case ChildProcessInfo::UTILITY_PROCESS: |
| 89 return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_UTILITY_PREFIX); | 89 return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_UTILITY_PREFIX); |
| 90 | 90 |
| 91 case ChildProcessInfo::PROFILE_IMPORT_PROCESS: | 91 case ChildProcessInfo::PROFILE_IMPORT_PROCESS: |
| 92 return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_UTILITY_PREFIX); | 92 return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_UTILITY_PREFIX); |
| 93 | 93 |
| 94 case ChildProcessInfo::GPU_PROCESS: | 94 case ChildProcessInfo::GPU_PROCESS: |
| 95 return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_GPU_PREFIX); | 95 return l10n_util::GetStringUTF16(IDS_TASK_MANAGER_GPU_PREFIX); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 base::GetCurrentProcId(), instance, | 142 base::GetCurrentProcId(), instance, |
| 143 base::RandInt(0, std::numeric_limits<int>::max())); | 143 base::RandInt(0, std::numeric_limits<int>::max())); |
| 144 } | 144 } |
| 145 | 145 |
| 146 // static | 146 // static |
| 147 int ChildProcessInfo::GenerateChildProcessUniqueId() { | 147 int ChildProcessInfo::GenerateChildProcessUniqueId() { |
| 148 // This function must be threadsafe. | 148 // This function must be threadsafe. |
| 149 static base::subtle::Atomic32 last_unique_child_id = 0; | 149 static base::subtle::Atomic32 last_unique_child_id = 0; |
| 150 return base::subtle::NoBarrier_AtomicIncrement(&last_unique_child_id, 1); | 150 return base::subtle::NoBarrier_AtomicIncrement(&last_unique_child_id, 1); |
| 151 } | 151 } |
| OLD | NEW |