michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIVisualEventTracerLog; michael@0: michael@0: /** michael@0: * Interface to control the visual event tracer feature. The result michael@0: * is a log of various events that are monitored by a custom code michael@0: * instrumentation around the mozilla code base. michael@0: */ michael@0: michael@0: [builtinclass, scriptable, uuid(713ee3ca-95e0-4085-8616-f6d64a9508ad)] michael@0: interface nsIVisualEventTracer : nsISupports michael@0: { michael@0: /** michael@0: * Start the logging now. No affect if already started. michael@0: * Current backlog is deleted by this call otherwise. michael@0: * michael@0: * @param minBacklogSeconds michael@0: * Manimum time to keep the backlog. Entries of the log are discarded michael@0: * when their age is more then value of this argument. michael@0: */ michael@0: void start(in unsigned long minBacklogSeconds); michael@0: michael@0: /** michael@0: * Stop the logging now. Backlog is kept in memory. michael@0: */ michael@0: void stop(); michael@0: michael@0: /** michael@0: * Obtain the log. This can be called whenever you want. michael@0: * michael@0: * @return michael@0: * Result is an object that keeps snaphot of the log from michael@0: * time this method has been called. You can then access michael@0: * the log using the object. Calling stop() on the tracer michael@0: * doesn't delete this log. michael@0: */ michael@0: nsIVisualEventTracerLog snapshot(); michael@0: }; michael@0: michael@0: [builtinclass, scriptable, uuid(8ec6e36d-6cba-400b-bcd6-454679f5f75a)] michael@0: interface nsIVisualEventTracerLog : nsISupports michael@0: { michael@0: /** michael@0: * JSON string of the log. Use JSON.parse to get it as an object. michael@0: */ michael@0: readonly attribute ACString JSONString; michael@0: michael@0: /** michael@0: * Write the JSON string returned by JSONString to the log defined by michael@0: * the environment variable MOZ_PROFILING_FILE. michael@0: */ michael@0: void writeToProfilingFile(); michael@0: };