From d60a111f6cfc6d4a8c486b92814ecdbc067c44da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B8is=C3=A6ther=20Rasch?= Date: Tue, 22 Sep 2015 12:08:54 +0200 Subject: [PATCH] Added/Updated system.cpu /w docs --- chrome/chrome.d.ts | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/chrome/chrome.d.ts b/chrome/chrome.d.ts index 9f5579bf25..5d7c79d12d 100755 --- a/chrome/chrome.d.ts +++ b/chrome/chrome.d.ts @@ -6061,6 +6061,51 @@ declare module chrome.socket { export function getNetworkList(callback: (result: NetworkInterface[]) => void): void; } +//////////////////// +// System CPU +//////////////////// +/** + * Use the system.cpu API to query CPU metadata. + * Permissions: "system.cpu" + * @since Chrome 32. + */ +declare module chrome.system.cpu { + interface ProcessorUsage { + /** The cumulative time used by userspace programs on this processor. */ + user: number; + /** The cumulative time used by kernel programs on this processor. */ + kernel: number; + /** The cumulative time spent idle by this processor. */ + idle: number; + /** The total cumulative time for this processor. This value is equal to user + kernel + idle. */ + total: number; + } + + interface ProcessorInfo { + /** Cumulative usage info for this logical processor. */ + usage: ProcessorUsage; + } + + interface CpuInfo { + /** The number of logical processors. */ + numOfProcessors: number; + /** The architecture name of the processors. */ + archName: string; + /** The model name of the processors. */ + modelName: string; + /** + * A set of feature codes indicating some of the processor's capabilities. + * The currently supported codes are "mmx", "sse", "sse2", "sse3", "ssse3", "sse4_1", "sse4_2", and "avx". + */ + features: string[]; + /** Information about each logical processor. */ + processors: ProcessorInfo[]; + } + + /** Queries basic CPU information of the system. */ + export function getInfo(callback: (info: CpuInfo) => void): void; +} + //////////////////// // TabCapture ////////////////////