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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_ANDROID_SECCOMP_SUPPORT_DETECTOR_H_
6 #define CHROME_BROWSER_ANDROID_SECCOMP_SUPPORT_DETECTOR_H_
8 #include "base/compiler_specific.h"
9 #include "base/memory/ref_counted.h"
11 // This class is used to report via UMA the Android kernel version and
12 // level of seccomp-bpf support. The operations are performed on the
13 // blocking thread pool.
14 class SeccompSupportDetector
15 : public base::RefCountedThreadSafe
<SeccompSupportDetector
> {
17 // Starts the detection process. This should be called once per browser
18 // session. This is safe to call from any thread.
19 static void StartDetection();
22 friend class base::RefCountedThreadSafe
<SeccompSupportDetector
>;
24 SeccompSupportDetector();
25 ~SeccompSupportDetector();
27 // Called on the blocking thread pool. This reads the utsname and records
28 // the kernel version.
29 void DetectKernelVersion();
31 // Called on the blocking thread pool. This tests whether the system
32 // supports PR_SET_SECCOMP.
35 DISALLOW_COPY_AND_ASSIGN(SeccompSupportDetector
);
38 #endif // CHROME_BROWSER_ANDROID_SECCOMP_SUPPORT_DETECTOR_H_