1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/xpcom/base/nsIVisualEventTracer.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,59 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsISupports.idl" 1.10 + 1.11 +interface nsIVisualEventTracerLog; 1.12 + 1.13 +/** 1.14 + * Interface to control the visual event tracer feature. The result 1.15 + * is a log of various events that are monitored by a custom code 1.16 + * instrumentation around the mozilla code base. 1.17 + */ 1.18 + 1.19 +[builtinclass, scriptable, uuid(713ee3ca-95e0-4085-8616-f6d64a9508ad)] 1.20 +interface nsIVisualEventTracer : nsISupports 1.21 +{ 1.22 + /** 1.23 + * Start the logging now. No affect if already started. 1.24 + * Current backlog is deleted by this call otherwise. 1.25 + * 1.26 + * @param minBacklogSeconds 1.27 + * Manimum time to keep the backlog. Entries of the log are discarded 1.28 + * when their age is more then value of this argument. 1.29 + */ 1.30 + void start(in unsigned long minBacklogSeconds); 1.31 + 1.32 + /** 1.33 + * Stop the logging now. Backlog is kept in memory. 1.34 + */ 1.35 + void stop(); 1.36 + 1.37 + /** 1.38 + * Obtain the log. This can be called whenever you want. 1.39 + * 1.40 + * @return 1.41 + * Result is an object that keeps snaphot of the log from 1.42 + * time this method has been called. You can then access 1.43 + * the log using the object. Calling stop() on the tracer 1.44 + * doesn't delete this log. 1.45 + */ 1.46 + nsIVisualEventTracerLog snapshot(); 1.47 +}; 1.48 + 1.49 +[builtinclass, scriptable, uuid(8ec6e36d-6cba-400b-bcd6-454679f5f75a)] 1.50 +interface nsIVisualEventTracerLog : nsISupports 1.51 +{ 1.52 + /** 1.53 + * JSON string of the log. Use JSON.parse to get it as an object. 1.54 + */ 1.55 + readonly attribute ACString JSONString; 1.56 + 1.57 + /** 1.58 + * Write the JSON string returned by JSONString to the log defined by 1.59 + * the environment variable MOZ_PROFILING_FILE. 1.60 + */ 1.61 + void writeToProfilingFile(); 1.62 +};