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

Side by Side Diff: chrome/browser/android/seccomp_support_detector.cc

Issue 1062873003: Give names to all utility processes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix typos Created 5 years, 8 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/android/seccomp_support_detector.h" 5 #include "chrome/browser/android/seccomp_support_detector.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 #include <sys/utsname.h> 8 #include <sys/utsname.h>
9 9
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
11 #include "base/metrics/histogram_macros.h" 11 #include "base/metrics/histogram_macros.h"
12 #include "base/metrics/sparse_histogram.h" 12 #include "base/metrics/sparse_histogram.h"
13 #include "chrome/common/chrome_utility_messages.h" 13 #include "chrome/common/chrome_utility_messages.h"
14 #include "chrome/grit/generated_resources.h"
14 #include "content/public/browser/browser_thread.h" 15 #include "content/public/browser/browser_thread.h"
15 #include "content/public/browser/utility_process_host.h" 16 #include "content/public/browser/utility_process_host.h"
17 #include "ui/base/l10n/l10n_util.h"
16 18
17 using content::BrowserThread; 19 using content::BrowserThread;
18 20
19 enum AndroidSeccompStatus { 21 enum AndroidSeccompStatus {
20 DETECTION_FAILED, // The process crashed during detection. 22 DETECTION_FAILED, // The process crashed during detection.
21 NOT_SUPPORTED, // Kernel has no seccomp support. 23 NOT_SUPPORTED, // Kernel has no seccomp support.
22 SUPPORTED, // Kernel has seccomp support. 24 SUPPORTED, // Kernel has seccomp support.
23 LAST_STATUS 25 LAST_STATUS
24 }; 26 };
25 27
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 base::Bind(&SeccompSupportDetector::OnDetectSyscall, this, false)); 68 base::Bind(&SeccompSupportDetector::OnDetectSyscall, this, false));
67 #endif 69 #endif
68 } 70 }
69 71
70 void SeccompSupportDetector::DetectSeccomp() { 72 void SeccompSupportDetector::DetectSeccomp() {
71 DCHECK_CURRENTLY_ON(BrowserThread::IO); 73 DCHECK_CURRENTLY_ON(BrowserThread::IO);
72 74
73 content::UtilityProcessHost* utility_process_host = 75 content::UtilityProcessHost* utility_process_host =
74 content::UtilityProcessHost::Create( 76 content::UtilityProcessHost::Create(
75 this, base::MessageLoopProxy::current()); 77 this, base::MessageLoopProxy::current());
78 utility_process_host->SetName(l10n_util::GetStringUTF16(
79 IDS_UTILITY_PROCESS_SECCOMP_DETECTOR_NAME));
76 utility_process_host->Send(new ChromeUtilityMsg_DetectSeccompSupport()); 80 utility_process_host->Send(new ChromeUtilityMsg_DetectSeccompSupport());
77 } 81 }
78 82
79 void SeccompSupportDetector::OnProcessCrashed(int exit_code) { 83 void SeccompSupportDetector::OnProcessCrashed(int exit_code) {
80 DCHECK_CURRENTLY_ON(BrowserThread::IO); 84 DCHECK_CURRENTLY_ON(BrowserThread::IO);
81 // The process crashed. Since prctl detection happens first, report which 85 // The process crashed. Since prctl detection happens first, report which
82 // probe failed. 86 // probe failed.
83 if (prctl_detected_) { 87 if (prctl_detected_) {
84 UMA_HISTOGRAM_ENUMERATION("Android.SeccompStatus.Syscall", 88 UMA_HISTOGRAM_ENUMERATION("Android.SeccompStatus.Syscall",
85 DETECTION_FAILED, 89 DETECTION_FAILED,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 DCHECK_CURRENTLY_ON(BrowserThread::IO); 122 DCHECK_CURRENTLY_ON(BrowserThread::IO);
119 DCHECK(prctl_detected_); 123 DCHECK(prctl_detected_);
120 124
121 UMA_HISTOGRAM_ENUMERATION("Android.SeccompStatus.Syscall", 125 UMA_HISTOGRAM_ENUMERATION("Android.SeccompStatus.Syscall",
122 syscall_supported ? SUPPORTED : NOT_SUPPORTED, 126 syscall_supported ? SUPPORTED : NOT_SUPPORTED,
123 LAST_STATUS); 127 LAST_STATUS);
124 128
125 // The utility process will shutdown after this, and this object will 129 // The utility process will shutdown after this, and this object will
126 // be deleted when the UtilityProcessHost releases its reference. 130 // be deleted when the UtilityProcessHost releases its reference.
127 } 131 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698