goog.Disposable | |
goog.module.ModuleManager | goog.Disposable |
![]()
Loads a single module for use with a given deferred.
Arguments:
|
code » | |||||||
![]()
Ensures that the module with the given id is listed as a user-initiated
module that is being loaded. This method guarantees that a module will never
get listed more than once.
Arguments:
|
code » | |||||||
![]()
Method called just after module code is loaded
Arguments:
|
code » | |||||||
![]()
Method called just before a module code is loaded.
Arguments:
|
code » | |||||||
![]()
Dispatches an ACTIVE or IDLE event if necessary.
|
code » | |||||||
![]()
Handles when a module load failed.
Arguments:
|
code » | |||||||
![]()
No description.
|
code » | |||||||
![]()
Requests that a function be called once a particular module is loaded.
Client code can use this method to safely call into modules that may not yet
be loaded. For consistency, this method always calls the function
asynchronously -- even if the module is already loaded. Initiates loading of
the module if necessary, unless opt_noLoad is true.
Arguments:
Returns: goog.module.ModuleLoadCallback
A callback wrapper that exposes
an abort and execute method.
|
code » | |||||||
![]()
Call the callback functions of the specified type.
Arguments:
|
code » | |||||||
Gets the amount of delay to wait before sending a request for more modules.
If a certain module request fails, we backoff a little bit and try again.
Returns: number
Delay, in ms.
|
code » | |||||||
Gets the application-specific module loader.
Returns: goog.module.AbstractModuleLoader
An object that has a
loadModules(ids, moduleInfoMap, opt_successFn, opt_errFn,
opt_timeoutFn, opt_forceReload) method.
|
code » | |||||||
Gets the module context to use to initialize the module.
Returns: Object
The context.
|
code » | |||||||
Gets a module info object by id.
Arguments:
Returns: goog.module.ModuleInfo
The module info.
|
code » | |||||||
Builds a list of the ids of the not-yet-loaded modules that a particular
module transitively depends on, including itself.
|
code » | |||||||
![]()
Handles a module load failure.
Arguments:
|
code » | |||||||
![]()
Handles a module load timeout.
|
code » | |||||||
Determines if the ModuleManager is active
Returns: boolean
TRUE iff the ModuleManager is active (i.e., not idle).
|
code » | |||||||
Gets whether a module is currently loading or in the queue, waiting to be
loaded.
|
code » | |||||||
Determines if the ModuleManager is user active
Returns: boolean
TRUE iff the ModuleManager is user active (i.e., not idle).
|
code » | |||||||
Loads a module, returning a goog.async.Deferred for keeping track of the
result.
Arguments:
Returns: goog.async.Deferred
A deferred object.
|
code » | |||||||
![]()
Loads a list of modules or, if some other module is currently being loaded,
appends the ids to the queue of requested module ids. Registers callbacks a
module that is currently loading and returns a fired deferred for a module
that is already loaded.
|
code » | |||||||
![]()
Initiates loading of a list of modules or, if a module is currently being
loaded, appends the modules to the queue of requested module ids.
The caller should verify that the requested modules are not already loaded or
loading.
#loadModulesOrEnqueueIfNotLoadedOrLoading_ is a more lenient
alternative to this method.
|
code » | |||||||
![]()
Loads a list of modules and any of their not-yet-loaded prerequisites.
If batch mode is enabled, the prerequisites will be loaded together with the
requested modules and all requested modules will be loaded at the same time.
The caller should verify that the requested modules are not already loaded
and that no modules are currently loading before calling this method.
|
code » | |||||||
Loads a list of modules, returning a goog.async.Deferred for keeping track of
the result.
|
code » | |||||||
![]()
Loads the next modules on the queue.
|
code » | |||||||
![]()
If we are still loading the base module, consider the load complete.
|
code » | |||||||
![]()
Prefetches a JavaScript module and its dependencies, which means that the
module will be downloaded, but not evaluated. To complete the module load,
the caller should also call load or execOnLoad after prefetching the module.
Arguments:
|
code » | |||||||
Preloads a module after a short delay.
Arguments:
Returns: !goog.async.Deferred
A deferred object.
|
code » | |||||||
Processes a list of module ids for loading. Checks if any of the modules are
already loaded and then gets transitive deps. Queues any necessary modules
if batch mode is not enabled. Returns the list of ids that should be loaded.
|
code » | |||||||
![]()
The function to call if the module manager is in error.
|
code » | |||||||
![]()
Register a callback for the specified callback type.
Arguments:
|
code » | |||||||
![]()
Register an initialization callback for the currently loading module. This
should only be called by script that is executed during the evaluation of
a module's javascript. This is almost equivalent to calling the function
inline, but ensures that all the code from the currently loading module
has been loaded. This makes it cleaner and more robust than calling the
function inline.
If this function is called from the base module (the one that contains
the module manager code), the callback is held until #setAllModuleInfo
is called, or until #setModuleContext is called, whichever happens first.
Arguments:
|
code » | |||||||
![]()
Register a late initialization callback for the currently loading module.
Callbacks registered via this function are executed similar to
, but they are fired after all
initialization callbacks are called.
Arguments:
|
code » | |||||||
![]()
Registers the callbacks and handles logic if it is a user initiated module
load.
Arguments:
|
code » | |||||||
![]()
Requeues batch loads that had more than one requested module
(i.e. modules that were not included as dependencies) as separate loads or
if there was only one requested module, fails that module with the received
cause.
Arguments:
|
code » | |||||||
![]()
Sets the module info for all modules. Should only be called once.
|
code » | |||||||
![]()
Sets the module info for all modules. Should only be called once. Also
marks modules that are currently being loaded.
Arguments:
|
code » | |||||||
![]()
Sets the batch mode as enabled or disabled for the module manager.
Arguments:
|
code » | |||||||
![]()
Sets the concurrent loading mode as enabled or disabled for the module
manager. Requires a moduleloader implementation that supports concurrent
loads. The default does not.
Arguments:
|
code » | |||||||
![]()
Records that a module was loaded. Also initiates loading the next module if
any module requests are queued. This method is called by code that is
generated and appended to each dynamic module's code at compilation time.
Arguments:
|
code » | |||||||
![]()
Sets the application-specific module loader.
Arguments:
|
code » | |||||||
![]()
Sets the constructor to use for the module object for the currently
loading module. The constructor should derive from .
Arguments:
|
code » | |||||||
![]()
Sets the module context to use to initialize the module.
Arguments:
|
code » | |||||||
![]()
Sets the module uris.
Arguments:
|
code » |
![]()
Invokes a callback function when this object is disposed. Callbacks are
invoked in the order in which they were added.
Arguments:
|
code » | |||
![]()
Disposes of the object. If the object hasn't already been disposed of, calls
#disposeInternal . Classes that extend goog.Disposable should
override #disposeInternal in order to delete references to COM
objects, DOM nodes, and other disposable objects. Reentrant.
Returns: void
Nothing.
|
code » | |||
![]()
Deletes or nulls out any references to COM objects, DOM nodes, or other
disposable objects. Classes that extend
goog.Disposable should
override this method.
Not reentrant. To avoid calling it twice, it must only be called from the
subclass' disposeInternal method. Everywhere else the public
dispose method must be used.
For example:
mypackage.MyClass = function() { mypackage.MyClass.base(this, 'constructor'); // Constructor logic specific to MyClass. ... }; goog.inherits(mypackage.MyClass, goog.Disposable); mypackage.MyClass.prototype.disposeInternal = function() { // Dispose logic specific to MyClass. ... // Call superclass's disposeInternal at the end of the subclass's, like // in C++, to avoid hard-to-catch issues. mypackage.MyClass.base(this, 'disposeInternal'); }; |
code » | |||
Use
#isDisposed instead.
No description.
Returns: boolean
Whether the object has been disposed of.
|
code » | |||
No description.
Returns: boolean
Whether the object has been disposed of.
|
code » | |||
![]()
Associates a disposable object with this object so that they will be disposed
together.
Arguments:
|
code » |
Module info for the base module (the one that contains the module
manager code), which we set as the loading module so one can
register initialization callbacks in the base module.
The base module is considered loaded when #setAllModuleInfo is called or
#setModuleContext is called, whichever comes first.
|
Code » | |
![]()
Whether the batch mode (i.e. the loading of multiple modules with just one
request) has been enabled.
|
Code » | |
![]()
A map of callback types to the functions to call for the specified
callback type.
|
Code » | |
![]()
Whether the module requests may be sent out of order.
|
Code » | |
![]()
The number of consecutive failures that have happened upon module load
requests.
|
Code » | |
![]()
No description.
|
Code » | |
The module that is currently loading, or null if not loading anything.
|
Code » | |
Deferred for when all initial modules have loaded. We currently block
sending additional module requests until this deferred resolves. In a
future optimization it may be possible to use the initial modules as
seeds for the module loader "requested module ids" and start making new
requests even sooner.
|
Code » | |
![]()
Determines if the module manager was just active before the processing of
the last data.
|
Code » | |
![]()
The id of the last requested initial module. When it loaded
the deferred in
this.initialModulesLoaded_ resolves.
|
Code » | |
![]()
Tracer that measures how long it takes to load a module.
|
Code » | |
A loader for the modules that implements loadModules(ids, moduleInfoMap,
opt_successFn, opt_errorFn, opt_timeoutFn, opt_forceReload) method.
|
Code » | |
![]()
The ids of the currently loading modules. If batch mode is disabled, then
this array will never contain more than one element at a time.
|
Code » | |
A logger.
|
Code » | |
![]()
The module context needed for module initialization.
|
Code » | |
![]()
A mapping from module id to ModuleInfo object.
|
Code » | |
![]()
The requested ids of the currently loading modules. This does not include
module dependencies that may also be loading.
|
Code » | |
![]()
A queue of the ids of requested but not-yet-loaded modules. The zero
position is the front of the queue. This is a 2-D array to group modules
together with other modules that should be batch loaded with them, if
batch loading is enabled.
|
Code » | |
![]()
All module ids that have ever been requested. In concurrent loading these
are the ones to subtract from future requests.
|
Code » | |
![]()
The ids of the currently loading modules which have been initiated by user
actions.
|
Code » | |
![]()
Determines if the module manager was just user active before the processing
of the last data. The module manager is user active if any of the
user-initiated modules are loading or queued up to load.
|
Code » |
![]()
No description.
|
code » |
![]()
A non-HTTP status code indicating a corruption in loaded module.
This should be used by a ModuleLoader as a replacement for the HTTP code
given to the error handler function to indicated that the module was
corrupted.
This will set the forceReload flag on the loadModules method when retrying
module loading.
|
Code » | |
![]()
No description.
|
Code » | |
![]()
No description.
|
Code » |
![]()
The type of callbacks that can be registered with the module manager,.
Constants:
|
Code » | ||||||
![]()
The possible reasons for a module load failure callback being fired.
Constants:
|
Code » |