Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
SeleniumHQ
GitHub Repository: SeleniumHQ/Selenium
Path: blob/trunk/third_party/closure/goog/net/xmlhttpfactory.js
4113 views
1
/**
2
* @license
3
* Copyright The Closure Library Authors.
4
* SPDX-License-Identifier: Apache-2.0
5
*/
6
7
/**
8
* @fileoverview Interface for a factory for creating XMLHttpRequest objects
9
* and metadata about them.
10
*/
11
12
goog.provide('goog.net.XmlHttpFactory');
13
14
/** @suppress {extraRequire} Typedef. */
15
goog.require('goog.net.XhrLike');
16
17
18
19
/**
20
* Abstract base class for an XmlHttpRequest factory.
21
* @constructor
22
*/
23
goog.net.XmlHttpFactory = function() {};
24
25
26
/**
27
* Cache of options - we only actually call internalGetOptions once.
28
* @type {?Object}
29
* @private
30
*/
31
goog.net.XmlHttpFactory.prototype.cachedOptions_ = null;
32
33
34
/**
35
* @return {!goog.net.XhrLike.OrNative} A new XhrLike instance.
36
*/
37
goog.net.XmlHttpFactory.prototype.createInstance = goog.abstractMethod;
38
39
40
/**
41
* @return {Object} Options describing how xhr objects obtained from this
42
* factory should be used.
43
*/
44
goog.net.XmlHttpFactory.prototype.getOptions = function() {
45
'use strict';
46
return this.cachedOptions_ ||
47
(this.cachedOptions_ = this.internalGetOptions());
48
};
49
50
51
/**
52
* Override this method in subclasses to preserve the caching offered by
53
* getOptions().
54
* @return {Object} Options describing how xhr objects obtained from this
55
* factory should be used.
56
* @protected
57
*/
58
goog.net.XmlHttpFactory.prototype.internalGetOptions = goog.abstractMethod;
59
60