goog.Disposable | |
goog.net.xpc.Transport | goog.Disposable |
goog.net.xpc.NativeMessagingTransport | goog.net.xpc.Transport |
channel
: goog.net.xpc.CrossPageChannel
The channel this
transport belongs to.
|
peerHostname
: string
The hostname (protocol, domain, and port) of the
peer.
|
opt_domHelper
: goog.dom.DomHelper=
The dom helper to use for
finding the correct window/document.
|
opt_oneSidedHandshake
: boolean=
If this is true, only the outer
transport sends a SETUP message and expects a SETUP_ACK. The inner
transport goes connected when it receives the SETUP.
|
opt_protocolVersion
: number=
Which version of its setup protocol the
transport should use. The default is '2'.
|
![]()
Connects this transport.
|
code » | ||
Checks whether the peer transport protocol version could be as indicated.
|
code » | ||
![]()
No description.
|
code » | ||
![]()
Connects to other peer. In the case of the outer peer, the setup messages are
likely sent before the inner peer is ready to receive them. Therefore, this
function will continue trying to send the SETUP message until the inner peer
responds. In the case of the inner peer, it will occasionally have its
channel name fall out of sync with the outer peer, particularly during
soft-reloads and history navigations.
|
code » | ||
![]()
Notify the channel that this transport is connected. If either transport is
protocol v1, a short delay is required to paper over timing vulnerabilities
in that protocol version.
|
code » | ||
![]()
Sends a message.
|
code » | ||
![]()
Sends a SETUP_ACK transport service message of the correct protocol number
for our current situation.
Arguments:
|
code » | ||
![]()
Sends a SETUP transport service message of the correct protocol number for
our current situation.
|
code » | ||
![]()
Attempts to set the peer protocol number. Downgrades from 2 to 1 are not
permitted.
Arguments:
|
code » | ||
![]()
Handles transport service messages.
Arguments:
|
code » |
Return the transport name.
Returns: string
the transport name.
|
code » | ||
No description.
Returns: number
The transport type identifier.
|
code » | ||
Returns the window associated with this transport instance.
Returns: !Window
The window to use.
|
code » | ||
![]()
Sends a message.
|
code » | ||
![]()
Handles transport service messages (internal signalling).
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 » |
The channel this transport belongs to.
|
Code » | |
Fires once we're marked connected.
|
Code » | |
![]()
No description.
|
Code » | |
![]()
The unique ID of this side of the connection. Used to determine when a peer
is reloaded.
|
Code » | |
The event handler.
|
Code » | |
![]()
Flag indicating if this instance of the transport has been initialized.
|
Code » | |
Timer for connection reattempts.
|
Code » | |
![]()
Whether one-sided handshakes are enabled.
|
Code » | |
![]()
The unique ID of the peer. If we get a message from a peer with an ID we
don't expect, we reset the connection.
|
Code » | |
![]()
The hostname of the peer. This parameterizes all calls to postMessage, and
should contain the precise protocol, domain, and port of the peer window.
|
Code » | |
![]()
Current determination of peer's protocol version, or null for unknown.
|
Code » | |
![]()
Which version of the transport's protocol should be used.
|
Code » | |
Fires once we've received our SETUP_ACK message.
|
Code » | |
Fires once we've sent our SETUP_ACK message.
|
Code » | |
![]()
The transport type.
|
Code » |
![]()
Connects this transport.
The transport implementation is expected to call
CrossPageChannel.prototype.notifyConnected when the channel is ready
to be used.
|
Code » | |
![]()
No description.
|
Code » | |
The dom helper to use for finding the window objects to reference.
|
Code » | |
![]()
The transport type.
|
Code » |
![]()
Initializes this transport. Registers a listener for 'message'-events
on the document.
Arguments:
|
code » | ||
Processes an incoming message-event.
Arguments:
Returns: boolean
True if message was successfully delivered to a channel.
|
code » | ||
Parse a transport service payload message. For v1, it is simply expected to
be 'SETUP' or 'SETUP_ACK'. For v2, an example setup message is
'SETUP_NTPV2,abc123', where the second part is the endpoint id. The v2 setup
ack message is simply 'SETUP_ACK_NTPV2'.
|
code » |
![]()
Length of the delay in milliseconds between the channel being connected and
the connection callback being called, in cases where coverage of timing flaws
is required.
|
Code » | |
![]()
The delimiter used for transport service messages.
|
Code » | |
![]()
Tracks the number of NativeMessagingTransport channels that have been
initialized but not disposed yet in a map keyed by the UID of the window
object. This allows for multiple windows to be initiallized and listening
for messages.
|
Code » | |
![]()
Id of a timer user during postMessage sends.
|
Code » | |
![]()
No description.
|
Code » |