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