goog.Disposable | |
goog.messaging.AbstractChannel | goog.Disposable |
goog.net.xpc.CrossPageChannel | goog.messaging.AbstractChannel |
cfg
: Object
Channel configuration object.
|
opt_domHelper
: goog.dom.DomHelper=
The optional dom helper to
use for looking up elements in the dom.
|
![]()
Clean up after any incomplete attempt to establish and connect to a peer
iframe.
|
code » | ||||
![]()
Closes the channel.
|
code » | ||||
![]()
Initiates connecting the channel. When this method is called, all the
information needed to connect the channel has to be available.
Arguments:
|
code » | ||||
![]()
Continues the connection process once we're as sure as we can be that the
peer iframe has been created.
|
code » | ||||
![]()
Creates the iframe containing the peer page in a specified parent element.
This method does not connect the channel, connect() still has to be called
separately.
Arguments:
Returns: !HTMLIFrameElement
The iframe element.
|
code » | ||||
![]()
Creates the transport for this channel. Chooses from the available
transport based on the user agent and the configuration.
|
code » | ||||
![]()
Determine which transport type to use for this channel / useragent.
Returns: goog.net.xpc.TransportTypes | undefined
The best transport type.
|
code » | ||||
![]()
No description.
|
code » | ||||
Escape the user-provided service name for sending across the channel. This
URL-encodes certain special characters so they don't conflict with delimiters
used by some of the transports, and adds a special prefix if the name
conflicts with the reserved transport service name.
This is the opposite of
#unescapeServiceName_ .
|
code » | ||||
Returns the configuration object for this channel.
Package private. Do not call from outside goog.net.xpc.
Returns: Object
The configuration object for this channel.
|
code » | ||||
Returns a reference to the iframe-element.
Package private. Do not call from outside goog.net.xpc.
Returns: Object
A reference to the iframe-element.
|
code » | ||||
No description.
Returns: !Object
Configuration-object to be used by the peer to
initialize the channel.
|
code » | ||||
Returns the peer URI, with an optional URL parameter for configuring the peer
window.
Arguments:
Returns: !goog.Uri
The peer URI.
|
code » | ||||
Returns the window object the foreign document resides in.
Package private. Do not call from outside goog.net.xpc.
Returns: Object
The window object of the peer.
|
code » | ||||
Returns the role of this channel (either inner or outer).
Returns: number
The role of this channel.
|
code » | ||||
Returns the tranport name in use for this channel.
Returns: string
The transport name.
|
code » | ||||
Returns the transport type in use for this channel.
Returns: number
Transport-type identifier.
|
code » | ||||
No description.
Returns: boolean
Whether the channel is connected.
|
code » | ||||
Returns whether an incoming message with the given origin is acceptable.
If an incoming request comes with a specified (non-empty) origin, and the
PEER_HOSTNAME config parameter has also been provided, the two must match,
or the message is unacceptable.
Arguments:
Returns: boolean
Whether the message is acceptable.
|
code » | ||||
Determines whether the peer window is available (e.g. not closed).
Package private. Do not call from outside goog.net.xpc.
Returns: boolean
Whether the peer window is available.
|
code » | ||||
![]()
Package-private.
Called by the transport when the channel is connected.
Arguments:
|
code » | ||||
![]()
Alias for notifyConected, for backward compatibility reasons.
|
code » | ||||
![]()
Called by the transport in case of an unrecoverable failure.
Package private. Do not call from outside goog.net.xpc.
|
code » | ||||
![]()
No description.
|
code » | ||||
![]()
Sets the window object the foreign document resides in.
Arguments:
|
code » | ||||
Unescape the escaped service name that was sent across the channel. This is
the opposite of
#escapeServiceName_ .
|
code » | ||||
![]()
Sets the channel name. Note, this doesn't establish a unique channel to
communicate on.
Arguments:
|
code » | ||||
![]()
Delivers messages to the appropriate service-handler. Named xpcDeliver to
avoid name conflict with
deliver function in superclass
goog.messaging.AbstractChannel.
Package private. Do not call from outside goog.net.xpc.
Arguments:
|
code » |
![]()
Immediately calls opt_connectCb if given, and is otherwise a no-op. If
subclasses have configuration that needs to happen before the channel is
connected, they should override this and
#isConnected .
|
code » | |
Converts the message payload into the format expected by the registered
service (either JSON or string).
|
code » | |
![]()
The default service to be run when no other services match.
|
code » | |
![]()
Delivers a message to the appropriate service. This is meant to be called by
subclasses when they receive messages.
This method takes into account both explicitly-registered and default
services, as well as making sure that JSON payloads are decoded when
necessary. If the subclass is capable of passing objects as payloads, those
objects can be passed in to this method directly. Otherwise, the (potentially
JSON-encoded) strings should be passed in.
|
code » | |
![]()
No description.
|
code » | |
![]()
Find the service object for a given service name. If there's no service
explicitly registered, but there is a default service, a service object is
constructed for it.
|
code » | |
![]()
Always returns true. If subclasses have configuration that needs to happen
before the channel is connected, they should override this and
#connect .
|
code » | |
![]()
No description.
|
code » | |
![]()
No description.
|
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 » |
![]()
The configuration for this channel.
|
Code » | |
A delay between the transport reporting as connected and the calling of the
connection callback. Sometimes used to paper over timing vulnerabilities.
|
Code » | |
![]()
No description.
|
Code » | |
![]()
Collects deferred function calls which will be made once the connection
has been fully set up.
|
Code » | |
The dom helper to use for accessing the dom.
|
Code » | |
![]()
Reference to the iframe-element.
|
Code » | |
![]()
The name of the channel. Please use
updateChannelNameAndCatalog to change this from the transports
vs changing the property directly.
|
Code » | |
An event handler used to listen for load events on peer iframes.
|
Code » | |
A deferred which is set to non-null while a peer iframe is being created
but has not yet thrown its load event, and which fires when that load event
arrives.
|
Code » | |
![]()
Reference to the window-object of the peer page.
|
Code » | |
![]()
The channel state.
|
Code » | |
The transport.
|
Code » |
![]()
Disposes all channels.
|
code » |
![]()
Regexp for escaping service names.
|
Code » | |
![]()
Regexp for unescaping service names.
|
Code » | |
![]()
No description.
|
Code » |