mozISandboxReporter.idl (2659B)
1 /* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #include "nsISupports.idl" 8 9 // A wrapper for the C++ class SandboxReport, representing one system 10 // call that was rejected by policy. 11 [scriptable, builtinclass, uuid(ed1e84d3-3346-42e1-b28c-e76a77f549f0)] 12 interface mozISandboxReport : nsISupports 13 { 14 // The timestamp relative to the time when this property is read. 15 // This is mainly meant for distinguishing recent events that might 16 // be related to an observable failure from older ones that may be 17 // unrelated, not for exact timing. 18 readonly attribute uint64_t msecAgo; 19 readonly attribute int32_t pid; 20 readonly attribute int32_t tid; 21 readonly attribute ACString procType; 22 readonly attribute uint32_t syscall; 23 // Currently numArgs is effectively a constant and indicates the 24 // maximum number of arguments possible on the platform; the actual 25 // system call may use fewer. 26 readonly attribute uint32_t numArgs; 27 // The argument values are presented as strings because JS doesn't 28 // have 64-bit integers and data would be lost on 64-bit platforms 29 // if the XPIDL type uint64_t were used. The string may be decimal 30 // or hex (with leading "0x"). 31 ACString getArg(in uint32_t aIndex); 32 }; 33 34 // A wrapper for SandboxReporter::Snapshot, representing the most 35 // recent SandboxReport events. Index 0 is the first report in the 36 // session, and so on; exposing the indices like this lets us see how 37 // many reports have been received even though only a limited number 38 // of them are stored. 39 [scriptable, builtinclass, uuid(6e8ff6e5-05c9-42d3-853d-40523fd86a50)] 40 interface mozISandboxReportArray : nsISupports 41 { 42 readonly attribute uint64_t begin; 43 readonly attribute uint64_t end; 44 // (aIndex >= begin && aIndex < end) must be true. 45 mozISandboxReport getElement(in uint64_t aIndex); 46 }; 47 48 // A wrapper for the SandboxReporter; use the component/contract IDs 49 // below to access the SandboxReporter singleton. The component 50 // constructor will fail if called in a child process. 51 [scriptable, builtinclass, uuid(8535bdf7-6d9e-4853-acf9-a146449c4a3b)] 52 interface mozISandboxReporter : nsISupports 53 { 54 mozISandboxReportArray snapshot(); 55 }; 56 57 %{ C++ 58 59 #define MOZ_SANDBOX_REPORTER_CID \ 60 {0x5118a6f9, 0x2493, 0x4f97, {0x95, 0x52, 0x62, 0x06, 0x63, 0xe0, 0x3c, 0xb3}} 61 62 #define MOZ_SANDBOX_REPORTER_CONTRACTID \ 63 "@mozilla.org/sandbox/syscall-reporter;1" 64 65 %}