goog.net.xpc.CrossPageChannel
Classgoog.net.xpc.CrossPageChannel
> goog.messaging.AbstractChannel
> goog.Disposable
goog.net.xpc.CrossPageChannel(cfg, opt_domHelper)
A communication channel between two documents from different domains. Provides asynchronous messaging.
cfg
{Object
}
opt_domHelper
{goog.dom.DomHelper
=}
.addOnDisposeCallback(callback, opt_scope)
Inherited from goog.Disposable
.
Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added.
callback
{!Function
}
opt_scope
{Object
=}
.close()
Closes the channel.
.connect(opt_connectCb)
Initiates connecting the channel. When this method is called, all the information needed to connect the channel has to be available.
opt_connectCb
{Function
=}
.createPeerIframe(parentElm, opt_configureIframeCb, opt_addCfgParam)
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.
parentElm
{!Element
}
opt_configureIframeCb
{Function
=}
opt_addCfgParam
{boolean
=}
HTMLIFrameElement
}
.creationStack
{string
}Inherited from goog.Disposable
.
If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.
.decodePayload(serviceName, payload, objectPayload)
[protected]Inherited from goog.messaging.AbstractChannel
.
Converts the message payload into the format expected by the registered service (either JSON or string).
serviceName
{string
}
payload
{string
|!Object
}
objectPayload
{boolean
}
string
|Object
}
.deliver(serviceName, payload)
[protected]Inherited from goog.messaging.AbstractChannel
.
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.
serviceName
{string
}
payload
{string
|!Object
}
.dispose()
Inherited from goog.Disposable
.
Disposes of the object. If the object hasn't already been disposed of, calls {@link #disposeInternal}. Classes that extend {@code goog.Disposable} should override {@link #disposeInternal} in order to delete references to COM objects, DOM nodes, and other disposable objects. Reentrant.
void
}
.disposeInternal()
[protected]Deletes or nulls out any references to COM objects, DOM nodes, or other disposable objects. Classes that extend {@code goog.Disposable} should override this method. Not reentrant. To avoid calling it twice, it must only be called from the subclass' {@code disposeInternal} method. Everywhere else the public {@code dispose} method must be used. For example:
mypackage.MyClass = function() { goog.base(this); // Constructor logic specific to MyClass. ... }; goog.inherits(mypackage.MyClass, goog.Disposable); mypackage.MyClass.prototype.disposeInternal = function() { goog.base(this, 'disposeInternal'); // Dispose logic specific to MyClass. ... };
.getDisposed
[deprecated]Deprecated. Use {@link #isDisposed} instead.
Inherited from goog.Disposable
.
boolean
}
.getPeerConfiguration()
Object
}
.getPeerUri(opt_addCfgParam)
Returns the peer URI, with an optional URL parameter for configuring the peer window.
opt_addCfgParam
{boolean
=}
goog.Uri
}
.getPeerWindowObject()
Returns the window object the foreign document resides in. Package private.
Object
}
.getRole()
Returns the role of this channel (either inner or outer).
number
}
.getService(serviceName, payload)
[protected]Inherited from goog.messaging.AbstractChannel
.
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.
serviceName
{string
}
payload
{string
|!Object
}
callback
: function
((string
|!Object
)), objectPayload
: boolean
}}
.getTransportName()
Returns the tranport name in use for this channel.
string
}
.getTransportType()
Returns the transport type in use for this channel.
number
}
.isConnected()
Always returns true. If subclasses have configuration that needs to happen before the channel is connected, they should override this and {@link #connect}.
boolean
}
.isDisposed()
Inherited from goog.Disposable
.
boolean
}
.isPeerAvailable()
Determines whether the peer window is available (e.g. not closed). Package private.
boolean
}
.logger
[protected] {goog.debug.Logger
}Inherited from goog.messaging.AbstractChannel
.
Logger for this class.
.name
{string
}The name of the channel.
.notifyConnected(opt_delay)
Package-private. Called by the transport when the channel is connected.
opt_delay
{number
=}
.registerDefaultService()
Inherited from goog.messaging.AbstractChannel
.
.registerDisposable(disposable)
Inherited from goog.Disposable
.
Associates a disposable object with this object so that they will be disposed together.
disposable
{goog.disposable.IDisposable
}
.registerService()
Inherited from goog.messaging.AbstractChannel
.
.safeDeliver(serviceName, payload, opt_origin)
Delivers messages to the appropriate service-handler.
serviceName
{string
}
payload
{string
}
opt_origin
{string
=}
.send()
.setPeerWindowObject(peerWindowObject)
Sets the window object the foreign document resides in.
peerWindowObject
{Object
}