jam@chromium.org | a5431114 | 2011-12-01 05:13:41 | [diff] [blame] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "content/public/common/process_type.h" |
| 6 | |
| 7 | #include "base/logging.h" |
jam@chromium.org | f3b35769 | 2013-03-22 05:16:13 | [diff] [blame] | 8 | #include "content/public/common/content_client.h" |
jam@chromium.org | a5431114 | 2011-12-01 05:13:41 | [diff] [blame] | 9 | |
| 10 | namespace content { |
| 11 | |
jam@chromium.org | f3b35769 | 2013-03-22 05:16:13 | [diff] [blame] | 12 | std::string GetProcessTypeNameInEnglish(int type) { |
jam@chromium.org | a5431114 | 2011-12-01 05:13:41 | [diff] [blame] | 13 | switch (type) { |
| 14 | case PROCESS_TYPE_BROWSER: |
| 15 | return "Browser"; |
| 16 | case PROCESS_TYPE_RENDERER: |
| 17 | return "Tab"; |
jam@chromium.org | a5431114 | 2011-12-01 05:13:41 | [diff] [blame] | 18 | case PROCESS_TYPE_UTILITY: |
| 19 | return "Utility"; |
jam@chromium.org | a5431114 | 2011-12-01 05:13:41 | [diff] [blame] | 20 | case PROCESS_TYPE_ZYGOTE: |
| 21 | return "Zygote"; |
| 22 | case PROCESS_TYPE_SANDBOX_HELPER: |
| 23 | return "Sandbox helper"; |
jam@chromium.org | a5431114 | 2011-12-01 05:13:41 | [diff] [blame] | 24 | case PROCESS_TYPE_GPU: |
| 25 | return "GPU"; |
| 26 | case PROCESS_TYPE_PPAPI_PLUGIN: |
| 27 | return "Pepper Plugin"; |
| 28 | case PROCESS_TYPE_PPAPI_BROKER: |
| 29 | return "Pepper Plugin Broker"; |
| 30 | case PROCESS_TYPE_UNKNOWN: |
jam@chromium.org | a5431114 | 2011-12-01 05:13:41 | [diff] [blame] | 31 | DCHECK(false) << "Unknown child process type!"; |
| 32 | return "Unknown"; |
| 33 | } |
jam@chromium.org | f3b35769 | 2013-03-22 05:16:13 | [diff] [blame] | 34 | |
| 35 | return content::GetContentClient()->GetProcessTypeNameInEnglish(type); |
jam@chromium.org | a5431114 | 2011-12-01 05:13:41 | [diff] [blame] | 36 | } |
| 37 | |
| 38 | } // namespace content |