This file is indexed.

/usr/share/idl/thunderbird/xpccomponents.idl is in thunderbird-dev 1:24.4.0+build1-0ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
/* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "nsISupports.idl"
#include "xpcexception.idl"
#include "xpcjsid.idl"
#include "nsIComponentManager.idl"

%{C++
#include "jspubtd.h"
%}

interface xpcIJSWeakReference;
interface nsIClassInfo;

/**
* interface of Components.interfacesByID
* (interesting stuff only reflected into JavaScript)
*/
[scriptable, uuid(c99cffac-5aed-4267-ad2f-f4a4c9d4a081)]
interface nsIXPCComponents_InterfacesByID : nsISupports
{
};

/**
* interface of Components.interfaces
* (interesting stuff only reflected into JavaScript)
*/
[scriptable, uuid(b8c31bba-79db-4a1d-930d-4cdd68713f9e)]
interface nsIXPCComponents_Interfaces : nsISupports
{
};

/**
* interface of Components.classes
* (interesting stuff only reflected into JavaScript)
*/
[scriptable, uuid(978ff520-d26c-11d2-9842-006008962422)]
interface nsIXPCComponents_Classes : nsISupports
{
};

/**
* interface of Components.classesByID
* (interesting stuff only reflected into JavaScript)
*/
[scriptable, uuid(336a9590-4d19-11d3-9893-006008962422)]
interface nsIXPCComponents_ClassesByID : nsISupports
{
};

/**
* interface of Components.results
* (interesting stuff only reflected into JavaScript)
*/
[scriptable, uuid(2fc229a0-5860-11d3-9899-006008962422)]
interface nsIXPCComponents_Results : nsISupports
{
};

/**
* interface of Components.ID
* (interesting stuff only reflected into JavaScript)
*/
[scriptable, uuid(7994a6e0-e028-11d3-8f5d-0010a4e73d9a)]
interface nsIXPCComponents_ID : nsISupports
{
};

/**
* interface of Components.Exception
* (interesting stuff only reflected into JavaScript)
*/
[scriptable, uuid(5bf039c0-e028-11d3-8f5d-0010a4e73d9a)]
interface nsIXPCComponents_Exception : nsISupports
{
};

/**
* interface of Components.Constructor
* (interesting stuff only reflected into JavaScript)
*/
[scriptable, uuid(88655640-e028-11d3-8f5d-0010a4e73d9a)]
interface nsIXPCComponents_Constructor : nsISupports
{
};

/**
* interface of object returned by Components.Constructor
* (additional interesting stuff only reflected into JavaScript)
*/
[scriptable, uuid(c814ca20-e0dc-11d3-8f5f-0010a4e73d9a)]
interface nsIXPCConstructor : nsISupports
{
    readonly attribute nsIJSCID classID;
    readonly attribute nsIJSIID interfaceID;
    readonly attribute string   initializer;
};

/**
* interface of object returned by Components.utils.Sandbox.
*/
[scriptable, uuid(4f8ae0dc-d266-4a32-875b-6a9de71a8ce9)]
interface nsIXPCComponents_utils_Sandbox : nsISupports
{
};

/**
 * interface for callback to be passed to Cu.schedulePreciseGC
 */
[scriptable, function, uuid(71000535-b0fd-44d1-8ce0-909760e3953c)]
interface ScheduledGCCallback : nsISupports
{
    void callback();
};

/**
* interface of Components.utils
*/
[scriptable, uuid(fdd32d38-9341-4067-9000-d781075a60c9)]
interface nsIXPCComponents_Utils : nsISupports
{

    /* reportError is designed to be called from JavaScript only.
     *
     * It will report a JS Error object to the JS console, and return. It
     * is meant for use in exception handler blocks which want to "eat"
     * an exception, but still want to report it to the console.
     *
     * It must be called with one param, usually an object which was caught by
     * an exception handler.  If it is not a JS error object, the parameter
     * is converted to a string and reported as a new error.
     */
    [implicit_jscontext] void reportError(in jsval error);

    /* lookupMethod is designed to be called from JavaScript only.
     *
     * It returns a method looking only at the idl interfaces and
     * ignores any overrides or resolvers that might be in place for
     * a given scriptable wrapped native.
     * It must be called with two params: an object and a method name.
     * It returns a function object or throws an exception on error.
     * This method exists only to solve mozilla browser problems
     * when chrome attempts to lookup and call methods in content
     * and *must* not get confused by method properties that have been
     * replaced in the content JS code. This method is not recommended for
     * any other use.
     */
    [implicit_jscontext]
    jsval lookupMethod(in jsval obj, in jsval name);

    readonly attribute nsIXPCComponents_utils_Sandbox Sandbox;

    /*
     * evalInSandbox is designed to be called from JavaScript only.
     *
     * evalInSandbox evaluates the provided source string in the given sandbox.
     * It returns the result of the evaluation to the caller.
     *
     * var s = new C.u.Sandbox("http://www.mozilla.org");
     * var res = C.u.evalInSandbox("var five = 5; 2 + five", s);
     * var outerFive = s.five;
     * s.seven = res;
     * var thirtyFive = C.u.evalInSandbox("five * seven", s);
     */
    [implicit_jscontext,optional_argc]
    jsval evalInSandbox(in AString source, in jsval sandbox,
                        [optional] in jsval version,
                        [optional] in jsval filename,
                        [optional] in long lineNo);


    /*
     * import is designed to be called from JavaScript only.
     *
     * Synchronously loads and evaluates the js file located at
     * 'registryLocation' with a new, fully privileged global object.
     *
     * If 'targetObj' is specified and equal to null, returns the
     * module's global object. Otherwise (if 'targetObj' is not
     * specified, or 'targetObj' is != null) looks for a property
     * 'EXPORTED_SYMBOLS' on the new global object. 'EXPORTED_SYMBOLS'
     * is expected to be an array of strings identifying properties on
     * the global object.  These properties will be installed as
     * properties on 'targetObj', or, if 'targetObj' is not specified,
     * on the caller's global object. If 'EXPORTED_SYMBOLS' is not
     * found, an error is thrown.
     *
     * @param resourceURI A resource:// URI string to load the module from.
     * @param targetObj  the object to install the exported properties on.
     *        If this parameter is a primitive value, this method throws
     *        an exception.
     * @returns the module code's global object.
     *
     * The implementation maintains a hash of registryLocation->global obj.
     * Subsequent invocations of importModule with 'registryLocation'
     * pointing to the same file will not cause the module to be re-evaluated,
     * but the symbols in EXPORTED_SYMBOLS will be exported into the
     * specified target object and the global object returned as above.
     *
     * (This comment is duplicated from xpcIJSModuleLoader.)
     */
    [implicit_jscontext,optional_argc]
    jsval import(in AUTF8String aResourceURI, [optional] in jsval targetObj);

    /*
     * Unloads the JS module at 'registryLocation'. Existing references to the
     * module will continue to work but any subsequent import of the module will
     * reload it and give new reference. If the JS module hasn't yet been
     * imported then this method will do nothing.
     *
     * @param resourceURI A resource:// URI string to unload the module from.
     */
    void unload(in AUTF8String registryLocation);

    /*
     * To be called from JS only.
     *
     * Return a weak reference for the given JS object.
     */
    [implicit_jscontext]
    xpcIJSWeakReference getWeakReference(in jsval obj);

    /*
     * To be called from JS only.
     *
     * Force an immediate garbage collection cycle.
     */
    void forceGC();

    /*
     * To be called from JS only.
     *
     * Force an immediate cycle collection cycle.
     */
    void forceCC();
    
    /*
     * To be called from JS only.
     *
     * Force an immediate shrinking garbage collection cycle.
     */
    void forceShrinkingGC();

    /*
     * Schedule a garbage collection cycle for a point in the future when no JS
     * is running. Call the provided function once this has occurred.
     */
    void schedulePreciseGC(in ScheduledGCCallback callback);
    
    /*
     * Schedule a shrinking garbage collection cycle for a point in the future
     * when no JS is running. Call the provided function once this has occured.
     */
    void schedulePreciseShrinkingGC(in ScheduledGCCallback callback);

    /**
     * Return the keys in a weak map.  This operation is
     * non-deterministic because it is affected by the scheduling of the
     * garbage collector and the cycle collector.
     *
     * This should only be used to write tests of the interaction of
     * the GC and CC with weak maps.
     *
     * @param aMap weak map or other JavaScript value
     * @returns If aMap is a weak map object, return the keys of the weak
                map as an array.  Otherwise, return undefined.
     */
    [implicit_jscontext]
    jsval nondeterministicGetWeakMapKeys(in jsval aMap);

    [implicit_jscontext]
    jsval getJSTestingFunctions();

    /*
     * To be called from JS only.
     *
     * Returns the global object with which the given object is associated.
     *
     * @param obj The JavaScript object whose global is to be gotten.
     * @return the corresponding global.
     */
    [implicit_jscontext]
    jsval getGlobalForObject(in jsval obj);

    /*
     * To be called from JS only.
     *
     * Returns an object created in |vobj|'s compartment.
     */
    [implicit_jscontext]
    jsval createObjectIn(in jsval vobj);

    /*
     * To be called from JS only.
     *
     * Returns an array created in |vobj|'s compartment.
     */
    [implicit_jscontext]
    jsval createArrayIn(in jsval vobj);

    /*
     * To be called from JS only.
     *
     * Returns a date given timestamp |msec| created in |vobj|'s compartment.
     */
    [implicit_jscontext]
    jsval createDateIn(in jsval vobj, in long long msec);

    /*
     * To be called from JS only.
     *
     * Ensures that all functions come from vobj's scope (and aren't cross
     * compartment wrappers).
     */
    [implicit_jscontext]
    void makeObjectPropsNormal(in jsval vobj);

    /**
     * Determines whether this object is backed by a DeadObjectProxy.
     *
     * Dead-wrapper objects hold no other objects alive (they have no outgoing
     * reference edges) and will throw if you touch them (e.g. by
     * reading/writing a property).
     */
    bool isDeadWrapper(in jsval obj);

    /*
     * To be called from JS only. This is for Gecko internal use only, and may
     * disappear at any moment.
     *
     * Forces a recomputation of all wrappers in and out of the compartment
     * containing |vobj|. If |vobj| is not an object, all wrappers system-wide
     * are recomputed.
     */
    [implicit_jscontext]
    void recomputeWrappers([optional] in jsval vobj);

    /*
     * To be called from JS only. This is for Gecko internal use only, and may
     * disappear at any moment.
     *
     * Enables Xray vision for same-compartment access for the compartment
     * indicated by |vscope|. All outgoing wrappers are recomputed.
     */
    [implicit_jscontext]
    void setWantXrays(in jsval vscope);

    /*
     * This seemingly-paradoxical API allows privileged code to explicitly give
     * unprivileged code a reference to its own Components object (whereas it's
     * normally hidden away on a scope chain visible only to XBL methods). See
     * also SpecialPowers.getComponents.
     */
    [implicit_jscontext]
    jsval getComponentsForScope(in jsval vscope);

    /*
     * Dispatches a runnable to the current/main thread. If |scope| is passed,
     * the runnable will be dispatch in the compartment of |scope|, which
     * affects which error reporter gets called.
     */
    [implicit_jscontext]
    void dispatch(in jsval runnable, [optional] in jsval scope);

    /*
     * To be called from JS only.
     *
     * These are the set of JSContext options that privileged script
     * is allowed to control for the purposes of testing.  These
     * options should be kept in sync with what's controllable in the
     * jsshell and by setting prefs in nsJSEnvironment.
     *
     * NB: Assume that getting any of these attributes is relatively
     * cheap, but setting any of them is relatively expensive.
     */
    [implicit_jscontext]
    attribute boolean strict;

    [implicit_jscontext]
    attribute boolean werror;

    [implicit_jscontext]
    attribute boolean strict_mode;

    [implicit_jscontext]
    attribute boolean ion;

    [implicit_jscontext]
    void setGCZeal(in long zeal);

    [implicit_jscontext]
    void nukeSandbox(in jsval obj);

    /**
     * Check whether the given object is an XrayWrapper.
     */
    bool isXrayWrapper(in jsval obj);

    /**
     * Waive Xray on a given value. Identity op for primitives.
     */
    [implicit_jscontext]
    jsval waiveXrays(in jsval aVal);

    /**
     * Strip off Xray waivers on a given value. Identity op for primitives.
     */
    [implicit_jscontext]
    jsval unwaiveXrays(in jsval aVal);

    /**
     * Gets the name of the JSClass of the object.
     *
     * if |aUnwrap| is true, all wrappers are unwrapped first. Unless you're
     * specifically trying to detect whether the object is a proxy, this is
     * probably what you want.
     */
    [implicit_jscontext]
    string getClassName(in jsval aObj, in bool aUnwrap);

    /**
     * Get a DOM classinfo for the given classname.  Only some class
     * names are supported.
     */
    nsIClassInfo getDOMClassInfo(in AString aClassName);
};

/**
* interface of JavaScript's 'Components' object
*/
[scriptable, uuid(8406dedb-23cc-42db-9f69-1f18785091b5)]
interface nsIXPCComponents : nsISupports
{
    readonly attribute nsIXPCComponents_Interfaces      interfaces;
    readonly attribute nsIXPCComponents_InterfacesByID  interfacesByID;
    readonly attribute nsIXPCComponents_Classes         classes;
    readonly attribute nsIXPCComponents_ClassesByID     classesByID;
    readonly attribute nsIStackFrame                    stack;
    readonly attribute nsIXPCComponents_Results         results;
    readonly attribute nsIComponentManager              manager;
    readonly attribute nsIXPCComponents_Utils           utils;

    readonly attribute nsIXPCComponents_ID              ID;
    readonly attribute nsIXPCComponents_Exception       Exception;
    readonly attribute nsIXPCComponents_Constructor     Constructor;

    boolean isSuccessCode(in nsresult result);

    /* @deprecated Use Components.utils.lookupMethod instead.
     * (But are you sure you really want this method any more?
     *  See http://developer-test.mozilla.org/en/docs/XPCNativeWrapper )
     */
    [deprecated,implicit_jscontext]
    jsval lookupMethod(in jsval obj, in jsval name);

    /* @deprecated Use Components.utils.reportError instead. */
    [deprecated, implicit_jscontext] void reportError(in jsval error);

    /* 'lastResult' is accessible via JavaScript only */
    /* 'returnCode' is accessible via JavaScript only */
};