Skip to content
This repository has been archived by the owner on Aug 1, 2024. It is now read-only.

Commit

Permalink
[webchannel] Update useFetchStreams use Fetch/streams for all reque…
Browse files Browse the repository at this point in the history
…sts.

RELNOTES: n/a

PiperOrigin-RevId: 574288521
Change-Id: If59764144aceae20276903632938975ba00fa83e
  • Loading branch information
sampajano authored and copybara-github committed Oct 17, 2023
1 parent 0d779e6 commit 00fba00
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions closure/goog/labs/net/webchannel.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,10 +298,10 @@ goog.net.WebChannel.Options.prototype.xmlHttpFactory;
goog.net.WebChannel.Options.prototype.requestRefreshThresholds;

/**
* This is an experimental feature to use WHATWG Fetch/streams (when supported)
* for the backchannel. If a custom 'xmlHttpFactory' is speficied, this option
* will not be effective. This option defaults to false now and will eventually
* be turned on by default.
* This is an experimental feature to use WHATWG Fetch/streams (when supported).
* If a custom 'xmlHttpFactory' is speficied, this option will not be effective.
* This option defaults to false now and will eventually be turned on by
* default.
* @type {boolean|undefined}
*/
goog.net.WebChannel.Options.prototype.useFetchStreams;
Expand Down
4 changes: 2 additions & 2 deletions closure/goog/labs/net/webchannel/webchannelbase.js
Original file line number Diff line number Diff line change
Expand Up @@ -2622,9 +2622,9 @@ WebChannelBase.prototype.createXhrIo = function(hostPrefix, isStreaming) {
throw new Error('Can\'t create secondary domain capable XhrIo object.');
}
let xhr;
if (isStreaming && this.usesFetchStreams_ && !this.xmlHttpFactory_) {
if (this.usesFetchStreams_ && !this.xmlHttpFactory_) {
xhr = new goog.net.XhrIo(
new goog.net.FetchXmlHttpFactory({streamBinaryChunks: true}));
new goog.net.FetchXmlHttpFactory({streamBinaryChunks: isStreaming}));
} else {
xhr = new goog.net.XhrIo(this.xmlHttpFactory_);
}
Expand Down

0 comments on commit 00fba00

Please sign in to comment.