CheckerboardReportService.webidl (2057B)
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this file, 4 * You can obtain one at http://mozilla.org/MPL/2.0/. 5 */ 6 7 /* 8 * This file declares data structures used to communicate checkerboard reports 9 * from C++ code to about:checkerboard (see bug 1238042). These dictionaries 10 * are NOT exposed to standard web content. 11 */ 12 13 enum CheckerboardReason { 14 "severe", 15 "recent" 16 }; 17 18 // Individual checkerboard report. Contains fields for the severity of the 19 // checkerboard event, the timestamp at which it was reported, the detailed 20 // log of the event, and the reason this report was saved (currently either 21 // "severe" or "recent"). 22 dictionary CheckerboardReport { 23 unsigned long severity; 24 DOMTimeStamp timestamp; // milliseconds since epoch 25 DOMString log; 26 CheckerboardReason reason; 27 }; 28 29 // The guard function only allows creation of this interface on the 30 // about:checkerboard page, and only if it's in the parent process. 31 [Func="mozilla::dom::CheckerboardReportService::IsEnabled", 32 Exposed=Window] 33 interface CheckerboardReportService { 34 constructor(); 35 36 /** 37 * Gets the available checkerboard reports. 38 */ 39 sequence<CheckerboardReport> getReports(); 40 41 /** 42 * Gets the state of the apz.record_checkerboarding pref. 43 */ 44 boolean isRecordingEnabled(); 45 46 /** 47 * Sets the state of the apz.record_checkerboarding pref. 48 */ 49 undefined setRecordingEnabled(boolean aEnabled); 50 51 /** 52 * Flush any in-progress checkerboard reports. Since this happens 53 * asynchronously, the caller may register an observer with the observer 54 * service to be notified when this operation is complete. The observer should 55 * listen for the topic "APZ:FlushActiveCheckerboard:Done". Upon receiving 56 * this notification, the caller may call getReports() to obtain the flushed 57 * reports, along with any other reports that are available. 58 */ 59 undefined flushActiveReports(); 60 };