EMMA Coverage Report (generated Fri Aug 23 16:39:17 PDT 2013)
[all classes][org.chromium.base]

COVERAGE SUMMARY FOR SOURCE FILE [CpuFeatures.java]

nameclass, %method, %block, %line, %
CpuFeatures.java100% (1/1)67%  (2/3)57%  (4/7)67%  (2/3)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class CpuFeatures100% (1/1)67%  (2/3)57%  (4/7)67%  (2/3)
CpuFeatures (): void 0%   (0/1)0%   (0/3)0%   (0/1)
getCount (): int 100% (1/1)100% (2/2)100% (1/1)
getMask (): long 100% (1/1)100% (2/2)100% (1/1)

1// Copyright (c) 2012 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 
5package org.chromium.base;
6 
7// The only purpose of this class is to allow sending CPU properties
8// from the browser process to sandboxed renderer processes. This is
9// needed because sandboxed processes cannot, on ARM, query the kernel
10// about the CPU's properties by parsing /proc, so this operation must
11// be performed in the browser process, and the result passed to
12// renderer ones.
13//
14// For more context, see http://crbug.com/164154
15//
16// Technically, this is a wrapper around the native NDK cpufeatures
17// library. The exact CPU features bits are never used in Java so
18// there is no point in duplicating their definitions here.
19//
20@JNINamespace("base::android")
21public abstract class CpuFeatures {
22    /**
23     * Return the number of CPU Cores on the device.
24     */
25    public static int getCount() {
26        return nativeGetCoreCount();
27    }
28 
29    /**
30     * Return the CPU feature mask.
31     * This is a 64-bit integer that corresponds to the CPU's features.
32     * The value comes directly from android_getCpuFeatures().
33     */
34     public static long getMask() {
35        return nativeGetCpuFeatures();
36     }
37 
38    private static native int nativeGetCoreCount();
39    private static native long nativeGetCpuFeatures();
40}

[all classes][org.chromium.base]
EMMA 2.0.5312 (C) Vladimir Roubtsov