UNPKG

selenium-webdriver

Version:

The official WebDriver JavaScript bindings from the Selenium project

37 lines (36 loc) 12.6 kB
<!DOCTYPE html><meta charset="UTF-8"><meta http-equiv="Content-Language" content="en" /><title>goog.Disposable</title><link href="dossier.css" rel="stylesheet" type="text/css"><div id="main-wrapper"><input type="checkbox" id="sidenav-toggle" /><main><header><h1>Class goog.Disposable</h1><a class="source" href="source/lib/goog/disposable/disposable.js.src.html#l40">code &raquo;</a><dl><dt>All implemented interfaces:<dd><code><a href="interface_goog_disposable_IDisposable.html">goog.disposable.IDisposable</a></code></dl></header><section><p>Class that provides the basic implementation for disposable objects. If your class holds one or more references to COM objects, DOM nodes, or other disposable objects, it should extend this class or implement the disposable interface (defined in goog.disposable.IDisposable).<h2>Constructor</h2><div class="ctor wrap-details public"><div><div class="ctor"><span class="member">goog.Disposable <span class="args">( )</span></span></div></div></div></section><section><h2>Enumerations</h2><div class="type-summary"><table><tbody><tr><td><dl><dt><a href="enum_goog_Disposable_MonitoringMode.html">goog.Disposable.MonitoringMode</a><dd>No Description.</dl></table></div></section><div id="visibility-controls"><b>Show:</b><label for="show-public"><span><input type="checkbox" id="show-public" checked/></span>Public</label><label for="show-protected"><span><input type="checkbox" id="show-protected"/></span>Protected</label><label for="show-private"><span><input type="checkbox" id="show-private"/></span>Private</label></div><section id="instance-methods"><h2>Instance Methods</h2><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/disposable/disposable.js.src.html#l214">code &raquo;</a><code class="type">&lt;T&gt;</code> <span class="member"><a name="addOnDisposeCallback">addOnDisposeCallback</a> <span class="args">( callback, opt_scope )</span></span></div><p>Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>callback: <code class="type">function(this: T): ?</code><dd>The callback function.<dt>opt_scope: <code class="type">T=</code><dd>An optional scope to call the callback in.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/disposable/disposable.js.src.html#l175">code &raquo;</a><span class="member"><a name="dispose">dispose</a> <span class="args">( )</span> &rArr; <code class="type">void</code></span></div><p>Disposes of the object. If the object hasn't already been disposed of, calls <code class="type"><a class="unresolved-link">#disposeInternal</a></code>. Classes that extend <code >goog.Disposable</code> should override <code class="type"><a class="unresolved-link">#disposeInternal</a></code> in order to delete references to COM objects, DOM nodes, and other disposable objects. Reentrant.</summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Nothing.</dl></table></div></details></div></div><div class="wrap-details protected"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/disposable/disposable.js.src.html#l250">code &raquo;</a><span class="member"><a name="disposeInternal">disposeInternal</a> <span class="args">( )</span></span></div><p>Deletes or nulls out any references to COM objects, DOM nodes, or other disposable objects. Classes that extend <code >goog.Disposable</code> should override this method. Not reentrant. To avoid calling it twice, it must only be called from the subclass' <code >disposeInternal</code> method. Everywhere else the public <code >dispose</code> method must be used. For example: <pre> 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'); }; </pre></summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/disposable/disposable.js.src.html#l163">code &raquo;</a><span class="member deprecation-notice"><a name="getDisposed">getDisposed</a> <span class="args">( )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><div class="deprecation-notice">Deprecated: <span class="deprecation-reason">Use <code class="type"><a class="unresolved-link">#isDisposed</a></code> instead.</span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Whether the object has been disposed of.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/disposable/disposable.js.src.html#l154">code &raquo;</a><span class="member"><a name="isDisposed">isDisposed</a> <span class="args">( )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>Whether the object has been disposed of.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/disposable/disposable.js.src.html#l202">code &raquo;</a><span class="member"><a name="registerDisposable">registerDisposable</a> <span class="args">( disposable )</span></span></div><p>Associates a disposable object with this object so that they will be disposed together.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>disposable: <code class="type"><a href="interface_goog_disposable_IDisposable.html">goog.disposable.IDisposable</a></code><dd>that will be disposed when this object is disposed.</dl></table></div></details></div></div></section><section id="instance-properties"><h2>Instance Properties</h2><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/disposable/disposable.js.src.html#l147">code &raquo;</a><span class="member"><a name="creationStack">creationStack</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></span></div><p>If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/disposable/disposable.js.src.html#l131">code &raquo;</a><span class="member"><a name="disposed_">disposed_</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Whether the object has been disposed of.</summary></details></div></div><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/disposable/disposable.js.src.html#l139">code &raquo;</a><span class="member"><a name="onDisposeCallbacks_">onDisposeCallbacks_</a> : <code class="type"><a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></code></span></div><p>Callbacks to invoke when this object is disposed.</summary></details></div></div></section><section id="static-functions"><h2>Static Functions</h2><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/disposable/disposable.js.src.html#l121">code &raquo;</a><span class="member"><a name="goog.Disposable.clearUndisposedObjects">goog.Disposable.clearUndisposedObjects</a> <span class="args">( )</span></span></div><p>Clears the registry of undisposed objects but doesn't dispose of them.</summary></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/disposable/disposable.js.src.html#l107">code &raquo;</a><span class="member"><a name="goog.Disposable.getUndisposedObjects">goog.Disposable.getUndisposedObjects</a> <span class="args">( )</span> &rArr; <code class="type">!<a href="http://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Array">Array</a></code></span></div></summary><div class="info"><table><tbody><tr><th>Returns<tr><td><dl>All <code >goog.Disposable</code> objects that haven't been disposed of.</dl></table></div></details></div></div><div class="wrap-details public"><div><details class="function"><summary><div><a class="source" href="source/lib/goog/disposable/disposable.js.src.html#l266">code &raquo;</a><span class="member"><a name="goog.Disposable.isDisposed">goog.Disposable.isDisposed</a> <span class="args">( obj )</span> &rArr; <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div><p>Returns True if we can verify the object is disposed. Calls <code >isDisposed</code> on the argument if it supports it. If obj is not an object with an isDisposed() method, return false.</summary><div class="info"><table><tbody><tr><th>Parameters<tr><td><dl><dt>obj: <code class="type">*</code><dd>The object to investigate.</dl><tr><th>Returns<tr><td><dl>True if we can verify the object is disposed.</dl></table></div></details></div></div></section><section id="static-properties"><h2>Static Properties</h2><div class="wrap-details private"><div><details><summary><div><a class="source" href="source/lib/goog/disposable/disposable.js.src.html#l100">code &raquo;</a><span class="member"><a name="goog.Disposable.instances_">goog.Disposable.instances_</a> : <code class="type">!<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>.&lt;<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a>&gt;</code></span></div><p>Maps the unique ID of every undisposed <code >goog.Disposable</code> object to the object itself.</summary></details></div></div></section><section id="compiler-constants"><h2>Compiler Constants</h2><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/disposable/disposable.js.src.html#l91">code &raquo;</a><span class="member"><a name="goog.Disposable.INCLUDE_STACK_ON_CREATION">goog.Disposable.INCLUDE_STACK_ON_CREATION</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></span></div></summary></details></div></div><div class="wrap-details public"><div><details><summary><div><a class="source" href="source/lib/goog/disposable/disposable.js.src.html#l84">code &raquo;</a><span class="member"><a name="goog.Disposable.MONITORING_MODE">goog.Disposable.MONITORING_MODE</a> : <code class="type"><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></span></div></summary></details></div></div></section></main><nav id="topnav"><div><div id="menubutton"><label for="sidenav-toggle">Menu</label></div><form id="searchbox"><div><input type="search" placeholder="Search" tabindex="1"></div></form></div></nav><nav id="sidenav"><input type="checkbox" id="sidenav-types-ctrl" /><input type="checkbox" id="sidenav-files-ctrl" /><input type="checkbox" id="sidenav-modules-ctrl" /><a id="sidenav-overview"><div><h4>Overview</h4></div></a><div id="sidenav-types"><label for="sidenav-types-ctrl"><h4>Types</h4></label><i>Loading</i></div><div id="sidenav-modules"><label for="sidenav-modules-ctrl"><h4>Modules</h4></label><i>Loading</i></div><div id="sidenav-files"><label for="sidenav-files-ctrl"><h4>Files</h4></label><i>Loading</i></div><a href="license.html"><div><h4>License</h4></div></a></nav><div id="push-footer"></div></div><footer><a href="https://github.com/jleyba/js-dossier">Generated by dossier</a></footer><script src="types.js"></script><script src="dossier.js"></script>