1/* -*- Mode: IDL; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 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 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 6#include "nsISupports.idl" 7 8%{C++ 9#include "jspubtd.h" 10%} 11 12interface xpcIJSWeakReference; 13interface nsIClassInfo; 14interface nsICommandParams; 15interface nsIComponentManager; 16interface nsICycleCollectorListener; 17interface nsIDocumentEncoder; 18interface nsIEditorSpellCheck; 19interface nsIFile; 20interface nsILoadContext; 21interface nsIPersistentProperties; 22interface nsIURI; 23interface nsIPrincipal; 24interface nsIStackFrame; 25webidl Element; 26 27/** 28* interface of Components.interfaces 29* (interesting stuff only reflected into JavaScript) 30*/ 31[scriptable, builtinclass, uuid(b8c31bba-79db-4a1d-930d-4cdd68713f9e)] 32interface nsIXPCComponents_Interfaces : nsISupports 33{ 34}; 35 36/** 37* interface of Components.classes 38* (interesting stuff only reflected into JavaScript) 39*/ 40[scriptable, builtinclass, uuid(978ff520-d26c-11d2-9842-006008962422)] 41interface nsIXPCComponents_Classes : nsISupports 42{ 43}; 44 45/** 46* interface of Components.results 47* (interesting stuff only reflected into JavaScript) 48*/ 49[scriptable, builtinclass, uuid(2fc229a0-5860-11d3-9899-006008962422)] 50interface nsIXPCComponents_Results : nsISupports 51{ 52}; 53 54/** 55* interface of Components.ID 56* (interesting stuff only reflected into JavaScript) 57*/ 58[scriptable, builtinclass, uuid(7994a6e0-e028-11d3-8f5d-0010a4e73d9a)] 59interface nsIXPCComponents_ID : nsISupports 60{ 61}; 62 63/** 64* interface of Components.Exception 65* (interesting stuff only reflected into JavaScript) 66*/ 67[scriptable, builtinclass, uuid(5bf039c0-e028-11d3-8f5d-0010a4e73d9a)] 68interface nsIXPCComponents_Exception : nsISupports 69{ 70}; 71 72/** 73* interface of Components.Constructor 74* (interesting stuff only reflected into JavaScript) 75*/ 76[scriptable, builtinclass, uuid(88655640-e028-11d3-8f5d-0010a4e73d9a)] 77interface nsIXPCComponents_Constructor : nsISupports 78{ 79}; 80 81/** 82* interface of object returned by Components.utils.Sandbox. 83*/ 84[scriptable, builtinclass, uuid(4f8ae0dc-d266-4a32-875b-6a9de71a8ce9)] 85interface nsIXPCComponents_utils_Sandbox : nsISupports 86{ 87}; 88 89/** 90 * interface for callback to be passed to Cu.schedulePreciseGC 91 */ 92[scriptable, function, uuid(71000535-b0fd-44d1-8ce0-909760e3953c)] 93interface nsIScheduledGCCallback : nsISupports 94{ 95 void callback(); 96}; 97 98/** 99* interface of Components.utils 100*/ 101[scriptable, builtinclass, uuid(86003fe3-ee9a-4620-91dc-eef8b1e58815)] 102interface nsIXPCComponents_Utils : nsISupports 103{ 104 /* 105 * Prints the provided message to stderr. 106 */ 107 void printStderr(in AUTF8String message); 108 109 /* 110 * reportError is designed to be called from JavaScript only. 111 * 112 * It will report a JS Error object to the JS console, and return. It 113 * is meant for use in exception handler blocks which want to "eat" 114 * an exception, but still want to report it to the console. 115 * 116 * It must be called with one param, usually an object which was caught by 117 * an exception handler. If it is not a JS error object, the parameter 118 * is converted to a string and reported as a new error. 119 * 120 * If called with two parameters, and the first parameter is not an 121 * object, the second parameter is used as the stack for the error report. 122 */ 123 [implicit_jscontext] 124 void reportError(in jsval error, [optional] in jsval stack); 125 126 readonly attribute nsIXPCComponents_utils_Sandbox Sandbox; 127 128 [implicit_jscontext] 129 jsval createServicesCache(); 130 131 /* 132 * evalInSandbox is designed to be called from JavaScript only. 133 * 134 * evalInSandbox evaluates the provided source string in the given sandbox. 135 * It returns the result of the evaluation to the caller. 136 * 137 * var s = new C.u.Sandbox("http://www.mozilla.org"); 138 * var res = C.u.evalInSandbox("var five = 5; 2 + five", s); 139 * var outerFive = s.five; 140 * s.seven = res; 141 * var thirtyFive = C.u.evalInSandbox("five * seven", s); 142 */ 143 [implicit_jscontext,optional_argc] 144 jsval evalInSandbox(in AString source, in jsval sandbox, 145 [optional] in jsval version, 146 [optional] in AUTF8String filename, 147 [optional] in long lineNo, 148 [optional] in bool enforceFilenameRestrictions); 149 150 /* 151 * Get the sandbox for running JS-implemented UA widgets (video controls etc.), 152 * hosted inside UA-created Shadow DOM. 153 */ 154 [implicit_jscontext] 155 jsval getUAWidgetScope(in nsIPrincipal principal); 156 157 /* 158 * getSandboxMetadata is designed to be called from JavaScript only. 159 * 160 * getSandboxMetadata retrieves the metadata associated with 161 * a sandbox object. It will return undefined if there 162 * is no metadata attached to the sandbox. 163 * 164 * var s = C.u.Sandbox(..., { metadata: "metadata" }); 165 * var metadata = C.u.getSandboxMetadata(s); 166 */ 167 [implicit_jscontext] 168 jsval getSandboxMetadata(in jsval sandbox); 169 170 /* 171 * setSandboxMetadata is designed to be called from JavaScript only. 172 * 173 * setSandboxMetadata sets the metadata associated with 174 * a sandbox object. 175 * 176 * Note that the metadata object will be copied before being used. 177 * The copy will be performed using the structured clone algorithm. 178 * Note that this algorithm does not support reflectors and 179 * it will throw if it encounters them. 180 */ 181 [implicit_jscontext] 182 void setSandboxMetadata(in jsval sandbox, in jsval metadata); 183 184 /* 185 * import is designed to be called from JavaScript only. 186 * 187 * Synchronously loads and evaluates the js file located at 188 * 'registryLocation' with a new, fully privileged global object. 189 * 190 * If 'targetObj' is specified and equal to null, returns the 191 * module's global object. Otherwise (if 'targetObj' is not 192 * specified, or 'targetObj' is != null) looks for a property 193 * 'EXPORTED_SYMBOLS' on the new global object. 'EXPORTED_SYMBOLS' 194 * is expected to be an array of strings identifying properties on 195 * the global object. These properties will be installed as 196 * properties on 'targetObj', or, if 'targetObj' is not specified, 197 * on the caller's global object. If 'EXPORTED_SYMBOLS' is not 198 * found, an error is thrown. 199 * 200 * @param resourceURI A resource:// URI string to load the module from. 201 * @param targetObj the object to install the exported properties on. 202 * If this parameter is a primitive value, this method throws 203 * an exception. 204 * @returns the module code's global object. 205 * 206 * The implementation maintains a hash of registryLocation->global obj. 207 * Subsequent invocations of importModule with 'registryLocation' 208 * pointing to the same file will not cause the module to be re-evaluated, 209 * but the symbols in EXPORTED_SYMBOLS will be exported into the 210 * specified target object and the global object returned as above. 211 */ 212 [implicit_jscontext,optional_argc] 213 jsval import(in AUTF8String aResourceURI, [optional] in jsval targetObj); 214 215 /** 216 * Returns true if the js file located at 'registryLocation' location has 217 * been loaded previously via the import method above. Returns false 218 * otherwise. 219 * 220 * @param resourceURI A resource:// URI string representing the location of 221 * the js file to be checked if it is already loaded or not. 222 * @returns boolean, true if the js file has been loaded via import. false 223 * otherwise 224 */ 225 boolean isModuleLoaded(in AUTF8String aResourceURI); 226 227 /* 228 * Unloads the JS module at 'registryLocation'. Existing references to the 229 * module will continue to work but any subsequent import of the module will 230 * reload it and give new reference. If the JS module hasn't yet been 231 * imported then this method will do nothing. 232 * 233 * @param resourceURI A resource:// URI string to unload the module from. 234 */ 235 void unload(in AUTF8String registryLocation); 236 237 /* 238 * Imports global properties (like DOM constructors) into the scope, defining 239 * them on the caller's global. aPropertyList should be an array of property 240 * names. 241 * 242 * See xpc::GlobalProperties::Parse for the current list of supported 243 * properties. 244 */ 245 [implicit_jscontext] 246 void importGlobalProperties(in jsval aPropertyList); 247 248 /* 249 * To be called from JS only. 250 * 251 * Return a weak reference for the given JS object. 252 */ 253 [implicit_jscontext] 254 xpcIJSWeakReference getWeakReference(in jsval obj); 255 256 /* 257 * To be called from JS only. 258 * 259 * Force an immediate garbage collection cycle. 260 */ 261 [implicit_jscontext] 262 void forceGC(); 263 264 /* 265 * To be called from JS only. 266 * 267 * Force an immediate cycle collection cycle. 268 */ 269 void forceCC([optional] in nsICycleCollectorListener aListener); 270 271 /* 272 * To be called from JS only. C++ callers should use the 273 * nsCycleCollector_createLogger() function instead. 274 * 275 * Create an instance of the built-in cycle collector logger object. 276 */ 277 nsICycleCollectorListener createCCLogger(); 278 279 /* 280 * To be called from JS only. 281 * 282 * If any incremental CC is in progress, finish it. For testing. 283 */ 284 void finishCC(); 285 286 /* 287 * To be called from JS only. 288 * 289 * Do some cycle collector work, with the given work budget. 290 * The cost of calling Traverse() on a single object is set as 1. 291 * For testing. 292 */ 293 void ccSlice(in long long budget); 294 295 /* 296 * To be called from JS only. 297 * 298 * Return the longest cycle collector slice time since the last 299 * time clearMaxCCTime() was called. 300 */ 301 long getMaxCCSliceTimeSinceClear(); 302 303 /* 304 * To be called from JS only. 305 * 306 * Reset the internal max slice time value used for 307 * getMaxCCSliceTimeSinceClear(). 308 */ 309 void clearMaxCCTime(); 310 311 /* 312 * To be called from JS only. 313 * 314 * Force an immediate shrinking garbage collection cycle. 315 */ 316 [implicit_jscontext] 317 void forceShrinkingGC(); 318 319 /* 320 * Schedule a garbage collection cycle for a point in the future when no JS 321 * is running. Call the provided function once this has occurred. 322 */ 323 void schedulePreciseGC(in nsIScheduledGCCallback callback); 324 325 /* 326 * Schedule a shrinking garbage collection cycle for a point in the future 327 * when no JS is running. Call the provided function once this has occured. 328 */ 329 void schedulePreciseShrinkingGC(in nsIScheduledGCCallback callback); 330 331 /* 332 * In a debug build, unlink any ghost windows. This is only for debugging 333 * leaks, and can cause bad things to happen if called. 334 */ 335 void unlinkGhostWindows(); 336 337 /* 338 * In an NS_FREE_PERMANENT_DATA build, intentionally leak a C++ object. This 339 * is needed to test leak checking. 340 */ 341 void intentionallyLeak(); 342 343 [implicit_jscontext] 344 jsval getJSTestingFunctions(); 345 346 /** 347 * Returns an object containing `filename` and `lineNumber` properties 348 * describing the source location of the given function. 349 */ 350 [implicit_jscontext] 351 jsval getFunctionSourceLocation(in jsval func); 352 353 /* 354 * To be called from JS only. 355 * 356 * Call 'function', using the provided stack as the async stack responsible 357 * for the call, and propagate its return value or the exception it throws. 358 * The function is called with no arguments, and 'this' is 'undefined'. 359 * 360 * The code in the function will see the given stack frame as the 361 * asyncCaller of its own stack frame, instead of the current caller. 362 */ 363 [implicit_jscontext] 364 jsval callFunctionWithAsyncStack(in jsval function, in nsIStackFrame stack, 365 in AString asyncCause); 366 367 /* 368 * To be called from JS only. 369 * 370 * Returns the global object with which the given object is associated. 371 * 372 * @param obj The JavaScript object whose global is to be gotten. 373 * @return the corresponding global. 374 */ 375 [implicit_jscontext] 376 jsval getGlobalForObject(in jsval obj); 377 378 /* 379 * To be called from JS only. 380 * 381 * Returns the true if the object is a (scripted) proxy. 382 * NOTE: Security wrappers are unwrapped first before the check. 383 */ 384 [implicit_jscontext] 385 boolean isProxy(in jsval vobject); 386 387 /* 388 * To be called from JS only. 389 * 390 * Instead of simply wrapping a function into another compartment, 391 * this helper function creates a native function in the target 392 * compartment and forwards the call to the original function. 393 * That call will be different than a regular JS function call in 394 * that, the |this| is left unbound, and all the non-native JS 395 * object arguments will be cloned using the structured clone 396 * algorithm. 397 * The return value is the new forwarder function, wrapped into 398 * the caller's compartment. 399 * The 3rd argument is an optional options object: 400 * - defineAs: the name of the property that will 401 * be set on the target scope, with 402 * the forwarder function as the value. 403 */ 404 [implicit_jscontext] 405 jsval exportFunction(in jsval vfunction, in jsval vscope, [optional] in jsval voptions); 406 407 /* 408 * To be called from JS only. 409 * 410 * Returns an object created in |vobj|'s compartment. 411 * If defineAs property on the options object is a non-null ID, 412 * the new object will be added to vobj as a property. Also, the 413 * returned new object is always automatically waived (see waiveXrays). 414 */ 415 [implicit_jscontext] 416 jsval createObjectIn(in jsval vobj, [optional] in jsval voptions); 417 418 /* 419 * To be called from JS only. 420 * 421 * Ensures that all functions come from vobj's scope (and aren't cross 422 * compartment wrappers). 423 */ 424 [implicit_jscontext] 425 void makeObjectPropsNormal(in jsval vobj); 426 427 /** 428 * Determines whether this object is backed by a DeadObjectProxy. 429 * 430 * Dead-wrapper objects hold no other objects alive (they have no outgoing 431 * reference edges) and will throw if you touch them (e.g. by 432 * reading/writing a property). 433 */ 434 bool isDeadWrapper(in jsval obj); 435 436 /** 437 * Determines whether this value is a remote object proxy, such as 438 * RemoteWindowProxy or RemoteLocationProxy, for an out-of-process frame. 439 * 440 * Remote object proxies do not grant chrome callers the same exemptions 441 * to the same-origin-policy that in-process wrappers typically do, so 442 * this can be used to determine whether access to cross-origin proxies is 443 * safe: 444 * 445 * if (!Cu.isRemoteProxy(frame.contentWindow)) { 446 * frame.contentWindow.doCrossOriginThing(); 447 * } 448 */ 449 bool isRemoteProxy(in jsval val); 450 451 /* 452 * To be called from JS only. This is for Gecko internal use only, and may 453 * disappear at any moment. 454 * 455 * Forces a recomputation of all wrappers in and out of the compartment 456 * containing |vobj|. If |vobj| is not an object, all wrappers system-wide 457 * are recomputed. 458 */ 459 [implicit_jscontext] 460 void recomputeWrappers([optional] in jsval vobj); 461 462 /* 463 * To be called from JS only. This is for Gecko internal use only, and may 464 * disappear at any moment. 465 * 466 * Enables Xray vision for same-compartment access for the compartment 467 * indicated by |vscope|. All outgoing wrappers are recomputed. 468 * 469 * This must not be called on chrome (system-principal) scopes. 470 */ 471 [implicit_jscontext] 472 void setWantXrays(in jsval vscope); 473 474 /* 475 * Dispatches a runnable to the current/main thread. If |scope| is passed, 476 * the runnable will be dispatch in the compartment of |scope|, which 477 * affects which error reporter gets called. 478 */ 479 [implicit_jscontext] 480 void dispatch(in jsval runnable, [optional] in jsval scope); 481 482 /* 483 * Bug 1621603 - Remove strict_mode. 484 * 485 * Do not use this API! Instead use "use strict"; at the top of your JS 486 * file. 487 */ 488 [implicit_jscontext] 489 attribute boolean strict_mode; 490 491 // Returns true if we're running in automation and certain security 492 // restrictions can be eased. 493 readonly attribute boolean isInAutomation; 494 495 // Called by automated tests to exit immediately after we are done getting 496 // test results. 497 void exitIfInAutomation(); 498 499 void crashIfNotInAutomation(); 500 501 [implicit_jscontext] 502 void setGCZeal(in long zeal); 503 504 [implicit_jscontext] 505 void nukeSandbox(in jsval obj); 506 507 /* 508 * API to dynamically block script for a given global. This takes effect 509 * immediately, unlike other APIs that only affect newly-created globals. 510 * 511 * The machinery here maintains a counter, and allows script only if each 512 * call to blockScriptForGlobal() has been matched with a call to 513 * unblockScriptForGlobal(). The caller _must_ make sure never to call 514 * unblock() more times than it calls block(), since that could potentially 515 * interfere with another consumer's script blocking. 516 */ 517 518 [implicit_jscontext] 519 void blockScriptForGlobal(in jsval global); 520 521 [implicit_jscontext] 522 void unblockScriptForGlobal(in jsval global); 523 524 /** 525 * Check whether the given object is an opaque wrapper (PermissiveXrayOpaque). 526 */ 527 bool isOpaqueWrapper(in jsval obj); 528 529 /** 530 * Check whether the given object is an XrayWrapper. 531 */ 532 bool isXrayWrapper(in jsval obj); 533 534 /** 535 * Waive Xray on a given value. Identity op for primitives. 536 */ 537 [implicit_jscontext] 538 jsval waiveXrays(in jsval aVal); 539 540 /** 541 * Strip off Xray waivers on a given value. Identity op for primitives. 542 */ 543 [implicit_jscontext] 544 jsval unwaiveXrays(in jsval aVal); 545 546 /** 547 * Gets the name of the JSClass of the object. 548 * 549 * if |aUnwrap| is true, all wrappers are unwrapped first. Unless you're 550 * specifically trying to detect whether the object is a proxy, this is 551 * probably what you want. 552 */ 553 [implicit_jscontext] 554 string getClassName(in jsval aObj, in bool aUnwrap); 555 556 /** 557 * Get a DOM classinfo for the given classname. Only some class 558 * names are supported. 559 */ 560 nsIClassInfo getDOMClassInfo(in AString aClassName); 561 562 /** 563 * Gets the incument global for the execution of this function. For internal 564 * and testing use only. 565 * 566 * If |callback| is passed, it is invoked with the incumbent global as its 567 * sole argument. This allows the incumbent global to be measured in callback 568 * environments with no scripted frames on the stack. 569 */ 570 [implicit_jscontext] 571 jsval getIncumbentGlobal([optional] in jsval callback); 572 573 /** 574 * Forces the generation of an XPCWrappedJS for a given object. For internal 575 * and testing use only. This is only useful to set up wrapper map conditions 576 * for a testcase. The return value is not an XPCWrappedJS itself, but an 577 * opaque nsISupports holder that keeps the underlying XPCWrappedJS alive. 578 * 579 * if |scope| is passed, the XPCWrappedJS is generated in the scope of that object. 580 */ 581 [implicit_jscontext] 582 nsISupports generateXPCWrappedJS(in jsval obj, [optional] in jsval scope); 583 584 /** 585 * Retrieve the last time, in microseconds since epoch, that a given 586 * watchdog-related event occured. 587 * 588 * Valid categories: 589 * "ContextStateChange" - Context switching between active and inactive states 590 * "WatchdogWakeup" - Watchdog waking up from sleeping 591 * "WatchdogHibernateStart" - Watchdog begins hibernating 592 * "WatchdogHibernateStop" - Watchdog stops hibernating 593 */ 594 PRTime getWatchdogTimestamp(in AString aCategory); 595 596 [implicit_jscontext] 597 jsval getJSEngineTelemetryValue(); 598 599 /* 600 * Clone an object into a scope. 601 * The 3rd argument is an optional options object: 602 * - cloneFunctions: boolean. If true, functions in the value are 603 * wrapped in a function forwarder that appears to be a native function in 604 * the content scope. Defaults to false. 605 * - wrapReflectors: boolean. If true, DOM objects are passed through the 606 * clone directly with cross-compartment wrappers. Otherwise, the clone 607 * fails when such an object is encountered. Defaults to false. 608 */ 609 [implicit_jscontext] 610 jsval cloneInto(in jsval value, in jsval scope, [optional] in jsval options); 611 612 /* 613 * When C++-Implemented code does security checks, it can generally query 614 * the subject principal (i.e. the principal of the most-recently-executed 615 * script) in order to determine the responsible party. However, when an API 616 * is implemented in JS, this doesn't work - the most-recently-executed 617 * script is always the System-Principaled API implementation. So we need 618 * another mechanism. 619 * 620 * Hence the notion of the "WebIDL Caller". If the current Entry Script on 621 * the Script Settings Stack represents the invocation of JS-implemented 622 * WebIDL, this API returns the principal of the caller at the time 623 * of invocation. Otherwise (i.e. outside of JS-implemented WebIDL), this 624 * function throws. If it throws, you probably shouldn't be using it. 625 */ 626 nsIPrincipal getWebIDLCallerPrincipal(); 627 628 /* 629 * Gets the principal of a script object, after unwrapping any cross- 630 * compartment wrappers. 631 */ 632 [implicit_jscontext] 633 nsIPrincipal getObjectPrincipal(in jsval obj); 634 635 /* 636 * Gets the URI or identifier string associated with an object's 637 * realm (the same one used by the memory reporter machinery). 638 * 639 * Unwraps cross-compartment wrappers first. 640 * 641 * The string formats and values may change at any time. Do not depend on 642 * this from addon code. 643 */ 644 [implicit_jscontext] 645 ACString getRealmLocation(in jsval obj); 646 647 /* 648 * Return a fractional number of milliseconds from process 649 * startup, measured with a monotonic clock. 650 */ 651 double now(); 652 653 /* 654 * Reads the given file and returns its contents. If called during early 655 * startup, the file will be pre-read on a background thread during profile 656 * startup so its contents will be available the next time they're read. 657 * 658 * The file must be a text file encoded in UTF-8. Otherwise the result is 659 * undefined. 660 */ 661 AUTF8String readUTF8File(in nsIFile file); 662 663 /* 664 * Reads the given local file URL and returns its contents. This has the 665 * same semantics of readUTF8File. 666 * Only supports file URLs or URLs that point into one of the omnijars. 667 */ 668 AUTF8String readUTF8URI(in nsIURI url); 669 670 /* Create a spellchecker object. */ 671 nsIEditorSpellCheck createSpellChecker(); 672 673 /* Create a commandline object. 674 * 675 * @return a new `nsICommandLine` instance. 676 * 677 * @param args 678 * The arguments of the command line, not including the app/program itself. 679 * @param workingDir 680 * An optional working directory for the command line. 681 * @param state 682 * The command line's state, one of `nsICommandLine.STATE_INITIAL_LAUNCH`, 683 * `nsICommandLine.STATE_REMOTE_AUTO`, or 684 * `nsICommandLine.STATE_REMOTE_EXPLICIT`. 685 */ 686 nsISupports createCommandLine(in Array<ACString> args, 687 in nsIFile workingDir, 688 in unsigned long state); 689 690 /* Create a command params object. */ 691 nsICommandParams createCommandParams(); 692 693 /* Create a loadcontext object. */ 694 nsILoadContext createLoadContext(); 695 696 /* Create a private loadcontext object. */ 697 nsILoadContext createPrivateLoadContext(); 698 699 /* Create a persistent property object. */ 700 nsIPersistentProperties createPersistentProperties(); 701 702 /* Create a document encoder object. */ 703 nsIDocumentEncoder createDocumentEncoder(in string contentType); 704 705 /* Create an HTML copy encoder object. */ 706 nsIDocumentEncoder createHTMLCopyEncoder(); 707 708 // These attributes are for startup testing purposes. They are not expected 709 // to be used for production code. 710 readonly attribute Array<ACString> loadedModules; 711 readonly attribute Array<ACString> loadedComponents; 712 713 // These 2 functions will only return useful values if the 714 // "browser.startup.record" preference was true at the time the JS file 715 // was loaded. 716 ACString getModuleImportStack(in AUTF8String aLocation); 717 ACString getComponentLoadStack(in AUTF8String aLocation); 718}; 719 720/** 721* Interface for the 'Components' object. 722*/ 723 724[scriptable, builtinclass, uuid(aa28aaf6-70ce-4b03-9514-afe43c7dfda8)] 725interface nsIXPCComponents : nsISupports 726{ 727 readonly attribute nsIXPCComponents_Interfaces interfaces; 728 readonly attribute nsIXPCComponents_Results results; 729 730 boolean isSuccessCode(in nsresult result); 731 732 readonly attribute nsIXPCComponents_Classes classes; 733 // Will return null if there is no JS stack right now. 734 readonly attribute nsIStackFrame stack; 735 readonly attribute nsIComponentManager manager; 736 readonly attribute nsIXPCComponents_Utils utils; 737 738 readonly attribute nsIXPCComponents_ID ID; 739 readonly attribute nsIXPCComponents_Exception Exception; 740 readonly attribute nsIXPCComponents_Constructor Constructor; 741 742 [implicit_jscontext] 743 // A javascript component can set |returnCode| to specify an nsresult to 744 // be returned without throwing an exception. 745 attribute jsval returnCode; 746}; 747