Bug 1520868 - Replacing AsyncOpen2 with AsyncOpen always r=valentin
authorJonathan Kingston <jkt@mozilla.com>
Tue, 12 Feb 2019 16:08:25 +0000
changeset 458763 74f99033251c
parent 458762 3378fd5f4f22
child 458764 0ca63f8a449c
push id35548
push useropoprus@mozilla.com
push dateWed, 13 Feb 2019 09:48:26 +0000
treeherdermozilla-central@93e37c529818 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin
bugs1520868
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1520868 - Replacing AsyncOpen2 with AsyncOpen always r=valentin Replacing js and text occurences of asyncOpen2 Replacing open2 with open Differential Revision: https://phabricator.services.mozilla.com/D16885
browser/base/content/nsContextMenu.js
browser/extensions/pdfjs/content/PdfStreamConverter.jsm
browser/modules/FaviconLoader.jsm
devtools/client/sourceeditor/test/head.js
devtools/client/styleeditor/test/browser_styleeditor_filesave.js
devtools/client/styleeditor/test/browser_styleeditor_sourcemap_watching.js
devtools/shared/base-loader.js
devtools/shared/loader-plugin-raw.jsm
docshell/base/nsPingListener.cpp
dom/base/Document.cpp
dom/base/EventSource.cpp
dom/base/Navigator.cpp
dom/base/nsContentUtils.cpp
dom/base/nsFrameMessageManager.cpp
dom/base/nsObjectLoadingContent.cpp
dom/base/nsSyncLoadService.cpp
dom/base/test/chrome/test_bug682305.html
dom/base/test/test_bug422403-1.html
dom/base/test/test_bug422403-2.xhtml
dom/base/test/test_bug424359-1.html
dom/base/test/test_bug424359-2.html
dom/base/test/test_bug498433.html
dom/base/test/unit/head_utilities.js
dom/fetch/FetchDriver.cpp
dom/html/HTMLMediaElement.cpp
dom/html/HTMLTrackElement.cpp
dom/ipc/TabParent.cpp
dom/jsurl/nsJSProtocolHandler.cpp
dom/media/ChannelMediaResource.cpp
dom/media/IdpSandbox.jsm
dom/plugins/base/nsPluginHost.cpp
dom/plugins/base/nsPluginStreamListenerPeer.cpp
dom/push/PushServiceHttp2.jsm
dom/script/ScriptLoader.cpp
dom/security/nsCSPContext.cpp
dom/security/nsContentSecurityManager.cpp
dom/security/test/unit/test_csp_upgrade_insecure_request_header.js
dom/serviceworkers/ServiceWorkerScriptCache.cpp
dom/webbrowserpersist/nsWebBrowserPersist.cpp
dom/websocket/WebSocket.cpp
dom/workers/ScriptLoader.cpp
dom/xbl/nsXBLService.cpp
dom/xhr/XMLHttpRequestMainThread.cpp
dom/xml/XMLDocument.cpp
dom/xslt/tests/XSLTMark/XSLTMark-static.js
dom/xslt/xslt/txMozillaStylesheetCompiler.cpp
extensions/cookie/nsPermissionManager.cpp
extensions/pref/autoconfig/src/nsAutoConfig.cpp
extensions/pref/autoconfig/src/nsReadConfig.cpp
extensions/spellcheck/hunspell/glue/mozHunspellFileMgr.cpp
image/decoders/icon/mac/nsIconChannelCocoa.mm
image/decoders/icon/win/nsIconChannel.cpp
image/imgLoader.cpp
image/test/unit/async_load_tests.js
image/test/unit/test_private_channel.js
intl/hyphenation/glue/hnjstdio.cpp
intl/strres/nsStringBundle.cpp
intl/uconv/tests/unit/test_bug317216.js
intl/uconv/tests/unit/test_bug340714.js
intl/uconv/tests/unit/test_bug563618.js
intl/uconv/tests/unit/test_utf8_illegals.js
ipc/glue/BackgroundUtils.cpp
js/xpconnect/loader/ChromeScriptLoader.cpp
js/xpconnect/loader/mozJSComponentLoader.cpp
js/xpconnect/loader/mozJSSubScriptLoader.cpp
js/xpconnect/src/XPCJSRuntime.cpp
layout/style/FontFaceSet.cpp
layout/style/Loader.cpp
layout/style/test/mochitest.ini
layout/style/test/test_asyncopen.html
layout/style/test/test_asyncopen2.html
layout/tools/reftest/manifest.jsm
media/mtransport/ipc/WebrtcProxyChannel.cpp
mobile/android/chrome/content/CastingApps.js
modules/libjar/nsJARChannel.cpp
modules/libjar/nsJARChannel.h
modules/libjar/test/unit/test_bug1328865.js
modules/libjar/test/unit/test_bug370103.js
modules/libjar/test/unit/test_bug589292.js
modules/libjar/test/unit/test_bug597702.js
modules/libjar/test/unit/test_bug637286.js
modules/libjar/test/unit/test_bug658093.js
modules/libjar/test/unit/test_jarchannel.js
modules/libjar/test/unit/test_not_found.js
modules/libjar/zipwriter/nsZipWriter.cpp
modules/libjar/zipwriter/test/unit/test_asyncadd.js
netwerk/base/LoadInfo.cpp
netwerk/base/LoadInfo.h
netwerk/base/NetUtil.jsm
netwerk/base/NetworkConnectivityService.cpp
netwerk/base/Predictor.cpp
netwerk/base/SimpleChannel.cpp
netwerk/base/SimpleChannel.h
netwerk/base/nsBaseChannel.cpp
netwerk/base/nsBaseChannel.h
netwerk/base/nsIChannel.idl
netwerk/base/nsILoadInfo.idl
netwerk/base/nsIncrementalDownload.cpp
netwerk/base/nsInputStreamPump.cpp
netwerk/base/nsInputStreamPump.h
netwerk/base/nsNetUtil.cpp
netwerk/base/nsNetUtil.h
netwerk/base/nsPACMan.cpp
netwerk/base/nsSecCheckWrapChannel.cpp
netwerk/base/nsSecCheckWrapChannel.h
netwerk/dns/TRR.cpp
netwerk/ipc/NeckoChannelParams.ipdlh
netwerk/protocol/about/nsAboutCache.cpp
netwerk/protocol/about/nsAboutCache.h
netwerk/protocol/data/DataChannelChild.cpp
netwerk/protocol/file/FileChannelChild.cpp
netwerk/protocol/ftp/FTPChannelChild.cpp
netwerk/protocol/ftp/FTPChannelChild.h
netwerk/protocol/ftp/FTPChannelParent.cpp
netwerk/protocol/http/AlternateServices.cpp
netwerk/protocol/http/HttpBaseChannel.cpp
netwerk/protocol/http/HttpBaseChannel.h
netwerk/protocol/http/HttpChannelChild.cpp
netwerk/protocol/http/HttpChannelChild.h
netwerk/protocol/http/HttpChannelParent.cpp
netwerk/protocol/http/InterceptedHttpChannel.cpp
netwerk/protocol/http/InterceptedHttpChannel.h
netwerk/protocol/http/NullHttpChannel.cpp
netwerk/protocol/http/TrackingDummyChannel.cpp
netwerk/protocol/http/nsCORSListenerProxy.cpp
netwerk/protocol/http/nsHttpChannel.cpp
netwerk/protocol/http/nsHttpChannel.h
netwerk/protocol/res/ExtensionProtocolHandler.cpp
netwerk/protocol/viewsource/nsViewSourceChannel.cpp
netwerk/protocol/websocket/WebSocketChannel.cpp
netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp
netwerk/protocol/wyciwyg/WyciwygChannelChild.h
netwerk/protocol/wyciwyg/WyciwygChannelParent.cpp
netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp
netwerk/protocol/wyciwyg/nsWyciwygChannel.h
netwerk/streamconv/converters/nsMultiMixedConv.cpp
netwerk/test/browser/browser_nsIFormPOSTActionChannel.js
netwerk/test/httpserver/test/head_utils.js
netwerk/test/httpserver/test/test_sjs_object_state.js
netwerk/test/unit/test_1351443-missing-NewChannel2.js
netwerk/test/unit/test_304_responses.js
netwerk/test/unit/test_307_redirect.js
netwerk/test/unit/test_421.js
netwerk/test/unit/test_about_networking.js
netwerk/test/unit/test_alt-data_cross_process.js
netwerk/test/unit/test_alt-data_overwrite.js
netwerk/test/unit/test_alt-data_simple.js
netwerk/test/unit/test_alt-data_stream.js
netwerk/test/unit/test_altsvc.js
netwerk/test/unit/test_anonymous-coalescing.js
netwerk/test/unit/test_auth_dialog_permission.js
netwerk/test/unit/test_auth_proxy.js
netwerk/test/unit/test_authentication.js
netwerk/test/unit/test_bug1064258.js
netwerk/test/unit/test_bug1279246.js
netwerk/test/unit/test_bug1312774_http1.js
netwerk/test/unit/test_bug1312782_http1.js
netwerk/test/unit/test_bug1355539_http1.js
netwerk/test/unit/test_bug1378385_http1.js
netwerk/test/unit/test_bug1411316_http1.js
netwerk/test/unit/test_bug203271.js
netwerk/test/unit/test_bug248970_cookie.js
netwerk/test/unit/test_bug263127.js
netwerk/test/unit/test_bug282432.js
netwerk/test/unit/test_bug331825.js
netwerk/test/unit/test_bug337744.js
netwerk/test/unit/test_bug369787.js
netwerk/test/unit/test_bug401564.js
netwerk/test/unit/test_bug412945.js
netwerk/test/unit/test_bug455311.js
netwerk/test/unit/test_bug468426.js
netwerk/test/unit/test_bug468594.js
netwerk/test/unit/test_bug482601.js
netwerk/test/unit/test_bug482934.js
netwerk/test/unit/test_bug490095.js
netwerk/test/unit/test_bug510359.js
netwerk/test/unit/test_bug528292.js
netwerk/test/unit/test_bug536324_64bit_content_length.js
netwerk/test/unit/test_bug561042.js
netwerk/test/unit/test_bug561276.js
netwerk/test/unit/test_bug586908.js
netwerk/test/unit/test_bug596443.js
netwerk/test/unit/test_bug618835.js
netwerk/test/unit/test_bug633743.js
netwerk/test/unit/test_bug650995.js
netwerk/test/unit/test_bug659569.js
netwerk/test/unit/test_bug667907.js
netwerk/test/unit/test_bug669001.js
netwerk/test/unit/test_bug770243.js
netwerk/test/unit/test_bug812167.js
netwerk/test/unit/test_bug856978.js
netwerk/test/unit/test_bug894586.js
netwerk/test/unit/test_cache-control_request.js
netwerk/test/unit/test_cache-entry-id.js
netwerk/test/unit/test_cache2-29a-concurrent_read_resumable_entry_size_zero.js
netwerk/test/unit/test_cache2-29b-concurrent_read_non-resumable_entry_size_zero.js
netwerk/test/unit/test_cache2-29c-concurrent_read_half-interrupted.js
netwerk/test/unit/test_cache2-29d-concurrent_read_half-corrupted-206.js
netwerk/test/unit/test_cache2-29e-concurrent_read_half-non-206-response.js
netwerk/test/unit/test_cacheForOfflineUse_no-store.js
netwerk/test/unit/test_cache_jar.js
netwerk/test/unit/test_cacheflags.js
netwerk/test/unit/test_channel_close.js
netwerk/test/unit/test_channel_priority.js
netwerk/test/unit/test_chunked_responses.js
netwerk/test/unit/test_content_encoding_gzip.js
netwerk/test/unit/test_content_length_underrun.js
netwerk/test/unit/test_content_sniffer.js
netwerk/test/unit/test_cookie_header.js
netwerk/test/unit/test_cookiejars.js
netwerk/test/unit/test_cookiejars_safebrowsing.js
netwerk/test/unit/test_data_protocol.js
netwerk/test/unit/test_duplicate_headers.js
netwerk/test/unit/test_event_sink.js
netwerk/test/unit/test_fallback_no-cache-entry_canceled.js
netwerk/test/unit/test_fallback_no-cache-entry_passing.js
netwerk/test/unit/test_fallback_redirect-to-different-origin_canceled.js
netwerk/test/unit/test_fallback_redirect-to-different-origin_passing.js
netwerk/test/unit/test_fallback_request-error_canceled.js
netwerk/test/unit/test_fallback_request-error_passing.js
netwerk/test/unit/test_fallback_response-error_canceled.js
netwerk/test/unit/test_fallback_response-error_passing.js
netwerk/test/unit/test_file_protocol.js
netwerk/test/unit/test_freshconnection.js
netwerk/test/unit/test_getHost.js
netwerk/test/unit/test_gre_resources.js
netwerk/test/unit/test_gzipped_206.js
netwerk/test/unit/test_head.js
netwerk/test/unit/test_header_Server_Timing.js
netwerk/test/unit/test_headers.js
netwerk/test/unit/test_http2.js
netwerk/test/unit/test_httpResponseTimeout.js
netwerk/test/unit/test_httpcancel.js
netwerk/test/unit/test_httpsuspend.js
netwerk/test/unit/test_immutable.js
netwerk/test/unit/test_inhibit_caching.js
netwerk/test/unit/test_localstreams.js
netwerk/test/unit/test_mismatch_last-modified.js
netwerk/test/unit/test_multipart_byteranges.js
netwerk/test/unit/test_multipart_streamconv-byte-by-byte.js
netwerk/test/unit/test_multipart_streamconv.js
netwerk/test/unit/test_multipart_streamconv_missing_boundary_lead_dashes.js
netwerk/test/unit/test_multipart_streamconv_missing_lead_boundary.js
netwerk/test/unit/test_network_activity.js
netwerk/test/unit/test_nojsredir.js
netwerk/test/unit/test_origin.js
netwerk/test/unit/test_original_sent_received_head.js
netwerk/test/unit/test_partial_response_entry_size_smart_shrink.js
netwerk/test/unit/test_plaintext_sniff.js
netwerk/test/unit/test_post.js
netwerk/test/unit/test_predictor.js
netwerk/test/unit/test_private_necko_channel.js
netwerk/test/unit/test_progress.js
netwerk/test/unit/test_protocolproxyservice.js
netwerk/test/unit/test_proxy-failover_canceled.js
netwerk/test/unit/test_proxy-failover_passing.js
netwerk/test/unit/test_proxy-replace_canceled.js
netwerk/test/unit/test_proxy-replace_passing.js
netwerk/test/unit/test_proxyconnect.js
netwerk/test/unit/test_race_cache_with_network.js
netwerk/test/unit/test_range_requests.js
netwerk/test/unit/test_redirect-caching_canceled.js
netwerk/test/unit/test_redirect-caching_failure.js
netwerk/test/unit/test_redirect-caching_passing.js
netwerk/test/unit/test_redirect_baduri.js
netwerk/test/unit/test_redirect_canceled.js
netwerk/test/unit/test_redirect_different-protocol.js
netwerk/test/unit/test_redirect_failure.js
netwerk/test/unit/test_redirect_from_script.js
netwerk/test/unit/test_redirect_from_script_after-open_passing.js
netwerk/test/unit/test_redirect_history.js
netwerk/test/unit/test_redirect_loop.js
netwerk/test/unit/test_redirect_passing.js
netwerk/test/unit/test_reentrancy.js
netwerk/test/unit/test_reopen.js
netwerk/test/unit/test_reply_without_content_type.js
netwerk/test/unit/test_resumable_channel.js
netwerk/test/unit/test_resumable_truncate.js
netwerk/test/unit/test_separate_connections.js
netwerk/test/unit/test_simple.js
netwerk/test/unit/test_suspend_channel_before_connect.js
netwerk/test/unit/test_suspend_channel_on_authRetry.js
netwerk/test/unit/test_suspend_channel_on_examine.js
netwerk/test/unit/test_suspend_channel_on_examine_merged_response.js
netwerk/test/unit/test_suspend_channel_on_modified.js
netwerk/test/unit/test_synthesized_response.js
netwerk/test/unit/test_throttlechannel.js
netwerk/test/unit/test_throttling.js
netwerk/test/unit/test_tls_flags_separate_connections.js
netwerk/test/unit/test_traceable_channel.js
netwerk/test/unit/test_trackingProtection_annotateChannels.js
netwerk/test/unit_ipc/child_channel_id.js
netwerk/test/unit_ipc/child_cookie_header.js
netwerk/test/unit_ipc/test_alt-data_cross_process_wrap.js
parser/htmlparser/nsExpatDriver.cpp
security/manager/ssl/ContentSignatureVerifier.cpp
security/manager/ssl/nsNSSCallbacks.cpp
services/common/rest.js
testing/specialpowers/content/SpecialPowersObserverAPI.js
testing/specialpowers/content/specialpowersAPI.js
testing/talos/talos/bootstrap.js
toolkit/components/aboutmemory/content/aboutMemory.js
toolkit/components/downloads/DownloadCore.jsm
toolkit/components/downloads/test/unit/head.js
toolkit/components/extensions/test/xpcshell/test_ext_webRequest_suspend.js
toolkit/components/mediasniffer/test/unit/test_mediasniffer.js
toolkit/components/mediasniffer/test/unit/test_mediasniffer_ext.js
toolkit/components/passwordmgr/test/browser/browser_hasInsecureLoginForms_streamConverter.js
toolkit/components/passwordmgr/test/mochitest/test_prompt_promptAuth_proxy.html
toolkit/components/places/FaviconHelpers.cpp
toolkit/components/places/PageIconProtocolHandler.js
toolkit/components/places/nsAnnoProtocolHandler.cpp
toolkit/components/places/nsFaviconService.cpp
toolkit/components/places/tests/favicons/test_moz-anno_favicon_mime_type.js
toolkit/components/reputationservice/ApplicationReputation.cpp
toolkit/components/search/nsSearchService.js
toolkit/components/search/tests/xpcshell/head_search.js
toolkit/components/url-classifier/nsUrlClassifierDBService.cpp
toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js
toolkit/components/url-classifier/nsUrlClassifierStreamUpdater.cpp
toolkit/mozapps/extensions/internal/XPIInstall.jsm
uriloader/base/nsIURILoader.idl
uriloader/base/nsURILoader.cpp
uriloader/exthandler/ExternalHelperAppParent.cpp
uriloader/exthandler/nsExternalProtocolHandler.cpp
uriloader/prefetch/nsOfflineCacheUpdate.cpp
uriloader/prefetch/nsPrefetchService.cpp
widget/android/WebExecutorSupport.cpp
widget/windows/WinUtils.cpp
widget/windows/nsDataObj.cpp
xpcom/tests/unit/test_bug121341.js
--- a/browser/base/content/nsContextMenu.js
+++ b/browser/base/content/nsContextMenu.js
@@ -1225,17 +1225,17 @@ nsContextMenu.prototype = {
     // fallback to the old way if we don't see the headers quickly
     var timeToWait =
       Services.prefs.getIntPref("browser.download.saveLinkAsFilenameTimeout");
     var timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
     timer.initWithCallback(new timerCallback(), timeToWait,
                            timer.TYPE_ONE_SHOT);
 
     // kick off the channel with our proxy object as the listener
-    channel.asyncOpen2(new saveAsListener());
+    channel.asyncOpen(new saveAsListener());
   },
 
   // Save URL of clicked-on link.
   saveLink() {
     let isContentWindowPrivate = this.isRemote ? this.ownerDoc.isPrivate : undefined;
     this.saveHelper(this.linkURL, this.linkTextStr, null, true, this.ownerDoc,
                     gContextMenuContentData.documentURIObject,
                     this.frameOuterWindowID,
--- a/browser/extensions/pdfjs/content/PdfStreamConverter.jsm
+++ b/browser/extensions/pdfjs/content/PdfStreamConverter.jsm
@@ -296,17 +296,17 @@ class ChromeActions {
           }
         },
         onDataAvailable(aRequest, aContext, aDataInputStream, aOffset, aCount) {
           this.extListener.onDataAvailable(aRequest, aContext, aDataInputStream,
                                            aOffset, aCount);
         },
       };
 
-      channel.asyncOpen2(listener);
+      channel.asyncOpen(listener);
     });
   }
 
   getLocale() {
     return Services.locale.requestedLocale || "en-US";
   }
 
   getStrings(data) {
@@ -990,17 +990,17 @@ PdfStreamConverter.prototype = {
     // e.g. useful for NoScript. Make make sure we reuse the origin attributes
     // from the request channel to keep isolation consistent.
     var uri = NetUtil.newURI(PDF_VIEWER_WEB_PAGE);
     var resourcePrincipal =
       Services.scriptSecurityManager.createCodebasePrincipal(uri,
         aRequest.loadInfo.originAttributes);
     aRequest.owner = resourcePrincipal;
 
-    channel.asyncOpen2(proxy);
+    channel.asyncOpen(proxy);
   },
 
   // nsIRequestObserver::onStopRequest
   onStopRequest(aRequest, aContext, aStatusCode) {
     if (!this.dataListener) {
       // Do nothing
       return;
     }
--- a/browser/modules/FaviconLoader.jsm
+++ b/browser/modules/FaviconLoader.jsm
@@ -139,17 +139,17 @@ class FaviconLoad {
     this._deferred.promise.then(cleanup, cleanup);
 
     this.dataBuffer = new StorageStream(STREAM_SEGMENT_SIZE, PR_UINT32_MAX);
 
     // storage streams do not implement writeFrom so wrap it with a buffered stream.
     this.stream = new BufferedOutputStream(this.dataBuffer.getOutputStream(0), STREAM_SEGMENT_SIZE * 2);
 
     try {
-      this.channel.asyncOpen2(this);
+      this.channel.asyncOpen(this);
     } catch (e) {
       this._deferred.reject(e);
     }
 
     return this._deferred.promise;
   }
 
   cancel() {
--- a/devtools/client/sourceeditor/test/head.js
+++ b/devtools/client/sourceeditor/test/head.js
@@ -107,17 +107,17 @@ function limit(source, [line, char]) {
 function read(url) {
   const scriptableStream = Cc["@mozilla.org/scriptableinputstream;1"]
     .getService(Ci.nsIScriptableInputStream);
 
   const channel = NetUtil.newChannel({
     uri: url,
     loadUsingSystemPrincipal: true,
   });
-  const input = channel.open2();
+  const input = channel.open();
   scriptableStream.init(input);
 
   let data = "";
   while (input.available()) {
     data = data.concat(scriptableStream.read(input.available()));
   }
   scriptableStream.close();
   input.close();
--- a/devtools/client/styleeditor/test/browser_styleeditor_filesave.js
+++ b/devtools/client/styleeditor/test/browser_styleeditor_filesave.js
@@ -60,17 +60,17 @@ function copy(srcChromeURL, destFileName
 function read(srcChromeURL) {
   const scriptableStream = Cc["@mozilla.org/scriptableinputstream;1"]
     .getService(Ci.nsIScriptableInputStream);
 
   const channel = NetUtil.newChannel({
     uri: srcChromeURL,
     loadUsingSystemPrincipal: true,
   });
-  const input = channel.open2();
+  const input = channel.open();
   scriptableStream.init(input);
 
   let data = "";
   while (input.available()) {
     data = data.concat(scriptableStream.read(input.available()));
   }
   scriptableStream.close();
   input.close();
--- a/devtools/client/styleeditor/test/browser_styleeditor_sourcemap_watching.js
+++ b/devtools/client/styleeditor/test/browser_styleeditor_sourcemap_watching.js
@@ -120,17 +120,17 @@ function copy(srcChromeURL, destFilePath
 function read(srcChromeURL) {
   const scriptableStream = Cc["@mozilla.org/scriptableinputstream;1"]
     .getService(Ci.nsIScriptableInputStream);
 
   const channel = NetUtil.newChannel({
     uri: srcChromeURL,
     loadUsingSystemPrincipal: true,
   });
-  const input = channel.open2();
+  const input = channel.open();
   scriptableStream.init(input);
 
   let data = "";
   while (input.available()) {
     data = data.concat(scriptableStream.read(input.available()));
   }
   scriptableStream.close();
   input.close();
--- a/devtools/shared/base-loader.js
+++ b/devtools/shared/base-loader.js
@@ -54,17 +54,17 @@ function readURI(uri) {
     // Resolve to a real URI, this will catch any obvious bad paths without
     // logging assertions in debug builds, see bug 1135219
     uri = resProto.resolveURI(nsURI);
   }
 
   const stream = NetUtil.newChannel({
     uri: NetUtil.newURI(uri, "UTF-8"),
     loadUsingSystemPrincipal: true}
-  ).open2();
+  ).open();
   const count = stream.available();
   const data = NetUtil.readInputStreamToString(stream, count, {
     charset: "UTF-8",
   });
 
   stream.close();
 
   return data;
--- a/devtools/shared/loader-plugin-raw.jsm
+++ b/devtools/shared/loader-plugin-raw.jsm
@@ -22,17 +22,17 @@ this.requireRawId = function(id, require
   // manually), so remove it here.
   if (!id.endsWith(".js") && uri.endsWith(".js")) {
     uri = uri.slice(0, -3);
   }
 
   const stream = NetUtil.newChannel({
     uri: NetUtil.newURI(uri, "UTF-8"),
     loadUsingSystemPrincipal: true,
-  }).open2();
+  }).open();
 
   const count = stream.available();
   const data = NetUtil.readInputStreamToString(stream, count, {
     charset: "UTF-8",
   });
   stream.close();
 
   // For the time being it doesn't seem worthwhile to cache the
--- a/docshell/base/nsPingListener.cpp
+++ b/docshell/base/nsPingListener.cpp
@@ -215,17 +215,17 @@ static void SendPing(void* aClosure, nsI
   if (!loadGroup) {
     return;
   }
   nsCOMPtr<nsIInterfaceRequestor> callbacks = do_QueryInterface(info->docShell);
   loadGroup->SetNotificationCallbacks(callbacks);
   chan->SetLoadGroup(loadGroup);
 
   RefPtr<nsPingListener> pingListener = new nsPingListener();
-  chan->AsyncOpen2(pingListener);
+  chan->AsyncOpen(pingListener);
 
   // Even if AsyncOpen failed, we still count this as a successful ping.  It's
   // possible that AsyncOpen may have failed after triggering some background
   // process that may have written something to the network.
   info->numPings++;
 
   // Prevent ping requests from stalling and never being garbage collected...
   if (NS_FAILED(pingListener->StartTimeout(doc->GetDocGroup()))) {
--- a/dom/base/Document.cpp
+++ b/dom/base/Document.cpp
@@ -1031,17 +1031,17 @@ nsresult ExternalResourceMap::PendingLoa
   nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(channel));
   if (httpChannel) {
     rv = httpChannel->SetReferrerWithPolicy(aReferrer, aReferrerPolicy);
     Unused << NS_WARN_IF(NS_FAILED(rv));
   }
 
   mURI = aURI;
 
-  return channel->AsyncOpen2(this);
+  return channel->AsyncOpen(this);
 }
 
 NS_IMPL_ISUPPORTS(ExternalResourceMap::LoadgroupCallbacks,
                   nsIInterfaceRequestor)
 
 #define IMPL_SHIM(_i) \
   NS_IMPL_ISUPPORTS(ExternalResourceMap::LoadgroupCallbacks::_i##Shim, _i)
 
--- a/dom/base/EventSource.cpp
+++ b/dom/base/EventSource.cpp
@@ -1003,17 +1003,17 @@ nsresult EventSourceImpl::InitChannelAnd
     mHttpChannel->GetNotificationCallbacks(
         getter_AddRefs(notificationCallbacks));
     MOZ_ASSERT(!notificationCallbacks);
   }
 #endif
   mHttpChannel->SetNotificationCallbacks(this);
 
   // Start reading from the channel
-  rv = mHttpChannel->AsyncOpen2(this);
+  rv = mHttpChannel->AsyncOpen(this);
   if (NS_FAILED(rv)) {
     DispatchFailConnection();
     return rv;
   }
   // Create the connection. Ask EventSource to hold reference until Close is
   // called or network error is received.
   mEventSource->UpdateMustKeepAlive();
   return rv;
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -1215,18 +1215,18 @@ bool Navigator::SendBeaconInternal(const
   // cancel the channel and any redirected channels it may create.
   nsCOMPtr<nsILoadGroup> loadGroup = do_CreateInstance(NS_LOADGROUP_CONTRACTID);
   nsCOMPtr<nsIInterfaceRequestor> callbacks =
       do_QueryInterface(mWindow->GetDocShell());
   loadGroup->SetNotificationCallbacks(callbacks);
   channel->SetLoadGroup(loadGroup);
 
   RefPtr<BeaconStreamListener> beaconListener = new BeaconStreamListener();
-  rv = channel->AsyncOpen2(beaconListener);
-  // do not throw if security checks fail within asyncOpen2
+  rv = channel->AsyncOpen(beaconListener);
+  // do not throw if security checks fail within asyncOpen
   NS_ENSURE_SUCCESS(rv, false);
 
   // make the beaconListener hold a strong reference to the loadgroup
   // which is released in ::OnStartRequest
   beaconListener->SetLoadGroup(loadGroup);
 
   return true;
 }
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -7311,17 +7311,17 @@ nsresult nsContentUtils::SlurpFileToStri
                      nsContentUtils::GetSystemPrincipal(),
                      nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                      nsIContentPolicy::TYPE_OTHER);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   nsCOMPtr<nsIInputStream> stream;
-  rv = channel->Open2(getter_AddRefs(stream));
+  rv = channel->Open(getter_AddRefs(stream));
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   rv = NS_ConsumeStream(stream, UINT32_MAX, aString);
   if (NS_FAILED(rv)) {
     return rv;
   }
--- a/dom/base/nsFrameMessageManager.cpp
+++ b/dom/base/nsFrameMessageManager.cpp
@@ -1279,17 +1279,17 @@ void nsMessageManagerScriptExecutor::Try
                   nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                   nsIContentPolicy::TYPE_OTHER);
 
     if (!channel) {
       return;
     }
 
     nsCOMPtr<nsIInputStream> input;
-    rv = channel->Open2(getter_AddRefs(input));
+    rv = channel->Open(getter_AddRefs(input));
     NS_ENSURE_SUCCESS_VOID(rv);
     nsString dataString;
     char16_t* dataStringBuf = nullptr;
     size_t dataStringLength = 0;
     if (input) {
       nsCString buffer;
       uint64_t written;
       if (NS_FAILED(NS_ReadInputStreamToString(input, buffer, -1, &written))) {
--- a/dom/base/nsObjectLoadingContent.cpp
+++ b/dom/base/nsObjectLoadingContent.cpp
@@ -1969,17 +1969,17 @@ nsresult nsObjectLoadingContent::LoadObj
   // Security checks
   //
 
   if (mType != eType_Null) {
     bool allowLoad = true;
     int16_t contentPolicy = nsIContentPolicy::ACCEPT;
     // If mChannelLoaded is set we presumably already passed load policy
     // If mType == eType_Loading then we call OpenChannel() which internally
-    // creates a new channel and calls asyncOpen2() on that channel which
+    // creates a new channel and calls asyncOpen() on that channel which
     // then enforces content policy checks.
     if (allowLoad && mURI && !mChannelLoaded && mType != eType_Loading) {
       allowLoad = CheckLoadPolicy(&contentPolicy);
     }
     // If we're loading a type now, check ProcessPolicy. Note that we may check
     // both now in the case of plugins whose type is determined before opening a
     // channel.
     if (allowLoad && mType != eType_Loading) {
@@ -2451,18 +2451,18 @@ nsresult nsObjectLoadingContent::OpenCha
   }
 
   nsCOMPtr<nsIScriptChannel> scriptChannel = do_QueryInterface(chan);
   if (scriptChannel) {
     // Allow execution against our context if the principals match
     scriptChannel->SetExecutionPolicy(nsIScriptChannel::EXECUTE_NORMAL);
   }
 
-  // AsyncOpen2 can fail if a file does not exist.
-  rv = chan->AsyncOpen2(shim);
+  // AsyncOpen can fail if a file does not exist.
+  rv = chan->AsyncOpen(shim);
   NS_ENSURE_SUCCESS(rv, rv);
   LOG(("OBJLC [%p]: Channel opened", this));
   mChannel = chan;
   return NS_OK;
 }
 
 uint32_t nsObjectLoadingContent::GetCapabilities() const {
   return eSupportImages | eSupportPlugins | eSupportDocuments;
--- a/dom/base/nsSyncLoadService.cpp
+++ b/dom/base/nsSyncLoadService.cpp
@@ -200,17 +200,17 @@ nsresult nsSyncLoader::LoadDocument(nsIC
 }
 
 nsresult nsSyncLoader::PushAsyncStream(nsIStreamListener *aListener) {
   mListener = aListener;
 
   mAsyncLoadStatus = NS_OK;
 
   // Start reading from the channel
-  nsresult rv = mChannel->AsyncOpen2(this);
+  nsresult rv = mChannel->AsyncOpen(this);
 
   if (NS_SUCCEEDED(rv)) {
     // process events until we're finished.
     mLoading = true;
     nsIThread *thread = NS_GetCurrentThread();
     while (mLoading && NS_SUCCEEDED(rv)) {
       bool processedEvent;
       rv = thread->ProcessNextEvent(true, &processedEvent);
@@ -225,17 +225,17 @@ nsresult nsSyncLoader::PushAsyncStream(n
   // Note that if AsyncOpen failed that's ok -- the only caller of
   // this method nulls out mChannel immediately after we return.
 
   return mAsyncLoadStatus;
 }
 
 nsresult nsSyncLoader::PushSyncStream(nsIStreamListener *aListener) {
   nsCOMPtr<nsIInputStream> in;
-  nsresult rv = mChannel->Open2(getter_AddRefs(in));
+  nsresult rv = mChannel->Open(getter_AddRefs(in));
   NS_ENSURE_SUCCESS(rv, rv);
 
   mLoading = true;
   rv = nsSyncLoadService::PushSyncStreamToListener(in.forget(), aListener,
                                                    mChannel);
   mLoading = false;
 
   return rv;
--- a/dom/base/test/chrome/test_bug682305.html
+++ b/dom/base/test/chrome/test_bug682305.html
@@ -47,44 +47,40 @@ CustomChannel.prototype = {
   contentType: "text/plain",
   owner: Cc["@mozilla.org/systemprincipal;1"].createInstance(Ci.nsIPrincipal),
   securityInfo: null,
   notificationCallbacks: null,
   loadFlags: 0,
   loadGroup: null,
   name: null,
   status: Cr.NS_OK,
-  asyncOpen(listener, context) {
+  asyncOpen(listener) {
+    // throws an error if security checks fail
+    var outListener = contentSecManager.performSecurityCheck(this, listener);
     let stream = this.open();
+    let context = null;
     try {
-      listener.onStartRequest(this, context);
-    } catch (e) {}
-    try {
-      listener.onDataAvailable(this, context, stream, 0, stream.available());
+      outListener.onStartRequest(this, context);
     } catch (e) {}
     try {
-      listener.onStopRequest(this, context, Cr.NS_OK);
+      outListener.onDataAvailable(this, context, stream, 0, stream.available());
+    } catch (e) {}
+    try {
+      outListener.onStopRequest(this, context, Cr.NS_OK);
     } catch (e) {}
   },
-  asyncOpen2(listener) {
+  open() {
     // throws an error if security checks fail
-    var outListener = contentSecManager.performSecurityCheck(this, listener);
-    return this.asyncOpen(outListener, null);
-  },
-  open() {
+    contentSecManager.performSecurityCheck(this, null);
+
     let data = "bar";
     let stream = Cc["@mozilla.org/io/string-input-stream;1"].createInstance(Ci.nsIStringInputStream);
     stream.setData(data, data.length);
     return stream;
   },
-  open2() {
-    // throws an error if security checks fail
-    contentSecManager.performSecurityCheck(this, null);
-    return this.open();
-  },
   isPending() {
     return false;
   },
   cancel() {
     throw Cr.NS_ERROR_NOT_IMPLEMENTED;
   },
   suspend() {
     throw Cr.NS_ERROR_NOT_IMPLEMENTED;
--- a/dom/base/test/test_bug422403-1.html
+++ b/dom/base/test/test_bug422403-1.html
@@ -39,17 +39,17 @@ function loadFileContent(aFile, aCharset
                                 null,      // aTriggeringPrincipal
                                 SpecialPowers.Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                                 SpecialPowers.Ci.nsIContentPolicy.TYPE_OTHER);
 
     var cis = SpecialPowers.Ci.nsIConverterInputStream;
 
     var inputStream = SpecialPowers.Cc["@mozilla.org/intl/converter-input-stream;1"]
                        .createInstance(cis);
-    inputStream.init(chann.open2(), aCharset, 1024, cis.DEFAULT_REPLACEMENT_CHARACTER);
+    inputStream.init(chann.open(), aCharset, 1024, cis.DEFAULT_REPLACEMENT_CHARACTER);
     var str = {}, content = '';
     while (inputStream.readString(4096, str) != 0) {
         content += str.value;
     }
     return content;
 }
 
 
--- a/dom/base/test/test_bug422403-2.xhtml
+++ b/dom/base/test/test_bug422403-2.xhtml
@@ -38,17 +38,17 @@ function loadFileContent(aFile, aCharset
                                 null,      // aTriggeringPrincipal
                                 SpecialPowers.Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                                 SpecialPowers.Ci.nsIContentPolicy.TYPE_OTHER);
 
     var cis = SpecialPowers.Ci.nsIConverterInputStream;
 
     var inputStream = SpecialPowers.Cc["@mozilla.org/intl/converter-input-stream;1"]
                        .createInstance(cis);
-    inputStream.init(chann.open2(), aCharset, 1024, cis.DEFAULT_REPLACEMENT_CHARACTER);
+    inputStream.init(chann.open(), aCharset, 1024, cis.DEFAULT_REPLACEMENT_CHARACTER);
     var str = {}, content = '';
     while (inputStream.readString(4096, str) != 0) {
         content += str.value;
     }
     return content;
 }
 
 
--- a/dom/base/test/test_bug424359-1.html
+++ b/dom/base/test/test_bug424359-1.html
@@ -39,17 +39,17 @@ function loadFileContent(aFile, aCharset
                                 null,      // aTriggeringPrincipal
                                 SpecialPowers.Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                                 SpecialPowers.Ci.nsIContentPolicy.TYPE_OTHER);
 
     var cis = SpecialPowers.Ci.nsIConverterInputStream;
 
     var inputStream = SpecialPowers.Cc["@mozilla.org/intl/converter-input-stream;1"]
                        .createInstance(cis);
-    inputStream.init(chann.open2(), aCharset, 1024, cis.DEFAULT_REPLACEMENT_CHARACTER);
+    inputStream.init(chann.open(), aCharset, 1024, cis.DEFAULT_REPLACEMENT_CHARACTER);
     var str = {}, content = '';
     while (inputStream.readString(4096, str) != 0) {
         content += str.value;
     }
     return content;
 }
 
 function isRoughly(actual, expected, message) {
--- a/dom/base/test/test_bug424359-2.html
+++ b/dom/base/test/test_bug424359-2.html
@@ -38,17 +38,17 @@ function loadFileContent(aFile, aCharset
                                 null,      // aTriggeringPrincipal
                                 SpecialPowers.Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                                 SpecialPowers.Ci.nsIContentPolicy.TYPE_OTHER);
 
     var cis = SpecialPowers.Ci.nsIConverterInputStream;
 
     var inputStream = SpecialPowers.Cc["@mozilla.org/intl/converter-input-stream;1"]
                        .createInstance(cis);
-    inputStream.init(chann.open2(), aCharset, 1024, cis.DEFAULT_REPLACEMENT_CHARACTER);
+    inputStream.init(chann.open(), aCharset, 1024, cis.DEFAULT_REPLACEMENT_CHARACTER);
     var str = {}, content = '';
     while (inputStream.readString(4096, str) != 0) {
         content += str.value;
     }
     return content;
 }
 
 function isRoughly(actual, expected, message) {
--- a/dom/base/test/test_bug498433.html
+++ b/dom/base/test/test_bug498433.html
@@ -37,17 +37,17 @@ function loadFileContent(aFile, aCharset
                                 null,      // aTriggeringPrincipal
                                 SpecialPowers.Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                                 SpecialPowers.Ci.nsIContentPolicy.TYPE_OTHER);
 
     var cis = SpecialPowers.Ci.nsIConverterInputStream;
 
     var inputStream = SpecialPowers.Cc["@mozilla.org/intl/converter-input-stream;1"]
                        .createInstance(cis);
-    inputStream.init(chann.open2(), aCharset, 1024, cis.DEFAULT_REPLACEMENT_CHARACTER);
+    inputStream.init(chann.open(), aCharset, 1024, cis.DEFAULT_REPLACEMENT_CHARACTER);
     var str = {}, content = '';
     while (inputStream.readString(4096, str) != 0) {
         content += str.value;
     }
     return content;
 }
 
 function isRoughly(actual, expected, message) {
--- a/dom/base/test/unit/head_utilities.js
+++ b/dom/base/test/unit/head_utilities.js
@@ -20,21 +20,21 @@ function loadContentFile(aFile, aCharset
     var chann = NetUtil.newChannel({
       uri: Services.io.newFileURI(file),
       loadUsingSystemPrincipal: true,
     });
     chann.contentCharset = aCharset;
 
     /* var inputStream = Components.classes["@mozilla.org/scriptableinputstream;1"]
                         .createInstance(Components.interfaces.nsIScriptableInputStream);
-    inputStream.init(chann.open2());
+    inputStream.init(chann.open());
     return inputStream.read(file.fileSize);
     */
 
     var inputStream = Cc["@mozilla.org/intl/converter-input-stream;1"]
                        .createInstance(Ci.nsIConverterInputStream);
-    inputStream.init(chann.open2(), aCharset, 1024, replacementChar);
+    inputStream.init(chann.open(), aCharset, 1024, replacementChar);
     var str = {}, content = "";
     while (inputStream.readString(4096, str) != 0) {
         content += str.value;
     }
     return content;
 }
--- a/dom/fetch/FetchDriver.cpp
+++ b/dom/fetch/FetchDriver.cpp
@@ -698,22 +698,22 @@ nsresult FetchDriver::HttpFetch(
   if (!aPreferredAlternativeDataType.IsEmpty()) {
     nsCOMPtr<nsICacheInfoChannel> cic = do_QueryInterface(chan);
     if (cic) {
       cic->PreferAlternativeDataType(aPreferredAlternativeDataType,
                                      EmptyCString());
       MOZ_ASSERT(!mAltDataListener);
       mAltDataListener = new AlternativeDataStreamListener(
           this, chan, aPreferredAlternativeDataType);
-      rv = chan->AsyncOpen2(mAltDataListener);
+      rv = chan->AsyncOpen(mAltDataListener);
     } else {
-      rv = chan->AsyncOpen2(this);
+      rv = chan->AsyncOpen(this);
     }
   } else {
-    rv = chan->AsyncOpen2(this);
+    rv = chan->AsyncOpen(this);
   }
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   // Step 4 onwards of "HTTP Fetch" is handled internally by Necko.
 
   mChannel = chan;
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -1239,17 +1239,17 @@ class HTMLMediaElement::ChannelLoader fi
  public:
   NS_INLINE_DECL_REFCOUNTING(ChannelLoader);
 
   void LoadInternal(HTMLMediaElement* aElement) {
     if (mCancelled) {
       return;
     }
 
-    // determine what security checks need to be performed in AsyncOpen2().
+    // determine what security checks need to be performed in AsyncOpen().
     nsSecurityFlags securityFlags =
         aElement->ShouldCheckAllowOrigin()
             ? nsILoadInfo::SEC_REQUIRE_CORS_DATA_INHERITS
             : nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS;
 
     if (aElement->GetCORSMode() == CORS_USE_CREDENTIALS) {
       securityFlags |= nsILoadInfo::SEC_COOKIES_INCLUDE;
     }
@@ -1332,17 +1332,17 @@ class HTMLMediaElement::ChannelLoader fi
       // This enables us to detect if the stream supports byte range
       // requests, and therefore seeking, early.
       rv = hc->SetRequestHeader(NS_LITERAL_CSTRING("Range"),
                                 NS_LITERAL_CSTRING("bytes=0-"), false);
       MOZ_ASSERT(NS_SUCCEEDED(rv));
       aElement->SetRequestHeaders(hc);
     }
 
-    rv = channel->AsyncOpen2(loadListener);
+    rv = channel->AsyncOpen(loadListener);
     if (NS_FAILED(rv)) {
       // Notify load error so the element will try next resource candidate.
       aElement->NotifyLoadError(NS_LITERAL_CSTRING("Failed to open channel"));
       return;
     }
 
     // Else the channel must be open and starting to download. If it encounters
     // a non-catastrophic failure, it will set a new task to continue loading
--- a/dom/html/HTMLTrackElement.cpp
+++ b/dom/html/HTMLTrackElement.cpp
@@ -321,17 +321,17 @@ void HTMLTrackElement::LoadResource(RefP
             nullptr,  // aCallbacks
             nsIRequest::LOAD_NORMAL | nsIChannel::LOAD_CLASSIFY_URI);
 
         NS_ENSURE_TRUE_VOID(NS_SUCCEEDED(rv));
 
         channel->SetNotificationCallbacks(self->mListener);
 
         LOG(LogLevel::Debug, ("opening webvtt channel"));
-        rv = channel->AsyncOpen2(self->mListener);
+        rv = channel->AsyncOpen(self->mListener);
 
         if (NS_FAILED(rv)) {
           self->SetReadyState(TextTrackReadyState::FailedToLoad);
           return;
         }
         self->mChannel = channel;
       });
   doc->Dispatch(TaskCategory::Other, runnable.forget());
--- a/dom/ipc/TabParent.cpp
+++ b/dom/ipc/TabParent.cpp
@@ -3042,19 +3042,17 @@ class FakeChannel final : public nsIChan
       GetSecurityInfo(nsISupports**) NO_IMPL NS_IMETHOD
       GetContentType(nsACString&) NO_IMPL NS_IMETHOD
       SetContentType(const nsACString&) NO_IMPL NS_IMETHOD
       GetContentCharset(nsACString&) NO_IMPL NS_IMETHOD
       SetContentCharset(const nsACString&) NO_IMPL NS_IMETHOD
       GetContentLength(int64_t*) NO_IMPL NS_IMETHOD
       SetContentLength(int64_t) NO_IMPL NS_IMETHOD
       Open(nsIInputStream**) NO_IMPL NS_IMETHOD
-      Open2(nsIInputStream**) NO_IMPL NS_IMETHOD
-      AsyncOpen(nsIStreamListener*, nsISupports*) NO_IMPL NS_IMETHOD
-      AsyncOpen2(nsIStreamListener*) NO_IMPL NS_IMETHOD
+      AsyncOpen(nsIStreamListener*) NO_IMPL NS_IMETHOD
       GetContentDisposition(uint32_t*) NO_IMPL NS_IMETHOD
       SetContentDisposition(uint32_t) NO_IMPL NS_IMETHOD
       GetContentDispositionFilename(nsAString&) NO_IMPL NS_IMETHOD
       SetContentDispositionFilename(const nsAString&) NO_IMPL NS_IMETHOD
       GetContentDispositionHeader(nsACString&) NO_IMPL NS_IMETHOD
       OnAuthAvailable(nsISupports* aContext,
                       nsIAuthInformation* aAuthInfo) override;
   NS_IMETHOD OnAuthCancelled(nsISupports* aContext, bool userCancel) override;
--- a/dom/jsurl/nsJSProtocolHandler.cpp
+++ b/dom/jsurl/nsJSProtocolHandler.cpp
@@ -332,24 +332,24 @@ class nsJSChannel : public nsIChannel,
   void CleanupStrongRefs();
 
  protected:
   nsCOMPtr<nsIChannel> mStreamChannel;
   nsCOMPtr<nsIPropertyBag2> mPropertyBag;
   nsCOMPtr<nsIStreamListener> mListener;              // Our final listener
   nsCOMPtr<nsPIDOMWindowInner> mOriginalInnerWindow;  // The inner window our
                                                       // load started against.
-  // If we blocked onload on a document in AsyncOpen2, this is the document we
+  // If we blocked onload on a document in AsyncOpen, this is the document we
   // did it on.
   RefPtr<mozilla::dom::Document> mDocumentOnloadBlockedOn;
 
   nsresult mStatus;  // Our status
 
   nsLoadFlags mLoadFlags;
-  nsLoadFlags mActualLoadFlags;  // See AsyncOpen2
+  nsLoadFlags mActualLoadFlags;  // See AsyncOpen
 
   RefPtr<nsJSThunk> mIOThunk;
   mozilla::dom::PopupBlocker::PopupControlState mPopupState;
   uint32_t mExecutionPolicy;
   bool mIsAsync;
   bool mIsActive;
   bool mOpenedStreamChannel;
 };
@@ -480,46 +480,47 @@ NS_IMETHODIMP
 nsJSChannel::SetOriginalURI(nsIURI* aURI) {
   return mStreamChannel->SetOriginalURI(aURI);
 }
 
 NS_IMETHODIMP
 nsJSChannel::GetURI(nsIURI** aURI) { return mStreamChannel->GetURI(aURI); }
 
 NS_IMETHODIMP
-nsJSChannel::Open(nsIInputStream** aResult) {
-  nsresult rv = mIOThunk->EvaluateScript(
-      mStreamChannel, mPopupState, mExecutionPolicy, mOriginalInnerWindow);
-  NS_ENSURE_SUCCESS(rv, rv);
-
-  return mStreamChannel->Open(aResult);
-}
-
-NS_IMETHODIMP
-nsJSChannel::Open2(nsIInputStream** aStream) {
+nsJSChannel::Open(nsIInputStream** aStream) {
   nsCOMPtr<nsIStreamListener> listener;
   nsresult rv =
       nsContentSecurityManager::doContentSecurityCheck(this, listener);
   NS_ENSURE_SUCCESS(rv, rv);
-  return Open(aStream);
+
+  rv = mIOThunk->EvaluateScript(
+      mStreamChannel, mPopupState, mExecutionPolicy, mOriginalInnerWindow);
+  NS_ENSURE_SUCCESS(rv, rv);
+
+  return mStreamChannel->Open(aStream);
 }
 
+
 NS_IMETHODIMP
-nsJSChannel::AsyncOpen(nsIStreamListener* aListener, nsISupports* aContext) {
+nsJSChannel::AsyncOpen(nsIStreamListener* aListener) {
+  NS_ENSURE_ARG(aListener);
+
+  nsCOMPtr<nsIStreamListener> listener = aListener;
+  nsresult rv =
+      nsContentSecurityManager::doContentSecurityCheck(this, listener);
+  NS_ENSURE_SUCCESS(rv, rv);
+
 #ifdef DEBUG
   {
     nsCOMPtr<nsILoadInfo> loadInfo = nsIChannel::GetLoadInfo();
     MOZ_ASSERT(!loadInfo || loadInfo->GetSecurityMode() == 0 ||
                    loadInfo->GetInitialSecurityCheckDone(),
-               "security flags in loadInfo but asyncOpen2() not called");
+               "security flags in loadInfo but asyncOpen() not called");
   }
 #endif
-  MOZ_RELEASE_ASSERT(!aContext, "please call AsyncOpen2()");
-
-  NS_ENSURE_ARG(aListener);
 
   // First make sure that we have a usable inner window; we'll want to make
   // sure that we execute against that inner and no other.
   nsIScriptGlobalObject* global = GetGlobalObject(this);
   if (!global) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
@@ -545,17 +546,17 @@ nsJSChannel::AsyncOpen(nsIStreamListener
   mActualLoadFlags = mLoadFlags;
   mLoadFlags |= LOAD_BACKGROUND;
 
   // Add the javascript channel to its loadgroup so that we know if
   // network loads were canceled or not...
   nsCOMPtr<nsILoadGroup> loadGroup;
   mStreamChannel->GetLoadGroup(getter_AddRefs(loadGroup));
   if (loadGroup) {
-    nsresult rv = loadGroup->AddRequest(this, nullptr);
+    rv = loadGroup->AddRequest(this, nullptr);
     if (NS_FAILED(rv)) {
       mIsActive = false;
       CleanupStrongRefs();
       return rv;
     }
   }
 
   mDocumentOnloadBlockedOn = mOriginalInnerWindow->GetExtantDoc();
@@ -599,46 +600,37 @@ nsJSChannel::AsyncOpen(nsIStreamListener
     if (mStatus != NS_ERROR_DOM_RETVAL_UNDEFINED &&
         mStatus != NS_BINDING_ABORTED) {
       // Note that calling EvaluateScript() handled removing us from the
       // loadgroup and marking us as not active anymore.
       CleanupStrongRefs();
       return mStatus;
     }
 
-    // We're returning success from asyncOpen2(), but we didn't open a
+    // We're returning success from asyncOpen(), but we didn't open a
     // stream channel.  We'll have to notify ourselves, but make sure to do
     // it asynchronously.
     method = &nsJSChannel::NotifyListener;
     name = "nsJSChannel::NotifyListener";
   }
 
   nsCOMPtr<nsIRunnable> runnable =
       mozilla::NewRunnableMethod(name, this, method);
   nsGlobalWindowInner* window = nsGlobalWindowInner::Cast(mOriginalInnerWindow);
-  nsresult rv =
+  rv =
       window->Dispatch(mozilla::TaskCategory::Other, runnable.forget());
 
   if (NS_FAILED(rv)) {
     loadGroup->RemoveRequest(this, nullptr, rv);
     mIsActive = false;
     CleanupStrongRefs();
   }
   return rv;
 }
 
-NS_IMETHODIMP
-nsJSChannel::AsyncOpen2(nsIStreamListener* aListener) {
-  nsCOMPtr<nsIStreamListener> listener = aListener;
-  nsresult rv =
-      nsContentSecurityManager::doContentSecurityCheck(this, listener);
-  NS_ENSURE_SUCCESS(rv, rv);
-  return AsyncOpen(listener, nullptr);
-}
-
 void nsJSChannel::EvaluateScript() {
   // Synchronously execute the script...
   // mIsActive is used to indicate the the request is 'busy' during the
   // the script evaluation phase.  This means that IsPending() will
   // indicate the the request is busy while the script is executing...
 
   // Note that we want to be in the loadgroup and pending while we evaluate
   // the script, so that we find out if the loadgroup gets canceled by the
@@ -718,17 +710,17 @@ void nsJSChannel::EvaluateScript() {
 
   if (NS_FAILED(mStatus)) {
     if (mIsAsync) {
       NotifyListener();
     }
     return;
   }
 
-  mStatus = mStreamChannel->AsyncOpen2(this);
+  mStatus = mStreamChannel->AsyncOpen(this);
   if (NS_SUCCEEDED(mStatus)) {
     // mStreamChannel will call OnStartRequest and OnStopRequest on
     // us, so we'll be sure to call them on our listener.
     mOpenedStreamChannel = true;
 
     // Now readd ourselves to the loadgroup so we can receive
     // cancellation notifications.
     mIsActive = true;
--- a/dom/media/ChannelMediaResource.cpp
+++ b/dom/media/ChannelMediaResource.cpp
@@ -541,17 +541,17 @@ nsresult ChannelMediaResource::OpenChann
 
   mListener = new Listener(this, aOffset, ++mLoadID);
   nsresult rv = mChannel->SetNotificationCallbacks(mListener.get());
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = SetupChannelHeaders(aOffset);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  rv = mChannel->AsyncOpen2(mListener);
+  rv = mChannel->AsyncOpen(mListener);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Tell the media element that we are fetching data from a channel.
   MediaDecoderOwner* owner = mCallback->GetMediaOwner();
   MOZ_DIAGNOSTIC_ASSERT(owner);
   dom::HTMLMediaElement* element = owner->GetMediaElement();
   MOZ_DIAGNOSTIC_ASSERT(element);
   element->DownloadResumed();
--- a/dom/media/IdpSandbox.jsm
+++ b/dom/media/IdpSandbox.jsm
@@ -41,17 +41,17 @@ ResourceLoader.load = function(uri, doc)
       uri,
       loadingNode: doc,
       securityFlags: Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
       contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_SCRIPT,
     });
 
     ioChannel.loadGroup = doc.documentLoadGroup.QueryInterface(Ci.nsILoadGroup);
     ioChannel.notificationCallbacks = new RedirectHttpsOnly();
-    ioChannel.asyncOpen2(listener);
+    ioChannel.asyncOpen(listener);
   });
 };
 
 ResourceLoader.prototype = {
   onDataAvailable(request, context, input, offset, count) {
     let stream = Cc["@mozilla.org/scriptableinputstream;1"]
       .createInstance(Ci.nsIScriptableInputStream);
     stream.init(input);
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -3155,17 +3155,17 @@ nsresult nsPluginHost::NewPluginURLStrea
       uploadChannel->SetUploadStream(aPostStream, EmptyCString(), -1);
     }
 
     if (aHeadersData) {
       rv = AddHeadersToChannel(aHeadersData, aHeadersDataLen, httpChannel);
       NS_ENSURE_SUCCESS(rv, rv);
     }
   }
-  rv = channel->AsyncOpen2(listenerPeer);
+  rv = channel->AsyncOpen(listenerPeer);
   if (NS_SUCCEEDED(rv)) listenerPeer->TrackRequest(channel);
   return rv;
 }
 
 nsresult nsPluginHost::AddHeadersToChannel(const char* aHeadersData,
                                            uint32_t aHeadersDataLen,
                                            nsIChannel* aGenericChannel) {
   nsresult rv = NS_OK;
--- a/dom/plugins/base/nsPluginStreamListenerPeer.cpp
+++ b/dom/plugins/base/nsPluginStreamListenerPeer.cpp
@@ -262,17 +262,17 @@ nsresult nsPluginStreamListenerPeer::Get
 }
 
 nsresult nsPluginStreamListenerPeer::GetURL(const char** result) {
   *result = mURLSpec.get();
   return NS_OK;
 }
 
 // XXX: Converting the channel within nsPluginStreamListenerPeer
-// to use asyncOpen2() and do not want to touch the fragile logic
+// to use asyncOpen() and do not want to touch the fragile logic
 // of byte range requests. Hence we just introduce this lightweight
 // wrapper to proxy the context.
 class PluginContextProxy final : public nsIStreamListener {
  public:
   NS_DECL_ISUPPORTS
 
   PluginContextProxy(nsIStreamListener* aListener, nsISupports* aContext)
       : mListener(aListener), mContext(aContext) {
--- a/dom/push/PushServiceHttp2.jsm
+++ b/dom/push/PushServiceHttp2.jsm
@@ -85,17 +85,17 @@ PushSubscriptionListener.prototype = {
     this._pushService.connOnStop(aRequest,
                                  Components.isSuccessCode(aStatusCode),
                                  this.uri);
   },
 
   onPush: function(associatedChannel, pushChannel) {
     console.debug("PushSubscriptionListener: onPush()");
     var pushChannelListener = new PushChannelListener(this);
-    pushChannel.asyncOpen2(pushChannelListener);
+    pushChannel.asyncOpen(pushChannelListener);
   },
 
   disconnect: function() {
     this._pushService = null;
   }
 };
 
 /**
@@ -487,33 +487,33 @@ var PushServiceHttp2 = {
       var listener = new SubscriptionListener(aSubInfo,
                                               resolve,
                                               reject,
                                               this._serverURI,
                                               this);
 
       var chan = this._makeChannel(this._serverURI.spec);
       chan.requestMethod = "POST";
-      chan.asyncOpen2(listener);
+      chan.asyncOpen(listener);
     })
     .catch(err => {
       if ("retry" in err) {
         return this._subscribeResourceInternal(err.subInfo);
       } else {
         throw err;
       }
     })
   },
 
   _deleteResource: function(aUri) {
 
     return new Promise((resolve,reject) => {
       var chan = this._makeChannel(aUri);
       chan.requestMethod = "DELETE";
-      chan.asyncOpen2(new PushServiceDelete(resolve, reject));
+      chan.asyncOpen(new PushServiceDelete(resolve, reject));
     });
   },
 
   /**
    * Unsubscribe the resource with a subscription uri aSubscriptionUri.
    * We can't do anything about it if it fails, so we don't listen for response.
    */
   _unsubscribeResource: function(aSubscriptionUri) {
@@ -537,20 +537,20 @@ var PushServiceHttp2 = {
     var conn = {};
     conn.channel = chan;
     var listener = new PushSubscriptionListener(this, aSubscriptionUri);
     conn.listener = listener;
 
     chan.notificationCallbacks = listener;
 
     try {
-      chan.asyncOpen2(listener);
+      chan.asyncOpen(listener);
     } catch (e) {
       console.error("listenForMsgs: Error connecting to push server.",
-        "asyncOpen2 failed", e);
+        "asyncOpen failed", e);
       conn.listener.disconnect();
       chan.cancel(Cr.NS_ERROR_ABORT);
       this._retryAfterBackoff(aSubscriptionUri, -1);
       return;
     }
 
     this._conns[aSubscriptionUri].lastStartListening = Date.now();
     this._conns[aSubscriptionUri].channel = conn.channel;
--- a/dom/script/ScriptLoader.cpp
+++ b/dom/script/ScriptLoader.cpp
@@ -1361,17 +1361,17 @@ nsresult ScriptLoader::StartLoad(ScriptL
 
   RefPtr<ScriptLoadHandler> handler =
       new ScriptLoadHandler(this, aRequest, sriDataVerifier.forget());
 
   nsCOMPtr<nsIIncrementalStreamLoader> loader;
   rv = NS_NewIncrementalStreamLoader(getter_AddRefs(loader), handler);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  rv = channel->AsyncOpen2(loader);
+  rv = channel->AsyncOpen(loader);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (aRequest->IsModuleRequest()) {
     // We successfully started fetching a module so put its URL in the module
     // map and mark it as fetching.
     SetModuleFetchStarted(aRequest->AsModuleRequest());
     LOG(("ScriptLoadRequest (%p): Start fetching module", aRequest));
   }
--- a/dom/security/nsCSPContext.cpp
+++ b/dom/security/nsCSPContext.cpp
@@ -1105,17 +1105,17 @@ nsresult nsCSPContext::SendReports(
     nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(reportChannel));
     if (httpChannel) {
       rv = httpChannel->SetRequestMethod(NS_LITERAL_CSTRING("POST"));
       MOZ_ASSERT(NS_SUCCEEDED(rv));
     }
 
     RefPtr<CSPViolationReportListener> listener =
         new CSPViolationReportListener();
-    rv = reportChannel->AsyncOpen2(listener);
+    rv = reportChannel->AsyncOpen(listener);
 
     // AsyncOpen should not fail, but could if there's no load group (like if
     // SetRequestContext is not given a channel).  This should fail quietly and
     // not return an error since it's really ok if reports don't go out, but
     // it's good to log the error locally.
 
     if (NS_FAILED(rv)) {
       const char16_t* params[] = {reportURIs[r].get()};
--- a/dom/security/nsContentSecurityManager.cpp
+++ b/dom/security/nsContentSecurityManager.cpp
@@ -744,19 +744,16 @@ static void DebugDoContentSecurityCheck(
             ("  externalContentPolicyType: %d\n",
              aLoadInfo->GetExternalContentPolicyType()));
     MOZ_LOG(sCSMLog, LogLevel::Debug,
             ("  upgradeInsecureRequests: %s\n",
              aLoadInfo->GetUpgradeInsecureRequests() ? "true" : "false"));
     MOZ_LOG(sCSMLog, LogLevel::Debug,
             ("  initalSecurityChecksDone: %s\n",
              aLoadInfo->GetInitialSecurityCheckDone() ? "true" : "false"));
-    MOZ_LOG(sCSMLog, LogLevel::Debug,
-            ("  enforceSecurity: %s\n",
-             aLoadInfo->GetEnforceSecurity() ? "true" : "false"));
 
     // Log CSPrequestPrincipal
     nsCOMPtr<nsIContentSecurityPolicy> csp;
     requestPrincipal->GetCsp(getter_AddRefs(csp));
     if (csp) {
       nsAutoString parsedPolicyStr;
       uint32_t count = 0;
       csp->GetPolicyCount(&count);
@@ -784,17 +781,17 @@ static void DebugDoContentSecurityCheck(
  * (2) Allow Cross Origin but perform sanity checks whether a principal
  *     is allowed to access the following URL.
  * (3) Perform CORS check (if applicable)
  * (4) ContentPolicy checks (Content-Security-Policy, Mixed Content, ...)
  *
  * @param aChannel
  *    The channel to perform the security checks on.
  * @param aInAndOutListener
- *    The streamListener that is passed to channel->AsyncOpen2() that is now
+ *    The streamListener that is passed to channel->AsyncOpen() that is now
  * potentially wrappend within nsCORSListenerProxy() and becomes the
  * corsListener that now needs to be set as new streamListener on the channel.
  */
 nsresult nsContentSecurityManager::doContentSecurityCheck(
     nsIChannel* aChannel, nsCOMPtr<nsIStreamListener>& aInAndOutListener) {
   NS_ENSURE_ARG(aChannel);
   nsCOMPtr<nsILoadInfo> loadInfo = aChannel->GetLoadInfo();
 
@@ -814,23 +811,16 @@ nsresult nsContentSecurityManager::doCon
     return NS_OK;
   }
 
   // make sure that only one of the five security flags is set in the loadinfo
   // e.g. do not require same origin and allow cross origin at the same time
   nsresult rv = ValidateSecurityFlags(loadInfo);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  // since aChannel was openend using asyncOpen2() we have to make sure
-  // that redirects of that channel also get openend using asyncOpen2()
-  // please note that some implementations of ::AsyncOpen2 might already
-  // have set that flag to true (e.g. nsViewSourceChannel) in which case
-  // we just set the flag again.
-  loadInfo->SetEnforceSecurity(true);
-
   if (loadInfo->GetSecurityMode() ==
       nsILoadInfo::SEC_REQUIRE_CORS_DATA_INHERITS) {
     rv = DoCORSChecks(aChannel, loadInfo, aInAndOutListener);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   rv = CheckChannel(aChannel);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -850,18 +840,17 @@ nsresult nsContentSecurityManager::doCon
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsContentSecurityManager::AsyncOnChannelRedirect(
     nsIChannel* aOldChannel, nsIChannel* aNewChannel, uint32_t aRedirFlags,
     nsIAsyncVerifyRedirectCallback* aCb) {
   nsCOMPtr<nsILoadInfo> loadInfo = aOldChannel->GetLoadInfo();
-  // Are we enforcing security using LoadInfo?
-  if (loadInfo && loadInfo->GetEnforceSecurity()) {
+  if (loadInfo) {
     nsresult rv = CheckChannel(aNewChannel);
     if (NS_SUCCEEDED(rv)) {
       rv = CheckFTPSubresourceLoad(aNewChannel);
     }
     if (NS_FAILED(rv)) {
       aOldChannel->Cancel(rv);
       return rv;
     }
--- a/dom/security/test/unit/test_csp_upgrade_insecure_request_header.js
+++ b/dom/security/test/unit/test_csp_upgrade_insecure_request_header.js
@@ -82,17 +82,17 @@ function serverHandler(metadata, respons
 
 function run_next_test() {
   curTest = tests.shift();
   if (!curTest) {
     httpserver.stop(do_test_finished);
     return;
   }
   channel = setupChannel(curTest.contentType);
-  channel.asyncOpen2(new ChannelListener());
+  channel.asyncOpen(new ChannelListener());
 }
 
 function run_test() {
   // set up the test environment
   httpserver = new HttpServer();
   httpserver.registerPathHandler(testpath, serverHandler);
   httpserver.start(-1);
 
--- a/dom/serviceworkers/ServiceWorkerScriptCache.cpp
+++ b/dom/serviceworkers/ServiceWorkerScriptCache.cpp
@@ -684,17 +684,17 @@ nsresult CompareNetwork::Initialize(nsIP
   }
 
   nsCOMPtr<nsIStreamLoader> loader;
   rv = NS_NewStreamLoader(getter_AddRefs(loader), this, this);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
-  rv = mChannel->AsyncOpen2(loader);
+  rv = mChannel->AsyncOpen(loader);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   // If we do have an existing cache to compare with.
   if (aCache) {
     mCC = new CompareCache(this);
     rv = mCC->Initialize(aCache, aURL);
--- a/dom/webbrowserpersist/nsWebBrowserPersist.cpp
+++ b/dom/webbrowserpersist/nsWebBrowserPersist.cpp
@@ -507,17 +507,17 @@ nsresult nsWebBrowserPersist::StartUploa
   CreateChannelFromURI(aDestinationURI, getter_AddRefs(destChannel));
   nsCOMPtr<nsIUploadChannel> uploadChannel(do_QueryInterface(destChannel));
   NS_ENSURE_TRUE(uploadChannel, NS_ERROR_FAILURE);
 
   // Set the upload stream
   // NOTE: ALL data must be available in "inputstream"
   nsresult rv = uploadChannel->SetUploadStream(aInputStream, aContentType, -1);
   NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
-  rv = destChannel->AsyncOpen2(this);
+  rv = destChannel->AsyncOpen(this);
   NS_ENSURE_SUCCESS(rv, NS_ERROR_FAILURE);
 
   // add this to the upload list
   nsCOMPtr<nsISupports> keyPtr = do_QueryInterface(destChannel);
   mUploadList.Put(keyPtr, new UploadData(aDestinationURI));
 
   return NS_OK;
 }
@@ -1334,17 +1334,17 @@ nsresult nsWebBrowserPersist::SaveChanne
   // special-cases a file target and creates a file output stream directly.
   // We want to special-case a file source and create a file input stream,
   // but we don't need to do this in the case of a file target.
   nsCOMPtr<nsIFileChannel> fc(do_QueryInterface(aChannel));
   nsCOMPtr<nsIFileURL> fu(do_QueryInterface(aFile));
 
   if (fc && !fu) {
     nsCOMPtr<nsIInputStream> fileInputStream, bufferedInputStream;
-    nsresult rv = NS_MaybeOpenChannelUsingOpen2(
+    nsresult rv = NS_MaybeOpenChannelUsingOpen(
         aChannel, getter_AddRefs(fileInputStream));
     NS_ENSURE_SUCCESS(rv, rv);
     rv = NS_NewBufferedInputStream(getter_AddRefs(bufferedInputStream),
                                    fileInputStream.forget(),
                                    BUFFERED_OUTPUT_SIZE);
     NS_ENSURE_SUCCESS(rv, rv);
     nsAutoCString contentType;
     aChannel->GetContentType(contentType);
@@ -1353,17 +1353,17 @@ nsresult nsWebBrowserPersist::SaveChanne
 
   // Mark save channel as throttleable.
   nsCOMPtr<nsIClassOfService> cos(do_QueryInterface(aChannel));
   if (cos) {
     cos->AddClassFlags(nsIClassOfService::Throttleable);
   }
 
   // Read from the input channel
-  nsresult rv = NS_MaybeOpenChannelUsingAsyncOpen2(aChannel, this);
+  nsresult rv = NS_MaybeOpenChannelUsingAsyncOpen(aChannel, this);
   if (rv == NS_ERROR_NO_CONTENT) {
     // Assume this is a protocol such as mailto: which does not feed out
     // data and just ignore it.
     return NS_SUCCESS_DONT_FIXUP;
   }
 
   if (NS_FAILED(rv)) {
     // Opening failed, but do we care?
--- a/dom/websocket/WebSocket.cpp
+++ b/dom/websocket/WebSocket.cpp
@@ -1526,17 +1526,17 @@ nsresult WebSocketImpl::Init(JSContext* 
       if (NS_WARN_IF(NS_FAILED(rv))) {
         MOZ_CRASH();
       }
     }
 
     // The 'real' nsHttpChannel of the websocket gets opened in the parent.
     // Since we don't serialize the CSP within child and parent and also not
     // the context, we have to perform content policy checks here instead of
-    // AsyncOpen2().
+    // AsyncOpen().
     // Please note that websockets can't follow redirects, hence there is no
     // need to perform a CSP check after redirects.
     nsCOMPtr<nsILoadInfo> secCheckLoadInfo = new net::LoadInfo(
         aPrincipal,  // loading principal
         aPrincipal,  // triggering principal
         originDoc, nsILoadInfo::SEC_ONLY_FOR_EXPLICIT_CONTENTSEC_CHECK,
         nsIContentPolicy::TYPE_WEBSOCKET);
 
--- a/dom/workers/ScriptLoader.cpp
+++ b/dom/workers/ScriptLoader.cpp
@@ -992,17 +992,17 @@ class ScriptLoaderRunnable final : publi
           channel, std::move(loadInfo.mReservedClientInfo), Maybe<ClientInfo>(),
           mWorkerPrivate->HybridEventTarget());
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
     }
 
     if (loadInfo.mCacheStatus != ScriptLoadInfo::ToBeCached) {
-      rv = channel->AsyncOpen2(loader);
+      rv = channel->AsyncOpen(loader);
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
     } else {
       nsCOMPtr<nsIOutputStream> writer;
 
       // In case we return early.
       loadInfo.mCacheStatus = ScriptLoadInfo::Cancel;
@@ -1017,17 +1017,17 @@ class ScriptLoaderRunnable final : publi
 
       nsCOMPtr<nsIStreamListenerTee> tee =
           do_CreateInstance(NS_STREAMLISTENERTEE_CONTRACTID);
       rv = tee->Init(loader, writer, listener);
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
 
-      nsresult rv = channel->AsyncOpen2(tee);
+      nsresult rv = channel->AsyncOpen(tee);
       if (NS_WARN_IF(NS_FAILED(rv))) {
         return rv;
       }
     }
 
     loadInfo.mChannel.swap(channel);
 
     return NS_OK;
--- a/dom/xbl/nsXBLService.cpp
+++ b/dom/xbl/nsXBLService.cpp
@@ -1068,34 +1068,34 @@ nsresult nsXBLService::FetchBindingDocum
       bindingManager->PutLoadingDocListener(aDocumentURI, xblListener);
 
     // Add our request.
     nsXBLBindingRequest* req =
         new nsXBLBindingRequest(aBindingURI, aBoundElement);
     xblListener->AddRequest(req);
 
     // Now kick off the async read.
-    rv = channel->AsyncOpen2(xblListener);
+    rv = channel->AsyncOpen(xblListener);
     if (NS_FAILED(rv)) {
       // Well, we won't be getting a load.  Make sure to clean up our stuff!
       if (bindingManager) {
         bindingManager->RemoveLoadingDocListener(aDocumentURI);
       }
     }
     return NS_OK;
   }
 
   nsCOMPtr<nsIStreamListener> listener;
   rv = doc->StartDocumentLoad("loadAsInteractiveData", channel, loadGroup,
                               nullptr, getter_AddRefs(listener), true, xblSink);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Now do a blocking synchronous parse of the file.
   nsCOMPtr<nsIInputStream> in;
-  rv = channel->Open2(getter_AddRefs(in));
+  rv = channel->Open(getter_AddRefs(in));
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = nsSyncLoadService::PushSyncStreamToListener(in.forget(), listener,
                                                    channel);
   NS_ENSURE_SUCCESS(rv, rv);
 
   doc.swap(*aResult);
 
--- a/dom/xhr/XMLHttpRequestMainThread.cpp
+++ b/dom/xhr/XMLHttpRequestMainThread.cpp
@@ -2615,17 +2615,17 @@ nsresult XMLHttpRequestMainThread::Initi
 
   // Check if this XHR is created from a tracking script.
   // If yes, lower the channel's priority.
   if (StaticPrefs::privacy_trackingprotection_lower_network_priority()) {
     MaybeLowerChannelPriority();
   }
 
   // Start reading from the channel
-  rv = mChannel->AsyncOpen2(listener);
+  rv = mChannel->AsyncOpen(listener);
   listener = nullptr;
   if (NS_WARN_IF(NS_FAILED(rv))) {
     // Drop our ref to the channel to avoid cycles. Also drop channel's
     // ref to us to be extra safe.
     mChannel->SetNotificationCallbacks(mNotificationCallbacks);
     mChannel = nullptr;
 
     mErrorLoad = ErrorType::eChannelOpen;
--- a/dom/xml/XMLDocument.cpp
+++ b/dom/xml/XMLDocument.cpp
@@ -418,17 +418,17 @@ bool XMLDocument::Load(const nsAString& 
     aRv.Throw(rv);
     return false;
   }
 
   // After this point, if we error out of this method we should clear
   // mChannelIsPending.
 
   // Start an asynchronous read of the XML document
-  rv = channel->AsyncOpen2(listener);
+  rv = channel->AsyncOpen(listener);
   if (NS_FAILED(rv)) {
     mChannelIsPending = false;
     aRv.Throw(rv);
     return false;
   }
 
   if (!mAsync) {
     nsAutoSyncOperation sync(this);
--- a/dom/xslt/tests/XSLTMark/XSLTMark-static.js
+++ b/dom/xslt/tests/XSLTMark/XSLTMark-static.js
@@ -25,17 +25,17 @@ function loadFile(aUriSpec)
         throw Cr.ERR_FAILURE;
     }
     var chan = NetUtil.newChannel({
         uri: aUriSpec,
         loadUsingSystemPrincipal: true
     });
     var instream = 
         Cc[SIS_CTRID].createInstance(nsISIS);
-    instream.init(chan.open2());
+    instream.init(chan.open());
 
     return instream.read(instream.available());
 }
 
 function dump20(aVal)
 {
     const pads = '                    ';
     if (typeof(aVal)=='string')
--- a/dom/xslt/xslt/txMozillaStylesheetCompiler.cpp
+++ b/dom/xslt/xslt/txMozillaStylesheetCompiler.cpp
@@ -429,17 +429,17 @@ nsresult txCompileObserver::startLoad(ns
   NS_ENSURE_TRUE(sink, NS_ERROR_OUT_OF_MEMORY);
 
   channel->SetNotificationCallbacks(sink);
 
   parser->SetCommand(kLoadAsData);
   parser->SetContentSink(sink);
   parser->Parse(aUri);
 
-  return channel->AsyncOpen2(sink);
+  return channel->AsyncOpen(sink);
 }
 
 nsresult TX_LoadSheet(nsIURI* aUri, txMozillaXSLTProcessor* aProcessor,
                       Document* aLoaderDocument,
                       ReferrerPolicy aReferrerPolicy) {
   nsIPrincipal* principal = aLoaderDocument->NodePrincipal();
 
   nsAutoCString spec;
--- a/extensions/cookie/nsPermissionManager.cpp
+++ b/extensions/cookie/nsPermissionManager.cpp
@@ -2982,17 +2982,17 @@ nsresult nsPermissionManager::ImportDefa
   nsCOMPtr<nsIChannel> channel;
   rv = NS_NewChannel(getter_AddRefs(channel), defaultsURI,
                      nsContentUtils::GetSystemPrincipal(),
                      nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                      nsIContentPolicy::TYPE_OTHER);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIInputStream> inputStream;
-  rv = channel->Open2(getter_AddRefs(inputStream));
+  rv = channel->Open(getter_AddRefs(inputStream));
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = _DoImport(inputStream, nullptr);
   inputStream->Close();
   return rv;
 }
 
 // _DoImport reads the specified stream and adds the parsed elements.  If
--- a/extensions/pref/autoconfig/src/nsAutoConfig.cpp
+++ b/extensions/pref/autoconfig/src/nsAutoConfig.cpp
@@ -251,17 +251,17 @@ nsresult nsAutoConfig::downloadAutoConfi
       nsIContentPolicy::TYPE_OTHER,
       nullptr,  // PerformanceStorage
       nullptr,  // loadGroup
       nullptr,  // aCallbacks
       nsIRequest::INHIBIT_PERSISTENT_CACHING | nsIRequest::LOAD_BYPASS_CACHE);
 
   if (NS_FAILED(rv)) return rv;
 
-  rv = channel->AsyncOpen2(this);
+  rv = channel->AsyncOpen(this);
   if (NS_FAILED(rv)) {
     readOfflineFile();
     return rv;
   }
 
   // Set a repeating timer if the pref is set.
   // This is to be done only once.
   // Also We are having the event queue processing only for the startup
--- a/extensions/pref/autoconfig/src/nsReadConfig.cpp
+++ b/extensions/pref/autoconfig/src/nsReadConfig.cpp
@@ -258,17 +258,17 @@ nsresult nsReadConfig::openAndEvaluateJS
 
     nsCOMPtr<nsIChannel> channel;
     rv = NS_NewChannel(getter_AddRefs(channel), uri,
                        nsContentUtils::GetSystemPrincipal(),
                        nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                        nsIContentPolicy::TYPE_OTHER);
     NS_ENSURE_SUCCESS(rv, rv);
 
-    rv = channel->Open2(getter_AddRefs(inStr));
+    rv = channel->Open(getter_AddRefs(inStr));
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   uint64_t fs64;
   uint32_t amt = 0;
   rv = inStr->Available(&fs64);
   if (NS_FAILED(rv)) return rv;
   // This used to use PR_Malloc(), which doesn't support over 4GB.
--- a/extensions/spellcheck/hunspell/glue/mozHunspellFileMgr.cpp
+++ b/extensions/spellcheck/hunspell/glue/mozHunspellFileMgr.cpp
@@ -23,17 +23,17 @@ Result<Ok, nsresult> FileMgr::Open(const
   MOZ_TRY(NS_NewURI(getter_AddRefs(uri), aPath));
 
   nsCOMPtr<nsIChannel> channel;
   MOZ_TRY(NS_NewChannel(getter_AddRefs(channel), uri,
                         nsContentUtils::GetSystemPrincipal(),
                         nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_INHERITS,
                         nsIContentPolicy::TYPE_OTHER));
 
-  MOZ_TRY(channel->Open2(getter_AddRefs(mStream)));
+  MOZ_TRY(channel->Open(getter_AddRefs(mStream)));
   return Ok();
 }
 
 Result<Ok, nsresult> FileMgr::ReadLine(nsACString& aLine) {
   if (!mStream) {
     return Err(NS_ERROR_NOT_INITIALIZED);
   }
 
--- a/image/decoders/icon/mac/nsIconChannelCocoa.mm
+++ b/image/decoders/icon/mac/nsIconChannelCocoa.mm
@@ -126,24 +126,23 @@ nsIconChannel::SetOriginalURI(nsIURI* aU
 NS_IMETHODIMP
 nsIconChannel::GetURI(nsIURI** aURI) {
   *aURI = mUrl;
   NS_IF_ADDREF(*aURI);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsIconChannel::Open(nsIInputStream** _retval) { return MakeInputStream(_retval, false); }
-
-NS_IMETHODIMP
-nsIconChannel::Open2(nsIInputStream** aStream) {
+nsIconChannel::Open(nsIInputStream** _retval)
+{
   nsCOMPtr<nsIStreamListener> listener;
   nsresult rv = nsContentSecurityManager::doContentSecurityCheck(this, listener);
   NS_ENSURE_SUCCESS(rv, rv);
-  return Open(aStream);
+
+  return MakeInputStream(_retval, false);
 }
 
 nsresult nsIconChannel::ExtractIconInfoFromUrl(nsIFile** aLocalFile, uint32_t* aDesiredImageSize,
                                                nsACString& aContentType,
                                                nsACString& aFileExtension) {
   nsresult rv = NS_OK;
   nsCOMPtr<nsIMozIconURI> iconURI(do_QueryInterface(mUrl, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
@@ -168,65 +167,63 @@ nsresult nsIconChannel::ExtractIconInfoF
 
   *aLocalFile = file;
   NS_IF_ADDREF(*aLocalFile);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsIconChannel::AsyncOpen(nsIStreamListener* aListener, nsISupports* ctxt) {
+nsIconChannel::AsyncOpen(nsIStreamListener* aListener)
+{
+  nsCOMPtr<nsIStreamListener> listener = aListener;
+  nsresult rv = nsContentSecurityManager::doContentSecurityCheck(this, listener);
+  if (NS_FAILED(rv)) {
+    mCallbacks = nullptr;
+    return rv;
+  }
+
   MOZ_ASSERT(
       !mLoadInfo || mLoadInfo->GetSecurityMode() == 0 || mLoadInfo->GetInitialSecurityCheckDone() ||
           (mLoadInfo->GetSecurityMode() == nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL &&
            nsContentUtils::IsSystemPrincipal(mLoadInfo->LoadingPrincipal())),
-      "security flags in loadInfo but asyncOpen2() not called");
+      "security flags in loadInfo but doContentSecurityCheck() not called");
+
 
   nsCOMPtr<nsIInputStream> inStream;
-  nsresult rv = MakeInputStream(getter_AddRefs(inStream), true);
+  MakeInputStream(getter_AddRefs(inStream), true);
   if (NS_FAILED(rv)) {
     mCallbacks = nullptr;
     return rv;
   }
 
   // Init our stream pump
   nsCOMPtr<nsIEventTarget> target =
       nsContentUtils::GetEventTargetByLoadInfo(mLoadInfo, mozilla::TaskCategory::Other);
   rv = mPump->Init(inStream, 0, 0, false, target);
   if (NS_FAILED(rv)) {
     mCallbacks = nullptr;
     return rv;
   }
 
-  rv = mPump->AsyncRead(this, ctxt);
+  rv = mPump->AsyncRead(this, nullptr);
   if (NS_SUCCEEDED(rv)) {
     // Store our real listener
     mListener = aListener;
     // Add ourself to the load group, if available
     if (mLoadGroup) {
       mLoadGroup->AddRequest(this, nullptr);
     }
   } else {
     mCallbacks = nullptr;
   }
 
   return rv;
 }
 
-NS_IMETHODIMP
-nsIconChannel::AsyncOpen2(nsIStreamListener* aListener) {
-  nsCOMPtr<nsIStreamListener> listener = aListener;
-  nsresult rv = nsContentSecurityManager::doContentSecurityCheck(this, listener);
-  if (NS_FAILED(rv)) {
-    mCallbacks = nullptr;
-    return rv;
-  }
-  return AsyncOpen(listener, nullptr);
-}
-
 nsresult nsIconChannel::MakeInputStream(nsIInputStream** _retval, bool aNonBlocking) {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NSRESULT;
 
   nsCString contentType;
   nsAutoCString fileExt;
   nsCOMPtr<nsIFile> fileloc;  // file we want an icon for
   uint32_t desiredImageSize;
   nsresult rv =
--- a/image/decoders/icon/win/nsIconChannel.cpp
+++ b/image/decoders/icon/win/nsIconChannel.cpp
@@ -151,27 +151,23 @@ nsIconChannel::SetOriginalURI(nsIURI* aU
 NS_IMETHODIMP
 nsIconChannel::GetURI(nsIURI** aURI) {
   *aURI = mUrl;
   NS_IF_ADDREF(*aURI);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsIconChannel::Open(nsIInputStream** _retval) {
-  return MakeInputStream(_retval, false);
-}
-
-NS_IMETHODIMP
-nsIconChannel::Open2(nsIInputStream** aStream) {
+nsIconChannel::Open(nsIInputStream** aStream) {
   nsCOMPtr<nsIStreamListener> listener;
   nsresult rv =
       nsContentSecurityManager::doContentSecurityCheck(this, listener);
   NS_ENSURE_SUCCESS(rv, rv);
-  return Open(aStream);
+
+  return MakeInputStream(aStream, false);
 }
 
 nsresult nsIconChannel::ExtractIconInfoFromUrl(nsIFile** aLocalFile,
                                                uint32_t* aDesiredImageSize,
                                                nsCString& aContentType,
                                                nsCString& aFileExtension) {
   nsresult rv = NS_OK;
   nsCOMPtr<nsIMozIconURI> iconURI(do_QueryInterface(mUrl, &rv));
@@ -190,69 +186,66 @@ nsresult nsIconChannel::ExtractIconInfoF
 
   nsCOMPtr<nsIFile> file;
   rv = fileURL->GetFile(getter_AddRefs(file));
   if (NS_FAILED(rv) || !file) return NS_OK;
 
   return file->Clone(aLocalFile);
 }
 
+
 NS_IMETHODIMP
-nsIconChannel::AsyncOpen(nsIStreamListener* aListener, nsISupports* ctxt) {
+nsIconChannel::AsyncOpen(nsIStreamListener* aListener) {
+  nsCOMPtr<nsIStreamListener> listener = aListener;
+  nsresult rv =
+      nsContentSecurityManager::doContentSecurityCheck(this, listener);
+  if (NS_FAILED(rv)) {
+    mCallbacks = nullptr;
+    return rv;
+  }
+
   MOZ_ASSERT(
       !mLoadInfo || mLoadInfo->GetSecurityMode() == 0 ||
           mLoadInfo->GetInitialSecurityCheckDone() ||
           (mLoadInfo->GetSecurityMode() ==
                nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL &&
            nsContentUtils::IsSystemPrincipal(mLoadInfo->LoadingPrincipal())),
-      "security flags in loadInfo but asyncOpen2() not called");
+      "security flags in loadInfo but doContentSecurityCheck() not called");
 
   nsCOMPtr<nsIInputStream> inStream;
-  nsresult rv = MakeInputStream(getter_AddRefs(inStream), true);
+  rv = MakeInputStream(getter_AddRefs(inStream), true);
   if (NS_FAILED(rv)) {
     mCallbacks = nullptr;
     return rv;
   }
 
   // Init our streampump
   nsCOMPtr<nsIEventTarget> target = nsContentUtils::GetEventTargetByLoadInfo(
       mLoadInfo, mozilla::TaskCategory::Other);
   rv = mPump->Init(inStream, 0, 0, false, target);
   if (NS_FAILED(rv)) {
     mCallbacks = nullptr;
     return rv;
   }
 
-  rv = mPump->AsyncRead(this, ctxt);
+  rv = mPump->AsyncRead(this, nullptr);
   if (NS_SUCCEEDED(rv)) {
     // Store our real listener
     mListener = aListener;
     // Add ourself to the load group, if available
     if (mLoadGroup) {
       mLoadGroup->AddRequest(this, nullptr);
     }
   } else {
     mCallbacks = nullptr;
   }
 
   return rv;
 }
 
-NS_IMETHODIMP
-nsIconChannel::AsyncOpen2(nsIStreamListener* aListener) {
-  nsCOMPtr<nsIStreamListener> listener = aListener;
-  nsresult rv =
-      nsContentSecurityManager::doContentSecurityCheck(this, listener);
-  if (NS_FAILED(rv)) {
-    mCallbacks = nullptr;
-    return rv;
-  }
-  return AsyncOpen(listener, nullptr);
-}
-
 static DWORD GetSpecialFolderIcon(nsIFile* aFile, int aFolder,
                                   SHFILEINFOW* aSFI, UINT aInfoFlags) {
   DWORD shellResult = 0;
 
   if (!aFile) {
     return shellResult;
   }
 
--- a/image/imgLoader.cpp
+++ b/image/imgLoader.cpp
@@ -1742,17 +1742,17 @@ bool imgLoader::ValidateRequestWithNewCh
   req->MarkValidating();
 
   // Add the proxy without notifying
   hvc->AddProxy(req);
 
   mozilla::net::PredictorLearn(aURI, aInitialDocumentURI,
                                nsINetworkPredictor::LEARN_LOAD_SUBRESOURCE,
                                aLoadGroup);
-  rv = newChannel->AsyncOpen2(listener);
+  rv = newChannel->AsyncOpen(listener);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     req->CancelAndForgetObserver(rv);
     return false;
   }
 
   req.forget(aProxyRequest);
   return true;
 }
@@ -2257,29 +2257,29 @@ nsresult imgLoader::LoadImage(
       timedChannel->SetInitiatorType(initiatorType);
     }
 
     // create the proxy listener
     nsCOMPtr<nsIStreamListener> listener = new ProxyListener(request.get());
 
     MOZ_LOG(
         gImgLog, LogLevel::Debug,
-        ("[this=%p] imgLoader::LoadImage -- Calling channel->AsyncOpen2()\n",
+        ("[this=%p] imgLoader::LoadImage -- Calling channel->AsyncOpen()\n",
          this));
 
     mozilla::net::PredictorLearn(aURI, aInitialDocumentURI,
                                  nsINetworkPredictor::LEARN_LOAD_SUBRESOURCE,
                                  aLoadGroup);
 
-    nsresult openRes = newChannel->AsyncOpen2(listener);
+    nsresult openRes = newChannel->AsyncOpen(listener);
 
     if (NS_FAILED(openRes)) {
       MOZ_LOG(
           gImgLog, LogLevel::Debug,
-          ("[this=%p] imgLoader::LoadImage -- AsyncOpen2() failed: 0x%" PRIx32
+          ("[this=%p] imgLoader::LoadImage -- AsyncOpen() failed: 0x%" PRIx32
            "\n",
            this, static_cast<uint32_t>(openRes)));
       request->CancelAndAbort(openRes);
       return openRes;
     }
 
     // Try to add the new request into the cache.
     PutIntoCache(key, entry);
--- a/image/test/unit/async_load_tests.js
+++ b/image/test/unit/async_load_tests.js
@@ -120,17 +120,17 @@ function getChannelLoadImageStopCallback
 
 // Load the request a second time. This should come from the image cache, and
 // therefore would be at most risk of being served synchronously.
 function checkSecondChannelLoad()
 {
   do_test_pending();
   var channel = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true});
   var channellistener = new ChannelListener();
-  channel.asyncOpen2(channellistener);
+  channel.asyncOpen(channellistener);
 
   var listener = new ImageListener(null,
                                    getChannelLoadImageStopCallback(channellistener,
                                                                    all_done_callback));
   var outer = Cc["@mozilla.org/image/tools;1"].getService(Ci.imgITools)
                 .createScriptedObserver(listener);
   var outlistener = {};
   requests.push({
@@ -145,17 +145,17 @@ function checkSecondChannelLoad()
 function run_loadImageWithChannel_tests()
 {
   // To ensure we're testing what we expect to, create a new loader and cache.
   gCurrentLoader = Cc["@mozilla.org/image/loader;1"].createInstance(Ci.imgILoader);
 
   do_test_pending();
   var channel =  NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true});
   var channellistener = new ChannelListener();
-  channel.asyncOpen2(channellistener);
+  channel.asyncOpen(channellistener);
 
   var listener = new ImageListener(null,
                                    getChannelLoadImageStopCallback(channellistener,
                                                                    checkSecondChannelLoad));
   var outer = Cc["@mozilla.org/image/tools;1"].getService(Ci.imgITools)
                 .createScriptedObserver(listener);
   var outlistener = {};
   requests.push({
--- a/image/test/unit/test_private_channel.js
+++ b/image/test/unit/test_private_channel.js
@@ -38,17 +38,17 @@ function setup_chan(path, isPrivate, cal
   var principal = Services.scriptSecurityManager
                           .createCodebasePrincipal(uri, {privateBrowsingId: isPrivate ? 1 : 0});
   var chan =  NetUtil.newChannel({uri: uri, loadingPrincipal: principal,
                                   securityFlags: securityFlags,
                                   contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE});
   chan.notificationCallbacks = isPrivate ? privateLoadContext
                                          : nonPrivateLoadContext;
   var channelListener = new ChannelListener();
-  chan.asyncOpen2(channelListener);
+  chan.asyncOpen(channelListener);
 
   var listener = new ImageListener(null, callback);
   var outlistener = {};
   var loader = isPrivate ? gPrivateLoader : gPublicLoader;
   var outer = Cc["@mozilla.org/image/tools;1"].getService(Ci.imgITools)
                 .createScriptedObserver(listener);
   listeners.push(outer);
   requests.push(loader.loadImageWithChannelXPCOM(chan, outer, null, outlistener));
--- a/intl/hyphenation/glue/hnjstdio.cpp
+++ b/intl/hyphenation/glue/hnjstdio.cpp
@@ -49,17 +49,17 @@ hnjFile* hnjFopen(const char* aURISpec, 
                      nsContentUtils::GetSystemPrincipal(),
                      nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                      nsIContentPolicy::TYPE_OTHER);
   if (NS_FAILED(rv)) {
     return nullptr;
   }
 
   nsCOMPtr<nsIInputStream> instream;
-  rv = channel->Open2(getter_AddRefs(instream));
+  rv = channel->Open(getter_AddRefs(instream));
   if (NS_FAILED(rv)) {
     return nullptr;
   }
 
   hnjFile* f = new hnjFile;
   f->mStream = instream;
   f->mCurPos = 0;
   f->mLimit = 0;
--- a/intl/strres/nsStringBundle.cpp
+++ b/intl/strres/nsStringBundle.cpp
@@ -452,17 +452,17 @@ nsresult nsStringBundleBase::ParseProper
                        nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                        nsIContentPolicy::TYPE_OTHER);
 
     if (NS_FAILED(rv)) return rv;
 
     // It's a string bundle.  We expect a text/plain type, so set that as hint
     channel->SetContentType(NS_LITERAL_CSTRING("text/plain"));
 
-    rv = channel->Open2(getter_AddRefs(in));
+    rv = channel->Open(getter_AddRefs(in));
     if (NS_FAILED(rv)) return rv;
   }
 
   auto props = MakeRefPtr<nsPersistentProperties>();
 
   mAttemptedLoad = true;
 
   MOZ_TRY(props->Load(in));
--- a/intl/uconv/tests/unit/test_bug317216.js
+++ b/intl/uconv/tests/unit/test_bug317216.js
@@ -68,17 +68,17 @@ const ConverterInputStream =
                              "nsIConverterInputStream",
                              "init");
 const ios = new IOService();
 
 function testCase(testText, expectedText, bufferLength, charset)
 {
   var dataURI = "data:text/plain;charset=" + charset + "," + testText;
   var channel = NetUtil.newChannel({uri: dataURI, loadUsingSystemPrincipal: true});
-  var testInputStream = channel.open2();
+  var testInputStream = channel.open();
   var testConverter = new ConverterInputStream(testInputStream,
                                                charset,
                                                bufferLength,
                                                0xFFFD);
 
   if (!(testConverter instanceof
         Ci.nsIUnicharLineInputStream))
     throw "not line input stream";
--- a/intl/uconv/tests/unit/test_bug340714.js
+++ b/intl/uconv/tests/unit/test_bug340714.js
@@ -44,17 +44,17 @@ function testCase(withBOM, charset, char
                  makeText(withBOM, charset);
 
   var ConverterInputStream =
       Components.Constructor("@mozilla.org/intl/converter-input-stream;1",
 			     "nsIConverterInputStream",
 			     "init");
 
   var channel = NetUtil.newChannel({uri: dataURI, loadUsingSystemPrincipal: true});
-  var testInputStream = channel.open2();
+  var testInputStream = channel.open();
   var testConverter = new ConverterInputStream(testInputStream,
 					       decoder,
 					       bufferLength,
 					       0xFFFD);
 
   if (!(testConverter instanceof Ci.nsIUnicharLineInputStream))
       throw "not line input stream";
 
--- a/intl/uconv/tests/unit/test_bug563618.js
+++ b/intl/uconv/tests/unit/test_bug563618.js
@@ -28,17 +28,17 @@ const ConverterInputStream =
       Components.Constructor("@mozilla.org/intl/converter-input-stream;1",
                              "nsIConverterInputStream",
                              "init");
 
 function testCase(testText, expectedText, bufferLength, charset)
 {
   var dataURI = "data:text/plain;charset=" + charset + "," + testText;
   var channel = NetUtil.newChannel({uri: dataURI, loadUsingSystemPrincipal: true});
-  var testInputStream = channel.open2();
+  var testInputStream = channel.open();
   var testConverter = new ConverterInputStream(testInputStream,
                                                charset,
                                                bufferLength,
                                                0xFFFD);
 
   if (!(testConverter instanceof Ci.nsIUnicharLineInputStream))
     throw "not line input stream";
 
--- a/intl/uconv/tests/unit/test_utf8_illegals.js
+++ b/intl/uconv/tests/unit/test_utf8_illegals.js
@@ -96,17 +96,17 @@ function testCaseInputStream(inStr, expe
   var dataURI = "data:text/plain; charset=UTF-8,ABC" + inStr + "XYZ"
   dump(inStr + "==>");
 
   var ConverterInputStream =
       Cc("@mozilla.org/intl/converter-input-stream;1",
 	 "nsIConverterInputStream",
 	 "init");
   var channel = NetUtil.newChannel({uri: dataURI, loadUsingSystemPrincipal: true});
-  var testInputStream = channel.open2();
+  var testInputStream = channel.open();
   var testConverter = new ConverterInputStream(testInputStream,
 					       "UTF-8",
 					       16,
 					       0xFFFD);
 
   if (!(testConverter instanceof Ci.nsIUnicharLineInputStream))
       throw "not line input stream";
 
--- a/ipc/glue/BackgroundUtils.cpp
+++ b/ipc/glue/BackgroundUtils.cpp
@@ -469,17 +469,17 @@ nsresult LoadInfoToLoadInfoArgs(nsILoadI
       aLoadInfo->GetVerifySignedContent(), aLoadInfo->GetEnforceSRI(),
       aLoadInfo->GetForceAllowDataURI(),
       aLoadInfo->GetAllowInsecureRedirectToDataURI(),
       aLoadInfo->GetSkipContentPolicyCheckForWebRequest(),
       aLoadInfo->GetForceInheritPrincipalDropped(),
       aLoadInfo->GetInnerWindowID(), aLoadInfo->GetOuterWindowID(),
       aLoadInfo->GetParentOuterWindowID(), aLoadInfo->GetTopOuterWindowID(),
       aLoadInfo->GetFrameOuterWindowID(), aLoadInfo->GetBrowsingContextID(),
-      aLoadInfo->GetEnforceSecurity(), aLoadInfo->GetInitialSecurityCheckDone(),
+      aLoadInfo->GetInitialSecurityCheckDone(),
       aLoadInfo->GetIsInThirdPartyContext(), aLoadInfo->GetIsDocshellReload(),
       aLoadInfo->GetSendCSPViolationEvents(), aLoadInfo->GetOriginAttributes(),
       redirectChainIncludingInternalRedirects, redirectChain,
       ancestorPrincipals, aLoadInfo->AncestorOuterWindowIDs(), ipcClientInfo,
       ipcReservedClientInfo, ipcInitialClientInfo, ipcController,
       aLoadInfo->CorsUnsafeHeaders(), aLoadInfo->GetForcePreflight(),
       aLoadInfo->GetIsPreflight(), aLoadInfo->GetLoadTriggeredFromExternal(),
       aLoadInfo->GetServiceWorkerTaintingSynthesized(),
@@ -626,18 +626,17 @@ nsresult LoadInfoArgsToLoadInfo(
       loadInfoArgs.browserWouldUpgradeInsecureRequests(),
       loadInfoArgs.verifySignedContent(), loadInfoArgs.enforceSRI(),
       loadInfoArgs.forceAllowDataURI(),
       loadInfoArgs.allowInsecureRedirectToDataURI(),
       loadInfoArgs.skipContentPolicyCheckForWebRequest(),
       loadInfoArgs.forceInheritPrincipalDropped(), loadInfoArgs.innerWindowID(),
       loadInfoArgs.outerWindowID(), loadInfoArgs.parentOuterWindowID(),
       loadInfoArgs.topOuterWindowID(), loadInfoArgs.frameOuterWindowID(),
-      loadInfoArgs.browsingContextID(), loadInfoArgs.enforceSecurity(),
-      loadInfoArgs.initialSecurityCheckDone(),
+      loadInfoArgs.browsingContextID(), loadInfoArgs.initialSecurityCheckDone(),
       loadInfoArgs.isInThirdPartyContext(), loadInfoArgs.isDocshellReload(),
       loadInfoArgs.sendCSPViolationEvents(), loadInfoArgs.originAttributes(),
       redirectChainIncludingInternalRedirects, redirectChain,
       std::move(ancestorPrincipals), loadInfoArgs.ancestorOuterWindowIDs(),
       loadInfoArgs.corsUnsafeHeaders(), loadInfoArgs.forcePreflight(),
       loadInfoArgs.isPreflight(), loadInfoArgs.loadTriggeredFromExternal(),
       loadInfoArgs.serviceWorkerTaintingSynthesized(),
       loadInfoArgs.documentHasUserInteracted(),
--- a/js/xpconnect/loader/ChromeScriptLoader.cpp
+++ b/js/xpconnect/loader/ChromeScriptLoader.cpp
@@ -107,17 +107,17 @@ nsresult AsyncScriptCompiler::Start(
                      nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                      nsIContentPolicy::TYPE_OTHER);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIIncrementalStreamLoader> loader;
   rv = NS_NewIncrementalStreamLoader(getter_AddRefs(loader), this);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  return channel->AsyncOpen2(loader);
+  return channel->AsyncOpen(loader);
 }
 
 static void OffThreadScriptLoaderCallback(JS::OffThreadToken* aToken,
                                           void* aCallbackData) {
   RefPtr<AsyncScriptCompiler> scriptCompiler =
       dont_AddRef(static_cast<AsyncScriptCompiler*>(aCallbackData));
 
   scriptCompiler->SetToken(aToken);
--- a/js/xpconnect/loader/mozJSComponentLoader.cpp
+++ b/js/xpconnect/loader/mozJSComponentLoader.cpp
@@ -734,18 +734,18 @@ JSObject* mozJSComponentLoader::PrepareO
   return thisObj;
 }
 
 static mozilla::Result<nsCString, nsresult> ReadScript(
     ComponentLoaderInfo& aInfo) {
   MOZ_TRY(aInfo.EnsureScriptChannel());
 
   nsCOMPtr<nsIInputStream> scriptStream;
-  MOZ_TRY(NS_MaybeOpenChannelUsingOpen2(aInfo.ScriptChannel(),
-                                        getter_AddRefs(scriptStream)));
+  MOZ_TRY(NS_MaybeOpenChannelUsingOpen(aInfo.ScriptChannel(),
+                                       getter_AddRefs(scriptStream)));
 
   uint64_t len64;
   uint32_t bytesRead;
 
   MOZ_TRY(scriptStream->Available(&len64));
   NS_ENSURE_TRUE(len64 < UINT32_MAX, Err(NS_ERROR_FILE_TOO_BIG));
   NS_ENSURE_TRUE(len64, Err(NS_ERROR_FAILURE));
   uint32_t len = (uint32_t)len64;
--- a/js/xpconnect/loader/mozJSSubScriptLoader.cpp
+++ b/js/xpconnect/loader/mozJSSubScriptLoader.cpp
@@ -431,17 +431,17 @@ nsresult mozJSSubScriptLoader::ReadScrip
   RefPtr<AsyncScriptLoader> loadObserver = new AsyncScriptLoader(
       channel, wantReturnValue, targetObj, loadScope, cache, promise);
 
   nsCOMPtr<nsIIncrementalStreamLoader> loader;
   rv = NS_NewIncrementalStreamLoader(getter_AddRefs(loader), loadObserver);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIStreamListener> listener = loader.get();
-  return channel->AsyncOpen2(listener);
+  return channel->AsyncOpen(listener);
 }
 
 bool mozJSSubScriptLoader::ReadScript(nsIURI* uri, JSContext* cx,
                                       HandleObject targetObj,
                                       const char* uriStr, nsIIOService* serv,
                                       bool wantReturnValue,
                                       bool useCompilationScope,
                                       MutableHandleScript script) {
@@ -458,17 +458,17 @@ bool mozJSSubScriptLoader::ReadScript(ns
                      nsIContentPolicy::TYPE_OTHER,
                      nullptr,  // PerformanceStorage
                      nullptr,  // aLoadGroup
                      nullptr,  // aCallbacks
                      nsIRequest::LOAD_NORMAL, serv);
 
   if (NS_SUCCEEDED(rv)) {
     chan->SetContentType(NS_LITERAL_CSTRING("application/javascript"));
-    rv = chan->Open2(getter_AddRefs(instream));
+    rv = chan->Open(getter_AddRefs(instream));
   }
 
   if (NS_FAILED(rv)) {
     ReportError(cx, LOAD_ERROR_NOSTREAM, uri);
     return false;
   }
 
   int64_t len = -1;
--- a/js/xpconnect/src/XPCJSRuntime.cpp
+++ b/js/xpconnect/src/XPCJSRuntime.cpp
@@ -2838,17 +2838,17 @@ static nsresult ReadSourceFromFilename(J
     return NS_OK;
   }
 
   // Explicitly set the content type so that we don't load the
   // exthandler to guess it.
   scriptChannel->SetContentType(NS_LITERAL_CSTRING("text/plain"));
 
   nsCOMPtr<nsIInputStream> scriptStream;
-  rv = scriptChannel->Open2(getter_AddRefs(scriptStream));
+  rv = scriptChannel->Open(getter_AddRefs(scriptStream));
   NS_ENSURE_SUCCESS(rv, rv);
 
   uint64_t rawLen;
   rv = scriptStream->Available(&rawLen);
   NS_ENSURE_SUCCESS(rv, rv);
   if (!rawLen) {
     return NS_ERROR_FAILURE;
   }
--- a/layout/style/FontFaceSet.cpp
+++ b/layout/style/FontFaceSet.cpp
@@ -651,17 +651,17 @@ nsresult FontFaceSet::StartLoad(gfxUserF
 
   rv = NS_NewStreamLoader(getter_AddRefs(streamLoader), fontLoader, fontLoader);
   NS_ENSURE_SUCCESS(rv, rv);
 
   mozilla::net::PredictorLearn(
       aFontFaceSrc->mURI->get(), mDocument->GetDocumentURI(),
       nsINetworkPredictor::LEARN_LOAD_SUBRESOURCE, loadGroup);
 
-  rv = channel->AsyncOpen2(streamLoader);
+  rv = channel->AsyncOpen(streamLoader);
   if (NS_FAILED(rv)) {
     fontLoader->DropChannel();  // explicitly need to break ref cycle
   }
 
   if (NS_SUCCEEDED(rv)) {
     fontLoader->StartedLoading(streamLoader);
     // let the font entry remember the loader, in case we need to cancel it
     aUserFontEntry->SetLoader(fontLoader);
@@ -1365,17 +1365,17 @@ nsresult FontFaceSet::SyncLoadFontData(g
       principal ? principal->get() : nullptr,
       nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_INHERITS,
       nsIContentPolicy::TYPE_FONT);
 
   NS_ENSURE_SUCCESS(rv, rv);
 
   // blocking stream is OK for data URIs
   nsCOMPtr<nsIInputStream> stream;
-  rv = channel->Open2(getter_AddRefs(stream));
+  rv = channel->Open(getter_AddRefs(stream));
   NS_ENSURE_SUCCESS(rv, rv);
 
   uint64_t bufferLength64;
   rv = stream->Available(&bufferLength64);
   NS_ENSURE_SUCCESS(rv, rv);
   if (bufferLength64 == 0) {
     return NS_ERROR_FAILURE;
   }
--- a/layout/style/Loader.cpp
+++ b/layout/style/Loader.cpp
@@ -1306,17 +1306,17 @@ nsresult Loader::LoadSheet(SheetLoadData
     }
     if (NS_FAILED(rv)) {
       LOG_ERROR(("  Failed to create channel"));
       SheetComplete(aLoadData, rv);
       return rv;
     }
 
     nsCOMPtr<nsIInputStream> stream;
-    rv = channel->Open2(getter_AddRefs(stream));
+    rv = channel->Open(getter_AddRefs(stream));
 
     if (NS_FAILED(rv)) {
       LOG_ERROR(("  Failed to open URI synchronously"));
       SheetComplete(aLoadData, rv);
       return rv;
     }
 
     // Force UA sheets to be UTF-8.
@@ -1516,17 +1516,17 @@ nsresult Loader::LoadSheet(SheetLoadData
   nsCOMPtr<nsIStreamListener> streamLoader = new StreamLoader(aLoadData);
 
   if (mDocument) {
     mozilla::net::PredictorLearn(aLoadData->mURI, mDocument->GetDocumentURI(),
                                  nsINetworkPredictor::LEARN_LOAD_SUBRESOURCE,
                                  mDocument);
   }
 
-  rv = channel->AsyncOpen2(streamLoader);
+  rv = channel->AsyncOpen(streamLoader);
 
 #ifdef DEBUG
   mSyncCallback = false;
 #endif
 
   if (NS_FAILED(rv)) {
     LOG_ERROR(("  Failed to create stream loader"));
     SheetComplete(aLoadData, rv);
--- a/layout/style/test/mochitest.ini
+++ b/layout/style/test/mochitest.ini
@@ -67,17 +67,17 @@ support-files = Ahem.ttf file_animations
 [test_animations_pausing.html]
 [test_animations_playbackrate.html]
 [test_animations_reverse.html]
 [test_animations_styles_on_event.html]
 [test_animations_variable_changes.html]
 [test_animations_with_disabled_properties.html]
 support-files = file_animations_with_disabled_properties.html
 [test_any_dynamic.html]
-[test_asyncopen2.html]
+[test_asyncopen.html]
 [test_at_rule_parse_serialize.html]
 [test_attribute_selector_eof_behavior.html]
 [test_background_blend_mode.html]
 [test_box_size_keywords.html]
 [test_bug73586.html]
 [test_bug74880.html]
 [test_bug98997.html]
 [test_bug160403.html]
rename from layout/style/test/test_asyncopen2.html
rename to layout/style/test/test_asyncopen.html
--- a/layout/style/test/test_asyncopen2.html
+++ b/layout/style/test/test_asyncopen.html
@@ -1,31 +1,31 @@
 <!DOCTYPE HTML>
 <html>
 <!--
 https://bugzilla.mozilla.org/show_bug.cgi?id=1195173
 -->
 <head>
-  <title>Bug 1195173 - Test asyncOpen2 security exception</title>
+  <title>Bug 1195173 - Test asyncOpen security exception</title>
   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
 
   <!-- Note: the following stylesheet does not exist -->
   <link rel="stylesheet" id="myCSS" type="text/css" href="file:///home/foo/bar.css">
 
 </head>
 <body onload="checkCSS()">
 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1195173">Mozilla Bug 1195173</a>
 <p id="display"></p>
 <div id="content" style="display: none"></div>
 
 <script type="application/javascript">
 /*
  * Description of the test:
- * Accessing a stylesheet that got blocked by asyncOpen2 should
+ * Accessing a stylesheet that got blocked by asyncOpen should
  * throw an exception.
  */
 
 SimpleTest.waitForExplicitFinish();
 
 function checkCSS()
 {
   try {
--- a/layout/tools/reftest/manifest.jsm
+++ b/layout/tools/reftest/manifest.jsm
@@ -45,17 +45,17 @@ function ReadManifest(aURL, aFilter)
     }
     g.manifestsLoaded[aURL.spec] = aFilter[1];
 
     var secMan = Cc[NS_SCRIPTSECURITYMANAGER_CONTRACTID]
                      .getService(Ci.nsIScriptSecurityManager);
 
     var listURL = aURL;
     var channel = NetUtil.newChannel({uri: aURL, loadUsingSystemPrincipal: true});
-    var inputStream = channel.open2();
+    var inputStream = channel.open();
     if (channel instanceof Ci.nsIHttpChannel
         && channel.responseStatus != 200) {
       g.logger.error("HTTP ERROR : " + channel.responseStatus);
     }
     var streamBuf = getStreamContent(inputStream);
     inputStream.close();
     var lines = streamBuf.split(/\n|\r|\r\n/);
 
--- a/media/mtransport/ipc/WebrtcProxyChannel.cpp
+++ b/media/mtransport/ipc/WebrtcProxyChannel.cpp
@@ -208,17 +208,17 @@ nsresult WebrtcProxyChannel::Open(const 
     return NS_ERROR_FAILURE;
   }
 
   rv = httpChannel->HTTPUpgrade(aAlpn, this);
   NS_ENSURE_SUCCESS(rv, rv);
   rv = httpChannel->SetConnectOnly();
   NS_ENSURE_SUCCESS(rv, rv);
 
-  rv = NS_MaybeOpenChannelUsingAsyncOpen2(httpChannel, this);
+  rv = NS_MaybeOpenChannelUsingAsyncOpen(httpChannel, this);
 
   if (NS_FAILED(rv)) {
     LOG(("WebrtcProxyChannel %p: cannot async open\n", this));
     CloseWithReason(rv);
     return rv;
   }
 
   return NS_OK;
--- a/mobile/android/chrome/content/CastingApps.js
+++ b/mobile/android/chrome/content/CastingApps.js
@@ -357,17 +357,17 @@ var CastingApps = {
             break;
         }
       },
       onStopRequest: function(request, context, statusCode) {},
       onDataAvailable: function(request, context, stream, offset, count) {},
     };
 
     if (channel) {
-      channel.asyncOpen2(listener);
+      channel.asyncOpen(listener);
     } else {
       aCallback(null);
     }
   },
 
   // Because this method uses a callback, make sure we return ASAP if we know
   // we have a castable video source.
   _getVideo: function(aElement, aTypes, aExtensions, aCallback) {
--- a/modules/libjar/nsJARChannel.cpp
+++ b/modules/libjar/nsJARChannel.cpp
@@ -194,18 +194,16 @@ nsJARChannel::~nsJARChannel() {
   NS_ReleaseOnMainThreadSystemGroup("nsJARChannel::mCallbacks",
                                     mCallbacks.forget());
   NS_ReleaseOnMainThreadSystemGroup("nsJARChannel::mProgressSink",
                                     mProgressSink.forget());
   NS_ReleaseOnMainThreadSystemGroup("nsJARChannel::mLoadGroup",
                                     mLoadGroup.forget());
   NS_ReleaseOnMainThreadSystemGroup("nsJARChannel::mListener",
                                     mListener.forget());
-  NS_ReleaseOnMainThreadSystemGroup("nsJARChannel::mListenerContext",
-                                    mListenerContext.forget());
 }
 
 NS_IMPL_ISUPPORTS_INHERITED(nsJARChannel, nsHashPropertyBag, nsIRequest,
                             nsIChannel, nsIStreamListener, nsIRequestObserver,
                             nsIThreadRetargetableRequest,
                             nsIThreadRetargetableStreamListener, nsIJARChannel)
 
 nsresult nsJARChannel::Init(nsIURI *uri) {
@@ -487,17 +485,16 @@ nsresult nsJARChannel::OnOpenLocalFileCo
     }
 
     if (mLoadGroup) {
       mLoadGroup->RemoveRequest(this, nullptr, aResult);
     }
 
     mOpened = false;
     mIsPending = false;
-    mListenerContext = nullptr;
     mListener = nullptr;
     mCallbacks = nullptr;
     mProgressSink = nullptr;
 
     return aResult;
   }
 
   return NS_OK;
@@ -807,118 +804,106 @@ nsJARChannel::GetContentLength(int64_t *
 NS_IMETHODIMP
 nsJARChannel::SetContentLength(int64_t aContentLength) {
   // XXX does this really make any sense at all?
   mContentLength = aContentLength;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsJARChannel::Open(nsIInputStream **stream) {
+nsJARChannel::Open(nsIInputStream **aStream) {
+  LOG(("nsJARChannel::Open [this=%p]\n", this));
+  nsCOMPtr<nsIStreamListener> listener;
+  nsresult rv =
+      nsContentSecurityManager::doContentSecurityCheck(this, listener);
+  NS_ENSURE_SUCCESS(rv, rv);
+
   LOG(("nsJARChannel::Open [this=%p]\n", this));
 
   NS_ENSURE_TRUE(!mOpened, NS_ERROR_IN_PROGRESS);
   NS_ENSURE_TRUE(!mIsPending, NS_ERROR_IN_PROGRESS);
 
   mJarFile = nullptr;
 
-  nsresult rv = LookupFile();
+  rv = LookupFile();
   if (NS_FAILED(rv)) return rv;
 
   // If mJarFile was not set by LookupFile, we can't open a channel.
   if (!mJarFile) {
     MOZ_ASSERT_UNREACHABLE("only file-backed jars are supported");
     return NS_ERROR_NOT_IMPLEMENTED;
   }
 
   RefPtr<nsJARInputThunk> input;
   rv = CreateJarInput(gJarHandler->JarCache(), getter_AddRefs(input));
   if (NS_FAILED(rv)) return rv;
 
-  input.forget(stream);
+  input.forget(aStream);
   mOpened = true;
   return NS_OK;
 }
 
+
 NS_IMETHODIMP
-nsJARChannel::Open2(nsIInputStream **aStream) {
-  LOG(("nsJARChannel::Open2 [this=%p]\n", this));
-  nsCOMPtr<nsIStreamListener> listener;
+nsJARChannel::AsyncOpen(nsIStreamListener *aListener) {
+  LOG(("nsJARChannel::AsyncOpen [this=%p]\n", this));
+  nsCOMPtr<nsIStreamListener> listener = aListener;
   nsresult rv =
       nsContentSecurityManager::doContentSecurityCheck(this, listener);
-  NS_ENSURE_SUCCESS(rv, rv);
-  return Open(aStream);
-}
+  if (NS_FAILED(rv)) {
+    mIsPending = false;
+    mListener = nullptr;
+    mCallbacks = nullptr;
+    mProgressSink = nullptr;
+    return rv;
+  }
 
-NS_IMETHODIMP
-nsJARChannel::AsyncOpen(nsIStreamListener *listener, nsISupports *ctx) {
   LOG(("nsJARChannel::AsyncOpen [this=%p]\n", this));
   MOZ_ASSERT(
       !mLoadInfo || mLoadInfo->GetSecurityMode() == 0 ||
           mLoadInfo->GetInitialSecurityCheckDone() ||
           (mLoadInfo->GetSecurityMode() ==
                nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL &&
            nsContentUtils::IsSystemPrincipal(mLoadInfo->LoadingPrincipal())),
-      "security flags in loadInfo but asyncOpen2() not called");
+      "security flags in loadInfo but doContentSecurityCheck() not called");
 
   NS_ENSURE_ARG_POINTER(listener);
   NS_ENSURE_TRUE(!mOpened, NS_ERROR_IN_PROGRESS);
   NS_ENSURE_TRUE(!mIsPending, NS_ERROR_IN_PROGRESS);
 
   mJarFile = nullptr;
 
   // Initialize mProgressSink
   NS_QueryNotificationCallbacks(mCallbacks, mLoadGroup, mProgressSink);
 
   mListener = listener;
-  mListenerContext = ctx;
   mIsPending = true;
 
-  nsresult rv = LookupFile();
+  rv = LookupFile();
   if (NS_FAILED(rv) || !mJarFile) {
     // Not a local file...
     mIsPending = false;
-    mListenerContext = nullptr;
     mListener = nullptr;
     mCallbacks = nullptr;
     mProgressSink = nullptr;
     return mJarFile ? rv : NS_ERROR_UNSAFE_CONTENT_TYPE;
   }
 
   rv = OpenLocalFile();
   if (NS_FAILED(rv)) {
     mIsPending = false;
-    mListenerContext = nullptr;
     mListener = nullptr;
     mCallbacks = nullptr;
     mProgressSink = nullptr;
     return rv;
   }
 
   return NS_OK;
 }
 
-NS_IMETHODIMP
-nsJARChannel::AsyncOpen2(nsIStreamListener *aListener) {
-  LOG(("nsJARChannel::AsyncOpen2 [this=%p]\n", this));
-  nsCOMPtr<nsIStreamListener> listener = aListener;
-  nsresult rv =
-      nsContentSecurityManager::doContentSecurityCheck(this, listener);
-  if (NS_FAILED(rv)) {
-    mIsPending = false;
-    mListenerContext = nullptr;
-    mListener = nullptr;
-    mCallbacks = nullptr;
-    mProgressSink = nullptr;
-    return rv;
-  }
-
-  return AsyncOpen(listener, nullptr);
-}
-
 //-----------------------------------------------------------------------------
 // nsIJARChannel
 //-----------------------------------------------------------------------------
 NS_IMETHODIMP
 nsJARChannel::GetJarFile(nsIFile **aFile) {
   NS_IF_ADDREF(*aFile = mJarFile);
   return NS_OK;
 }
@@ -1000,17 +985,17 @@ nsJARChannel::GetZipEntry(nsIZipEntry **
 // nsIStreamListener
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 nsJARChannel::OnStartRequest(nsIRequest *req, nsISupports *ctx) {
   LOG(("nsJARChannel::OnStartRequest [this=%p %s]\n", this, mSpec.get()));
 
   mRequest = req;
-  nsresult rv = mListener->OnStartRequest(this, mListenerContext);
+  nsresult rv = mListener->OnStartRequest(this, nullptr);
   mRequest = nullptr;
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Restrict loadable content types.
   nsAutoCString contentType;
   GetContentType(contentType);
   auto contentPolicyType = mLoadInfo->GetExternalContentPolicyType();
   if (contentType.Equals(APPLICATION_HTTP_INDEX_FORMAT) &&
@@ -1035,19 +1020,18 @@ NS_IMETHODIMP
 nsJARChannel::OnStopRequest(nsIRequest *req, nsISupports *ctx,
                             nsresult status) {
   LOG(("nsJARChannel::OnStopRequest [this=%p %s status=%" PRIx32 "]\n", this,
        mSpec.get(), static_cast<uint32_t>(status)));
 
   if (NS_SUCCEEDED(mStatus)) mStatus = status;
 
   if (mListener) {
-    mListener->OnStopRequest(this, mListenerContext, status);
+    mListener->OnStopRequest(this, nullptr, status);
     mListener = nullptr;
-    mListenerContext = nullptr;
   }
 
   if (mLoadGroup) mLoadGroup->RemoveRequest(this, nullptr, status);
 
   mPump = nullptr;
   mIsPending = false;
 
   // Drop notification callbacks to prevent cycles.
@@ -1066,18 +1050,17 @@ nsJARChannel::OnStopRequest(nsIRequest *
 NS_IMETHODIMP
 nsJARChannel::OnDataAvailable(nsIRequest *req, nsISupports *ctx,
                               nsIInputStream *stream, uint64_t offset,
                               uint32_t count) {
   LOG(("nsJARChannel::OnDataAvailable [this=%p %s]\n", this, mSpec.get()));
 
   nsresult rv;
 
-  rv =
-      mListener->OnDataAvailable(this, mListenerContext, stream, offset, count);
+  rv = mListener->OnDataAvailable(this, nullptr, stream, offset, count);
 
   // simply report progress here instead of hooking ourselves up as a
   // nsITransportEventSink implementation.
   // XXX do the 64-bit stuff for real
   if (mProgressSink && NS_SUCCEEDED(rv)) {
     if (NS_IsMainThread()) {
       FireOnProgress(offset + count);
     } else {
--- a/modules/libjar/nsJARChannel.h
+++ b/modules/libjar/nsJARChannel.h
@@ -74,17 +74,16 @@ class nsJARChannel final : public nsIJAR
   nsCOMPtr<nsIURI> mOriginalURI;
   nsCOMPtr<nsISupports> mOwner;
   nsCOMPtr<nsILoadInfo> mLoadInfo;
   nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
   nsCOMPtr<nsISupports> mSecurityInfo;
   nsCOMPtr<nsIProgressEventSink> mProgressSink;
   nsCOMPtr<nsILoadGroup> mLoadGroup;
   nsCOMPtr<nsIStreamListener> mListener;
-  nsCOMPtr<nsISupports> mListenerContext;
   nsCString mContentType;
   nsCString mContentCharset;
   int64_t mContentLength;
   uint32_t mLoadFlags;
   nsresult mStatus;
   bool mIsPending;  // the AsyncOpen is in progress.
 
   bool mEnableOMT;
--- a/modules/libjar/test/unit/test_bug1328865.js
+++ b/modules/libjar/test/unit/test_bug1328865.js
@@ -10,36 +10,36 @@ const {NetUtil} = ChromeUtils.import("re
 
 add_task(async function() {
   var file = do_get_file("data/test_bug597702.zip");
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
   var outerJarBase = "jar:" + ios.newFileURI(file).spec + "!/";
   var goodSpec = "jar:" + outerJarBase + "inner.jar!/hello#!/ignore%20this%20part";
   var goodChannel = NetUtil.newChannel({uri: goodSpec, loadUsingSystemPrincipal: true});
-  var instr = goodChannel.open2();
+  var instr = goodChannel.open();
 
   ok(!!instr, "Should be able to open channel");
 });
 
 add_task(async function() {
   var file = do_get_file("data/test_bug597702.zip");
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
   var outerJarBase = "jar:" + ios.newFileURI(file).spec + "!/";
   var goodSpec = "jar:" + outerJarBase + "inner.jar!/hello?ignore%20this%20part!/";
   var goodChannel = NetUtil.newChannel({uri: goodSpec, loadUsingSystemPrincipal: true});
-  var instr = goodChannel.open2();
+  var instr = goodChannel.open();
 
   ok(!!instr, "Should be able to open channel");
 });
 
 add_task(async function() {
   var file = do_get_file("data/test_bug597702.zip");
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
   var outerJarBase = "jar:" + ios.newFileURI(file).spec + "!/";
   var goodSpec = "jar:" + outerJarBase + "inner.jar!/hello?ignore#this!/part";
   var goodChannel = NetUtil.newChannel({uri: goodSpec, loadUsingSystemPrincipal: true});
-  var instr = goodChannel.open2();
+  var instr = goodChannel.open();
 
   ok(!!instr, "Should be able to open channel");
 });
--- a/modules/libjar/test/unit/test_bug370103.js
+++ b/modules/libjar/test/unit/test_bug370103.js
@@ -10,16 +10,16 @@ function run_test() {
   var url = ioService.newFileURI(file).spec;
   url = "jar:" + url + "!/test_bug370103";
 
   // Try opening channel with null listener
   var channel = NetUtil.newChannel({uri: url, loadUsingSystemPrincipal: true});
 
   var exception = false;
   try {
-    channel.asyncOpen2(null);
+    channel.asyncOpen(null);
   }
   catch(e) {
     exception = true;
   }
 
   Assert.ok(exception); // should throw exception instead of crashing
 }
--- a/modules/libjar/test/unit/test_bug589292.js
+++ b/modules/libjar/test/unit/test_bug589292.js
@@ -4,17 +4,17 @@ const {NetUtil} = ChromeUtils.import("re
 
 const path = "data/test_bug589292.zip";
 
 function run_test() {
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
   var spec = "jar:" + ios.newFileURI(do_get_file(path)).spec + "!/foo.txt";
   var channel = NetUtil.newChannel({uri: spec, loadUsingSystemPrincipal: true});
-  instr = channel.open2();
+  instr = channel.open();
   var val;
   try {
     val = channel.contentDisposition;
     Assert.ok(false, "The channel has content disposition?!");
   } catch (e) {
     // This is what we want to happen - there's no underlying channel, so no
     // content-disposition header is available
     Assert.ok(true, "How are you reading this?!");
--- a/modules/libjar/test/unit/test_bug597702.js
+++ b/modules/libjar/test/unit/test_bug597702.js
@@ -12,21 +12,21 @@ function run_test() {
             getService(Ci.nsIIOService);
   var outerJarBase = "jar:" + ios.newFileURI(file).spec + "!/";
   var goodSpec = "jar:" + outerJarBase + "inner.jar!/hello";
   var badSpec = "jar:" + outerJarBase + "jar_that_isnt_in_the.jar!/hello";
   var goodChannel = NetUtil.newChannel({uri: goodSpec, loadUsingSystemPrincipal: true});
   var badChannel = NetUtil.newChannel({uri: badSpec, loadUsingSystemPrincipal: true});
 
   try {
-    instr = goodChannel.open2();
+    instr = goodChannel.open();
   } catch (e) {
     do_throw("Failed to open file in inner jar");
   }
 
   try {
-    instr = badChannel.open2();
+    instr = badChannel.open();
     do_throw("Failed to report that file doesn't exist");
   } catch (e) {
     Assert.ok(e.name == "NS_ERROR_FILE_NOT_FOUND");
   }
 }
 
--- a/modules/libjar/test/unit/test_bug637286.js
+++ b/modules/libjar/test/unit/test_bug637286.js
@@ -6,17 +6,17 @@ const {NetUtil} = ChromeUtils.import("re
 
 // Check that the zip cache can expire entries from nested jars
 var ios = Cc["@mozilla.org/network/io-service;1"].
           getService(Ci.nsIIOService);
 
 function open_inner_zip(base, idx) {
     var spec = "jar:" + base + "inner" + idx + ".zip!/foo";
     var channel = NetUtil.newChannel({uri: spec, loadUsingSystemPrincipal: true});
-    var stream = channel.open2();
+    var stream = channel.open();
 }
 
 function run_test() {
   var file = do_get_file("data/test_bug637286.zip");
   var outerJarBase = "jar:" + ios.newFileURI(file).spec + "!/";
 
   for (var i = 0; i < 40; i++) {
     open_inner_zip(outerJarBase, i);
--- a/modules/libjar/test/unit/test_bug658093.js
+++ b/modules/libjar/test/unit/test_bug658093.js
@@ -9,14 +9,14 @@ var ios = Cc["@mozilla.org/network/io-se
           getService(Ci.nsIIOService);
 
 function run_test() {
   var file = do_get_file("data/test_bug658093.zip");
   var spec = "jar:" + ios.newFileURI(file).spec + "!/0000";
   var channel = NetUtil.newChannel({uri: spec, loadUsingSystemPrincipal: true});
   var failed = false;
   try {
-    var stream = channel.open2();
+    var stream = channel.open();
   } catch (e) {
     failed = true;
   }
   Assert.ok(failed);
 }
--- a/modules/libjar/test/unit/test_jarchannel.js
+++ b/modules/libjar/test/unit/test_jarchannel.js
@@ -71,17 +71,17 @@ Listener.prototype = {
 
 /**
  * Basic reading test for asynchronously opened jar channel
  */
 function testAsync() {
     var uri = jarBase + "/inner40.zip";
     var chan = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true});
     Assert.ok(chan.contentLength < 0);
-    chan.asyncOpen2(new Listener(function(l) {
+    chan.asyncOpen(new Listener(function(l) {
         Assert.ok(chan.contentLength > 0);
         Assert.ok(l.gotStartRequest);
         Assert.ok(l.gotStopRequest);
         Assert.equal(l.available, chan.contentLength);
 
         run_next_test();
     }));
 }
@@ -107,48 +107,48 @@ add_test(testZipEntry);
 
 
 /**
  * Basic reading test for synchronously opened jar channels
  */
 add_test(function testSync() {
     var uri = jarBase + "/inner40.zip";
     var chan = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true});
-    var stream = chan.open2();
+    var stream = chan.open();
     Assert.ok(chan.contentLength > 0);
     Assert.equal(stream.available(), chan.contentLength);
     stream.close();
     stream.close(); // should still not throw
 
     run_next_test();
 });
 
 
 /**
  * Basic reading test for synchronously opened, nested jar channels
  */
 add_test(function testSyncNested() {
     var uri = "jar:" + jarBase + "/inner40.zip!/foo";
     var chan = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true});
-    var stream = chan.open2();
+    var stream = chan.open();
     Assert.ok(chan.contentLength > 0);
     Assert.equal(stream.available(), chan.contentLength);
     stream.close();
     stream.close(); // should still not throw
 
     run_next_test();
 });
 
 /**
  * Basic reading test for asynchronously opened, nested jar channels
  */
 add_test(function testAsyncNested(next) {
     var uri = "jar:" + jarBase + "/inner40.zip!/foo";
     var chan = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true});
-    chan.asyncOpen2(new Listener(function(l) {
+    chan.asyncOpen(new Listener(function(l) {
         Assert.ok(chan.contentLength > 0);
         Assert.ok(l.gotStartRequest);
         Assert.ok(l.gotStopRequest);
         Assert.equal(l.available, chan.contentLength);
 
         run_next_test();
     }));
 });
@@ -158,17 +158,17 @@ add_test(function testAsyncNested(next) 
  * opened jar channel stream
  */
 add_test(function testSyncCloseUnlocks() {
     var copy = tmpDir.clone();
     copy.append(fileBase);
     file.copyTo(copy.parent, copy.leafName);
     var uri = "jar:" + ios.newFileURI(copy).spec + "!/inner40.zip";
     var chan = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true});
-    var stream = chan.open2();
+    var stream = chan.open();
     Assert.ok(chan.contentLength > 0);
     stream.close();
 
     // Drop any jar caches
     obs.notifyObservers(null, "chrome-flush-caches");
 
     try {
         copy.remove(false);
@@ -187,17 +187,17 @@ add_test(function testSyncCloseUnlocks()
 add_test(function testAsyncCloseUnlocks() {
     var copy = tmpDir.clone();
     copy.append(fileBase);
     file.copyTo(copy.parent, copy.leafName);
 
     var uri = "jar:" + ios.newFileURI(copy).spec + "!/inner40.zip";
     var chan = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true});
 
-    chan.asyncOpen2(new Listener(function (l) {
+    chan.asyncOpen(new Listener(function (l) {
         Assert.ok(chan.contentLength > 0);
 
         // Drop any jar caches
         obs.notifyObservers(null, "chrome-flush-caches");
 
         try {
             copy.remove(false);
         }
--- a/modules/libjar/test/unit/test_not_found.js
+++ b/modules/libjar/test/unit/test_not_found.js
@@ -7,14 +7,14 @@ function run_test() {
   var ios = Cc["@mozilla.org/network/io-service;1"].
             getService(Ci.nsIIOService);
   var spec = "jar:" + ios.newFileURI(do_get_file(path)).spec + "!/";
   var channel = NetUtil.newChannel({
     uri: spec + "file_that_isnt_in.archive",
     loadUsingSystemPrincipal: true
   });
   try {
-    instr = channel.open2();
+    instr = channel.open();
     do_throw("Failed to report that file doesn't exist")
   } catch (e) {
       Assert.ok(e.name == "NS_ERROR_FILE_NOT_FOUND")
   }
 }
--- a/modules/libjar/zipwriter/nsZipWriter.cpp
+++ b/modules/libjar/zipwriter/nsZipWriter.cpp
@@ -371,17 +371,17 @@ NS_IMETHODIMP nsZipWriter::AddEntryChann
     return NS_OK;
   }
 
   if (mInQueue) return NS_ERROR_IN_PROGRESS;
   if (mEntryHash.Get(aZipEntry, nullptr)) return NS_ERROR_FILE_ALREADY_EXISTS;
 
   nsCOMPtr<nsIInputStream> inputStream;
   nsresult rv =
-      NS_MaybeOpenChannelUsingOpen2(aChannel, getter_AddRefs(inputStream));
+      NS_MaybeOpenChannelUsingOpen(aChannel, getter_AddRefs(inputStream));
 
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = AddEntryStream(aZipEntry, aModTime, aCompression, inputStream, false,
                       PERMISSIONS_FILE);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return inputStream->Close();
@@ -910,17 +910,17 @@ inline nsresult nsZipWriter::BeginProces
       nsCOMPtr<nsIInputStream> tmpStream = aItem->mStream;
       rv = NS_NewInputStreamPump(getter_AddRefs(pump), tmpStream.forget(), 0, 0,
                                  true);
       NS_ENSURE_SUCCESS(rv, rv);
 
       rv = pump->AsyncRead(stream, nullptr);
       NS_ENSURE_SUCCESS(rv, rv);
     } else {
-      rv = NS_MaybeOpenChannelUsingAsyncOpen2(aItem->mChannel, stream);
+      rv = NS_MaybeOpenChannelUsingAsyncOpen(aItem->mChannel, stream);
       NS_ENSURE_SUCCESS(rv, rv);
     }
 
     return NS_OK;
   }
 
   // Must be plain directory addition
   *complete = true;
--- a/modules/libjar/zipwriter/test/unit/test_asyncadd.js
+++ b/modules/libjar/zipwriter/test/unit/test_asyncadd.js
@@ -77,17 +77,17 @@ var methods = {
   },
   stream: function method_stream(entry, source)
   {
     zipW.addEntryStream(entry, source.lastModifiedTime * PR_MSEC_PER_SEC,
                         Ci.nsIZipWriter.COMPRESSION_NONE,
                         NetUtil.newChannel({
                           uri: ioSvc.newFileURI(source),
                           loadUsingSystemPrincipal: true
-                        }).open2(), true);
+                        }).open(), true);
   }
 }
 
 function run_test()
 {
   zipW.open(tmpFile, PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE);
 
   for (var i = 0; i < TESTS.length; i++) {
--- a/netwerk/base/LoadInfo.cpp
+++ b/netwerk/base/LoadInfo.cpp
@@ -75,17 +75,16 @@ LoadInfo::LoadInfo(
       mOriginalFrameSrcLoad(false),
       mForceInheritPrincipalDropped(false),
       mInnerWindowID(0),
       mOuterWindowID(0),
       mParentOuterWindowID(0),
       mTopOuterWindowID(0),
       mFrameOuterWindowID(0),
       mBrowsingContextID(0),
-      mEnforceSecurity(false),
       mInitialSecurityCheckDone(false),
       mIsThirdPartyContext(false),
       mIsDocshellReload(false),
       mSendCSPViolationEvents(true),
       mForcePreflight(false),
       mIsPreflight(false),
       mLoadTriggeredFromExternal(false),
       mServiceWorkerTaintingSynthesized(false),
@@ -358,17 +357,16 @@ LoadInfo::LoadInfo(nsPIDOMWindowOuter* a
       mOriginalFrameSrcLoad(false),
       mForceInheritPrincipalDropped(false),
       mInnerWindowID(0),
       mOuterWindowID(0),
       mParentOuterWindowID(0),
       mTopOuterWindowID(0),
       mFrameOuterWindowID(0),
       mBrowsingContextID(0),
-      mEnforceSecurity(false),
       mInitialSecurityCheckDone(false),
       mIsThirdPartyContext(false),  // NB: TYPE_DOCUMENT implies !third-party.
       mIsDocshellReload(false),
       mSendCSPViolationEvents(true),
       mForcePreflight(false),
       mIsPreflight(false),
       mLoadTriggeredFromExternal(false),
       mServiceWorkerTaintingSynthesized(false),
@@ -456,17 +454,16 @@ LoadInfo::LoadInfo(const LoadInfo& rhs)
       mOriginalFrameSrcLoad(rhs.mOriginalFrameSrcLoad),
       mForceInheritPrincipalDropped(rhs.mForceInheritPrincipalDropped),
       mInnerWindowID(rhs.mInnerWindowID),
       mOuterWindowID(rhs.mOuterWindowID),
       mParentOuterWindowID(rhs.mParentOuterWindowID),
       mTopOuterWindowID(rhs.mTopOuterWindowID),
       mFrameOuterWindowID(rhs.mFrameOuterWindowID),
       mBrowsingContextID(rhs.mBrowsingContextID),
-      mEnforceSecurity(rhs.mEnforceSecurity),
       mInitialSecurityCheckDone(rhs.mInitialSecurityCheckDone),
       mIsThirdPartyContext(rhs.mIsThirdPartyContext),
       mIsDocshellReload(rhs.mIsDocshellReload),
       mSendCSPViolationEvents(rhs.mSendCSPViolationEvents),
       mOriginAttributes(rhs.mOriginAttributes),
       mRedirectChainIncludingInternalRedirects(
           rhs.mRedirectChainIncludingInternalRedirects),
       mRedirectChain(rhs.mRedirectChain),
@@ -497,17 +494,17 @@ LoadInfo::LoadInfo(
     bool aBrowserUpgradeInsecureRequests,
     bool aBrowserWouldUpgradeInsecureRequests, bool aVerifySignedContent,
     bool aEnforceSRI, bool aForceAllowDataURI,
     bool aAllowInsecureRedirectToDataURI,
     bool aSkipContentPolicyCheckForWebRequest,
     bool aForceInheritPrincipalDropped, uint64_t aInnerWindowID,
     uint64_t aOuterWindowID, uint64_t aParentOuterWindowID,
     uint64_t aTopOuterWindowID, uint64_t aFrameOuterWindowID,
-    uint64_t aBrowsingContextID, bool aEnforceSecurity,
+    uint64_t aBrowsingContextID,
     bool aInitialSecurityCheckDone, bool aIsThirdPartyContext,
     bool aIsDocshellReload, bool aSendCSPViolationEvents,
     const OriginAttributes& aOriginAttributes,
     RedirectHistoryArray& aRedirectChainIncludingInternalRedirects,
     RedirectHistoryArray& aRedirectChain,
     nsTArray<nsCOMPtr<nsIPrincipal>>&& aAncestorPrincipals,
     const nsTArray<uint64_t>& aAncestorOuterWindowIDs,
     const nsTArray<nsCString>& aCorsUnsafeHeaders, bool aForcePreflight,
@@ -540,17 +537,16 @@ LoadInfo::LoadInfo(
       mOriginalFrameSrcLoad(false),
       mForceInheritPrincipalDropped(aForceInheritPrincipalDropped),
       mInnerWindowID(aInnerWindowID),
       mOuterWindowID(aOuterWindowID),
       mParentOuterWindowID(aParentOuterWindowID),
       mTopOuterWindowID(aTopOuterWindowID),
       mFrameOuterWindowID(aFrameOuterWindowID),
       mBrowsingContextID(aBrowsingContextID),
-      mEnforceSecurity(aEnforceSecurity),
       mInitialSecurityCheckDone(aInitialSecurityCheckDone),
       mIsThirdPartyContext(aIsThirdPartyContext),
       mIsDocshellReload(aIsDocshellReload),
       mSendCSPViolationEvents(aSendCSPViolationEvents),
       mOriginAttributes(aOriginAttributes),
       mAncestorPrincipals(std::move(aAncestorPrincipals)),
       mAncestorOuterWindowIDs(aAncestorOuterWindowIDs),
       mCorsUnsafeHeaders(aCorsUnsafeHeaders),
@@ -601,17 +597,16 @@ already_AddRefed<nsILoadInfo> LoadInfo::
     nsSecurityFlags aSecurityFlags) const {
   RefPtr<LoadInfo> copy(new LoadInfo(*this));
   copy->mSecurityFlags = aSecurityFlags;
   return copy.forget();
 }
 
 already_AddRefed<nsILoadInfo> LoadInfo::CloneForNewRequest() const {
   RefPtr<LoadInfo> copy(new LoadInfo(*this));
-  copy->mEnforceSecurity = false;
   copy->mInitialSecurityCheckDone = false;
   copy->mRedirectChainIncludingInternalRedirects.Clear();
   copy->mRedirectChain.Clear();
   copy->mResultPrincipalURI = nullptr;
   return copy.forget();
 }
 
 NS_IMETHODIMP
@@ -760,17 +755,16 @@ LoadInfo::GetCookiePolicy(uint32_t* aRes
                  : nsILoadInfo::SEC_COOKIES_INCLUDE;
   }
 
   *aResult = policy;
   return NS_OK;
 }
 
 void LoadInfo::SetIncludeCookiesSecFlag() {
-  MOZ_ASSERT(!mEnforceSecurity, "Request should not have been opened yet");
   MOZ_ASSERT((mSecurityFlags & sCookiePolicyMask) ==
              nsILoadInfo::SEC_COOKIES_DEFAULT);
   mSecurityFlags =
       (mSecurityFlags & ~sCookiePolicyMask) | nsILoadInfo::SEC_COOKIES_INCLUDE;
 }
 
 NS_IMETHODIMP
 LoadInfo::GetForceInheritPrincipal(bool* aInheritPrincipal) {
@@ -1050,32 +1044,16 @@ nsresult LoadInfo::GetOriginAttributes(
 
 nsresult LoadInfo::SetOriginAttributes(
     const mozilla::OriginAttributes& aOriginAttributes) {
   mOriginAttributes = aOriginAttributes;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-LoadInfo::SetEnforceSecurity(bool aEnforceSecurity) {
-  // Indicates whether the channel was openend using AsyncOpen2. Once set
-  // to true, it must remain true throughout the lifetime of the channel.
-  // Setting it to anything else than true will be discarded.
-  MOZ_ASSERT(aEnforceSecurity, "aEnforceSecurity must be true");
-  mEnforceSecurity = mEnforceSecurity || aEnforceSecurity;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
-LoadInfo::GetEnforceSecurity(bool* aResult) {
-  *aResult = mEnforceSecurity;
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 LoadInfo::SetInitialSecurityCheckDone(bool aInitialSecurityCheckDone) {
   // Indicates whether the channel was ever evaluated by the
   // ContentSecurityManager. Once set to true, this flag must
   // remain true throughout the lifetime of the channel.
   // Setting it to anything else than true will be discarded.
   MOZ_ASSERT(aInitialSecurityCheckDone,
              "aInitialSecurityCheckDone must be true");
   mInitialSecurityCheckDone =
--- a/netwerk/base/LoadInfo.h
+++ b/netwerk/base/LoadInfo.h
@@ -105,17 +105,17 @@ class LoadInfo final : public nsILoadInf
            bool aUpgradeInsecureRequests, bool aBrowserUpgradeInsecureRequests,
            bool aBrowserWouldUpgradeInsecureRequests, bool aVerifySignedContent,
            bool aEnforceSRI, bool aForceAllowDataURI,
            bool aAllowInsecureRedirectToDataURI,
            bool aSkipContentPolicyCheckForWebRequest,
            bool aForceInheritPrincipalDropped, uint64_t aInnerWindowID,
            uint64_t aOuterWindowID, uint64_t aParentOuterWindowID,
            uint64_t aTopOuterWindowID, uint64_t aFrameOuterWindowID,
-           uint64_t aBrowsingContextID, bool aEnforceSecurity,
+           uint64_t aBrowsingContextID,
            bool aInitialSecurityCheckDone, bool aIsThirdPartyRequest,
            bool aIsDocshellReload, bool aSendCSPViolationEvents,
            const OriginAttributes& aOriginAttributes,
            RedirectHistoryArray& aRedirectChainIncludingInternalRedirects,
            RedirectHistoryArray& aRedirectChain,
            nsTArray<nsCOMPtr<nsIPrincipal>>&& aAncestorPrincipals,
            const nsTArray<uint64_t>& aAncestorOuterWindowIDs,
            const nsTArray<nsCString>& aUnsafeHeaders, bool aForcePreflight,
@@ -177,17 +177,16 @@ class LoadInfo final : public nsILoadInf
   bool mOriginalFrameSrcLoad;
   bool mForceInheritPrincipalDropped;
   uint64_t mInnerWindowID;
   uint64_t mOuterWindowID;
   uint64_t mParentOuterWindowID;
   uint64_t mTopOuterWindowID;
   uint64_t mFrameOuterWindowID;
   uint64_t mBrowsingContextID;
-  bool mEnforceSecurity;
   bool mInitialSecurityCheckDone;
   bool mIsThirdPartyContext;
   bool mIsDocshellReload;
   bool mSendCSPViolationEvents;
   OriginAttributes mOriginAttributes;
   RedirectHistoryArray mRedirectChainIncludingInternalRedirects;
   RedirectHistoryArray mRedirectChain;
   nsTArray<nsCOMPtr<nsIPrincipal>> mAncestorPrincipals;
--- a/netwerk/base/NetUtil.jsm
+++ b/netwerk/base/NetUtil.jsm
@@ -134,31 +134,17 @@ var NetUtil = {
         }
 
         let channel = aSource;
         if (!(channel instanceof Ci.nsIChannel)) {
             channel = this.newChannel(aSource);
         }
 
         try {
-            // Open the channel using asyncOpen2() if the loadinfo contains one
-            // of the security mode flags, otherwise fall back to use asyncOpen().
-            if (channel.loadInfo &&
-                channel.loadInfo.securityMode != 0) {
-                channel.asyncOpen2(listener);
-            } else {
-                // Log deprecation warning to console to make sure all channels
-                // are created providing the correct security flags in the loadinfo.
-                // See nsILoadInfo for all available security flags and also the API
-                // of NetUtil.newChannel() for details above.
-                Cu.reportError("NetUtil.jsm: asyncFetch() requires the channel to have " +
-                    "one of the security flags set in the loadinfo (see nsILoadInfo). " +
-                    "Please create channel using NetUtil.newChannel()");
-                channel.asyncOpen(listener, null);
-            }
+            channel.asyncOpen(listener);
         } catch (e) {
             let exception = new Components.Exception(
                 "Failed to open input source '" + channel.originalURI.spec + "'",
                 e.result,
                 Components.stack.caller,
                 aSource,
                 e
             );
--- a/netwerk/base/NetworkConnectivityService.cpp
+++ b/netwerk/base/NetworkConnectivityService.cpp
@@ -232,23 +232,23 @@ NetworkConnectivityService::RecheckIPCon
   if (mIPv6Channel) {
     mIPv6Channel->Cancel(NS_ERROR_ABORT);
     mIPv6Channel = nullptr;
   }
 
   nsresult rv;
   mIPv4Channel = SetupIPCheckChannel(/* ipv4 = */ true);
   if (mIPv4Channel) {
-    rv = mIPv4Channel->AsyncOpen2(this);
+    rv = mIPv4Channel->AsyncOpen(this);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   mIPv6Channel = SetupIPCheckChannel(/* ipv4 = */ false);
   if (mIPv6Channel) {
-    rv = mIPv6Channel->AsyncOpen2(this);
+    rv = mIPv6Channel->AsyncOpen(this);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 NetworkConnectivityService::OnStartRequest(nsIRequest *aRequest,
--- a/netwerk/base/Predictor.cpp
+++ b/netwerk/base/Predictor.cpp
@@ -1275,22 +1275,22 @@ nsresult Predictor::Prefetch(nsIURI *uri
   }
 
   rv = httpChannel->SetReferrer(referrer);
   NS_ENSURE_SUCCESS(rv, rv);
   // XXX - set a header here to indicate this is a prefetch?
 
   nsCOMPtr<nsIStreamListener> listener =
       new PrefetchListener(verifier, uri, this);
-  PREDICTOR_LOG(("    calling AsyncOpen2 listener=%p channel=%p",
+  PREDICTOR_LOG(("    calling AsyncOpen listener=%p channel=%p",
                  listener.get(), channel.get()));
-  rv = channel->AsyncOpen2(listener);
+  rv = channel->AsyncOpen(listener);
   if (NS_FAILED(rv)) {
     PREDICTOR_LOG(
-        ("    AsyncOpen2 failed rv=0x%" PRIX32, static_cast<uint32_t>(rv)));
+        ("    AsyncOpen failed rv=0x%" PRIX32, static_cast<uint32_t>(rv)));
   }
 
   return rv;
 }
 
 // Runs predictions that have been set up.
 bool Predictor::RunPredictions(nsIURI *referrer,
                                const OriginAttributes &originAttributes,
--- a/netwerk/base/SimpleChannel.cpp
+++ b/netwerk/base/SimpleChannel.cpp
@@ -119,22 +119,18 @@ SimpleChannelChild::ConnectParent(uint32
 NS_IMETHODIMP
 SimpleChannelChild::CompleteRedirectSetup(nsIStreamListener* aListener,
                                           nsISupports* aContext) {
   if (mIPDLRef) {
     MOZ_ASSERT(NS_IsMainThread());
   }
 
   nsresult rv;
-  if (mLoadInfo && mLoadInfo->GetEnforceSecurity()) {
-    MOZ_ASSERT(!aContext, "aContext should be null!");
-    rv = AsyncOpen2(aListener);
-  } else {
-    rv = AsyncOpen(aListener, aContext);
-  }
+  MOZ_ASSERT(!aContext, "aContext should be null!");
+  rv = AsyncOpen(aListener);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   if (mIPDLRef) {
     Unused << Send__delete__(this);
   }
   return NS_OK;
--- a/netwerk/base/SimpleChannel.h
+++ b/netwerk/base/SimpleChannel.h
@@ -68,18 +68,18 @@ already_AddRefed<nsIChannel> NS_NewSimpl
     nsIURI* aURI, nsILoadInfo* aLoadInfo,
     UniquePtr<SimpleChannelCallbacks>&& aCallbacks);
 
 }  // namespace net
 }  // namespace mozilla
 
 /**
  * Creates a simple channel which wraps an input stream created by the given
- * callbacks. The callbacks are not called until the underlying AsyncOpen2 or
- * Open2 methods are called, and correspond to the nsBaseChannel::StartAsyncRead
+ * callbacks. The callbacks are not called until the underlying AsyncOpen or
+ * Open methods are called, and correspond to the nsBaseChannel::StartAsyncRead
  * and nsBaseChannel::OpenContentStream methods of the same names.
  *
  * The last two arguments of each callback are the created channel instance,
  * and the ref-counted context object passed to NS_NewSimpleChannel. A strong
  * reference to that object is guaranteed to be kept alive until after a
  * callback successfully completes.
  */
 template <typename T, typename F1, typename F2>
--- a/netwerk/base/nsBaseChannel.cpp
+++ b/netwerk/base/nsBaseChannel.cpp
@@ -174,22 +174,17 @@ nsresult nsBaseChannel::ContinueRedirect
   mRedirectChannel->SetOriginalURI(OriginalURI());
 
   // If we fail to open the new channel, then we want to leave this channel
   // unaffected, so we defer tearing down our channel until we have succeeded
   // with the redirect.
 
   if (mOpenRedirectChannel) {
     nsresult rv = NS_OK;
-    if (mLoadInfo && mLoadInfo->GetEnforceSecurity()) {
-      MOZ_ASSERT(!mListenerContext, "mListenerContext should be null!");
-      rv = mRedirectChannel->AsyncOpen2(mListener);
-    } else {
-      rv = mRedirectChannel->AsyncOpen(mListener, mListenerContext);
-    }
+    rv = mRedirectChannel->AsyncOpen(mListener);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   mRedirectChannel = nullptr;
 
   // close down this channel
   Cancel(NS_BINDING_REDIRECTED);
   ChannelDone();
@@ -209,17 +204,17 @@ nsresult nsBaseChannel::PushStreamConver
   NS_ASSERTION(mListener, "no listener");
 
   nsresult rv;
   nsCOMPtr<nsIStreamConverterService> scs =
       do_GetService(NS_STREAMCONVERTERSERVICE_CONTRACTID, &rv);
   if (NS_FAILED(rv)) return rv;
 
   nsCOMPtr<nsIStreamListener> converter;
-  rv = scs->AsyncConvertData(fromType, toType, mListener, mListenerContext,
+  rv = scs->AsyncConvertData(fromType, toType, mListener, nullptr,
                              getter_AddRefs(converter));
   if (NS_SUCCEEDED(rv)) {
     mListener = converter;
     if (invalidatesContentLength) mContentLength = -1;
     if (result) {
       *result = nullptr;
       converter.swap(*result);
     }
@@ -288,18 +283,18 @@ void nsBaseChannel::HandleAsyncRedirect(
 
 void nsBaseChannel::ContinueHandleAsyncRedirect(nsresult result) {
   mWaitingOnAsyncRedirect = false;
 
   if (NS_FAILED(result)) Cancel(result);
 
   if (NS_FAILED(result) && mListener) {
     // Notify our consumer ourselves
-    mListener->OnStartRequest(this, mListenerContext);
-    mListener->OnStopRequest(this, mListenerContext, mStatus);
+    mListener->OnStartRequest(this, nullptr);
+    mListener->OnStopRequest(this, nullptr, mStatus);
     ChannelDone();
   }
 
   if (mLoadGroup) mLoadGroup->RemoveRequest(this, nullptr, mStatus);
 
   // Drop notification callbacks to prevent cycles.
   mCallbacks = nullptr;
   CallbacksChanged();
@@ -571,86 +566,90 @@ nsBaseChannel::GetContentLength(int64_t 
 
 NS_IMETHODIMP
 nsBaseChannel::SetContentLength(int64_t aContentLength) {
   mContentLength = aContentLength;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsBaseChannel::Open(nsIInputStream **result) {
+nsBaseChannel::Open(nsIInputStream **aStream) {
+  nsCOMPtr<nsIStreamListener> listener;
+  nsresult rv =
+      nsContentSecurityManager::doContentSecurityCheck(this, listener);
+  NS_ENSURE_SUCCESS(rv, rv);
+
   NS_ENSURE_TRUE(mURI, NS_ERROR_NOT_INITIALIZED);
   NS_ENSURE_TRUE(!mPumpingData, NS_ERROR_IN_PROGRESS);
   NS_ENSURE_TRUE(!mWasOpened, NS_ERROR_IN_PROGRESS);
 
   nsCOMPtr<nsIChannel> chan;
-  nsresult rv = OpenContentStream(false, result, getter_AddRefs(chan));
-  NS_ASSERTION(!chan || !*result, "Got both a channel and a stream?");
+  rv = OpenContentStream(false, aStream, getter_AddRefs(chan));
+  NS_ASSERTION(!chan || !*aStream, "Got both a channel and a stream?");
   if (NS_SUCCEEDED(rv) && chan) {
     rv = Redirect(chan, nsIChannelEventSink::REDIRECT_INTERNAL, false);
     if (NS_FAILED(rv)) return rv;
-    rv = chan->Open(result);
+    rv = chan->Open(aStream);
   } else if (rv == NS_ERROR_NOT_IMPLEMENTED)
-    return NS_ImplementChannelOpen(this, result);
+    return NS_ImplementChannelOpen(this, aStream);
 
   if (NS_SUCCEEDED(rv)) {
     mWasOpened = true;
     ClassifyURI();
   }
 
   return rv;
 }
 
 NS_IMETHODIMP
-nsBaseChannel::Open2(nsIInputStream **aStream) {
-  nsCOMPtr<nsIStreamListener> listener;
+nsBaseChannel::AsyncOpen(nsIStreamListener *aListener) {
+  nsCOMPtr<nsIStreamListener> listener = aListener;
+
   nsresult rv =
       nsContentSecurityManager::doContentSecurityCheck(this, listener);
-  NS_ENSURE_SUCCESS(rv, rv);
-  return Open(aStream);
-}
+  if (NS_FAILED(rv)) {
+    mCallbacks = nullptr;
+    return rv;
+  }
 
-NS_IMETHODIMP
-nsBaseChannel::AsyncOpen(nsIStreamListener *listener, nsISupports *ctxt) {
   MOZ_ASSERT(
       !mLoadInfo || mLoadInfo->GetSecurityMode() == 0 ||
           mLoadInfo->GetInitialSecurityCheckDone() ||
           (mLoadInfo->GetSecurityMode() ==
                nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL &&
            nsContentUtils::IsSystemPrincipal(mLoadInfo->LoadingPrincipal())),
-      "security flags in loadInfo but asyncOpen2() not called");
+      "security flags in loadInfo but doContentSecurityCheck() not called");
 
   NS_ENSURE_TRUE(mURI, NS_ERROR_NOT_INITIALIZED);
   NS_ENSURE_TRUE(!mPumpingData, NS_ERROR_IN_PROGRESS);
   NS_ENSURE_TRUE(!mWasOpened, NS_ERROR_ALREADY_OPENED);
   NS_ENSURE_ARG(listener);
 
   SetupNeckoTarget();
 
   // Skip checking for chrome:// sub-resources.
   nsAutoCString scheme;
   mURI->GetScheme(scheme);
   if (!scheme.EqualsLiteral("file")) {
     NS_CompareLoadInfoAndLoadContext(this);
   }
 
   // Ensure that this is an allowed port before proceeding.
-  nsresult rv = NS_CheckPortSafety(mURI);
+  rv = NS_CheckPortSafety(mURI);
   if (NS_FAILED(rv)) {
     mCallbacks = nullptr;
     return rv;
   }
 
   // Store the listener and context early so that OpenContentStream and the
   // stream's AsyncWait method (called by AsyncRead) can have access to them
   // via PushStreamConverter and the StreamListener methods.  However, since
   // this typically introduces a reference cycle between this and the listener,
   // we need to be sure to break the reference if this method does not succeed.
   mListener = listener;
-  mListenerContext = ctxt;
 
   // This method assigns mPump as a side-effect.  We need to clear mPump if
   // this method fails.
   rv = BeginPumpingData();
   if (NS_FAILED(rv)) {
     mPump = nullptr;
     mRequest = nullptr;
     mPumpingData = false;
@@ -667,28 +666,16 @@ nsBaseChannel::AsyncOpen(nsIStreamListen
 
   if (mLoadGroup) mLoadGroup->AddRequest(this, nullptr);
 
   ClassifyURI();
 
   return NS_OK;
 }
 
-NS_IMETHODIMP
-nsBaseChannel::AsyncOpen2(nsIStreamListener *aListener) {
-  nsCOMPtr<nsIStreamListener> listener = aListener;
-  nsresult rv =
-      nsContentSecurityManager::doContentSecurityCheck(this, listener);
-  if (NS_FAILED(rv)) {
-    mCallbacks = nullptr;
-    return rv;
-  }
-  return AsyncOpen(listener, nullptr);
-}
-
 //-----------------------------------------------------------------------------
 // nsBaseChannel::nsITransportEventSink
 
 NS_IMETHODIMP
 nsBaseChannel::OnTransportStatus(nsITransport *transport, nsresult status,
                                  int64_t progress, int64_t progressMax) {
   // In some cases, we may wish to suppress transport-layer status events.
 
@@ -708,22 +695,22 @@ nsBaseChannel::OnTransportStatus(nsITran
     if (!mProgressSink) {
       return NS_OK;
     }
   }
 
   if (!HasLoadFlag(LOAD_BACKGROUND)) {
     nsAutoString statusArg;
     if (GetStatusArg(status, statusArg)) {
-      mProgressSink->OnStatus(this, mListenerContext, status, statusArg.get());
+      mProgressSink->OnStatus(this, nullptr, status, statusArg.get());
     }
   }
 
   if (progress) {
-    mProgressSink->OnProgress(this, mListenerContext, progress, progressMax);
+    mProgressSink->OnProgress(this, nullptr, progress, progressMax);
   }
 
   return NS_OK;
 }
 
 //-----------------------------------------------------------------------------
 // nsBaseChannel::nsIInterfaceRequestor
 
@@ -775,34 +762,34 @@ nsBaseChannel::OnStartRequest(nsIRequest
     // Now, the general type sniffers. Skip this if we have none.
     if (mLoadFlags & LOAD_CALL_CONTENT_SNIFFERS)
       mPump->PeekStream(CallTypeSniffers, static_cast<nsIChannel *>(this));
   }
 
   SUSPEND_PUMP_FOR_SCOPE();
 
   if (mListener)  // null in case of redirect
-    return mListener->OnStartRequest(this, mListenerContext);
+    return mListener->OnStartRequest(this, nullptr);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsBaseChannel::OnStopRequest(nsIRequest *request, nsISupports *ctxt,
                              nsresult status) {
   // If both mStatus and status are failure codes, we keep mStatus as-is since
   // that is consistent with our GetStatus and Cancel methods.
   if (NS_SUCCEEDED(mStatus)) mStatus = status;
 
   // Cause Pending to return false.
   mPump = nullptr;
   mRequest = nullptr;
   mPumpingData = false;
 
   if (mListener)  // null in case of redirect
-    mListener->OnStopRequest(this, mListenerContext, mStatus);
+    mListener->OnStopRequest(this, nullptr, mStatus);
   ChannelDone();
 
   // No need to suspend pump in this scope since we will not be receiving
   // any more events from it.
 
   if (mLoadGroup) mLoadGroup->RemoveRequest(this, nullptr, mStatus);
 
   // Drop notification callbacks to prevent cycles.
@@ -817,17 +804,17 @@ nsBaseChannel::OnStopRequest(nsIRequest 
 
 NS_IMETHODIMP
 nsBaseChannel::OnDataAvailable(nsIRequest *request, nsISupports *ctxt,
                                nsIInputStream *stream, uint64_t offset,
                                uint32_t count) {
   SUSPEND_PUMP_FOR_SCOPE();
 
   nsresult rv =
-      mListener->OnDataAvailable(this, mListenerContext, stream, offset, count);
+      mListener->OnDataAvailable(this, nullptr, stream, offset, count);
   if (mSynthProgressEvents && NS_SUCCEEDED(rv)) {
     int64_t prog = offset + count;
     if (NS_IsMainThread()) {
       OnTransportStatus(nullptr, NS_NET_STATUS_READING, prog, mContentLength);
     } else {
       class OnTransportStatusAsyncEvent : public mozilla::Runnable {
         RefPtr<nsBaseChannel> mChannel;
         int64_t mProgress;
--- a/netwerk/base/nsBaseChannel.h
+++ b/netwerk/base/nsBaseChannel.h
@@ -89,17 +89,17 @@ class nsBaseChannel
   // That case will be treated as a redirect to the new channel.  By default
   // *channel will be set to null by the caller, so callees who don't want to
   // return one an just not touch it.
   virtual nsresult OpenContentStream(bool async, nsIInputStream **stream,
                                      nsIChannel **channel) = 0;
 
   // Implemented by subclass to begin pumping data for an async channel, in
   // lieu of returning a stream. If implemented, OpenContentStream will never
-  // be called for async channels. If not implemented, AsyncOpen2 will fall
+  // be called for async channels. If not implemented, AsyncOpen will fall
   // back to OpenContentStream.
   //
   // On success, the callee must begin pumping data to the stream listener,
   // and at some point call OnStartRequest followed by OnStopRequest.
   // Additionally, it may provide a request object which may be used to
   // suspend, resume, and cancel the underlying request.
   virtual nsresult BeginAsyncRead(nsIStreamListener *listener,
                                   nsIRequest **request) {
@@ -217,17 +217,16 @@ class nsBaseChannel
     mQueriedProgressSink = false;
     OnCallbacksChanged();
   }
 
   // Called when our channel is done.  This should drop no-longer-needed
   // pointers.
   void ChannelDone() {
     mListener = nullptr;
-    mListenerContext = nullptr;
     OnChannelDone();
   }
 
   // Handle an async redirect callback.  This will only be called if we
   // returned success from AsyncOpen while posting a redirect runnable.
   void HandleAsyncRedirect(nsIChannel *newChannel);
   void ContinueHandleAsyncRedirect(nsresult result);
   nsresult ContinueRedirect();
@@ -274,17 +273,16 @@ class nsBaseChannel
   uint32_t mRedirectFlags;
 
  protected:
   nsCOMPtr<nsIURI> mURI;
   nsCOMPtr<nsILoadGroup> mLoadGroup;
   nsCOMPtr<nsILoadInfo> mLoadInfo;
   nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
   nsCOMPtr<nsIStreamListener> mListener;
-  nsCOMPtr<nsISupports> mListenerContext;
   nsresult mStatus;
   uint32_t mContentDispositionHint;
   nsAutoPtr<nsString> mContentDispositionFilename;
   int64_t mContentLength;
   bool mWasOpened;
 
   friend class mozilla::net::PrivateBrowsingChannel<nsBaseChannel>;
 };
--- a/netwerk/base/nsIChannel.idl
+++ b/netwerk/base/nsIChannel.idl
@@ -151,21 +151,16 @@ interface nsIChannel : nsIRequest
      * than the XPCOM main thread.
      *
      * NOTE: Implementations should throw NS_ERROR_IN_PROGRESS if the channel
      * is reopened.
      */
     nsIInputStream open();
 
     /**
-     * Performs content security check and calls open()
-     */
-    nsIInputStream open2();
-
-    /**
      * Asynchronously open this channel.  Data is fed to the specified stream
      * listener as it becomes available.  The stream listener's methods are
      * called on the thread that calls asyncOpen and are not called until
      * after asyncOpen returns.  If asyncOpen returns successfully, the
      * channel promises to call at least onStartRequest and onStopRequest.
      *
      * If the nsIRequest object passed to the stream listener's methods is not
      * this channel, an appropriate onChannelRedirect notification needs to be
@@ -183,25 +178,19 @@ interface nsIChannel : nsIRequest
      *
      * Implementations are allowed to synchronously add themselves to the
      * associated load group (if any).
      *
      * NOTE: Implementations should throw NS_ERROR_ALREADY_OPENED if the
      * channel is reopened.
      *
      * @param aListener the nsIStreamListener implementation
-     * @param aContext an opaque parameter forwarded to aListener's methods
      * @see nsIChannelEventSink for onChannelRedirect
      */
-    void asyncOpen(in nsIStreamListener aListener, in nsISupports aContext);
-
-    /**
-     * Performs content security check and calls asyncOpen().
-     */
-    void asyncOpen2(in nsIStreamListener aListener);
+    void asyncOpen(in nsIStreamListener aListener);
 
     /**************************************************************************
      * Channel specific load flags:
      *
      * Bits 16-31 are reserved for future use by this interface or one of its
      * derivatives (e.g., see nsICachingChannel).
      */
 
--- a/netwerk/base/nsILoadInfo.idl
+++ b/netwerk/base/nsILoadInfo.idl
@@ -71,17 +71,17 @@ interface nsILoadInfo : nsISupports
    *    * SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED
    *    * SEC_ALLOW_CROSS_ORIGIN_DATA_INHERITS
    *    * SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL
    *    * SEC_REQUIRE_CORS_DATA_INHERITS
    *
    * Exactly one of these flags are required to be set in order to allow
    * the channel to perform the correct security checks (SOP, CORS, ...) and
    * return the correct result principal. If none or more than one of these
-   * flags are set AsyncOpen2 will fail.
+   * flags are set AsyncOpen will fail.
    */
 
    /**
     * Warning: Never use this flag when creating a new channel!
     * Only use this flag if you have to create a temporary LoadInfo
     * for performing an explicit nsIContentPolicy check, like e.g.
     * when loading something from the cache that needs an explicit
     * nsIContentPolicy check. In all other cases pick one of the
@@ -667,31 +667,19 @@ interface nsILoadInfo : nsISupports
     mozilla::OriginAttributes result;
     mozilla::DebugOnly<nsresult> rv = GetOriginAttributes(&result);
     MOZ_ASSERT(NS_SUCCEEDED(rv));
     return result;
   }
 %}
 
   /**
-   * Whenever a channel is openend by asyncOpen2() [or also open2()],
-   * lets set this flag so that redirects of such channels are also
-   * openend using asyncOpen2() [open2()].
-   *
-   * Please note, once the flag is set to true it must remain true
-   * throughout the lifetime of the channel. Trying to set it
-   * to anything else than true will be discareded.
-   *
-   */
-  [infallible] attribute boolean enforceSecurity;
-
-  /**
    * Whenever a channel is evaluated by the ContentSecurityManager
    * the first time, we set this flag to true to indicate that
-   * subsequent calls of AsyncOpen2() do not have to enforce all
+   * subsequent calls of AsyncOpen() do not have to enforce all
    * security checks again. E.g., after a redirect there is no
    * need to set up CORS again. We need this separate flag
    * because the redirectChain might also contain internal
    * redirects which might pollute the redirectChain so we can't
    * rely on the size of the redirectChain-array to query whether
    * a channel got redirected or not.
    *
    * Please note, once the flag is set to true it must remain true
--- a/netwerk/base/nsIncrementalDownload.cpp
+++ b/netwerk/base/nsIncrementalDownload.cpp
@@ -268,17 +268,17 @@ nsresult nsIncrementalDownload::ProcessT
       if (NS_FAILED(rv)) {
         LOG(
             ("nsIncrementalDownload::ProcessTimeout\n"
              "    failed to set request header: If-Range\n"));
       }
     }
   }
 
-  rv = channel->AsyncOpen2(this);
+  rv = channel->AsyncOpen(this);
   if (NS_FAILED(rv)) return rv;
 
   // Wait to assign mChannel when we know we are going to succeed.  This is
   // important because we don't want to introduce a reference cycle between
   // mChannel and this until we know for a fact that AsyncOpen has succeeded,
   // thus ensuring that our stream listener methods will be invoked.
   mChannel = channel;
   return NS_OK;
--- a/netwerk/base/nsInputStreamPump.cpp
+++ b/netwerk/base/nsInputStreamPump.cpp
@@ -348,17 +348,16 @@ nsInputStreamPump::AsyncRead(nsIStreamLi
 
   rv = EnsureWaiting();
   if (NS_FAILED(rv)) return rv;
 
   if (mLoadGroup) mLoadGroup->AddRequest(this, nullptr);
 
   mState = STATE_START;
   mListener = listener;
-  mListenerContext = ctxt;
   return NS_OK;
 }
 
 //-----------------------------------------------------------------------------
 // nsInputStreamPump::nsIInputStreamCallback implementation
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
@@ -480,17 +479,17 @@ uint32_t nsInputStreamPump::OnStateStart
     if (NS_FAILED(rv) && rv != NS_BASE_STREAM_CLOSED) mStatus = rv;
   }
 
   {
     // Note: Must exit mutex for call to OnStartRequest to avoid
     // deadlocks when calls to RetargetDeliveryTo for multiple
     // nsInputStreamPumps are needed (e.g. nsHttpChannel).
     RecursiveMutexAutoUnlock unlock(mMutex);
-    rv = mListener->OnStartRequest(this, mListenerContext);
+    rv = mListener->OnStartRequest(this, nullptr);
   }
 
   // an error returned from OnStartRequest should cause us to abort; however,
   // we must not stomp on mStatus if already canceled.
   if (NS_FAILED(rv) && NS_SUCCEEDED(mStatus)) mStatus = rv;
 
   return NS_SUCCEEDED(mStatus) ? STATE_TRANSFER : STATE_STOP;
 }
@@ -547,17 +546,17 @@ uint32_t nsInputStreamPump::OnStateTrans
          "(%u)]\n",
          mStreamOffset, avail, odaAvail));
 
     {
       // Note: Must exit mutex for call to OnStartRequest to avoid
       // deadlocks when calls to RetargetDeliveryTo for multiple
       // nsInputStreamPumps are needed (e.g. nsHttpChannel).
       RecursiveMutexAutoUnlock unlock(mMutex);
-      rv = mListener->OnDataAvailable(this, mListenerContext, mAsyncStream,
+      rv = mListener->OnDataAvailable(this, nullptr, mAsyncStream,
                                       mStreamOffset, odaAvail);
     }
 
     // don't enter this code if ODA failed or called Cancel
     if (NS_SUCCEEDED(rv) && NS_SUCCEEDED(mStatus)) {
       // test to see if this ODA failed to consume data
       if (tellable) {
         // NOTE: if Tell fails, which can happen if the stream is
@@ -648,20 +647,19 @@ uint32_t nsInputStreamPump::OnStateStop(
   mAsyncStream = nullptr;
   mTargetThread = nullptr;
   mIsPending = false;
   {
     // Note: Must exit mutex for call to OnStartRequest to avoid
     // deadlocks when calls to RetargetDeliveryTo for multiple
     // nsInputStreamPumps are needed (e.g. nsHttpChannel).
     RecursiveMutexAutoUnlock unlock(mMutex);
-    mListener->OnStopRequest(this, mListenerContext, mStatus);
+    mListener->OnStopRequest(this, nullptr, mStatus);
   }
   mListener = nullptr;
-  mListenerContext = nullptr;
 
   if (mLoadGroup) mLoadGroup->RemoveRequest(this, nullptr, mStatus);
 
   return STATE_IDLE;
 }
 
 nsresult nsInputStreamPump::CreateBufferedStreamIfNeeded() {
   if (mAsyncStreamIsBuffered) {
--- a/netwerk/base/nsInputStreamPump.h
+++ b/netwerk/base/nsInputStreamPump.h
@@ -65,17 +65,16 @@ class nsInputStreamPump final : public n
   uint32_t OnStateStart();
   uint32_t OnStateTransfer();
   uint32_t OnStateStop();
   nsresult CreateBufferedStreamIfNeeded();
 
   uint32_t mState;
   nsCOMPtr<nsILoadGroup> mLoadGroup;
   nsCOMPtr<nsIStreamListener> mListener;
-  nsCOMPtr<nsISupports> mListenerContext;
   nsCOMPtr<nsIEventTarget> mTargetThread;
   nsCOMPtr<nsIEventTarget> mLabeledMainThreadTarget;
   nsCOMPtr<nsIInputStream> mStream;
   nsCOMPtr<nsIAsyncInputStream> mAsyncStream;
   uint64_t mStreamOffset;
   uint64_t mStreamLength;
   uint32_t mSegSize;
   uint32_t mSegCount;
--- a/netwerk/base/nsNetUtil.cpp
+++ b/netwerk/base/nsNetUtil.cpp
@@ -914,17 +914,17 @@ nsresult NS_NewStreamLoaderInternal(
   NS_ENSURE_SUCCESS(rv, rv);
   nsCOMPtr<nsIHttpChannel> httpChannel(do_QueryInterface(channel));
   if (httpChannel) {
     rv = httpChannel->SetReferrer(aReferrer);
     MOZ_ASSERT(NS_SUCCEEDED(rv));
   }
   rv = NS_NewStreamLoader(outStream, aObserver);
   NS_ENSURE_SUCCESS(rv, rv);
-  return channel->AsyncOpen2(*outStream);
+  return channel->AsyncOpen(*outStream);
 }
 
 nsresult NS_NewStreamLoader(
     nsIStreamLoader **outStream, nsIURI *aUri,
     nsIStreamLoaderObserver *aObserver, nsINode *aLoadingNode,
     nsSecurityFlags aSecurityFlags, nsContentPolicyType aContentPolicyType,
     nsILoadGroup *aLoadGroup /* = nullptr */,
     nsIInterfaceRequestor *aCallbacks /* = nullptr */,
@@ -968,17 +968,17 @@ nsresult NS_NewSyncStreamListener(nsIStr
 
 nsresult NS_ImplementChannelOpen(nsIChannel *channel, nsIInputStream **result) {
   nsCOMPtr<nsIStreamListener> listener;
   nsCOMPtr<nsIInputStream> stream;
   nsresult rv = NS_NewSyncStreamListener(getter_AddRefs(listener),
                                          getter_AddRefs(stream));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  rv = NS_MaybeOpenChannelUsingAsyncOpen2(channel, listener);
+  rv = NS_MaybeOpenChannelUsingAsyncOpen(channel, listener);
   NS_ENSURE_SUCCESS(rv, rv);
 
   uint64_t n;
   // block until the initial response is received or an error occurs.
   rv = stream->Available(&n);
   NS_ENSURE_SUCCESS(rv, rv);
 
   *result = nullptr;
@@ -1678,17 +1678,17 @@ nsresult NS_LoadPersistentPropertiesFrom
 
   nsCOMPtr<nsIChannel> channel;
   rv = NS_NewChannel(getter_AddRefs(channel), uri,
                      nsContentUtils::GetSystemPrincipal(),
                      nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
                      nsIContentPolicy::TYPE_OTHER);
   NS_ENSURE_SUCCESS(rv, rv);
   nsCOMPtr<nsIInputStream> in;
-  rv = channel->Open2(getter_AddRefs(in));
+  rv = channel->Open(getter_AddRefs(in));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIPersistentProperties> properties = new nsPersistentProperties();
   rv = properties->Load(in);
   NS_ENSURE_SUCCESS(rv, rv);
 
   properties.swap(*outResult);
   return NS_OK;
@@ -2352,32 +2352,26 @@ nsresult NS_LinkRedirectChannels(uint32_
                                  nsIChannel **_result) {
   nsCOMPtr<nsIRedirectChannelRegistrar> registrar =
       RedirectChannelRegistrar::GetOrCreate();
   MOZ_ASSERT(registrar);
 
   return registrar->LinkChannels(channelId, parentChannel, _result);
 }
 
-nsresult NS_MaybeOpenChannelUsingOpen2(nsIChannel *aChannel,
+nsresult NS_MaybeOpenChannelUsingOpen(nsIChannel *aChannel,
                                        nsIInputStream **aStream) {
   nsCOMPtr<nsILoadInfo> loadInfo = aChannel->GetLoadInfo();
-  if (loadInfo && loadInfo->GetSecurityMode() != 0) {
-    return aChannel->Open2(aStream);
-  }
   return aChannel->Open(aStream);
 }
 
-nsresult NS_MaybeOpenChannelUsingAsyncOpen2(nsIChannel *aChannel,
+nsresult NS_MaybeOpenChannelUsingAsyncOpen(nsIChannel *aChannel,
                                             nsIStreamListener *aListener) {
   nsCOMPtr<nsILoadInfo> loadInfo = aChannel->GetLoadInfo();
-  if (loadInfo && loadInfo->GetSecurityMode() != 0) {
-    return aChannel->AsyncOpen2(aListener);
-  }
-  return aChannel->AsyncOpen(aListener, nullptr);
+  return aChannel->AsyncOpen(aListener);
 }
 
 /** Given the first (disposition) token from a Content-Disposition header,
  * tell whether it indicates the content is inline or attachment
  * @param aDispToken the disposition token from the content-disposition header
  */
 uint32_t NS_GetContentDispositionFromToken(const nsAString &aDispToken) {
   // RFC 2183, section 2.8 says that an unknown disposition
--- a/netwerk/base/nsNetUtil.h
+++ b/netwerk/base/nsNetUtil.h
@@ -787,29 +787,29 @@ bool NS_IsHSTSUpgradeRedirect(nsIChannel
                               uint32_t aFlags);
 
 nsresult NS_LinkRedirectChannels(uint32_t channelId,
                                  nsIParentChannel *parentChannel,
                                  nsIChannel **_result);
 
 /**
  * Helper function which checks whether the channel can be
- * openend using Open2() or has to fall back to opening
+ * openend using Open() or has to fall back to opening
  * the channel using Open().
  */
-nsresult NS_MaybeOpenChannelUsingOpen2(nsIChannel *aChannel,
-                                       nsIInputStream **aStream);
+nsresult NS_MaybeOpenChannelUsingOpen(nsIChannel *aChannel,
+                                      nsIInputStream **aStream);
 
 /**
  * Helper function which checks whether the channel can be
- * openend using AsyncOpen2() or has to fall back to opening
+ * openend using AsyncOpen() or has to fall back to opening
  * the channel using AsyncOpen().
  */
-nsresult NS_MaybeOpenChannelUsingAsyncOpen2(nsIChannel *aChannel,
-                                            nsIStreamListener *aListener);
+nsresult NS_MaybeOpenChannelUsingAsyncOpen(nsIChannel *aChannel,
+                                           nsIStreamListener *aListener);
 
 /** Given the first (disposition) token from a Content-Disposition header,
  * tell whether it indicates the content is inline or attachment
  * @param aDispToken the disposition token from the content-disposition header
  */
 uint32_t NS_GetContentDispositionFromToken(const nsAString &aDispToken);
 
 /** Determine the disposition (inline/attachment) of the content based on the
--- a/netwerk/base/nsPACMan.cpp
+++ b/netwerk/base/nsPACMan.cpp
@@ -644,17 +644,17 @@ void nsPACMan::ContinueLoadingAfterPACUr
       } else {
         LOG(("nsPACMan::StartLoading Failed pacspec uri conversion %s\n",
              mPACURISpec.get()));
       }
 
       if (channel) {
         channel->SetLoadFlags(nsIRequest::LOAD_BYPASS_CACHE);
         channel->SetNotificationCallbacks(this);
-        if (NS_SUCCEEDED(channel->AsyncOpen2(mLoader))) return;
+        if (NS_SUCCEEDED(channel->AsyncOpen(mLoader))) return;
       }
     }
   }
 
   CancelExistingLoad();
   PostCancelPendingQ(NS_ERROR_UNEXPECTED);
 }
 
--- a/netwerk/base/nsSecCheckWrapChannel.cpp
+++ b/netwerk/base/nsSecCheckWrapChannel.cpp
@@ -151,27 +151,27 @@ nsSecCheckWrapChannel::GetLoadInfo(nsILo
 NS_IMETHODIMP
 nsSecCheckWrapChannel::SetLoadInfo(nsILoadInfo *aLoadInfo) {
   CHANNELWRAPPERLOG(("nsSecCheckWrapChannel::SetLoadInfo() [%p]", this));
   mLoadInfo = aLoadInfo;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsSecCheckWrapChannel::AsyncOpen2(nsIStreamListener *aListener) {
+nsSecCheckWrapChannel::AsyncOpen(nsIStreamListener *aListener) {
   nsCOMPtr<nsIStreamListener> secWrapChannelListener =
       new SecWrapChannelStreamListener(this, aListener);
   nsresult rv = nsContentSecurityManager::doContentSecurityCheck(
       this, secWrapChannelListener);
   NS_ENSURE_SUCCESS(rv, rv);
-  return AsyncOpen(secWrapChannelListener, nullptr);
+  return AsyncOpen(secWrapChannelListener);
 }
 
 NS_IMETHODIMP
-nsSecCheckWrapChannel::Open2(nsIInputStream **aStream) {
+nsSecCheckWrapChannel::Open(nsIInputStream **aStream) {
   nsCOMPtr<nsIStreamListener> listener;
   nsresult rv =
       nsContentSecurityManager::doContentSecurityCheck(this, listener);
   NS_ENSURE_SUCCESS(rv, rv);
   return Open(aStream);
 }
 
 }  // namespace net
--- a/netwerk/base/nsSecCheckWrapChannel.h
+++ b/netwerk/base/nsSecCheckWrapChannel.h
@@ -72,26 +72,26 @@ class nsSecCheckWrapChannelBase : public
   nsCOMPtr<nsIHttpChannel> mHttpChannel;
   nsCOMPtr<nsIHttpChannelInternal> mHttpChannelInternal;
   nsCOMPtr<nsIRequest> mRequest;
   nsCOMPtr<nsIUploadChannel> mUploadChannel;
   nsCOMPtr<nsIUploadChannel2> mUploadChannel2;
 };
 
 /* We define a separate class here to make it clear that we're overriding
- * Get/SetLoadInfo as well as AsyncOpen2() and Open2(), rather that using
+ * Get/SetLoadInfo as well as AsyncOpen() and Open(), rather that using
  * the forwarded implementations provided by NS_FORWARD_NSICHANNEL"
  */
 class nsSecCheckWrapChannel : public nsSecCheckWrapChannelBase {
  public:
   NS_IMETHOD GetLoadInfo(nsILoadInfo** aLoadInfo) override;
   NS_IMETHOD SetLoadInfo(nsILoadInfo* aLoadInfo) override;
 
-  NS_IMETHOD AsyncOpen2(nsIStreamListener* aListener) override;
-  NS_IMETHOD Open2(nsIInputStream** aStream) override;
+  NS_IMETHOD AsyncOpen(nsIStreamListener* aListener) override;
+  NS_IMETHOD Open(nsIInputStream** aStream) override;
 
   nsSecCheckWrapChannel(nsIChannel* aChannel, nsILoadInfo* aLoadInfo);
   static already_AddRefed<nsIChannel> MaybeWrap(nsIChannel* aChannel,
                                                 nsILoadInfo* aLoadInfo);
 
  protected:
   virtual ~nsSecCheckWrapChannel() = default;
 
--- a/netwerk/dns/TRR.cpp
+++ b/netwerk/dns/TRR.cpp
@@ -302,17 +302,17 @@ nsresult TRR::SendHTTPRequest() {
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   // set the *default* response content type
   if (NS_FAILED(httpChannel->SetContentType(
           NS_LITERAL_CSTRING("application/dns-message")))) {
     LOG(("TRR::SendHTTPRequest: couldn't set content-type!\n"));
   }
-  if (NS_SUCCEEDED(httpChannel->AsyncOpen2(this))) {
+  if (NS_SUCCEEDED(httpChannel->AsyncOpen(this))) {
     NS_NewTimerWithCallback(getter_AddRefs(mTimeout), this,
                             gTRRService->GetRequestTimeout(),
                             nsITimer::TYPE_ONE_SHOT);
     return NS_OK;
   }
   mChannel = nullptr;
   return NS_ERROR_UNEXPECTED;
 }
@@ -443,17 +443,17 @@ nsresult TRR::ReceivePush(nsIHttpChannel
     return rv;
   }
 
   rv = mHostResolver->TrrLookup_unlocked(hostRecord, this);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
-  rv = pushed->AsyncOpen2(this);
+  rv = pushed->AsyncOpen(this);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   // OK!
   mChannel = pushed;
   mRec.swap(hostRecord);
 
--- a/netwerk/ipc/NeckoChannelParams.ipdlh
+++ b/netwerk/ipc/NeckoChannelParams.ipdlh
@@ -59,17 +59,16 @@ struct LoadInfoArgs
   bool                        skipContentPolicyCheckForWebRequest;
   bool                        forceInheritPrincipalDropped;
   uint64_t                    innerWindowID;
   uint64_t                    outerWindowID;
   uint64_t                    parentOuterWindowID;
   uint64_t                    topOuterWindowID;
   uint64_t                    frameOuterWindowID;
   uint64_t                    browsingContextID;
-  bool                        enforceSecurity;
   bool                        initialSecurityCheckDone;
   bool                        isInThirdPartyContext;
   bool                        isDocshellReload;
   bool                        sendCSPViolationEvents;
   OriginAttributes            originAttributes;
   RedirectHistoryEntryInfo[]  redirectChainIncludingInternalRedirects;
   RedirectHistoryEntryInfo[]  redirectChain;
 
--- a/netwerk/protocol/about/nsAboutCache.cpp
+++ b/netwerk/protocol/about/nsAboutCache.cpp
@@ -121,47 +121,37 @@ nsresult nsAboutCache::Channel::Init(nsI
   rv = FlushBuffer();
   if (NS_FAILED(rv)) {
     NS_WARNING("Failed to flush buffer");
   }
 
   return NS_OK;
 }
 
-NS_IMETHODIMP nsAboutCache::Channel::AsyncOpen(nsIStreamListener *aListener,
-                                               nsISupports *aContext) {
+NS_IMETHODIMP nsAboutCache::Channel::AsyncOpen(nsIStreamListener *aListener) {
   nsresult rv;
 
   if (!mChannel) {
     return NS_ERROR_UNEXPECTED;
   }
 
   // Kick the walk loop.
   rv = VisitNextStorage();
   if (NS_FAILED(rv)) return rv;
 
-  MOZ_ASSERT(!aContext, "asyncOpen2() does not take a context argument");
-  rv = NS_MaybeOpenChannelUsingAsyncOpen2(mChannel, aListener);
+  rv = NS_MaybeOpenChannelUsingAsyncOpen(mChannel, aListener);
   if (NS_FAILED(rv)) return rv;
 
   return NS_OK;
 }
 
-NS_IMETHODIMP nsAboutCache::Channel::AsyncOpen2(nsIStreamListener *aListener) {
-  return AsyncOpen(aListener, nullptr);
-}
-
 NS_IMETHODIMP nsAboutCache::Channel::Open(nsIInputStream **_retval) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-NS_IMETHODIMP nsAboutCache::Channel::Open2(nsIInputStream **_retval) {
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
 nsresult nsAboutCache::Channel::ParseURI(nsIURI *uri, nsACString &storage) {
   //
   // about:cache[?storage=<storage-name>[&context=<context-key>]]
   //
   nsresult rv;
 
   nsAutoCString path;
   rv = uri->GetPathQueryRef(path);
--- a/netwerk/protocol/about/nsAboutCache.h
+++ b/netwerk/protocol/about/nsAboutCache.h
@@ -120,21 +120,18 @@ class nsAboutCache final : public nsIAbo
  protected:
   virtual ~nsAboutCache() = default;
 
   class Channel final : public nsIChannel, public nsICacheStorageVisitor {
     NS_DECL_ISUPPORTS
     NS_DECL_NSICACHESTORAGEVISITOR
     NS_FORWARD_SAFE_NSIREQUEST(mChannel)
     NS_FORWARD_SAFE_NSICHANNEL_SUBSET(mChannel)
-    NS_IMETHOD AsyncOpen(nsIStreamListener *aListener,
-                         nsISupports *aContext) override;
-    NS_IMETHOD AsyncOpen2(nsIStreamListener *aListener) override;
+    NS_IMETHOD AsyncOpen(nsIStreamListener *aListener) override;
     NS_IMETHOD Open(nsIInputStream **_retval) override;
-    NS_IMETHOD Open2(nsIInputStream **_retval) override;
 
    private:
     virtual ~Channel() = default;
 
    public:
     MOZ_MUST_USE nsresult Init(nsIURI *aURI, nsILoadInfo *aLoadInfo);
     MOZ_MUST_USE nsresult ParseURI(nsIURI *uri, nsACString &storage);
 
--- a/netwerk/protocol/data/DataChannelChild.cpp
+++ b/netwerk/protocol/data/DataChannelChild.cpp
@@ -34,22 +34,18 @@ DataChannelChild::ConnectParent(uint32_t
   AddIPDLReference();
   return NS_OK;
 }
 
 NS_IMETHODIMP
 DataChannelChild::CompleteRedirectSetup(nsIStreamListener* aListener,
                                         nsISupports* aContext) {
   nsresult rv;
-  if (mLoadInfo && mLoadInfo->GetEnforceSecurity()) {
-    MOZ_ASSERT(!aContext, "aContext should be null!");
-    rv = AsyncOpen2(aListener);
-  } else {
-    rv = AsyncOpen(aListener, aContext);
-  }
+  MOZ_ASSERT(!aContext, "aContext should be null!");
+  rv = AsyncOpen(aListener);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   if (mIPCOpen) {
     Unused << Send__delete__(this);
   }
   return NS_OK;
--- a/netwerk/protocol/file/FileChannelChild.cpp
+++ b/netwerk/protocol/file/FileChannelChild.cpp
@@ -34,22 +34,17 @@ FileChannelChild::ConnectParent(uint32_t
   return NS_OK;
 }
 
 NS_IMETHODIMP
 FileChannelChild::CompleteRedirectSetup(nsIStreamListener *listener,
                                         nsISupports *ctx) {
   nsresult rv;
 
-  if (mLoadInfo && mLoadInfo->GetEnforceSecurity()) {
-    MOZ_ASSERT(!ctx, "Context should be null");
-    rv = AsyncOpen2(listener);
-  } else {
-    rv = AsyncOpen(listener, ctx);
-  }
+  rv = AsyncOpen(listener);
 
   if (NS_WARN_IF(NS_FAILED(rv))) {
     return rv;
   }
 
   if (mIPCOpen) {
     Unused << Send__delete__(this);
   }
--- a/netwerk/protocol/ftp/FTPChannelChild.cpp
+++ b/netwerk/protocol/ftp/FTPChannelChild.cpp
@@ -17,16 +17,17 @@
 #include "nsStringStream.h"
 #include "nsNetUtil.h"
 #include "base/compiler_specific.h"
 #include "mozilla/ipc/IPCStreamUtils.h"
 #include "mozilla/ipc/URIUtils.h"
 #include "SerializedLoadContext.h"
 #include "mozilla/ipc/BackgroundUtils.h"
 #include "nsIURIMutator.h"
+#include "nsContentSecurityManager.h"
 
 using mozilla::dom::ContentChild;
 using namespace mozilla::ipc;
 
 #undef LOG
 #define LOG(args) MOZ_LOG(gFTPLog, mozilla::LogLevel::Debug, args)
 
 namespace mozilla {
@@ -124,31 +125,34 @@ NS_IMETHODIMP
 FTPChannelChild::GetUploadStream(nsIInputStream** stream) {
   NS_ENSURE_ARG_POINTER(stream);
   *stream = mUploadStream;
   NS_IF_ADDREF(*stream);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-FTPChannelChild::AsyncOpen(::nsIStreamListener* listener,
-                           nsISupports* aContext) {
+FTPChannelChild::AsyncOpen(nsIStreamListener* aListener) {
+  nsCOMPtr<nsIStreamListener> listener = aListener;
+  nsresult rv =
+      nsContentSecurityManager::doContentSecurityCheck(this, listener);
+  NS_ENSURE_SUCCESS(rv, rv);
+
   LOG(("FTPChannelChild::AsyncOpen [this=%p]\n", this));
 
   NS_ENSURE_TRUE((gNeckoChild), NS_ERROR_FAILURE);
   NS_ENSURE_TRUE(
       !static_cast<ContentChild*>(gNeckoChild->Manager())->IsShuttingDown(),
       NS_ERROR_FAILURE);
   NS_ENSURE_ARG_POINTER(listener);
   NS_ENSURE_TRUE(!mIsPending, NS_ERROR_IN_PROGRESS);
   NS_ENSURE_TRUE(!mWasOpened, NS_ERROR_ALREADY_OPENED);
 
   // Port checked in parent, but duplicate here so we can return with error
   // immediately, as we've done since before e10s.
-  nsresult rv;
   rv = NS_CheckPortSafety(nsBaseChannel::URI());  // Need to disambiguate,
                                                   // because in the child ipdl,
                                                   // a typedef URI is defined...
   if (NS_FAILED(rv)) return rv;
 
   mozilla::dom::TabChild* tabChild = nullptr;
   nsCOMPtr<nsITabChild> iTabChild;
   NS_QueryNotificationCallbacks(mCallbacks, mLoadGroup, NS_GET_IID(nsITabChild),
@@ -157,17 +161,16 @@ FTPChannelChild::AsyncOpen(::nsIStreamLi
   if (iTabChild) {
     tabChild = static_cast<mozilla::dom::TabChild*>(iTabChild.get());
   }
   if (MissingRequiredTabChild(tabChild, "ftp")) {
     return NS_ERROR_ILLEGAL_VALUE;
   }
 
   mListener = listener;
-  mListenerContext = aContext;
 
   // add ourselves to the load group.
   if (mLoadGroup) mLoadGroup->AddRequest(this, nullptr);
 
   mozilla::ipc::AutoIPCStream autoStream;
   autoStream.Serialize(mUploadStream,
                        static_cast<ContentChild*>(gNeckoChild->Manager()));
 
@@ -308,22 +311,21 @@ void FTPChannelChild::DoOnStartRequest(c
     if (NS_FAILED(rv)) {
       Cancel(rv);
     }
   } else {
     Cancel(rv);
   }
 
   AutoEventEnqueuer ensureSerialDispatch(mEventQ);
-  rv = mListener->OnStartRequest(this, mListenerContext);
+  rv = mListener->OnStartRequest(this, nullptr);
   if (NS_FAILED(rv)) Cancel(rv);
 
   if (mDivertingToParent) {
     mListener = nullptr;
-    mListenerContext = nullptr;
     if (mLoadGroup) {
       mLoadGroup->RemoveRequest(this, nullptr, mStatus);
     }
   }
 }
 
 class FTPDataAvailableEvent : public NeckoTargetChannelEvent<FTPChannelChild> {
  public:
@@ -423,18 +425,17 @@ void FTPChannelChild::DoOnDataAvailable(
   nsresult rv = NS_NewByteInputStream(getter_AddRefs(stringStream), data.get(),
                                       count, NS_ASSIGNMENT_DEPEND);
   if (NS_FAILED(rv)) {
     Cancel(rv);
     return;
   }
 
   AutoEventEnqueuer ensureSerialDispatch(mEventQ);
-  rv = mListener->OnDataAvailable(this, mListenerContext, stringStream, offset,
-                                  count);
+  rv = mListener->OnDataAvailable(this, nullptr, stringStream, offset, count);
   if (NS_FAILED(rv)) Cancel(rv);
   stringStream->Close();
 }
 
 class FTPStopRequestEvent : public NeckoTargetChannelEvent<FTPChannelChild> {
  public:
   FTPStopRequestEvent(FTPChannelChild* aChild, const nsresult& aChannelStatus,
                       const nsCString& aErrorMsg, bool aUseUTF8)
@@ -508,20 +509,19 @@ void FTPChannelChild::DoOnStopRequest(co
     mUnknownDecoderEventQ.AppendElement(
         MakeUnique<MaybeDivertOnStopFTPEvent>(this, aChannelStatus));
   }
 
   {  // Ensure that all queued ipdl events are dispatched before
     // we initiate protocol deletion below.
     mIsPending = false;
     AutoEventEnqueuer ensureSerialDispatch(mEventQ);
-    (void)mListener->OnStopRequest(this, mListenerContext, aChannelStatus);
+    (void)mListener->OnStopRequest(this, nullptr, aChannelStatus);
 
     mListener = nullptr;
-    mListenerContext = nullptr;
 
     if (mLoadGroup) mLoadGroup->RemoveRequest(this, nullptr, aChannelStatus);
   }
 
   // This calls NeckoChild::DeallocPFTPChannelChild(), which deletes |this| if
   // IPDL holds the last reference.  Don't rely on |this| existing after here!
   Send__delete__(this);
 }
@@ -549,25 +549,24 @@ mozilla::ipc::IPCResult FTPChannelChild:
 void FTPChannelChild::DoFailedAsyncOpen(const nsresult& statusCode) {
   LOG(("FTPChannelChild::DoFailedAsyncOpen [this=%p status=%" PRIx32 "]\n",
        this, static_cast<uint32_t>(statusCode)));
   mStatus = statusCode;
 
   if (mLoadGroup) mLoadGroup->RemoveRequest(this, nullptr, statusCode);
 
   if (mListener) {
-    mListener->OnStartRequest(this, mListenerContext);
+    mListener->OnStartRequest(this, nullptr);
     mIsPending = false;
-    mListener->OnStopRequest(this, mListenerContext, statusCode);
+    mListener->OnStopRequest(this, nullptr, statusCode);
   } else {
     mIsPending = false;
   }
 
   mListener = nullptr;
-  mListenerContext = nullptr;
 
   if (mIPCOpen) Send__delete__(this);
 }
 
 class FTPFlushedForDiversionEvent
     : public NeckoTargetChannelEvent<FTPChannelChild> {
  public:
   explicit FTPFlushedForDiversionEvent(FTPChannelChild* aChild)
@@ -719,17 +718,16 @@ FTPChannelChild::CompleteRedirectSetup(n
   LOG(("FTPChannelChild::CompleteRedirectSetup [this=%p]\n", this));
 
   NS_ENSURE_TRUE(!mIsPending, NS_ERROR_IN_PROGRESS);
   NS_ENSURE_TRUE(!mWasOpened, NS_ERROR_ALREADY_OPENED);
 
   mIsPending = true;
   mWasOpened = true;
   mListener = listener;
-  mListenerContext = aContext;
 
   // add ourselves to the load group.
   if (mLoadGroup) mLoadGroup->AddRequest(this, nullptr);
 
   // We already have an open IPDL connection to the parent. If on-modify-request
   // listeners or load group observers canceled us, let the parent handle it
   // and send it back to us naturally.
   return NS_OK;
--- a/netwerk/protocol/ftp/FTPChannelChild.h
+++ b/netwerk/protocol/ftp/FTPChannelChild.h
@@ -57,18 +57,17 @@ class FTPChannelChild final : public PFT
   NS_IMETHOD Suspend() override;
   NS_IMETHOD Resume() override;
 
   explicit FTPChannelChild(nsIURI* uri);
 
   void AddIPDLReference();
   void ReleaseIPDLReference();
 
-  NS_IMETHOD AsyncOpen(nsIStreamListener* listener,
-                       nsISupports* aContext) override;
+  NS_IMETHOD AsyncOpen(nsIStreamListener* listener) override;
 
   // Note that we handle this ourselves, overriding the nsBaseChannel
   // default behavior, in order to be e10s-friendly.
   NS_IMETHOD IsPending(bool* result) override;
 
   nsresult OpenContentStream(bool async, nsIInputStream** stream,
                              nsIChannel** channel) override;
 
--- a/netwerk/protocol/ftp/FTPChannelParent.cpp
+++ b/netwerk/protocol/ftp/FTPChannelParent.cpp
@@ -159,21 +159,17 @@ bool FTPChannelParent::DoAsyncOpen(const
     // contentType and contentLength are ignored
     rv = ftpChan->SetUploadStream(upload, EmptyCString(), 0);
     if (NS_FAILED(rv)) return SendFailedAsyncOpen(rv);
   }
 
   rv = ftpChan->ResumeAt(aStartPos, aEntityID);
   if (NS_FAILED(rv)) return SendFailedAsyncOpen(rv);
 
-  if (loadInfo && loadInfo->GetEnforceSecurity()) {
-    rv = ftpChan->AsyncOpen2(this);
-  } else {
-    rv = ftpChan->AsyncOpen(this, nullptr);
-  }
+  rv = ftpChan->AsyncOpen(this);
 
   if (NS_FAILED(rv)) return SendFailedAsyncOpen(rv);
 
   return true;
 }
 
 bool FTPChannelParent::ConnectChannel(const uint32_t& channelId) {
   nsresult rv;
--- a/netwerk/protocol/http/AlternateServices.cpp
+++ b/netwerk/protocol/http/AlternateServices.cpp
@@ -698,17 +698,17 @@ class WellKnownChecker {
       return NS_ERROR_FAILURE;
     }
     flags |= HttpBaseChannel::LOAD_BYPASS_CACHE;
     if (NS_FAILED(chan->SetLoadFlags(flags))) {
       return NS_ERROR_FAILURE;
     }
     chan->SetTransactionObserver(obs);
     chan->SetConnectionInfo(ci);
-    return chan->AsyncOpen2(obs);
+    return chan->AsyncOpen(obs);
   }
 
   RefPtr<TransactionObserver> mTransactionAlternate;
   RefPtr<TransactionObserver> mTransactionOrigin;
   uint32_t mWaiting;  // semaphore
   nsCString mOrigin;
   int32_t mAlternatePort;
   RefPtr<AltSvcMapping> mMapping;
--- a/netwerk/protocol/http/HttpBaseChannel.cpp
+++ b/netwerk/protocol/http/HttpBaseChannel.cpp
@@ -288,17 +288,16 @@ void HttpBaseChannel::ReleaseMainThreadO
   arrayToRelease.AppendElement(mProgressSink.forget());
   arrayToRelease.AppendElement(mReferrer.forget());
   arrayToRelease.AppendElement(mApplicationCache.forget());
   arrayToRelease.AppendElement(mAPIRedirectToURI.forget());
   arrayToRelease.AppendElement(mProxyURI.forget());
   arrayToRelease.AppendElement(mPrincipal.forget());
   arrayToRelease.AppendElement(mTopWindowURI.forget());
   arrayToRelease.AppendElement(mListener.forget());
-  arrayToRelease.AppendElement(mListenerContext.forget());
   arrayToRelease.AppendElement(mCompressListener.forget());
 
   if (mAddedAsNonTailRequest) {
     // RemoveNonTailRequest() on our request context must be called on the main
     // thread
     MOZ_RELEASE_ASSERT(mRequestContext,
                        "Someone released rc or set flags w/o having it?");
 
@@ -736,39 +735,35 @@ HttpBaseChannel::GetContentLength(int64_
 
 NS_IMETHODIMP
 HttpBaseChannel::SetContentLength(int64_t value) {
   MOZ_ASSERT_UNREACHABLE("HttpBaseChannel::SetContentLength");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-HttpBaseChannel::Open(nsIInputStream** aResult) {
-  NS_ENSURE_TRUE(!mWasOpened, NS_ERROR_IN_PROGRESS);
-
-  if (!gHttpHandler->Active()) {
-    LOG(("HttpBaseChannel::Open after HTTP shutdown..."));
-    return NS_ERROR_NOT_AVAILABLE;
-  }
-
-  return NS_ImplementChannelOpen(this, aResult);
-}
-
-NS_IMETHODIMP
-HttpBaseChannel::Open2(nsIInputStream** aStream) {
+HttpBaseChannel::Open(nsIInputStream** aStream) {
   if (!gHttpHandler->Active()) {
     LOG(("HttpBaseChannel::Open after HTTP shutdown..."));
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   nsCOMPtr<nsIStreamListener> listener;
   nsresult rv =
       nsContentSecurityManager::doContentSecurityCheck(this, listener);
   NS_ENSURE_SUCCESS(rv, rv);
-  return Open(aStream);
+
+  NS_ENSURE_TRUE(!mWasOpened, NS_ERROR_IN_PROGRESS);
+
+  if (!gHttpHandler->Active()) {
+    LOG(("HttpBaseChannel::Open after HTTP shutdown..."));
+    return NS_ERROR_NOT_AVAILABLE;
+  }
+
+  return NS_ImplementChannelOpen(this, aStream);
 }
 
 //-----------------------------------------------------------------------------
 // HttpBaseChannel::nsIUploadChannel
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 HttpBaseChannel::GetUploadStream(nsIInputStream** stream) {
@@ -1082,38 +1077,34 @@ bool HttpBaseChannel::MaybeWaitForUpload
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(!mAsyncOpenWaitingForStreamLength, "AsyncOpen() called twice?");
 
   if (!mPendingInputStreamLengthOperation) {
     return false;
   }
 
   mListener = aListener;
-  mListenerContext = aContext;
   mAsyncOpenWaitingForStreamLength = true;
   return true;
 }
 
 void HttpBaseChannel::MaybeResumeAsyncOpen() {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(!mPendingInputStreamLengthOperation);
 
   if (!mAsyncOpenWaitingForStreamLength) {
     return;
   }
 
   nsCOMPtr<nsIStreamListener> listener;
   listener.swap(mListener);
 
-  nsCOMPtr<nsISupports> context;
-  context.swap(mListenerContext);
-
   mAsyncOpenWaitingForStreamLength = false;
 
-  nsresult rv = AsyncOpen(listener, context);
+  nsresult rv = AsyncOpen(listener);
   if (NS_WARN_IF(NS_FAILED(rv))) {
     DoAsyncAbort(rv);
   }
 }
 
 //-----------------------------------------------------------------------------
 // HttpBaseChannel::nsIEncodedChannel
 //-----------------------------------------------------------------------------
@@ -1129,18 +1120,17 @@ HttpBaseChannel::SetApplyConversion(bool
   LOG(("HttpBaseChannel::SetApplyConversion [this=%p value=%d]\n", this,
        value));
   mApplyConversion = value;
   return NS_OK;
 }
 
 nsresult HttpBaseChannel::DoApplyContentConversions(
     nsIStreamListener* aNextListener, nsIStreamListener** aNewNextListener) {
-  return DoApplyContentConversions(aNextListener, aNewNextListener,
-                                   mListenerContext);
+  return DoApplyContentConversions(aNextListener, aNewNextListener, nullptr);
 }
 
 // create a listener chain that looks like this
 // http-channel -> decompressor (n times) -> InterceptFailedOnSTop ->
 // channel-creator-listener
 //
 // we need to do this because not every decompressor has fully streamed output
 // so may need a call to OnStopRequest to identify its completion state.. and if
@@ -3258,17 +3248,16 @@ HttpBaseChannel::SetNewListener(nsIStrea
 //-----------------------------------------------------------------------------
 // HttpBaseChannel helpers
 //-----------------------------------------------------------------------------
 
 void HttpBaseChannel::ReleaseListeners() {
   MOZ_ASSERT(NS_IsMainThread(), "Should only be called on the main thread.");
 
   mListener = nullptr;
-  mListenerContext = nullptr;
   mCallbacks = nullptr;
   mProgressSink = nullptr;
   mCompressListener = nullptr;
 }
 
 void HttpBaseChannel::DoNotifyListener() {
   LOG(("HttpBaseChannel::DoNotifyListener this=%p", this));
 
@@ -3279,31 +3268,31 @@ void HttpBaseChannel::DoNotifyListener()
     mAfterOnStartRequestBegun = true;
   }
 
   if (mListener) {
     MOZ_ASSERT(!mOnStartRequestCalled,
                "We should not call OnStartRequest twice");
 
     nsCOMPtr<nsIStreamListener> listener = mListener;
-    listener->OnStartRequest(this, mListenerContext);
+    listener->OnStartRequest(this, nullptr);
 
     mOnStartRequestCalled = true;
   }
 
   // Make sure mIsPending is set to false. At this moment we are done from
   // the point of view of our consumer and we have to report our self
   // as not-pending.
   mIsPending = false;
 
   if (mListener) {
     MOZ_ASSERT(!mOnStopRequestCalled, "We should not call OnStopRequest twice");
 
     nsCOMPtr<nsIStreamListener> listener = mListener;
-    listener->OnStopRequest(this, mListenerContext, mStatus);
+    listener->OnStopRequest(this, nullptr, mStatus);
 
     mOnStopRequestCalled = true;
   }
 
   // notify "http-on-stop-connect" observers
   gHttpHandler->OnStopRequest(this);
 
   // This channel has finished its job, potentially release any tail-blocked
--- a/netwerk/protocol/http/HttpBaseChannel.h
+++ b/netwerk/protocol/http/HttpBaseChannel.h
@@ -164,17 +164,16 @@ class HttpBaseChannel : public nsHashPro
       nsAString &aContentDispositionFilename) override;
   NS_IMETHOD SetContentDispositionFilename(
       const nsAString &aContentDispositionFilename) override;
   NS_IMETHOD GetContentDispositionHeader(
       nsACString &aContentDispositionHeader) override;
   NS_IMETHOD GetContentLength(int64_t *aContentLength) override;
   NS_IMETHOD SetContentLength(int64_t aContentLength) override;
   NS_IMETHOD Open(nsIInputStream **aResult) override;
-  NS_IMETHOD Open2(nsIInputStream **aResult) override;
   NS_IMETHOD GetBlockAuthPrompt(bool *aValue) override;
   NS_IMETHOD SetBlockAuthPrompt(bool aValue) override;
 
   // nsIEncodedChannel
   NS_IMETHOD GetApplyConversion(bool *value) override;
   NS_IMETHOD SetApplyConversion(bool value) override;
   NS_IMETHOD GetContentEncodings(nsIUTF8StringEnumerator **aEncodings) override;
   NS_IMETHOD DoApplyContentConversions(nsIStreamListener *aNextListener,
@@ -545,17 +544,16 @@ class HttpBaseChannel : public nsHashPro
   nsCOMPtr<nsIProgressEventSink> mProgressSink;
   nsCOMPtr<nsIURI> mReferrer;
   nsCOMPtr<nsIApplicationCache> mApplicationCache;
   nsCOMPtr<nsIURI> mAPIRedirectToURI;
   nsCOMPtr<nsIURI> mProxyURI;
   nsCOMPtr<nsIPrincipal> mPrincipal;
   nsCOMPtr<nsIURI> mTopWindowURI;
   nsCOMPtr<nsIStreamListener> mListener;
-  nsCOMPtr<nsISupports> mListenerContext;
   // An instance of nsHTTPCompressConv
   nsCOMPtr<nsIStreamListener> mCompressListener;
 
  private:
   // Proxy release all members above on main thread.
   void ReleaseMainThreadOnlyReferences();
 
   bool IsCrossOriginWithReferrer();
--- a/netwerk/protocol/http/HttpChannelChild.cpp
+++ b/netwerk/protocol/http/HttpChannelChild.cpp
@@ -584,17 +584,17 @@ void HttpChannelChild::OnStartRequest(
   // We have deliberately disabled this for child processes (see bug 806753)
   //
   // gHttpHandler->OnExamineResponse(this);
 
   mTracingEnabled = false;
 
   mTransactionTimings = aTiming;
 
-  DoOnStartRequest(this, mListenerContext);
+  DoOnStartRequest(this, nullptr);
 }
 
 class SyntheticDiversionListener final : public nsIStreamListener {
   RefPtr<HttpChannelChild> mChannel;
 
   ~SyntheticDiversionListener() = default;
 
  public:
@@ -664,17 +664,16 @@ void HttpChannelChild::DoOnStartRequest(
   nsresult rv = mListener->OnStartRequest(aRequest, aContext);
   if (NS_FAILED(rv)) {
     Cancel(rv);
     return;
   }
 
   if (mDivertingToParent) {
     mListener = nullptr;
-    mListenerContext = nullptr;
     mCompressListener = nullptr;
     if (mLoadGroup) {
       mLoadGroup->RemoveRequest(this, nullptr, mStatus);
     }
 
     // If the response has been synthesized in the child, then we are going
     // be getting OnDataAvailable and OnStopRequest from the synthetic
     // stream pump.  We need to forward these back to the parent diversion
@@ -682,18 +681,17 @@ void HttpChannelChild::DoOnStartRequest(
     if (mSynthesizedResponse) {
       mListener = new SyntheticDiversionListener(this);
     }
 
     return;
   }
 
   nsCOMPtr<nsIStreamListener> listener;
-  rv = DoApplyContentConversions(mListener, getter_AddRefs(listener),
-                                 mListenerContext);
+  rv = DoApplyContentConversions(mListener, getter_AddRefs(listener), nullptr);
   if (NS_FAILED(rv)) {
     Cancel(rv);
   } else if (listener) {
     mListener = listener;
     mCompressListener = listener;
   }
 }
 
@@ -846,17 +844,17 @@ void HttpChannelChild::OnTransportAndDat
   nsCOMPtr<nsIInputStream> stringStream;
   nsresult rv = NS_NewByteInputStream(getter_AddRefs(stringStream), data.get(),
                                       count, NS_ASSIGNMENT_DEPEND);
   if (NS_FAILED(rv)) {
     Cancel(rv);
     return;
   }
 
-  DoOnDataAvailable(this, mListenerContext, stringStream, offset, count);
+  DoOnDataAvailable(this, nullptr, stringStream, offset, count);
   stringStream->Close();
 
   if (NeedToReportBytesRead()) {
     mUnreportBytesRead += count;
     if (mUnreportBytesRead >= gHttpHandler->SendWindowSize() >> 2) {
       if (NS_IsMainThread()) {
         Unused << SendBytesRead(mUnreportBytesRead);
       } else {
@@ -1095,17 +1093,17 @@ void HttpChannelChild::OnStopRequest(
 
   DoPreOnStopRequest(channelStatus);
 
   {  // We must flush the queue before we Send__delete__
     // (although we really shouldn't receive any msgs after OnStop),
     // so make sure this goes out of scope before then.
     AutoEventEnqueuer ensureSerialDispatch(mEventQ);
 
-    DoOnStopRequest(this, channelStatus, mListenerContext);
+    DoOnStopRequest(this, channelStatus, nullptr);
     // DoOnStopRequest() calls ReleaseListeners()
   }
 
   // If unknownDecoder is involved and the received content is short we will
   // know whether we need to divert to parent only after OnStopRequest of the
   // listeners chain is called in DoOnStopRequest. At that moment
   // unknownDecoder will call OnStartRequest of the real listeners of the
   // channel including the OnStopRequest of UrlLoader which decides whether we
@@ -1505,22 +1503,19 @@ mozilla::ipc::IPCResult HttpChannelChild
 
   return IPC_OK();
 }
 
 void HttpChannelChild::DeleteSelf() { Send__delete__(this); }
 
 void HttpChannelChild::FinishInterceptedRedirect() {
   nsresult rv;
-  if (mLoadInfo && mLoadInfo->GetEnforceSecurity()) {
-    MOZ_ASSERT(!mInterceptedRedirectContext, "the context should be null!");
-    rv = AsyncOpen2(mInterceptedRedirectListener);
-  } else {
-    rv = AsyncOpen(mInterceptedRedirectListener, mInterceptedRedirectContext);
-  }
+  MOZ_ASSERT(!mInterceptedRedirectContext, "the context should be null!");
+  rv = AsyncOpen(mInterceptedRedirectListener);
+
   mInterceptedRedirectListener = nullptr;
   mInterceptedRedirectContext = nullptr;
 
   if (mInterceptingChannel) {
     mInterceptingChannel->CleanupRedirectingChannel(rv);
     mInterceptingChannel = nullptr;
   }
 
@@ -1940,18 +1935,17 @@ bool HttpChannelChild::Redirect3Complete
   RefPtr<HttpChannelChild> httpChannelChild =
       static_cast<HttpChannelChild*>(chan.get());
   // Chrome channel has been AsyncOpen'd.  Reflect this in child.
   if (mRedirectChannelChild) {
     if (httpChannelChild) {
       httpChannelChild->mOverrideRunnable = aRunnable;
       httpChannelChild->mInterceptingChannel = this;
     }
-    rv = mRedirectChannelChild->CompleteRedirectSetup(mListener,
-                                                      mListenerContext);
+    rv = mRedirectChannelChild->CompleteRedirectSetup(mListener, nullptr);
   }
 
   if (!httpChannelChild || !httpChannelChild->mShouldParentIntercept) {
     // The redirect channel either isn't a HttpChannelChild, or the interception
     // logic wasn't triggered, so we can clean it up right here.
     CleanupRedirectingChannel(rv);
     if (httpChannelChild) {
       httpChannelChild->mOverrideRunnable = nullptr;
@@ -2114,17 +2108,16 @@ HttpChannelChild::CompleteRedirectSetup(
    * before AsyncOpen(); if it's canceled after that, OnStart/Stop will just
    * get called with error code as usual.  So just setup mListener and make the
    * channel reflect AsyncOpen'ed state.
    */
 
   mIsPending = true;
   mWasOpened = true;
   mListener = listener;
-  mListenerContext = aContext;
 
   // add ourselves to the load group.
   if (mLoadGroup) mLoadGroup->AddRequest(this, nullptr);
 
   // We already have an open IPDL connection to the parent. If on-modify-request
   // listeners or load group observers canceled us, let the parent handle it
   // and send it back to us naturally.
   return NS_OK;
@@ -2176,17 +2169,17 @@ HttpChannelChild::OnRedirectVerifyCallba
     nsCOMPtr<nsIHttpChannelChild> httpChannelChild =
         do_QueryInterface(mRedirectChannelChild);
     RefPtr<HttpChannelChild> redirectedChannel =
         static_cast<HttpChannelChild*>(httpChannelChild.get());
     // redirectChannel will be NULL if mRedirectChannelChild isn't a
     // nsIHttpChannelChild (it could be a DataChannelChild).
 
     RefPtr<InterceptStreamListener> streamListener =
-        new InterceptStreamListener(redirectedChannel, mListenerContext);
+        new InterceptStreamListener(redirectedChannel, nullptr);
 
     nsCOMPtr<nsIEventTarget> neckoTarget = GetNeckoTarget();
     MOZ_ASSERT(neckoTarget);
 
     nsCOMPtr<nsIInterceptedBodyCallback> callback =
         mSynthesizedCallback.forget();
 
     Unused << neckoTarget->Dispatch(
@@ -2382,26 +2375,34 @@ HttpChannelChild::Resume() {
 
 NS_IMETHODIMP
 HttpChannelChild::GetSecurityInfo(nsISupports** aSecurityInfo) {
   NS_ENSURE_ARG_POINTER(aSecurityInfo);
   NS_IF_ADDREF(*aSecurityInfo = mSecurityInfo);
   return NS_OK;
 }
 
+
 NS_IMETHODIMP
-HttpChannelChild::AsyncOpen(nsIStreamListener* listener,
-                            nsISupports* aContext) {
+HttpChannelChild::AsyncOpen(nsIStreamListener* aListener) {
+  nsCOMPtr<nsIStreamListener> listener = aListener;
+  nsresult rv =
+      nsContentSecurityManager::doContentSecurityCheck(this, listener);
+  if (NS_WARN_IF(NS_FAILED(rv))) {
+    ReleaseListeners();
+    return rv;
+  }
+
   MOZ_ASSERT(
       !mLoadInfo || mLoadInfo->GetSecurityMode() == 0 ||
           mLoadInfo->GetInitialSecurityCheckDone() ||
           (mLoadInfo->GetSecurityMode() ==
                nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL &&
            nsContentUtils::IsSystemPrincipal(mLoadInfo->LoadingPrincipal())),
-      "security flags in loadInfo but asyncOpen2() not called");
+      "security flags in loadInfo but doContentSecurityCheck() not called");
 
   LOG(("HttpChannelChild::AsyncOpen [this=%p uri=%s]\n", this, mSpec.get()));
   LogCallingScriptLocation(this);
 
   if (!mLoadGroup && !mCallbacks) {
     // If no one called SetLoadGroup or SetNotificationCallbacks, the private
     // state has not been updated on PrivateBrowsingChannel (which we derive
     // from) Hence, we have to call UpdatePrivateBrowsing() here
@@ -2414,17 +2415,17 @@ HttpChannelChild::AsyncOpen(nsIStreamLis
 
   if (mCanceled) return mStatus;
 
   NS_ENSURE_TRUE(gNeckoChild != nullptr, NS_ERROR_FAILURE);
   NS_ENSURE_ARG_POINTER(listener);
   NS_ENSURE_TRUE(!mIsPending, NS_ERROR_IN_PROGRESS);
   NS_ENSURE_TRUE(!mWasOpened, NS_ERROR_ALREADY_OPENED);
 
-  if (MaybeWaitForUploadStreamLength(listener, aContext)) {
+  if (MaybeWaitForUploadStreamLength(listener, nullptr)) {
     return NS_OK;
   }
 
   if (!mAsyncOpenTimeOverriden) {
     mAsyncOpenTime = TimeStamp::Now();
   }
 
 #ifdef MOZ_TASK_TRACER
@@ -2434,17 +2435,16 @@ HttpChannelChild::AsyncOpen(nsIStreamLis
     nsAutoCString urispec;
     uri->GetSpec(urispec);
     tasktracer::AddLabel("HttpChannelChild::AsyncOpen %s", urispec.get());
   }
 #endif
 
   // Port checked in parent, but duplicate here so we can return with error
   // immediately
-  nsresult rv;
   rv = NS_CheckPortSafety(mURI);
   if (NS_FAILED(rv)) {
     ReleaseListeners();
     return rv;
   }
 
   nsAutoCString cookie;
   if (NS_SUCCEEDED(mRequestHead.GetHeader(nsHttp::Cookie, cookie))) {
@@ -2469,17 +2469,16 @@ HttpChannelChild::AsyncOpen(nsIStreamLis
   PROFILER_ADD_NETWORK_MARKER(mURI, mPriority, mChannelId,
                               NetworkLoadType::LOAD_START,
                               mChannelCreationTimestamp, mLastStatusReported, 0,
                               kCacheUnknown, nullptr, nullptr);
 
   mIsPending = true;
   mWasOpened = true;
   mListener = listener;
-  mListenerContext = aContext;
 
   // add ourselves to the load group.
   if (mLoadGroup) mLoadGroup->AddRequest(this, nullptr);
 
   if (mCanceled) {
     // We may have been canceled already, either by on-modify-request
     // listeners or by load group observers; in that case, don't create IPDL
     // connection. See nsHttpChannel::AsyncOpen().
@@ -2506,18 +2505,17 @@ HttpChannelChild::AsyncOpen(nsIStreamLis
         return;
       }
 
       self->mResponseCouldBeSynthesized = true;
 
       nsCOMPtr<nsINetworkInterceptController> controller;
       self->GetCallback(controller);
 
-      self->mInterceptListener =
-          new InterceptStreamListener(self, self->mListenerContext);
+      self->mInterceptListener = new InterceptStreamListener(self, nullptr);
 
       RefPtr<InterceptedChannelContent> intercepted =
           new InterceptedChannelContent(
               self, controller, self->mInterceptListener, shouldUpgrade);
       intercepted->NotifyController();
     };
 
     TrackingDummyChannel::StorageAllowedState state =
@@ -2534,28 +2532,16 @@ HttpChannelChild::AsyncOpen(nsIStreamLis
 
     MOZ_ASSERT(state == TrackingDummyChannel::eStorageDenied);
     // Fall through
   }
 
   return ContinueAsyncOpen();
 }
 
-NS_IMETHODIMP
-HttpChannelChild::AsyncOpen2(nsIStreamListener* aListener) {
-  nsCOMPtr<nsIStreamListener> listener = aListener;
-  nsresult rv =
-      nsContentSecurityManager::doContentSecurityCheck(this, listener);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    ReleaseListeners();
-    return rv;
-  }
-  return AsyncOpen(listener, nullptr);
-}
-
 // Assigns an nsIEventTarget to our IPDL actor so that IPC messages are sent to
 // the correct DocGroup/TabGroup.
 void HttpChannelChild::SetEventTarget() {
   nsCOMPtr<nsILoadInfo> loadInfo;
   GetLoadInfo(getter_AddRefs(loadInfo));
 
   nsCOMPtr<nsIEventTarget> target =
       nsContentUtils::GetEventTargetByLoadInfo(loadInfo, TaskCategory::Network);
--- a/netwerk/protocol/http/HttpChannelChild.h
+++ b/netwerk/protocol/http/HttpChannelChild.h
@@ -87,19 +87,17 @@ class HttpChannelChild final : public PH
   // Methods HttpBaseChannel didn't implement for us or that we override.
   //
   // nsIRequest
   NS_IMETHOD Cancel(nsresult status) override;
   NS_IMETHOD Suspend() override;
   NS_IMETHOD Resume() override;
   // nsIChannel
   NS_IMETHOD GetSecurityInfo(nsISupports** aSecurityInfo) override;
-  NS_IMETHOD AsyncOpen(nsIStreamListener* listener,
-                       nsISupports* aContext) override;
-  NS_IMETHOD AsyncOpen2(nsIStreamListener* aListener) override;
+  NS_IMETHOD AsyncOpen(nsIStreamListener* aListener) override;
 
   // HttpBaseChannel::nsIHttpChannel
   NS_IMETHOD SetReferrerWithPolicy(nsIURI* referrer,
                                    uint32_t referrerPolicy) override;
   NS_IMETHOD SetRequestHeader(const nsACString& aHeader,
                               const nsACString& aValue, bool aMerge) override;
   NS_IMETHOD SetEmptyRequestHeader(const nsACString& aHeader) override;
   NS_IMETHOD RedirectTo(nsIURI* newURI) override;
--- a/netwerk/protocol/http/HttpChannelParent.cpp
+++ b/netwerk/protocol/http/HttpChannelParent.cpp
@@ -370,21 +370,17 @@ void HttpChannelParent::InvokeAsyncOpen(
   }
 
   nsCOMPtr<nsILoadInfo> loadInfo;
   rv = mChannel->GetLoadInfo(getter_AddRefs(loadInfo));
   if (NS_FAILED(rv)) {
     AsyncOpenFailed(rv);
     return;
   }
-  if (loadInfo && loadInfo->GetEnforceSecurity()) {
-    rv = mChannel->AsyncOpen2(mParentListener);
-  } else {
-    rv = mChannel->AsyncOpen(mParentListener, nullptr);
-  }
+  rv = mChannel->AsyncOpen(mParentListener);
   if (NS_FAILED(rv)) {
     AsyncOpenFailed(rv);
   }
 }
 
 bool HttpChannelParent::DoAsyncOpen(
     const URIParams& aURI, const OptionalURIParams& aOriginalURI,
     const OptionalURIParams& aDocURI, const OptionalURIParams& aReferrerURI,
--- a/netwerk/protocol/http/InterceptedHttpChannel.cpp
+++ b/netwerk/protocol/http/InterceptedHttpChannel.cpp
@@ -312,17 +312,17 @@ nsresult InterceptedHttpChannel::StartPu
   //       QI to it here.  This would let us determine the total length
   //       for streams that support it.  See bug 1388774.
   Unused << GetContentLength(&mSynthesizedStreamLength);
 
   nsresult rv =
       nsInputStreamPump::Create(getter_AddRefs(mPump), mBodyReader, 0, 0, true);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  rv = mPump->AsyncRead(this, mListenerContext);
+  rv = mPump->AsyncRead(this, nullptr);
   NS_ENSURE_SUCCESS(rv, rv);
 
   uint32_t suspendCount = mSuspendCount;
   while (suspendCount--) {
     mPump->Suspend();
   }
 
   MOZ_DIAGNOSTIC_ASSERT(!mCanceled);
@@ -341,22 +341,17 @@ nsresult InterceptedHttpChannel::OpenRed
     return NS_ERROR_DOM_ABORT_ERR;
   }
 
   // Make sure to do this after we received redirect veto answer,
   // i.e. after all sinks had been notified
   mRedirectChannel->SetOriginalURI(mOriginalURI);
 
   // open new channel
-  if (mLoadInfo && mLoadInfo->GetEnforceSecurity()) {
-    MOZ_ASSERT(!mListenerContext, "mListenerContext should be null!");
-    rv = mRedirectChannel->AsyncOpen2(mListener);
-  } else {
-    rv = mRedirectChannel->AsyncOpen(mListener, mListenerContext);
-  }
+  rv = mRedirectChannel->AsyncOpen(mListener);
   NS_ENSURE_SUCCESS(rv, rv);
 
   mStatus = NS_BINDING_REDIRECTED;
 
   return rv;
 }
 
 void InterceptedHttpChannel::MaybeCallStatusAndProgress() {
@@ -405,21 +400,20 @@ void InterceptedHttpChannel::MaybeCallSt
   // Capture the host name on the first set of calls to avoid doing this
   // string processing repeatedly.
   if (mProgressReported == 0) {
     nsAutoCString host;
     MOZ_ALWAYS_SUCCEEDS(mURI->GetHost(host));
     CopyUTF8toUTF16(host, mStatusHost);
   }
 
-  mProgressSink->OnStatus(this, mListenerContext, NS_NET_STATUS_READING,
+  mProgressSink->OnStatus(this, nullptr, NS_NET_STATUS_READING,
                           mStatusHost.get());
 
-  mProgressSink->OnProgress(this, mListenerContext, progress,
-                            mSynthesizedStreamLength);
+  mProgressSink->OnProgress(this, nullptr, progress, mSynthesizedStreamLength);
 
   mProgressReported = progress;
 }
 
 void InterceptedHttpChannel::MaybeCallBodyCallback() {
   nsCOMPtr<nsIInterceptedBodyCallback> callback = mBodyCallback.forget();
   if (callback) {
     callback->BodyComplete(mStatus);
@@ -520,44 +514,38 @@ InterceptedHttpChannel::Resume(void) {
 NS_IMETHODIMP
 InterceptedHttpChannel::GetSecurityInfo(nsISupports** aSecurityInfo) {
   nsCOMPtr<nsISupports> ref(mSecurityInfo);
   ref.forget(aSecurityInfo);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-InterceptedHttpChannel::AsyncOpen(nsIStreamListener* aListener,
-                                  nsISupports* aContext) {
+InterceptedHttpChannel::AsyncOpen(nsIStreamListener* aListener) {
+  nsCOMPtr<nsIStreamListener> listener(aListener);
+  nsresult rv =
+      nsContentSecurityManager::doContentSecurityCheck(this, listener);
+  if (NS_WARN_IF(NS_FAILED(rv))) {
+    Cancel(rv);
+    return rv;
+  }
   if (mCanceled) {
     return mStatus;
   }
 
   // After this point we should try to return NS_OK and notify the listener
   // of the result.
   mListener = aListener;
 
   AsyncOpenInternal();
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-InterceptedHttpChannel::AsyncOpen2(nsIStreamListener* aListener) {
-  nsCOMPtr<nsIStreamListener> listener(aListener);
-  nsresult rv =
-      nsContentSecurityManager::doContentSecurityCheck(this, listener);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    Cancel(rv);
-    return rv;
-  }
-  return AsyncOpen(listener, nullptr);
-}
-
-NS_IMETHODIMP
 InterceptedHttpChannel::LogBlockedCORSRequest(const nsAString& aMessage,
                                               const nsACString& aCategory) {
   // Synthetic responses should not trigger CORS blocking.
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 InterceptedHttpChannel::LogMimeTypeMismatch(const nsACString& aMessageName,
@@ -1028,17 +1016,17 @@ InterceptedHttpChannel::OnStartRequest(n
     GetCallback(mProgressSink);
   }
 
   if (mPump && mLoadFlags & LOAD_CALL_CONTENT_SNIFFERS) {
     mPump->PeekStream(CallTypeSniffers, static_cast<nsIChannel*>(this));
   }
 
   if (mListener) {
-    mListener->OnStartRequest(this, mListenerContext);
+    mListener->OnStartRequest(this, nullptr);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP
 InterceptedHttpChannel::OnStopRequest(nsIRequest* aRequest,
                                       nsISupports* aContext, nsresult aStatus) {
   MOZ_ASSERT(NS_IsMainThread());
@@ -1056,17 +1044,17 @@ InterceptedHttpChannel::OnStopRequest(ns
   MaybeCallStatusAndProgress();
 
   mIsPending = false;
 
   // Register entry to the PerformanceStorage resource timing
   MaybeReportTimingData();
 
   if (mListener) {
-    mListener->OnStopRequest(this, mListenerContext, mStatus);
+    mListener->OnStopRequest(this, nullptr, mStatus);
   }
 
   gHttpHandler->OnStopRequest(this);
 
   ReleaseListeners();
 
   return NS_OK;
 }
@@ -1087,18 +1075,18 @@ InterceptedHttpChannel::OnDataAvailable(
   }
   if (mProgressSink) {
     if (!(mLoadFlags & HttpBaseChannel::LOAD_BACKGROUND)) {
       mProgress = aOffset + aCount;
       MaybeCallStatusAndProgress();
     }
   }
 
-  return mListener->OnDataAvailable(this, mListenerContext, aInputStream,
-                                    aOffset, aCount);
+  return mListener->OnDataAvailable(this, nullptr, aInputStream, aOffset,
+                                    aCount);
 }
 
 NS_IMETHODIMP
 InterceptedHttpChannel::MessageDiversionStarted(
     ADivertableParentChannel* aParentChannel) {
   MOZ_ASSERT(!mParentChannel);
   mParentChannel = aParentChannel;
   mDiverting = true;
--- a/netwerk/protocol/http/InterceptedHttpChannel.h
+++ b/netwerk/protocol/http/InterceptedHttpChannel.h
@@ -143,20 +143,17 @@ class InterceptedHttpChannel final
 
   NS_IMETHOD
   Resume(void) override;
 
   NS_IMETHOD
   GetSecurityInfo(nsISupports** aSecurityInfo) override;
 
   NS_IMETHOD
-  AsyncOpen(nsIStreamListener* aListener, nsISupports* aContext) override;
-
-  NS_IMETHOD
-  AsyncOpen2(nsIStreamListener* aListener) override;
+  AsyncOpen(nsIStreamListener* aListener) override;
 
   NS_IMETHOD
   LogBlockedCORSRequest(const nsAString& aMessage,
                         const nsACString& aCategory) override;
 
   NS_IMETHOD
   LogMimeTypeMismatch(const nsACString& aMessageName, bool aWarning,
                       const nsAString& aURL,
--- a/netwerk/protocol/http/NullHttpChannel.cpp
+++ b/netwerk/protocol/http/NullHttpChannel.cpp
@@ -372,42 +372,32 @@ NullHttpChannel::GetContentLength(int64_
 }
 
 NS_IMETHODIMP
 NullHttpChannel::SetContentLength(int64_t aContentLength) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-NullHttpChannel::Open(nsIInputStream **_retval) {
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-NullHttpChannel::Open2(nsIInputStream **aStream) {
+NullHttpChannel::Open(nsIInputStream **aStream) {
   nsCOMPtr<nsIStreamListener> listener;
   nsresult rv =
       nsContentSecurityManager::doContentSecurityCheck(this, listener);
   NS_ENSURE_SUCCESS(rv, rv);
-  return Open(aStream);
-}
 
-NS_IMETHODIMP
-NullHttpChannel::AsyncOpen(nsIStreamListener *aListener,
-                           nsISupports *aContext) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-NullHttpChannel::AsyncOpen2(nsIStreamListener *aListener) {
+NullHttpChannel::AsyncOpen(nsIStreamListener *aListener) {
   nsCOMPtr<nsIStreamListener> listener = aListener;
   nsresult rv =
       nsContentSecurityManager::doContentSecurityCheck(this, listener);
   NS_ENSURE_SUCCESS(rv, rv);
-  return AsyncOpen(listener, nullptr);
+  return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 NullHttpChannel::GetContentDisposition(uint32_t *aContentDisposition) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
--- a/netwerk/protocol/http/TrackingDummyChannel.cpp
+++ b/netwerk/protocol/http/TrackingDummyChannel.cpp
@@ -177,42 +177,32 @@ TrackingDummyChannel::GetContentLength(i
 }
 
 NS_IMETHODIMP
 TrackingDummyChannel::SetContentLength(int64_t aContentLength) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-TrackingDummyChannel::Open(nsIInputStream** aRetval) {
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-TrackingDummyChannel::Open2(nsIInputStream** aStream) {
+TrackingDummyChannel::Open(nsIInputStream** aStream) {
   nsCOMPtr<nsIStreamListener> listener;
   nsresult rv =
       nsContentSecurityManager::doContentSecurityCheck(this, listener);
   NS_ENSURE_SUCCESS(rv, rv);
-  return Open(aStream);
-}
 
-NS_IMETHODIMP
-TrackingDummyChannel::AsyncOpen(nsIStreamListener* aListener,
-                                nsISupports* aContext) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-TrackingDummyChannel::AsyncOpen2(nsIStreamListener* aListener) {
+TrackingDummyChannel::AsyncOpen(nsIStreamListener* aListener) {
   nsCOMPtr<nsIStreamListener> listener = aListener;
   nsresult rv =
       nsContentSecurityManager::doContentSecurityCheck(this, listener);
   NS_ENSURE_SUCCESS(rv, rv);
-  return AsyncOpen(listener, nullptr);
+  return AsyncOpen(listener);
 }
 
 NS_IMETHODIMP
 TrackingDummyChannel::GetContentDisposition(uint32_t* aContentDisposition) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
--- a/netwerk/protocol/http/nsCORSListenerProxy.cpp
+++ b/netwerk/protocol/http/nsCORSListenerProxy.cpp
@@ -975,36 +975,36 @@ nsresult nsCORSListenerProxy::UpdateChan
     }
   }
 
   rv = http->SetRequestHeader(nsDependentCString(net::nsHttp::Origin), origin,
                               false);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Make cookie-less if needed. We don't need to do anything here if the
-  // channel was opened with AsyncOpen2, since then AsyncOpen2 will take
+  // channel was opened with AsyncOpen, since then AsyncOpen will take
   // care of the cookie policy for us.
-  if (!mWithCredentials && (!loadInfo || !loadInfo->GetEnforceSecurity())) {
+  if (!mWithCredentials) {
     nsLoadFlags flags;
     rv = http->GetLoadFlags(&flags);
     NS_ENSURE_SUCCESS(rv, rv);
 
     flags |= nsIRequest::LOAD_ANONYMOUS;
     rv = http->SetLoadFlags(flags);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   mHttpChannel = http;
 
   return NS_OK;
 }
 
 nsresult nsCORSListenerProxy::CheckPreflightNeeded(nsIChannel* aChannel,
                                                    UpdateType aUpdateType) {
-  // If this caller isn't using AsyncOpen2, or if this *is* a preflight channel,
+  // If this caller isn't using AsyncOpen, or if this *is* a preflight channel,
   // then we shouldn't initiate preflight for this channel.
   nsCOMPtr<nsILoadInfo> loadInfo = aChannel->GetLoadInfo();
   if (!loadInfo ||
       loadInfo->GetSecurityMode() !=
           nsILoadInfo::SEC_REQUIRE_CORS_DATA_INHERITS ||
       loadInfo->GetIsPreflight()) {
     return NS_OK;
   }
@@ -1524,17 +1524,17 @@ nsresult nsCORSListenerProxy::StartCORSP
   NS_ENSURE_SUCCESS(rv, rv);
   nsCOMPtr<nsIURI> requestReferrerURI;
   rv = reqCh->GetReferrer(getter_AddRefs(requestReferrerURI));
   NS_ENSURE_SUCCESS(rv, rv);
   rv = preCh->SetReferrerWithPolicy(requestReferrerURI, referrerPolicy);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Start preflight
-  rv = preflightChannel->AsyncOpen2(preflightListener);
+  rv = preflightChannel->AsyncOpen(preflightListener);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Return newly created preflight channel
   preflightChannel.forget(aPreflightChannel);
 
   return NS_OK;
 }
 
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -1623,17 +1623,17 @@ nsresult nsHttpChannel::CallOnStartReque
     LOG(
         ("  calling mListener->OnStartRequest by ScopeExit [this=%p, "
          "listener=%p]\n",
          this, mListener.get()));
     MOZ_ASSERT(!mOnStartRequestCalled);
 
     if (mListener) {
       nsCOMPtr<nsIStreamListener> deleteProtector(mListener);
-      deleteProtector->OnStartRequest(this, mListenerContext);
+      deleteProtector->OnStartRequest(this, nullptr);
     }
 
     mOnStartRequestCalled = true;
   });
 
   nsresult rv = EnsureMIMEOfScript(this, mURI, mResponseHead, mLoadInfo);
   NS_ENSURE_SUCCESS(rv, rv);
 
@@ -1672,19 +1672,18 @@ nsresult nsHttpChannel::CallOnStartReque
       mResponseHead->SetContentType(NS_LITERAL_CSTRING(TEXT_PLAIN));
     else {
       // Uh-oh.  We had better find out what type we are!
       nsCOMPtr<nsIStreamConverterService> serv;
       rv = gHttpHandler->GetStreamConverterService(getter_AddRefs(serv));
       // If we failed, we just fall through to the "normal" case
       if (NS_SUCCEEDED(rv)) {
         nsCOMPtr<nsIStreamListener> converter;
-        rv =
-            serv->AsyncConvertData(UNKNOWN_CONTENT_TYPE, "*/*", mListener,
-                                   mListenerContext, getter_AddRefs(converter));
+        rv = serv->AsyncConvertData(UNKNOWN_CONTENT_TYPE, "*/*", mListener,
+                                    nullptr, getter_AddRefs(converter));
         if (NS_SUCCEEDED(rv)) {
           mListener = converter;
           unknownDecoderStarted = true;
         }
       }
     }
   }
 
@@ -1696,31 +1695,31 @@ nsresult nsHttpChannel::CallOnStartReque
 
   // About to call OnStartRequest, dismiss the guard object.
   onStartGuard.release();
 
   if (mListener) {
     MOZ_ASSERT(!mOnStartRequestCalled,
                "We should not call OsStartRequest twice");
     nsCOMPtr<nsIStreamListener> deleteProtector(mListener);
-    rv = deleteProtector->OnStartRequest(this, mListenerContext);
+    rv = deleteProtector->OnStartRequest(this, nullptr);
     mOnStartRequestCalled = true;
     if (NS_FAILED(rv)) return rv;
   } else {
     NS_WARNING("OnStartRequest skipped because of null listener");
     mOnStartRequestCalled = true;
   }
 
   // Install stream converter if required.
   // If we use unknownDecoder, stream converters will be installed later (in
   // nsUnknownDecoder) after OnStartRequest is called for the real listener.
   if (!unknownDecoderStarted) {
     nsCOMPtr<nsIStreamListener> listener;
-    nsISupports *ctxt = mListenerContext;
-    rv = DoApplyContentConversions(mListener, getter_AddRefs(listener), ctxt);
+    rv =
+        DoApplyContentConversions(mListener, getter_AddRefs(listener), nullptr);
     if (NS_FAILED(rv)) {
       return rv;
     }
     if (listener) {
       mListener = listener;
       mCompressListener = listener;
     }
   }
@@ -2088,19 +2087,18 @@ nsresult nsHttpChannel::ProcessContentSi
   if (!aResponseHead->HasContentType()) {
     NS_WARNING(
         "Empty content type can get us in trouble when verifying "
         "content signatures");
     return NS_ERROR_INVALID_SIGNATURE;
   }
   // create a new listener that meadiates the content
   RefPtr<ContentVerifier> contentVerifyingMediator =
-      new ContentVerifier(mListener, mListenerContext);
-  rv = contentVerifyingMediator->Init(contentSignatureHeader, this,
-                                      mListenerContext);
+      new ContentVerifier(mListener, nullptr);
+  rv = contentVerifyingMediator->Init(contentSignatureHeader, this, nullptr);
   NS_ENSURE_SUCCESS(rv, NS_ERROR_INVALID_SIGNATURE);
   mListener = contentVerifyingMediator;
 
   return NS_OK;
 }
 
 /**
  * Decide whether or not to send a security report and, if so, give the
@@ -3085,22 +3083,18 @@ nsresult nsHttpChannel::ContinueAsyncRed
 nsresult nsHttpChannel::OpenRedirectChannel(nsresult rv) {
   AutoRedirectVetoNotifier notifier(this);
 
   // Make sure to do this after we received redirect veto answer,
   // i.e. after all sinks had been notified
   mRedirectChannel->SetOriginalURI(mOriginalURI);
 
   // open new channel
-  if (mLoadInfo && mLoadInfo->GetEnforceSecurity()) {
-    MOZ_ASSERT(!mListenerContext, "mListenerContext should be null!");
-    rv = mRedirectChannel->AsyncOpen2(mListener);
-  } else {
-    rv = mRedirectChannel->AsyncOpen(mListener, mListenerContext);
-  }
+  rv = mRedirectChannel->AsyncOpen(mListener);
+
   NS_ENSURE_SUCCESS(rv, rv);
 
   mStatus = NS_BINDING_REDIRECTED;
 
   notifier.RedirectSucceeded();
 
   ReleaseListeners();
 
@@ -3143,23 +3137,19 @@ nsresult nsHttpChannel::ContinueDoReplac
   if (NS_FAILED(rv)) return rv;
 
   MOZ_ASSERT(mRedirectChannel, "No redirect channel?");
 
   // Make sure to do this after we received redirect veto answer,
   // i.e. after all sinks had been notified
   mRedirectChannel->SetOriginalURI(mOriginalURI);
 
+
   // open new channel
-  if (mLoadInfo && mLoadInfo->GetEnforceSecurity()) {
-    MOZ_ASSERT(!mListenerContext, "mListenerContext should be null!");
-    rv = mRedirectChannel->AsyncOpen2(mListener);
-  } else {
-    rv = mRedirectChannel->AsyncOpen(mListener, mListenerContext);
-  }
+  rv = mRedirectChannel->AsyncOpen(mListener);
   NS_ENSURE_SUCCESS(rv, rv);
 
   mStatus = NS_BINDING_REDIRECTED;
 
   notifier.RedirectSucceeded();
 
   ReleaseListeners();
 
@@ -3711,22 +3701,17 @@ nsresult nsHttpChannel::ContinueProcessF
   if (NS_FAILED(rv)) return rv;
 
   MOZ_ASSERT(mRedirectChannel, "No redirect channel?");
 
   // Make sure to do this after we received redirect veto answer,
   // i.e. after all sinks had been notified
   mRedirectChannel->SetOriginalURI(mOriginalURI);
 
-  if (mLoadInfo && mLoadInfo->GetEnforceSecurity()) {
-    MOZ_ASSERT(!mListenerContext, "mListenerContext should be null!");
-    rv = mRedirectChannel->AsyncOpen2(mListener);
-  } else {
-    rv = mRedirectChannel->AsyncOpen(mListener, mListenerContext);
-  }
+  rv = mRedirectChannel->AsyncOpen(mListener);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (mLoadFlags & LOAD_INITIAL_DOCUMENT_URI) {
     MaybeWarnAboutAppCache();
   }
 
   // close down this channel
   Cancel(NS_BINDING_REDIRECTED);
@@ -5131,17 +5116,17 @@ nsresult nsHttpChannel::ReadFromCache(bo
 
   rv = nsInputStreamPump::Create(getter_AddRefs(mCachePump), inputStream, 0, 0,
                                  true);
   if (NS_FAILED(rv)) {
     inputStream->Close();
     return rv;
   }
 
-  rv = mCachePump->AsyncRead(this, mListenerContext);
+  rv = mCachePump->AsyncRead(this, nullptr);
   if (NS_FAILED(rv)) return rv;
 
   if (mTimingEnabled) mCacheReadStart = TimeStamp::Now();
 
   uint32_t suspendCount = mSuspendCount;
   if (mAsyncResumePending) {
     LOG(
         ("  Suspend()'ing cache pump once because of async resume pending"
@@ -5824,22 +5809,17 @@ nsresult nsHttpChannel::ContinueProcessR
   // Make sure to do this after we received redirect veto answer,
   // i.e. after all sinks had been notified
   mRedirectChannel->SetOriginalURI(mOriginalURI);
 
   // XXX we used to talk directly with the script security manager, but that
   // should really be handled by the event sink implementation.
 
   // begin loading the new channel
-  if (mLoadInfo && mLoadInfo->GetEnforceSecurity()) {
-    MOZ_ASSERT(!mListenerContext, "mListenerContext should be null!");
-    rv = mRedirectChannel->AsyncOpen2(mListener);
-  } else {
-    rv = mRedirectChannel->AsyncOpen(mListener, mListenerContext);
-  }
+  rv = mRedirectChannel->AsyncOpen(mListener);
   LOG(("  new channel AsyncOpen returned %" PRIX32, static_cast<uint32_t>(rv)));
   NS_ENSURE_SUCCESS(rv, rv);
 
   // close down this channel
   Cancel(NS_BINDING_REDIRECTED);
 
   notifier.RedirectSucceeded();
 
@@ -6165,24 +6145,31 @@ nsHttpChannel::GetSecurityInfo(nsISuppor
 }
 
 // If any of the functions that AsyncOpen calls returns immediately an error
 // AsyncAbort(which calls onStart/onStopRequest) does not need to be call.
 // To be sure that they are not call ReleaseListeners() is called.
 // If AsyncOpen returns NS_OK, after that point AsyncAbort must be called on
 // any error.
 NS_IMETHODIMP
-nsHttpChannel::AsyncOpen(nsIStreamListener *listener, nsISupports *context) {
+nsHttpChannel::AsyncOpen(nsIStreamListener *aListener) {
+  nsCOMPtr<nsIStreamListener> listener = aListener;
+  nsresult rv =
+      nsContentSecurityManager::doContentSecurityCheck(this, listener);
+  if (NS_WARN_IF(NS_FAILED(rv))) {
+    ReleaseListeners();
+    return rv;
+  }
   MOZ_ASSERT(
       !mLoadInfo || mLoadInfo->GetSecurityMode() == 0 ||
           mLoadInfo->GetInitialSecurityCheckDone() ||
           (mLoadInfo->GetSecurityMode() ==
                nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL &&
            nsContentUtils::IsSystemPrincipal(mLoadInfo->LoadingPrincipal())),
-      "security flags in loadInfo but asyncOpen2() not called");
+      "security flags in loadInfo but doContentSecurityCheck() not called");
 
   LOG(("nsHttpChannel::AsyncOpen [this=%p]\n", this));
 
 #ifdef MOZ_TASK_TRACER
   if (tasktracer::IsStartLogging()) {
     uint64_t sourceEventId, parentTaskId;
     tasktracer::SourceEventType sourceEventType;
     GetCurTraceInfo(&sourceEventId, &parentTaskId, &sourceEventType);
@@ -6207,22 +6194,20 @@ nsHttpChannel::AsyncOpen(nsIStreamListen
 #ifdef DEBUG
   AssertPrivateBrowsingId();
 #endif
 
   NS_ENSURE_ARG_POINTER(listener);
   NS_ENSURE_TRUE(!mIsPending, NS_ERROR_IN_PROGRESS);
   NS_ENSURE_TRUE(!mWasOpened, NS_ERROR_ALREADY_OPENED);
 
-  if (MaybeWaitForUploadStreamLength(listener, context)) {
+  if (MaybeWaitForUploadStreamLength(listener, nullptr)) {
     return NS_OK;
   }
 
-  nsresult rv;
-
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!gHttpHandler->Active()) {
     LOG(("  after HTTP shutdown..."));
     ReleaseListeners();
     return NS_ERROR_NOT_AVAILABLE;
   }
 
@@ -6259,17 +6244,16 @@ nsHttpChannel::AsyncOpen(nsIStreamListen
 
   if (WaitingForTailUnblock()) {
     // This channel is marked as Tail and is part of a request context
     // that has positive number of non-tailed requestst, hence this channel
     // has been put to a queue.
     // When tail is unblocked, OnTailUnblock on this channel will be called
     // to continue AsyncOpen.
     mListener = listener;
-    mListenerContext = context;
     MOZ_DIAGNOSTIC_ASSERT(!mOnTailUnblock);
     mOnTailUnblock = &nsHttpChannel::AsyncOpenOnTailUnblock;
 
     LOG(("  put on hold until tail is unblocked"));
     return NS_OK;
   }
 
   // Remember the cookie header that was set, if any
@@ -6293,17 +6277,16 @@ nsHttpChannel::AsyncOpen(nsIStreamListen
   if (!(mLoadFlags & LOAD_REPLACE)) {
     gHttpHandler->OnOpeningRequest(this);
   }
 
   mIsPending = true;
   mWasOpened = true;
 
   mListener = listener;
-  mListenerContext = context;
 
   // PauseTask/DelayHttpChannel queuing
   if (!DelayHttpChannelQueue::AttemptQueueChannel(this)) {
     // If fuzzyfox is disabled; or adding to the queue failed, the channel must
     // continue.
     AsyncOpenFinal(TimeStamp::Now());
   }
 
@@ -6343,43 +6326,31 @@ nsresult nsHttpChannel::AsyncOpenFinal(T
     CloseCacheEntry(false);
     Unused << AsyncAbort(rv);
   }
 
   return NS_OK;
 }
 
 nsresult nsHttpChannel::AsyncOpenOnTailUnblock() {
-  return AsyncOpen(mListener, mListenerContext);
+  return AsyncOpen(mListener);
 }
 
 already_AddRefed<nsChannelClassifier>
 nsHttpChannel::GetOrCreateChannelClassifier() {
   if (!mChannelClassifier) {
     mChannelClassifier = new nsChannelClassifier(this);
     LOG(("nsHttpChannel [%p] created nsChannelClassifier [%p]\n", this,
          mChannelClassifier.get()));
   }
 
   RefPtr<nsChannelClassifier> classifier = mChannelClassifier;
   return classifier.forget();
 }
 
-NS_IMETHODIMP
-nsHttpChannel::AsyncOpen2(nsIStreamListener *aListener) {
-  nsCOMPtr<nsIStreamListener> listener = aListener;
-  nsresult rv =
-      nsContentSecurityManager::doContentSecurityCheck(this, listener);
-  if (NS_WARN_IF(NS_FAILED(rv))) {
-    ReleaseListeners();
-    return rv;
-  }
-  return AsyncOpen(listener, nullptr);
-}
-
 // BeginConnect() SHOULD NOT call AsyncAbort(). AsyncAbort will be called by
 // functions that called BeginConnect if needed. Only AsyncOpen and
 // OnProxyAvailable ever call BeginConnect.
 nsresult nsHttpChannel::BeginConnect() {
   LOG(("nsHttpChannel::BeginConnect [this=%p]\n", this));
   nsresult rv;
 
   // Construct connection info object
@@ -7582,17 +7553,17 @@ nsresult nsHttpChannel::ContinueOnStopRe
     MOZ_ASSERT(NS_FAILED(aStatus), "should have a failure code here");
     // NOTE: since we have a failure status, we can ignore the return
     // value from onStartRequest.
     LOG(("  calling mListener->OnStartRequest [this=%p, listener=%p]\n", this,
          mListener.get()));
     if (mListener) {
       MOZ_ASSERT(!mOnStartRequestCalled,
                  "We should not call OnStartRequest twice.");
-      mListener->OnStartRequest(this, mListenerContext);
+      mListener->OnStartRequest(this, nullptr);
       mOnStartRequestCalled = true;
     } else {
       NS_WARNING("OnStartRequest skipped because of null listener");
     }
   }
 
   // if this transaction has been replaced, then bail.
   if (mTransactionReplaced) {
@@ -7785,17 +7756,17 @@ nsresult nsHttpChannel::ContinueOnStopRe
   }
 #endif
 
   if (mListener) {
     LOG(("nsHttpChannel %p calling OnStopRequest\n", this));
     MOZ_ASSERT(mOnStartRequestCalled,
                "OnStartRequest should be called before OnStopRequest");
     MOZ_ASSERT(!mOnStopRequestCalled, "We should not call OnStopRequest twice");
-    mListener->OnStopRequest(this, mListenerContext, aStatus);
+    mListener->OnStopRequest(this, nullptr, aStatus);
     mOnStopRequestCalled = true;
   }
 
   // notify "http-on-stop-connect" observers
   gHttpHandler->OnStopRequest(this);
 
   RemoveAsNonTailRequest();
 
@@ -7940,18 +7911,18 @@ nsHttpChannel::OnDataAvailable(nsIReques
     // OnDoneReadingPartialCacheEntry).
     //
     int64_t offsetBefore = 0;
     nsCOMPtr<nsISeekableStream> seekable = do_QueryInterface(input);
     if (seekable && NS_FAILED(seekable->Tell(&offsetBefore))) {
       seekable = nullptr;
     }
 
-    nsresult rv = mListener->OnDataAvailable(this, mListenerContext, input,
-                                             mLogicalOffset, count);
+    nsresult rv =
+        mListener->OnDataAvailable(this, nullptr, input, mLogicalOffset, count);
     if (NS_SUCCEEDED(rv)) {
       // by contract mListener must read all of "count" bytes, but
       // nsInputStreamPump is tolerant to seekable streams that violate that
       // and it will redeliver incompletely read data. So we need to do
       // the same thing when updating the progress counter to stay in sync.
       int64_t offsetAfter, delta;
       if (seekable && NS_SUCCEEDED(seekable->Tell(&offsetAfter))) {
         delta = offsetAfter - offsetBefore;
--- a/netwerk/protocol/http/nsHttpChannel.h
+++ b/netwerk/protocol/http/nsHttpChannel.h
@@ -152,19 +152,17 @@ class nsHttpChannel final : public HttpB
   // Methods HttpBaseChannel didn't implement for us or that we override.
   //
   // nsIRequest
   NS_IMETHOD Cancel(nsresult status) override;
   NS_IMETHOD Suspend() override;
   NS_IMETHOD Resume() override;
   // nsIChannel
   NS_IMETHOD GetSecurityInfo(nsISupports **aSecurityInfo) override;
-  NS_IMETHOD AsyncOpen(nsIStreamListener *listener,
-                       nsISupports *aContext) override;
-  NS_IMETHOD AsyncOpen2(nsIStreamListener *aListener) override;
+  NS_IMETHOD AsyncOpen(nsIStreamListener *aListener) override;
   // nsIHttpChannel
   NS_IMETHOD GetEncodedBodySize(uint64_t *aEncodedBodySize) override;
   NS_IMETHOD SwitchProcessTo(mozilla::dom::Promise *aTabParent,
                              uint64_t aIdentifier) override;
   // nsIHttpChannelInternal
   NS_IMETHOD SetupFallbackChannel(const char *aFallbackKey) override;
   NS_IMETHOD SetChannelIsForDownload(bool aChannelIsForDownload) override;
   NS_IMETHOD GetNavigationStartTimeStamp(TimeStamp *aTimeStamp) override;
--- a/netwerk/protocol/res/ExtensionProtocolHandler.cpp
+++ b/netwerk/protocol/res/ExtensionProtocolHandler.cpp
@@ -283,22 +283,22 @@ void ExtensionStreamGetter::OnFD(const F
   MOZ_ASSERT(mChannel);
 
   if (!aFD.IsValid()) {
     OnStream(nullptr);
     return;
   }
 
   // We must keep an owning reference to the listener
-  // until we pass it on to AsyncOpen2.
+  // until we pass it on to AsyncOpen.
   nsCOMPtr<nsIStreamListener> listener = mListener.forget();
 
   RefPtr<FileDescriptorFile> fdFile = new FileDescriptorFile(aFD, mJarFile);
   mJarChannel->SetJarFile(fdFile);
-  nsresult rv = mJarChannel->AsyncOpen2(listener);
+  nsresult rv = mJarChannel->AsyncOpen(listener);
   if (NS_FAILED(rv)) {
     CancelRequest(listener, mChannel, rv);
   }
 }
 
 NS_IMPL_QUERY_INTERFACE(ExtensionProtocolHandler,
                         nsISubstitutingProtocolHandler, nsIProtocolHandler,
                         nsIProtocolHandlerWithDynamicFlags,
@@ -437,40 +437,36 @@ nsresult ExtensionProtocolHandler::Subst
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (!ext.LowerCaseEqualsLiteral("css")) {
     return NS_OK;
   }
 
   // Filter CSS files to replace locale message tokens with localized strings.
 
-  bool haveLoadInfo = aLoadInfo;
   nsCOMPtr<nsIChannel> channel = NS_NewSimpleChannel(
       aURI, aLoadInfo, *result,
-      [haveLoadInfo](nsIStreamListener* listener, nsIChannel* channel,
+      [](nsIStreamListener* listener, nsIChannel* channel,
                      nsIChannel* origChannel) -> RequestOrReason {
         nsresult rv;
         nsCOMPtr<nsIStreamConverterService> convService =
             do_GetService(NS_STREAMCONVERTERSERVICE_CONTRACTID, &rv);
         MOZ_TRY(rv);
 
         nsCOMPtr<nsIURI> uri;
         MOZ_TRY(channel->GetURI(getter_AddRefs(uri)));
 
         const char* kFromType = "application/vnd.mozilla.webext.unlocalized";
         const char* kToType = "text/css";
 
         nsCOMPtr<nsIStreamListener> converter;
         MOZ_TRY(convService->AsyncConvertData(kFromType, kToType, listener, uri,
                                               getter_AddRefs(converter)));
-        if (haveLoadInfo) {
-          MOZ_TRY(origChannel->AsyncOpen2(converter));
-        } else {
-          MOZ_TRY(origChannel->AsyncOpen(converter, nullptr));
-        }
+
+        MOZ_TRY(origChannel->AsyncOpen(converter));
 
         return RequestOrReason(origChannel);
       });
   NS_ENSURE_TRUE(channel, NS_ERROR_OUT_OF_MEMORY);
 
   if (aLoadInfo) {
     nsCOMPtr<nsILoadInfo> loadInfo =
         static_cast<LoadInfo*>(aLoadInfo)->CloneForNewRequest();
@@ -793,17 +789,17 @@ static void NewSimpleChannel(nsIURI* aUR
 
 // Gets a SimpleChannel that wraps the provided channel
 static void NewSimpleChannel(nsIURI* aURI, nsILoadInfo* aLoadinfo,
                              nsIChannel* aChannel, nsIChannel** aRetVal) {
   nsCOMPtr<nsIChannel> channel = NS_NewSimpleChannel(
       aURI, aLoadinfo, aChannel,
       [](nsIStreamListener* listener, nsIChannel* simpleChannel,
          nsIChannel* origChannel) -> RequestOrReason {
-        nsresult rv = origChannel->AsyncOpen2(listener);
+        nsresult rv = origChannel->AsyncOpen(listener);
         if (NS_FAILED(rv)) {
           simpleChannel->Cancel(NS_BINDING_ABORTED);
           return RequestOrReason(rv);
         }
         return RequestOrReason(origChannel);
       });
 
   SetContentType(aURI, channel);
--- a/netwerk/protocol/viewsource/nsViewSourceChannel.cpp
+++ b/netwerk/protocol/viewsource/nsViewSourceChannel.cpp
@@ -283,52 +283,34 @@ nsViewSourceChannel::GetURI(nsIURI **aUR
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   return BuildViewSourceURI(uri, aURI);
 }
 
 NS_IMETHODIMP
-nsViewSourceChannel::Open(nsIInputStream **_retval) {
-  NS_ENSURE_TRUE(mChannel, NS_ERROR_FAILURE);
-
-  nsresult rv = NS_MaybeOpenChannelUsingOpen2(mChannel, _retval);
-  if (NS_SUCCEEDED(rv)) {
-    mOpened = true;
-  }
-  return rv;
-}
-
-NS_IMETHODIMP
-nsViewSourceChannel::Open2(nsIInputStream **aStream) {
+nsViewSourceChannel::Open(nsIInputStream **aStream) {
   NS_ENSURE_TRUE(mChannel, NS_ERROR_FAILURE);
   nsCOMPtr<nsILoadInfo> loadInfo = mChannel->GetLoadInfo();
   if (!loadInfo) {
     MOZ_ASSERT(loadInfo, "can not enforce security without loadInfo");
     return NS_ERROR_UNEXPECTED;
   }
-  // setting the flag on the loadInfo indicates that the underlying
-  // channel will be openend using Open2() and hence performs
-  // the necessary security checks.
-  loadInfo->SetEnforceSecurity(true);
   return Open(aStream);
 }
 
 NS_IMETHODIMP
-nsViewSourceChannel::AsyncOpen(nsIStreamListener *aListener,
-                               nsISupports *ctxt) {
-#ifdef DEBUG
-  {
-    nsCOMPtr<nsILoadInfo> loadInfo = mChannel->GetLoadInfo();
-    MOZ_ASSERT(!loadInfo || loadInfo->GetSecurityMode() == 0 ||
-                   loadInfo->GetEnforceSecurity(),
-               "security flags in loadInfo but asyncOpen2() not called");
+nsViewSourceChannel::AsyncOpen(nsIStreamListener *aListener) {
+  nsCOMPtr<nsILoadInfo> loadInfo = mChannel->GetLoadInfo();
+  if (!loadInfo) {
+    MOZ_ASSERT(loadInfo, "can not enforce security without loadInfo");
+    return NS_ERROR_UNEXPECTED;
   }
-#endif
+  // We can't ensure GetInitialSecurityCheckDone here
 
   NS_ENSURE_TRUE(mChannel, NS_ERROR_FAILURE);
 
   mListener = aListener;
 
   /*
    * We want to add ourselves to the loadgroup before opening
    * mChannel, since we want to make sure we're in the loadgroup
@@ -336,47 +318,29 @@ nsViewSourceChannel::AsyncOpen(nsIStream
    */
 
   nsCOMPtr<nsILoadGroup> loadGroup;
   mChannel->GetLoadGroup(getter_AddRefs(loadGroup));
   if (loadGroup)
     loadGroup->AddRequest(static_cast<nsIViewSourceChannel *>(this), nullptr);
 
   nsresult rv = NS_OK;
-  nsCOMPtr<nsILoadInfo> loadInfo = mChannel->GetLoadInfo();
-  if (loadInfo && loadInfo->GetEnforceSecurity()) {
-    rv = mChannel->AsyncOpen2(this);
-  } else {
-    rv = mChannel->AsyncOpen(this, ctxt);
-  }
+  rv = mChannel->AsyncOpen(this);
 
   if (NS_FAILED(rv) && loadGroup)
     loadGroup->RemoveRequest(static_cast<nsIViewSourceChannel *>(this), nullptr,
                              rv);
 
   if (NS_SUCCEEDED(rv)) {
     mOpened = true;
   }
 
   return rv;
 }
 
-NS_IMETHODIMP
-nsViewSourceChannel::AsyncOpen2(nsIStreamListener *aListener) {
-  nsCOMPtr<nsILoadInfo> loadInfo = mChannel->GetLoadInfo();
-  if (!loadInfo) {
-    MOZ_ASSERT(loadInfo, "can not enforce security without loadInfo");
-    return NS_ERROR_UNEXPECTED;
-  }
-  // setting the flag on the loadInfo indicates that the underlying
-  // channel will be openend using AsyncOpen2() and hence performs
-  // the necessary security checks.
-  loadInfo->SetEnforceSecurity(true);
-  return AsyncOpen(aListener, nullptr);
-}
 /*
  * Both the view source channel and mChannel are added to the
  * loadgroup.  There should never be more than one request in the
  * loadgroup that has LOAD_DOCUMENT_URI set.  The one that has this
  * flag set is the request whose URI is used to refetch the document,
  * so it better be the viewsource channel.
  *
  * Therefore, we need to make sure that
--- a/netwerk/protocol/websocket/WebSocketChannel.cpp
+++ b/netwerk/protocol/websocket/WebSocketChannel.cpp
@@ -1341,17 +1341,17 @@ void WebSocketChannel::BeginOpenInternal
 
   nsCOMPtr<nsIChannel> localChannel = do_QueryInterface(mChannel, &rv);
   if (NS_FAILED(rv)) {
     LOG(("WebSocketChannel::BeginOpenInternal: cannot async open\n"));
     AbortSession(NS_ERROR_UNEXPECTED);
     return;
   }
 
-  rv = NS_MaybeOpenChannelUsingAsyncOpen2(localChannel, this);
+  rv = NS_MaybeOpenChannelUsingAsyncOpen(localChannel, this);
 
   if (NS_FAILED(rv)) {
     LOG(("WebSocketChannel::BeginOpenInternal: cannot async open\n"));
     AbortSession(NS_ERROR_CONNECTION_REFUSED);
     return;
   }
   mOpenedHttpChannel = true;
 
--- a/netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp
+++ b/netwerk/protocol/wyciwyg/WyciwygChannelChild.cpp
@@ -180,17 +180,17 @@ void WyciwygChannelChild::OnStartRequest
   if (!securityInfo.IsEmpty()) {
     rv = NS_DeserializeObject(securityInfo, getter_AddRefs(mSecurityInfo));
     MOZ_DIAGNOSTIC_ASSERT(NS_SUCCEEDED(rv),
                           "Deserializing security info should not fail");
   }
 
   AutoEventEnqueuer ensureSerialDispatch(mEventQ);
 
-  rv = mListener->OnStartRequest(this, mListenerContext);
+  rv = mListener->OnStartRequest(this, nullptr);
   if (NS_FAILED(rv)) Cancel(rv);
 }
 
 class WyciwygDataAvailableEvent
     : public NeckoTargetChannelEvent<WyciwygChannelChild> {
  public:
   WyciwygDataAvailableEvent(WyciwygChannelChild* child, const nsCString& data,
                             const uint64_t& offset)
@@ -229,17 +229,17 @@ void WyciwygChannelChild::OnDataAvailabl
                                       data.Length(), NS_ASSIGNMENT_DEPEND);
   if (NS_FAILED(rv)) {
     Cancel(rv);
     return;
   }
 
   AutoEventEnqueuer ensureSerialDispatch(mEventQ);
 
-  rv = mListener->OnDataAvailable(this, mListenerContext, stringStream, offset,
+  rv = mListener->OnDataAvailable(this, nullptr, stringStream, offset,
                                   data.Length());
   if (NS_FAILED(rv)) Cancel(rv);
 
   if (mProgressSink && NS_SUCCEEDED(rv)) {
     mProgressSink->OnProgress(this, nullptr, offset + data.Length(),
                               mContentLength);
   }
 }
@@ -273,20 +273,19 @@ void WyciwygChannelChild::OnStopRequest(
     AutoEventEnqueuer ensureSerialDispatch(mEventQ);
 
     mState = WCC_ONSTOP;
 
     mIsPending = false;
 
     if (!mCanceled) mStatus = statusCode;
 
-    mListener->OnStopRequest(this, mListenerContext, statusCode);
+    mListener->OnStopRequest(this, nullptr, statusCode);
 
     mListener = nullptr;
-    mListenerContext = nullptr;
 
     if (mLoadGroup) mLoadGroup->RemoveRequest(this, nullptr, mStatus);
 
     mCallbacks = nullptr;
     mProgressSink = nullptr;
   }
 
   if (mIPCOpen) PWyciwygChannelChild::Send__delete__(this);
@@ -316,21 +315,20 @@ void WyciwygChannelChild::CancelEarly(co
 
   mCanceled = true;
   mStatus = statusCode;
 
   mIsPending = false;
   if (mLoadGroup) mLoadGroup->RemoveRequest(this, nullptr, mStatus);
 
   if (mListener) {
-    mListener->OnStartRequest(this, mListenerContext);
-    mListener->OnStopRequest(this, mListenerContext, mStatus);
+    mListener->OnStartRequest(this, nullptr);
+    mListener->OnStopRequest(this, nullptr, mStatus);
   }
   mListener = nullptr;
-  mListenerContext = nullptr;
 
   if (mIPCOpen) PWyciwygChannelChild::Send__delete__(this);
 }
 
 //-----------------------------------------------------------------------------
 // nsIRequest
 //-----------------------------------------------------------------------------
 
@@ -533,60 +531,61 @@ WyciwygChannelChild::GetContentLength(in
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 NS_IMETHODIMP
 WyciwygChannelChild::SetContentLength(int64_t aContentLength) {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-WyciwygChannelChild::Open(nsIInputStream** _retval) {
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-WyciwygChannelChild::Open2(nsIInputStream** aStream) {
+WyciwygChannelChild::Open(nsIInputStream** aStream) {
   nsCOMPtr<nsIStreamListener> listener;
   nsresult rv =
       nsContentSecurityManager::doContentSecurityCheck(this, listener);
   NS_ENSURE_SUCCESS(rv, rv);
-  return Open(aStream);
+
+  return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 static mozilla::dom::TabChild* GetTabChild(nsIChannel* aChannel) {
   nsCOMPtr<nsITabChild> iTabChild;
   NS_QueryNotificationCallbacks(aChannel, iTabChild);
   return iTabChild ? static_cast<mozilla::dom::TabChild*>(iTabChild.get())
                    : nullptr;
 }
 
 NS_IMETHODIMP
-WyciwygChannelChild::AsyncOpen(nsIStreamListener* aListener,
-                               nsISupports* aContext) {
+WyciwygChannelChild::AsyncOpen(nsIStreamListener* aListener) {
+  nsCOMPtr<nsIStreamListener> listener = aListener;
+  nsresult rv =
+      nsContentSecurityManager::doContentSecurityCheck(this, listener);
+  if (NS_FAILED(rv)) {
+    mCallbacks = nullptr;
+    return rv;
+  }
   MOZ_ASSERT(
       !mLoadInfo || mLoadInfo->GetSecurityMode() == 0 ||
           mLoadInfo->GetInitialSecurityCheckDone() ||
           (mLoadInfo->GetSecurityMode() ==
                nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL &&
            nsContentUtils::IsSystemPrincipal(mLoadInfo->LoadingPrincipal())),
-      "security flags in loadInfo but asyncOpen2() not called");
+      "security flags in loadInfo but doContentSecurityCheck() not called");
 
   LOG(("WyciwygChannelChild::AsyncOpen [this=%p]\n", this));
 
   // The only places creating wyciwyg: channels should be
   // HTMLDocument::OpenCommon and session history.  Both should be setting an
   // owner or loadinfo.
   MOZ_ASSERT(mOwner || mLoadInfo, "Must have a principal");
   NS_ENSURE_STATE(mOwner || mLoadInfo);
 
   NS_ENSURE_ARG_POINTER(aListener);
   NS_ENSURE_TRUE(!mIsPending, NS_ERROR_IN_PROGRESS);
 
   mListener = aListener;
-  mListenerContext = aContext;
   mIsPending = true;
 
   if (mLoadGroup) {
     mLoadGroup->AddRequest(this, nullptr);
   }
 
   URIParams originalURI;
   SerializeURI(mOriginalURI, originalURI);
@@ -604,28 +603,16 @@ WyciwygChannelChild::AsyncOpen(nsIStream
                 browser);
 
   mSentAppData = true;
   mState = WCC_OPENED;
 
   return NS_OK;
 }
 
-NS_IMETHODIMP
-WyciwygChannelChild::AsyncOpen2(nsIStreamListener* aListener) {
-  nsCOMPtr<nsIStreamListener> listener = aListener;
-  nsresult rv =
-      nsContentSecurityManager::doContentSecurityCheck(this, listener);
-  if (NS_FAILED(rv)) {
-    mCallbacks = nullptr;
-    return rv;
-  }
-  return AsyncOpen(listener, nullptr);
-}
-
 //-----------------------------------------------------------------------------
 // nsIWyciwygChannel
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
 WyciwygChannelChild::WriteToCacheEntry(const nsAString& aData) {
   NS_ENSURE_TRUE((mState == WCC_INIT) || (mState == WCC_ONWRITE),
                  NS_ERROR_UNEXPECTED);
--- a/netwerk/protocol/wyciwyg/WyciwygChannelChild.h
+++ b/netwerk/protocol/wyciwyg/WyciwygChannelChild.h
@@ -89,17 +89,16 @@ class WyciwygChannelChild final
   nsCOMPtr<nsIURI> mURI;
   nsCOMPtr<nsIURI> mOriginalURI;
   nsCOMPtr<nsISupports> mOwner;
   nsCOMPtr<nsILoadInfo> mLoadInfo;
   nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
   nsCOMPtr<nsIProgressEventSink> mProgressSink;
   nsCOMPtr<nsILoadGroup> mLoadGroup;
   nsCOMPtr<nsIStreamListener> mListener;
-  nsCOMPtr<nsISupports> mListenerContext;
   nsCOMPtr<nsISupports> mSecurityInfo;
 
   // FIXME: replace with IPDL states (bug 536319)
   enum WyciwygChannelChildState mState;
 
   bool mIPCOpen;
   bool mSentAppData;
   RefPtr<ChannelEventQueue> mEventQ;
--- a/netwerk/protocol/wyciwyg/WyciwygChannelParent.cpp
+++ b/netwerk/protocol/wyciwyg/WyciwygChannelParent.cpp
@@ -208,21 +208,17 @@ mozilla::ipc::IPCResult WyciwygChannelPa
   if (NS_FAILED(rv)) {
     if (!SendCancelEarly(rv)) {
       return IPC_FAIL_NO_REASON(this);
     }
     return IPC_OK();
   }
 
   nsCOMPtr<nsILoadInfo> loadInfo = mChannel->GetLoadInfo();
-  if (loadInfo && loadInfo->GetEnforceSecurity()) {
-    rv = mChannel->AsyncOpen2(this);
-  } else {
-    rv = mChannel->AsyncOpen(this, nullptr);
-  }
+  rv = mChannel->AsyncOpen(this);
 
   if (NS_FAILED(rv)) {
     if (!SendCancelEarly(rv)) {
       return IPC_FAIL_NO_REASON(this);
     }
     return IPC_OK();
   }
 
--- a/netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp
+++ b/netwerk/protocol/wyciwyg/nsWyciwygChannel.cpp
@@ -286,85 +286,68 @@ nsWyciwygChannel::GetContentLength(int64
 NS_IMETHODIMP
 nsWyciwygChannel::SetContentLength(int64_t aContentLength) {
   mContentLength = aContentLength;
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsWyciwygChannel::Open(nsIInputStream **aReturn) {
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-nsWyciwygChannel::Open2(nsIInputStream **aStream) {
+nsWyciwygChannel::Open(nsIInputStream **aStream) {
   nsCOMPtr<nsIStreamListener> listener;
   nsresult rv =
       nsContentSecurityManager::doContentSecurityCheck(this, listener);
   NS_ENSURE_SUCCESS(rv, rv);
-  return Open(aStream);
+
+  return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsWyciwygChannel::AsyncOpen(nsIStreamListener *listener, nsISupports *ctx) {
-  MOZ_ASSERT(
-      !mLoadInfo || mLoadInfo->GetSecurityMode() == 0 ||
-          mLoadInfo->GetInitialSecurityCheckDone() ||
-          (mLoadInfo->GetSecurityMode() ==
-               nsILoadInfo::SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL &&
-           nsContentUtils::IsSystemPrincipal(mLoadInfo->LoadingPrincipal())),
-      "security flags in loadInfo but asyncOpen2() not called");
+nsWyciwygChannel::AsyncOpen(nsIStreamListener *aListener) {
+  nsCOMPtr<nsIStreamListener> listener = aListener;
+  nsresult rv =
+      nsContentSecurityManager::doContentSecurityCheck(this, listener);
+  if (NS_FAILED(rv)) {
+    mIsPending = false;
+    mCallbacks = nullptr;
+    return rv;
+  }
 
   LOG(("nsWyciwygChannel::AsyncOpen [this=%p]\n", this));
   MOZ_ASSERT(mMode == NONE, "nsWyciwygChannel already open");
 
   NS_ENSURE_TRUE(!mIsPending, NS_ERROR_IN_PROGRESS);
   NS_ENSURE_TRUE(mMode == NONE, NS_ERROR_IN_PROGRESS);
   NS_ENSURE_ARG_POINTER(listener);
 
   mMode = READING;
 
   // open a cache entry for this channel...
   // mIsPending set to true since OnCacheEntryAvailable may be called
   // synchronously and fails when mIsPending found false.
   mIsPending = true;
-  nsresult rv = OpenCacheEntryForReading(mURI);
+  rv = OpenCacheEntryForReading(mURI);
   if (NS_FAILED(rv)) {
     LOG(("nsWyciwygChannel::OpenCacheEntryForReading failed [rv=%" PRIx32 "]\n",
          static_cast<uint32_t>(rv)));
     mIsPending = false;
     mCallbacks = nullptr;
     return rv;
   }
 
   // There is no code path that would invoke the listener sooner than
   // we get to this line in case OnCacheEntryAvailable is invoked
   // synchronously.
   mListener = listener;
-  mListenerContext = ctx;
 
   if (mLoadGroup) mLoadGroup->AddRequest(this, nullptr);
 
   return NS_OK;
 }
 
-NS_IMETHODIMP
-nsWyciwygChannel::AsyncOpen2(nsIStreamListener *aListener) {
-  nsCOMPtr<nsIStreamListener> listener = aListener;
-  nsresult rv =
-      nsContentSecurityManager::doContentSecurityCheck(this, listener);
-  if (NS_FAILED(rv)) {
-    mIsPending = false;
-    mCallbacks = nullptr;
-    return rv;
-  }
-  return AsyncOpen(listener, nullptr);
-}
-
 //////////////////////////////////////////////////////////////////////////////
 // nsIWyciwygChannel
 //////////////////////////////////////////////////////////////////////////////
 
 NS_IMETHODIMP
 nsWyciwygChannel::WriteToCacheEntry(const nsAString &aData) {
   LOG(("nsWyciwygChannel::WriteToCacheEntry [this=%p]", this));
 
@@ -567,20 +550,19 @@ nsWyciwygChannel::OnDataAvailable(nsIReq
                                   uint32_t count) {
   LOG(("nsWyciwygChannel::OnDataAvailable [this=%p request=%p offset=%" PRIu64
        " count=%u]\n",
        this, request, offset, count));
 
   nsresult rv;
 
   nsCOMPtr<nsIStreamListener> listener = mListener;
-  nsCOMPtr<nsISupports> listenerContext = mListenerContext;
 
   if (listener) {
-    rv = listener->OnDataAvailable(this, listenerContext, input, offset, count);
+    rv = listener->OnDataAvailable(this, nullptr, input, offset, count);
   } else {
     MOZ_ASSERT(false, "We must have a listener!");
     rv = NS_ERROR_UNEXPECTED;
   }
 
   // XXX handle 64-bit stuff for real
   if (mProgressSink && NS_SUCCEEDED(rv)) {
     mProgressSink->OnProgress(this, nullptr, offset + count, mContentLength);
@@ -594,20 +576,19 @@ nsWyciwygChannel::OnDataAvailable(nsIReq
 //////////////////////////////////////////////////////////////////////////////
 
 NS_IMETHODIMP
 nsWyciwygChannel::OnStartRequest(nsIRequest *request, nsISupports *ctx) {
   LOG(("nsWyciwygChannel::OnStartRequest [this=%p request=%p]\n", this,
        request));
 
   nsCOMPtr<nsIStreamListener> listener = mListener;
-  nsCOMPtr<nsISupports> listenerContext = mListenerContext;
 
   if (listener) {
-    return listener->OnStartRequest(this, listenerContext);
+    return listener->OnStartRequest(this, nullptr);
   }
 
   MOZ_ASSERT(false, "We must have a listener!");
   return NS_ERROR_UNEXPECTED;
 }
 
 NS_IMETHODIMP
 nsWyciwygChannel::OnStopRequest(nsIRequest *request, nsISupports *ctx,
@@ -616,22 +597,20 @@ nsWyciwygChannel::OnStopRequest(nsIReque
        "]\n",
        this, request, static_cast<uint32_t>(status)));
 
   if (NS_SUCCEEDED(mStatus)) mStatus = status;
 
   mIsPending = false;
 
   nsCOMPtr<nsIStreamListener> listener;
-  nsCOMPtr<nsISupports> listenerContext;
   listener.swap(mListener);
-  listenerContext.swap(mListenerContext);
 
   if (listener) {
-    listener->OnStopRequest(this, listenerContext, mStatus);
+    listener->OnStopRequest(this, nullptr, mStatus);
   } else {
     MOZ_ASSERT(false, "We must have a listener!");
   }
 
   if (mLoadGroup) mLoadGroup->RemoveRequest(this, nullptr, mStatus);
 
   CloseCacheEntry(mStatus);
   mPump = nullptr;
@@ -726,25 +705,23 @@ void nsWyciwygChannel::WriteCharsetAndSo
 
   nsAutoCString source;
   source.AppendInt(aSource);
   mCacheEntry->SetMetaDataElement("charset-source", source.get());
 }
 
 void nsWyciwygChannel::NotifyListener() {
   nsCOMPtr<nsIStreamListener> listener;
-  nsCOMPtr<nsISupports> listenerContext;
 
   listener.swap(mListener);
-  listenerContext.swap(mListenerContext);
 
   if (listener) {
-    listener->OnStartRequest(this, listenerContext);
+    listener->OnStartRequest(this, nullptr);
     mIsPending = false;
-    listener->OnStopRequest(this, listenerContext, mStatus);
+    listener->OnStopRequest(this, nullptr, mStatus);
   } else {
     MOZ_ASSERT(false, "We must have the listener!");
     mIsPending = false;
   }
 
   CloseCacheEntry(mStatus);
 
   // Remove ourselves from the load group.
--- a/netwerk/protocol/wyciwyg/nsWyciwygChannel.h
+++ b/netwerk/protocol/wyciwyg/nsWyciwygChannel.h
@@ -78,17 +78,16 @@ class nsWyciwygChannel final
   nsCOMPtr<nsIURI> mURI;
   nsCOMPtr<nsIURI> mOriginalURI;
   nsCOMPtr<nsISupports> mOwner;
   nsCOMPtr<nsILoadInfo> mLoadInfo;
   nsCOMPtr<nsIInterfaceRequestor> mCallbacks;
   nsCOMPtr<nsIProgressEventSink> mProgressSink;
   nsCOMPtr<nsILoadGroup> mLoadGroup;
   nsCOMPtr<nsIStreamListener> mListener;
-  nsCOMPtr<nsISupports> mListenerContext;
 
   // reuse as much of this channel implementation as we can
   nsCOMPtr<nsIInputStreamPump> mPump;
 
   // Cache related stuff
   nsCOMPtr<nsICacheEntry> mCacheEntry;
   nsCOMPtr<nsIOutputStream> mCacheOutputStream;
 
--- a/netwerk/streamconv/converters/nsMultiMixedConv.cpp
+++ b/netwerk/streamconv/converters/nsMultiMixedConv.cpp
@@ -160,43 +160,35 @@ NS_IMETHODIMP
 nsPartChannel::SetOriginalURI(nsIURI *aURI) {
   return mMultipartChannel->SetOriginalURI(aURI);
 }
 
 NS_IMETHODIMP
 nsPartChannel::GetURI(nsIURI **aURI) { return mMultipartChannel->GetURI(aURI); }
 
 NS_IMETHODIMP
-nsPartChannel::Open(nsIInputStream **result) {
+nsPartChannel::Open(nsIInputStream **aStream) {
+  nsCOMPtr<nsIStreamListener> listener;
+  nsresult rv =
+      nsContentSecurityManager::doContentSecurityCheck(this, listener);
+  NS_ENSURE_SUCCESS(rv, rv);
+
   // This channel cannot be opened!
   return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
-nsPartChannel::Open2(nsIInputStream **aStream) {
-  nsCOMPtr<nsIStreamListener> listener;
-  nsresult rv =
-      nsContentSecurityManager::doContentSecurityCheck(this, listener);
-  NS_ENSURE_SUCCESS(rv, rv);
-  return Open(aStream);
-}
-
-NS_IMETHODIMP
-nsPartChannel::AsyncOpen(nsIStreamListener *aListener, nsISupports *aContext) {
-  // This channel cannot be opened!
-  return NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP
-nsPartChannel::AsyncOpen2(nsIStreamListener *aListener) {
+nsPartChannel::AsyncOpen(nsIStreamListener *aListener) {
   nsCOMPtr<nsIStreamListener> listener = aListener;
   nsresult rv =
       nsContentSecurityManager::doContentSecurityCheck(this, listener);
   NS_ENSURE_SUCCESS(rv, rv);
-  return AsyncOpen(listener, nullptr);
+
+  // This channel cannot be opened!
+  return NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
 nsPartChannel::GetLoadFlags(nsLoadFlags *aLoadFlags) {
   *aLoadFlags = mLoadFlags;
   return NS_OK;
 }
 
--- a/netwerk/test/browser/browser_nsIFormPOSTActionChannel.js
+++ b/netwerk/test/browser/browser_nsIFormPOSTActionChannel.js
@@ -110,20 +110,17 @@ CustomChannel.prototype = {
     return -1;
   },
   set contentLength(val) {
     throw Cr.NS_ERROR_NOT_IMPLEMENTED;
   },
   open: function() {
     throw Cr.NS_ERROR_NOT_IMPLEMENTED;
   },
-  open2: function() {
-    throw Cr.NS_ERROR_NOT_IMPLEMENTED;
-  },
-  asyncOpen: function(aListener, aContext) {
+  asyncOpen: function(aListener) {
     var data = `
 <!DOCTYPE html>
 <html>
 <head>
 <meta charset="utf-8">
 <title>test bug 1241377</title>
 </head>
 <body>
@@ -174,31 +171,28 @@ document.getElementById('form').submit()
 
     var stream = Cc["@mozilla.org/io/string-input-stream;1"]
         .createInstance(Ci.nsIStringInputStream);
     stream.setData(data, data.length);
 
     var runnable = {
       run: () => {
         try {
-          aListener.onStartRequest(this, aContext);
+          aListener.onStartRequest(this, null);
         } catch(e) {}
         try {
-          aListener.onDataAvailable(this, aContext, stream, 0, stream.available());
+          aListener.onDataAvailable(this, null, stream, 0, stream.available());
         } catch(e) {}
         try {
-          aListener.onStopRequest(this, aContext, Cr.NS_OK);
+          aListener.onStopRequest(this, null, Cr.NS_OK);
         } catch(e) {}
       }
     };
     Services.tm.dispatchToMainThread(runnable);
   },
-  asyncOpen2: function(aListener) {
-    this.asyncOpen(aListener, null);
-  },
 
   /** nsIRequest */
   get name() {
     return this.uri.spec;
   },
   isPending: function () {
     return false;
   },
--- a/netwerk/test/httpserver/test/head_utils.js
+++ b/netwerk/test/httpserver/test/head_utils.js
@@ -256,17 +256,17 @@ function runHttpTests(testArray, done) {
       try {
         do_report_unexpected_exception(e, "testArray[" + testIndex + "].initChannel(ch)");
       } catch (x) {
         /* swallow and let tests continue */
       }
     }
 
     listener._channel = ch;
-    ch.asyncOpen2(listener);
+    ch.asyncOpen(listener);
   }
 
   /** Index of the test being run. */
   var testIndex = -1;
 
   /** Stream listener for the channels. */
   var listener =
     {
--- a/netwerk/test/httpserver/test/test_sjs_object_state.js
+++ b/netwerk/test/httpserver/test/test_sjs_object_state.js
@@ -212,17 +212,17 @@ function HTTPTestLoader(path, start, sto
 
   /** onStartRequest callback. */
   this._start = start;
 
   /** onStopRequest callback. */
   this._stop = stop;
 
   var channel = makeChannel(path);
-  channel.asyncOpen2(this);
+  channel.asyncOpen(this);
 }
 HTTPTestLoader.prototype =
   {
     onStartRequest(request, cx) {
       dumpn("*** HTTPTestLoader.onStartRequest for " + this._path);
 
       var ch = request.QueryInterface(Ci.nsIHttpChannel)
                       .QueryInterface(Ci.nsIHttpChannelInternal);
--- a/netwerk/test/unit/test_1351443-missing-NewChannel2.js
+++ b/netwerk/test/unit/test_1351443-missing-NewChannel2.js
@@ -73,31 +73,29 @@ ProtocolHandler.prototype = {
   contentCharset: "UTF-8",
   get contentLength() {
     return -1;
   },
   set contentLength(val) {
     throw Components.Exception("Setting content length", NS_ERROR_NOT_IMPLEMENTED);
   },
   open: function() {
+    // throws an error if security checks fail
+    contentSecManager.performSecurityCheck(this, null);
+
     var file = do_get_file("test_bug894586.js", false);
     Assert.ok(file.exists());
     var url = Services.io.newFileURI(file);
-    return NetUtil.newChannel({uri: url, loadUsingSystemPrincipal: true}).open2();
-  },
-  open2: function() {
-    // throws an error if security checks fail
-    contentSecManager.performSecurityCheck(this, null);
-    return this.open();
+    return NetUtil.newChannel({uri: url, loadUsingSystemPrincipal: true}).open();
   },
   asyncOpen: function(aListener, aContext) {
     throw Components.Exception("Not implemented",
                                Cr.NS_ERROR_NOT_IMPLEMENTED);
   },
-  asyncOpen2: function(aListener, aContext) {
+  asyncOpen: function(aListener, aContext) {
     throw Components.Exception("Not implemented",
                                Cr.NS_ERROR_NOT_IMPLEMENTED);
   },
   contentDisposition: Ci.nsIChannel.DISPOSITION_INLINE,
   get contentDispositionFilename() {
     throw Components.Exception("No file name",
                                Cr.NS_ERROR_NOT_AVAILABLE);
   },
--- a/netwerk/test/unit/test_304_responses.js
+++ b/netwerk/test/unit/test_304_responses.js
@@ -63,17 +63,17 @@ function consume304(request, buffer) {
   Assert.equal(request.getResponseHeader("Returned-From-Handler"), "1");
   run_next_test();
 }
 
 // Test that we return a 304 response to the caller when we are not expecting
 // a 304 response (i.e. when the server shouldn't have sent us one).
 add_test(function test_unexpected_304() {
   var chan = make_channel(baseURI + unexpected304);
-  chan.asyncOpen2(new ChannelListener(consume304, null));
+  chan.asyncOpen(new ChannelListener(consume304, null));
 });
 
 // Test that we can cope with a 304 response that was (erroneously) stored in
 // the cache.
 add_test(function test_304_stored_in_cache() {
   asyncOpenCacheEntry(
     baseURI + existingCached304, "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
     function (entryStatus, cacheEntry) {
@@ -85,11 +85,11 @@ add_test(function test_304_stored_in_cac
       cacheEntry.close();
 
       var chan = make_channel(baseURI + existingCached304);
 
       // make it a custom conditional request
       chan.QueryInterface(Ci.nsIHttpChannel);
       chan.setRequestHeader("If-None-Match", '"foo"', false);
 
-      chan.asyncOpen2(new ChannelListener(consume304, null));
+      chan.asyncOpen(new ChannelListener(consume304, null));
     });
 });
--- a/netwerk/test/unit/test_307_redirect.js
+++ b/netwerk/test/unit/test_307_redirect.js
@@ -40,31 +40,31 @@ function noRedirectStreamObserver(reques
   Assert.equal(buffer, requestBody);
   var chan = make_channel(uri);
   var uploadStream = Cc["@mozilla.org/io/string-input-stream;1"]
                        .createInstance(Ci.nsIStringInputStream);
   uploadStream.setData(requestBody, requestBody.length);
   chan.QueryInterface(Ci.nsIUploadChannel).setUploadStream(uploadStream,
                                                            "text/plain",
                                                            -1);
-  chan.asyncOpen2(new ChannelListener(noHeaderStreamObserver, null));
+  chan.asyncOpen(new ChannelListener(noHeaderStreamObserver, null));
 }
 
 function noHeaderStreamObserver(request, buffer)
 {
   Assert.equal(buffer, requestBody);
   var chan = make_channel(uri);
   var uploadStream = Cc["@mozilla.org/io/string-input-stream;1"]
                        .createInstance(Ci.nsIStringInputStream);
   var streamBody = "Content-Type: text/plain\r\n" +
       "Content-Length: " + requestBody.length + "\r\n\r\n" +
       requestBody;
   uploadStream.setData(streamBody, streamBody.length);
   chan.QueryInterface(Ci.nsIUploadChannel).setUploadStream(uploadStream, "", -1);
-  chan.asyncOpen2(new ChannelListener(headerStreamObserver, null));
+  chan.asyncOpen(new ChannelListener(headerStreamObserver, null));
 }
 
 function headerStreamObserver(request, buffer)
 {
   Assert.equal(buffer, requestBody);
   httpserver.stop(do_test_finished);
 }
 
@@ -81,11 +81,11 @@ function run_test()
 
   var chan = make_channel(noRedirectURI);
   var uploadStream = Cc["@mozilla.org/io/string-input-stream;1"]
                        .createInstance(Ci.nsIStringInputStream);
   uploadStream.setData(requestBody, requestBody.length);
   chan.QueryInterface(Ci.nsIUploadChannel).setUploadStream(uploadStream,
                                                            "text/plain",
                                                            -1);
-  chan.asyncOpen2(new ChannelListener(noRedirectStreamObserver, null));
+  chan.asyncOpen(new ChannelListener(noRedirectStreamObserver, null));
   do_test_pending();
 }
--- a/netwerk/test/unit/test_421.js
+++ b/netwerk/test/unit/test_421.js
@@ -17,17 +17,17 @@ function run_test() {
 }
 
 function setup_test() {
   httpserver.registerPathHandler(testpath, serverHandler);
   httpserver.start(-1);
 
   channel = setupChannel(testpath);
 
-  channel.asyncOpen2(new ChannelListener(checkRequestResponse, channel));
+  channel.asyncOpen(new ChannelListener(checkRequestResponse, channel));
 }
 
 function setupChannel(path) {
   var chan = NetUtil.newChannel({uri: URL + path, loadUsingSystemPrincipal: true});
   chan.QueryInterface(Ci.nsIHttpChannel);
   chan.requestMethod = "GET";
   return chan;
 }
--- a/netwerk/test/unit/test_about_networking.js
+++ b/netwerk/test/unit/test_about_networking.js
@@ -81,15 +81,15 @@ function run_test() {
   let ioService = Cc["@mozilla.org/network/io-service;1"]
     .getService(Ci.nsIIOService);
 
   gHttpServer.start(-1);
 
   let uri = ioService.newURI("http://localhost:" + gHttpServer.identity.primaryPort);
   let channel = NetUtil.newChannel({uri: uri, loadUsingSystemPrincipal: true});
 
-  channel.open2();
+  channel.open();
 
   gServerSocket.init(-1, true, -1);
 
   run_next_test();
 }
 
--- a/netwerk/test/unit/test_alt-data_cross_process.js
+++ b/netwerk/test/unit/test_alt-data_cross_process.js
@@ -81,17 +81,17 @@ function run_test()
 
 function asyncOpen()
 {
   var chan = make_channel(URL);
 
   var cc = chan.QueryInterface(Ci.nsICacheInfoChannel);
   cc.preferAlternativeDataType(altContentType, "");
 
-  chan.asyncOpen2(new ChannelListener(readServerContent, null));
+  chan.asyncOpen(new ChannelListener(readServerContent, null));
 }
 
 function readServerContent(request, buffer)
 {
   var cc = request.QueryInterface(Ci.nsICacheInfoChannel);
 
   Assert.equal(buffer, responseContent);
   Assert.equal(cc.alternativeDataType, "");
@@ -116,17 +116,17 @@ function flushAndOpenAltChannel()
   });
 }
 
 function openAltChannel() {
   var chan = make_channel(URL);
   var cc = chan.QueryInterface(Ci.nsICacheInfoChannel);
   cc.preferAlternativeDataType(altContentType, "");
 
-  chan.asyncOpen2(new ChannelListener(readAltContent, null));
+  chan.asyncOpen(new ChannelListener(readAltContent, null));
 }
 
 function readAltContent(request, buffer)
 {
   var cc = request.QueryInterface(Ci.nsICacheInfoChannel);
 
   Assert.equal(servedNotModified, true);
   Assert.equal(cc.alternativeDataType, altContentType);
--- a/netwerk/test/unit/test_alt-data_overwrite.js
+++ b/netwerk/test/unit/test_alt-data_overwrite.js
@@ -22,17 +22,17 @@ XPCOMUtils.defineLazyGetter(this, "URL",
 let httpServer = null;
 
 function make_and_open_channel(url, altContentType, callback) {
   let chan = NetUtil.newChannel({uri: url, loadUsingSystemPrincipal: true});
   if (altContentType) {
     let cc = chan.QueryInterface(Ci.nsICacheInfoChannel);
     cc.preferAlternativeDataType(altContentType, "");
   }
-  chan.asyncOpen2(new ChannelListener(callback, null));
+  chan.asyncOpen(new ChannelListener(callback, null));
 }
 
 const responseContent = "response body";
 const altContent = "!@#$%^&*()";
 const altContentType = "text/binary";
 const altContent2 = "abc";
 const altContentType2 = "text/binary2";
 
--- a/netwerk/test/unit/test_alt-data_simple.js
+++ b/netwerk/test/unit/test_alt-data_simple.js
@@ -87,17 +87,17 @@ function run_test()
 
 function asyncOpen()
 {
   var chan = make_channel(URL);
 
   var cc = chan.QueryInterface(Ci.nsICacheInfoChannel);
   cc.preferAlternativeDataType(altContentType, "");
 
-  chan.asyncOpen2(new ChannelListener(readServerContent, null));
+  chan.asyncOpen(new ChannelListener(readServerContent, null));
 }
 
 function readServerContent(request, buffer)
 {
   var cc = request.QueryInterface(Ci.nsICacheInfoChannel);
 
   Assert.equal(buffer, responseContent);
   Assert.equal(cc.alternativeDataType, "");
@@ -134,17 +134,17 @@ function flushAndOpenAltChannel()
 
 function openAltChannel() {
   var chan = make_channel(URL);
   var cc = chan.QueryInterface(Ci.nsICacheInfoChannel);
   cc.preferAlternativeDataType("dummy1", "text/javascript");
   cc.preferAlternativeDataType(altContentType, "text/plain");
   cc.preferAlternativeDataType("dummy2", "");
 
-  chan.asyncOpen2(new ChannelListener(readAltContent, null));
+  chan.asyncOpen(new ChannelListener(readAltContent, null));
 }
 
 function readAltContent(request, buffer)
 {
   var cc = request.QueryInterface(Ci.nsICacheInfoChannel);
 
   Assert.equal(servedNotModified, true);
   Assert.equal(cc.alternativeDataType, altContentType);
@@ -173,17 +173,17 @@ function readOriginalInputStream(aInputS
 }
 
 function requestAgain()
 {
   shouldPassRevalidation = false;
   var chan = make_channel(URL);
   var cc = chan.QueryInterface(Ci.nsICacheInfoChannel);
   cc.preferAlternativeDataType(altContentType, "");
-  chan.asyncOpen2(new ChannelListener(readEmptyAltContent, null));
+  chan.asyncOpen(new ChannelListener(readEmptyAltContent, null));
 }
 
 function readEmptyAltContent(request, buffer)
 {
   var cc = request.QueryInterface(Ci.nsICacheInfoChannel);
 
   // the cache is overwrite and the alt-data is reset
   Assert.equal(cc.alternativeDataType, "");
--- a/netwerk/test/unit/test_alt-data_stream.js
+++ b/netwerk/test/unit/test_alt-data_stream.js
@@ -56,17 +56,17 @@ function run_test()
   httpServer.registerPathHandler("/content", contentHandler);
   httpServer.start(-1);
 
   var chan = make_channel(URL);
 
   var cc = chan.QueryInterface(Ci.nsICacheInfoChannel);
   cc.preferAlternativeDataType(altContentType, "");
 
-  chan.asyncOpen2(new ChannelListener(readServerContent, null));
+  chan.asyncOpen(new ChannelListener(readServerContent, null));
   do_test_pending();
 }
 
 // Output stream used to write alt-data to the cache entry.
 var os;
 
 function readServerContent(request, buffer)
 {
@@ -85,17 +85,17 @@ function readServerContent(request, buff
 }
 
 function openAltChannel()
 {
   var chan = make_channel(URL);
   var cc = chan.QueryInterface(Ci.nsICacheInfoChannel);
   cc.preferAlternativeDataType(altContentType, "");
 
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 }
 
 var listener = {
   buffer: "",
   onStartRequest: function(request, context) { },
   onDataAvailable: function(request, context, stream, offset, count) {
     let string = NetUtil.readInputStreamToString(stream, count);
     this.buffer += string;
--- a/netwerk/test/unit/test_altsvc.js
+++ b/netwerk/test/unit/test_altsvc.js
@@ -219,17 +219,17 @@ function doTest()
   if (loadWithoutClearingMappings) {
     chan.loadFlags = Ci.nsIChannel.LOAD_INITIAL_DOCUMENT_URI;
   } else {
     chan.loadFlags = Ci.nsIRequest.LOAD_FRESH_CONNECTION |
                      Ci.nsIChannel.LOAD_INITIAL_DOCUMENT_URI;
   }
   loadWithoutClearingMappings = false;
   chan.loadInfo.originAttributes = originAttributes;
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 }
 
 // xaltsvc is overloaded to do two things..
 // 1] it is sent in the x-altsvc request header, and the response uses the value in the Alt-Svc response header
 // 2] the test polls until necko sets Alt-Used to that value (i.e. it uses that route)
 //
 // When xaltsvc is set to h2Route (i.e. :port with the implied hostname) it doesn't match the alt-used,
 // which is always explicit, so it needs to be changed after the channel is created but before the
--- a/netwerk/test/unit/test_anonymous-coalescing.js
+++ b/netwerk/test/unit/test_anonymous-coalescing.js
@@ -126,17 +126,17 @@ function doTest()
     loadFlags |= Ci.nsIRequest.LOAD_FRESH_CONNECTION;
   }
   forceReload = false;
 
   var chan = makeChan(origin);
   chan.loadFlags = loadFlags;
 
   var listener = new Listener();
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 }
 
 function doTest1()
 {
   dump("doTest1()\n");
   origin = "https://foo.example.com:" + h2Port + "/origin-1";
   nextTest = doTest2;
   nextPortExpectedToBeSame = false;
--- a/netwerk/test/unit/test_auth_dialog_permission.js
+++ b/netwerk/test/unit/test_auth_dialog_permission.js
@@ -188,17 +188,17 @@ Test.prototype = {
                       + this._uri
                       + this._contentPolicy
                       + this._expectedCode + " \n");
 
     prefs.setIntPref("network.auth.subresource-http-auth-allow",
                      this._subresource_http_auth_allow_pref);
     let chan = makeChan(this._loadingUri, this._uri, this._contentPolicy);
     chan.notificationCallbacks = new Requestor(this._expectedCode == 200);
-    chan.asyncOpen2(this);
+    chan.asyncOpen(this);
   }
 };
 
 var tests = [
   // For the next 3 tests the preference is set to 2 - allow the cross-origin
   // authentication as well.
 
   // A cross-origin request.
--- a/netwerk/test/unit/test_auth_proxy.js
+++ b/netwerk/test/unit/test_auth_proxy.js
@@ -248,94 +248,94 @@ function run_test() {
   tests[current_test]();
 }
 
 function test_proxy_returnfalse() {
   dump("\ntest: proxy returnfalse\n");
   var chan = makeChan();
   chan.notificationCallbacks = new Requestor(FLAG_RETURN_FALSE, 0);
   listener.expectedCode = 407; // Proxy Unauthorized
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 
   do_test_pending();
 }
 
 function test_proxy_wrongpw() {
   dump("\ntest: proxy wrongpw\n");
   var chan = makeChan();
   chan.notificationCallbacks = new Requestor(FLAG_WRONG_PASSWORD, 0);
   listener.expectedCode = 200; // Eventually OK
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
   do_test_pending();
 }
 
 function test_all_ok() {
   dump("\ntest: all ok\n");
   var chan = makeChan();
   chan.notificationCallbacks = new Requestor(0, 0);
   listener.expectedCode = 200; // OK
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
   do_test_pending();
 }
 
 function test_proxy_407_cookie() {
   var chan = makeChan();
   chan.notificationCallbacks = new Requestor(FLAG_RETURN_FALSE, 0);
   chan.setRequestHeader("X-Set-407-Cookie", "1", false);
   listener.expectedCode = 407; // Proxy Unauthorized
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 
   do_test_pending();
 }
 
 function test_proxy_200_cookie() {
   var chan = makeChan();
   chan.notificationCallbacks = new Requestor(0, 0);
   chan.setRequestHeader("X-Set-407-Cookie", "1", false);
   listener.expectedCode = 200; // OK
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
   do_test_pending();
 }
 
 function test_host_returnfalse() {
   dump("\ntest: host returnfalse\n");
   var chan = makeChan();
   chan.notificationCallbacks = new Requestor(0, FLAG_RETURN_FALSE);
   listener.expectedCode = 401; // Host Unauthorized
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 
   do_test_pending();
 }
 
 function test_host_wrongpw() {
   dump("\ntest: host wrongpw\n");
   var chan = makeChan();
   chan.notificationCallbacks = new Requestor(0, FLAG_WRONG_PASSWORD);
   listener.expectedCode = 200; // Eventually OK
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
   do_test_pending();
 }
 
 function test_proxy_wrongpw_host_wrongpw() {
   dump("\ntest: proxy wrongpw, host wrongpw\n");
   var chan = makeChan();
   chan.notificationCallbacks =
       new Requestor(FLAG_WRONG_PASSWORD, FLAG_WRONG_PASSWORD);
   listener.expectedCode = 200; // OK
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
   do_test_pending();
 }
 
 function test_proxy_wrongpw_host_returnfalse() {
   dump("\ntest: proxy wrongpw, host return false\n");
   var chan = makeChan();
   chan.notificationCallbacks =
       new Requestor(FLAG_WRONG_PASSWORD, FLAG_RETURN_FALSE);
   listener.expectedCode = 401; // Host Unauthorized
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
   do_test_pending();
 }
 
 var tests = [test_proxy_returnfalse, test_proxy_wrongpw, test_all_ok,
         test_proxy_407_cookie, test_proxy_200_cookie,
         test_host_returnfalse, test_host_wrongpw,
         test_proxy_wrongpw_host_wrongpw, test_proxy_wrongpw_host_returnfalse];
 
--- a/netwerk/test/unit/test_authentication.js
+++ b/netwerk/test/unit/test_authentication.js
@@ -346,127 +346,127 @@ function run_test() {
 
   tests[0]();
 }
 
 function test_noauth() {
   var chan = makeChan(URL + "/auth", URL);
 
   listener.expectedCode = 401; // Unauthorized
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 
   do_test_pending();
 }
 
 function test_returnfalse1() {
   var chan = makeChan(URL + "/auth", URL);
 
   chan.notificationCallbacks = new Requestor(FLAG_RETURN_FALSE, 1);
   listener.expectedCode = 401; // Unauthorized
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 
   do_test_pending();
 }
 
 function test_wrongpw1() {
   var chan = makeChan(URL + "/auth", URL);
 
   chan.notificationCallbacks = new Requestor(FLAG_WRONG_PASSWORD, 1);
   listener.expectedCode = 200; // OK
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 
   do_test_pending();
 }
 
 function test_prompt1() {
   var chan = makeChan(URL + "/auth", URL);
 
   chan.notificationCallbacks = new Requestor(0, 1);
   listener.expectedCode = 200; // OK
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 
   do_test_pending();
 }
 
 function test_prompt1CrossOrigin() {
   var chan = makeChan(URL + "/auth", "http://example.org");
 
   chan.notificationCallbacks = new Requestor(16, 1);
   listener.expectedCode = 200; // OK
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 
   do_test_pending();
 }
 
 function test_prompt2CrossOrigin() {
   var chan = makeChan(URL + "/auth", "http://example.org");
 
   chan.notificationCallbacks = new Requestor(16, 2);
   listener.expectedCode = 200; // OK
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 
   do_test_pending();
 }
 
 function test_returnfalse2() {
   var chan = makeChan(URL + "/auth", URL);
 
   chan.notificationCallbacks = new Requestor(FLAG_RETURN_FALSE, 2);
   listener.expectedCode = 401; // Unauthorized
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 
   do_test_pending();
 }
 
 function test_wrongpw2() {
   var chan = makeChan(URL + "/auth", URL);
 
   chan.notificationCallbacks = new Requestor(FLAG_WRONG_PASSWORD, 2);
   listener.expectedCode = 200; // OK
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 
   do_test_pending();
 }
 
 function test_prompt2() {
   var chan = makeChan(URL + "/auth", URL);
 
   chan.notificationCallbacks = new Requestor(0, 2);
   listener.expectedCode = 200; // OK
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 
   do_test_pending();
 }
 
 function test_ntlm() {
   var chan = makeChan(URL + "/auth/ntlm/simple", URL);
 
   chan.notificationCallbacks = new Requestor(FLAG_RETURN_FALSE, 2);
   listener.expectedCode = 401; // Unauthorized
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 
   do_test_pending();
 }
 
 function test_basicrealm() {
   var chan = makeChan(URL + "/auth/realm", URL);
 
   chan.notificationCallbacks = new RealmTestRequestor();
   listener.expectedCode = 401; // Unauthorized
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 
   do_test_pending();
 }
 
 function test_nonascii() {
   var chan = makeChan(URL + "/auth/non_ascii", URL);
 
   chan.notificationCallbacks = new Requestor(FLAG_NON_ASCII_USER_PASSWORD, 2);
   listener.expectedCode = 200; // OK
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 
   do_test_pending();
 }
 
 function test_nonascii_xhr() {
   var xhr = new XMLHttpRequest();
   xhr.open("GET", URL + "/auth/non_ascii", true, "é", "é");
   xhr.onreadystatechange = function(event) {
@@ -481,46 +481,46 @@ function test_nonascii_xhr() {
   do_test_pending();
 }
 
 function test_digest_noauth() {
   var chan = makeChan(URL + "/auth/digest", URL);
 
   //chan.notificationCallbacks = new Requestor(FLAG_RETURN_FALSE, 2);
   listener.expectedCode = 401; // Unauthorized
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 
   do_test_pending();
 }
 
 function test_digest() {
   var chan = makeChan(URL + "/auth/digest", URL);
 
   chan.notificationCallbacks = new Requestor(0, 2);
   listener.expectedCode = 200; // OK
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 
   do_test_pending();
 }
 
 function test_digest_bogus_user() {
   var chan = makeChan(URL + "/auth/digest", URL);
   chan.notificationCallbacks =  new Requestor(FLAG_BOGUS_USER, 2);
   listener.expectedCode = 401; // unauthorized
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 
   do_test_pending();
 }
 
 // Test header "WWW-Authenticate: Digest" - bug 1338876.
 function test_short_digest() {
   var chan = makeChan(URL + "/auth/short_digest", URL);
   chan.notificationCallbacks =  new Requestor(FLAG_NO_REALM, 2);
   listener.expectedCode = 401; // OK
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 
   do_test_pending();
 }
 
 // PATH HANDLERS
 
 // /auth
 function authHandler(metadata, response) {
@@ -720,21 +720,21 @@ function largeDomain(metadata, response)
   body = "need to authenticate";
   response.bodyOutputStream.write(body, body.length);
 }
 
 function test_large_realm() {
   var chan = makeChan(URL + "/largeRealm", URL);
 
   listener.expectedCode = 401; // Unauthorized
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 
   do_test_pending();
 }
 
 function test_large_domain() {
   var chan = makeChan(URL + "/largeDomain", URL);
 
   listener.expectedCode = 401; // Unauthorized
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 
   do_test_pending();
 }
--- a/netwerk/test/unit/test_bug1064258.js
+++ b/netwerk/test/unit/test_bug1064258.js
@@ -67,17 +67,17 @@ function run_test()
   do_test_pending();
 }
 
 function run_test_content1a()
 {
   var chan = make_channel(URL + "/content1");
   caching = chan.QueryInterface(Ci.nsICachingChannel);
   caching.cacheOnlyMetadata = true;
-  chan.asyncOpen2(new ChannelListener(contentListener1a, null));
+  chan.asyncOpen(new ChannelListener(contentListener1a, null));
 }
 
 function contentListener1a(request, buffer)
 {
   Assert.equal(buffer, responseBody1);
 
   asyncOpenCacheEntry(URL + "/content1", "disk", 0, null, cacheCheck1)
 }
@@ -91,17 +91,17 @@ function cacheCheck1(status, entry)
   }
   catch (ex) {
     do_throw("Missing response head");
   }
 
   var chan = make_channel(URL + "/content1");
   caching = chan.QueryInterface(Ci.nsICachingChannel);
   caching.cacheOnlyMetadata = true;
-  chan.asyncOpen2(new ChannelListener(contentListener1b, null, CL_IGNORE_CL));
+  chan.asyncOpen(new ChannelListener(contentListener1b, null, CL_IGNORE_CL));
 }
 
 function contentListener1b(request, buffer)
 {
   request.QueryInterface(Ci.nsIHttpChannel);
   Assert.equal(request.requestMethod, "GET");
   Assert.equal(request.responseStatus, 200);
   Assert.equal(request.getResponseHeader("Cache-control"), "max-age=999999");
@@ -112,17 +112,17 @@ function contentListener1b(request, buff
 
 // Now same set of steps but this time for an immediately expiring content.
 
 function run_test_content2a()
 {
   var chan = make_channel(URL + "/content2");
   caching = chan.QueryInterface(Ci.nsICachingChannel);
   caching.cacheOnlyMetadata = true;
-  chan.asyncOpen2(new ChannelListener(contentListener2a, null));
+  chan.asyncOpen(new ChannelListener(contentListener2a, null));
 }
 
 function contentListener2a(request, buffer)
 {
   Assert.equal(buffer, responseBody2a);
 
   asyncOpenCacheEntry(URL + "/content2", "disk", 0, null, cacheCheck2)
 }
@@ -137,17 +137,17 @@ function cacheCheck2(status, entry)
   }
   catch (ex) {
     do_throw("Missing response head");
   }
 
   var chan = make_channel(URL + "/content2");
   caching = chan.QueryInterface(Ci.nsICachingChannel);
   caching.cacheOnlyMetadata = true;
-  chan.asyncOpen2(new ChannelListener(contentListener2b, null));
+  chan.asyncOpen(new ChannelListener(contentListener2b, null));
 }
 
 function contentListener2b(request, buffer)
 {
   Assert.equal(buffer, responseBody2b);
 
   httpServer.stop(do_test_finished);
 }
--- a/netwerk/test/unit/test_bug1279246.js
+++ b/netwerk/test/unit/test_bug1279246.js
@@ -48,17 +48,17 @@ Listener.prototype = {
 
   onStopRequest: function(request, ctx, status) {
     if (pass == 0) {
       Assert.equal(this._buffer.length, responseLen);
       pass++;
 
       var channel = setupChannel();
       channel.loadFlags = Ci.nsIRequest.VALIDATE_NEVER;
-      channel.asyncOpen2(new Listener());
+      channel.asyncOpen(new Listener());
     } else {
       httpserver.stop(do_test_finished);
       prefs.setCharPref("network.http.accept-encoding", cePref);
     }
   }
 };
 
 var prefs;
@@ -72,17 +72,17 @@ function run_test() {
 
   // Disable rcwn to make cache behavior deterministic.
   prefs.setBoolPref("network.http.rcwn.enabled", false);
 
   httpserver.registerPathHandler(testUrl, handler);
   httpserver.start(-1);
 
   var channel = setupChannel();
-  channel.asyncOpen2(new Listener());
+  channel.asyncOpen(new Listener());
 
   do_test_pending();
 }
 
 function handler(metadata, response) {
   Assert.equal(pass, 0); // the second response must be server from the cache
 
   response.setStatusLine(metadata.httpVersion, 200, "OK");
--- a/netwerk/test/unit/test_bug1312774_http1.js
+++ b/netwerk/test/unit/test_bug1312774_http1.js
@@ -45,29 +45,29 @@ function serverStopListener() {
 }
 
 function commonHttpRequest(id) {
   let uri = baseURL;
   var chan = make_channel(uri);
   var listner = new HttpResponseListener(id);
   chan.setRequestHeader("X-ID", id, false);
   chan.setRequestHeader("Cache-control", "no-store", false);
-  chan.asyncOpen2(listner);
+  chan.asyncOpen(listner);
   log("Create common http request id=" + id);
 }
 
 function urgentStartHttpRequest(id) {
   let uri = baseURL;
   var chan = make_channel(uri);
   var listner = new HttpResponseListener(id);
   var cos = chan.QueryInterface(Ci.nsIClassOfService);
   cos.addClassFlags(Ci.nsIClassOfService.UrgentStart);
   chan.setRequestHeader("X-ID", id, false);
   chan.setRequestHeader("Cache-control", "no-store", false);
-  chan.asyncOpen2(listner);
+  chan.asyncOpen(listner);
   log("Create urgent-start http request id=" + id);
 }
 
 function setup_httpRequests() {
   log("setup_httpRequests");
   for (var i = 0; i < maxConnections ; i++) {
     commonHttpRequest(i);
     do_test_pending();
--- a/netwerk/test/unit/test_bug1312782_http1.js
+++ b/netwerk/test/unit/test_bug1312782_http1.js
@@ -55,17 +55,17 @@ function serverStopListener() {
 
 function createHttpRequest(windowId, requestId) {
   let uri = baseURL;
   var chan = make_channel(uri);
   chan.topLevelOuterContentWindowId = windowId;
   var listner = new HttpResponseListener(requestId);
   chan.setRequestHeader("X-ID", requestId, false);
   chan.setRequestHeader("Cache-control", "no-store", false);
-  chan.asyncOpen2(listner);
+  chan.asyncOpen(listner);
   log("Create http request id=" + requestId);
 }
 
 function setup_dummyHttpRequests() {
   log("setup_dummyHttpRequests");
   for (var i = 0; i < maxConnections ; i++) {
     createHttpRequest(0, i);
     do_test_pending();
--- a/netwerk/test/unit/test_bug1355539_http1.js
+++ b/netwerk/test/unit/test_bug1355539_http1.js
@@ -54,17 +54,17 @@ function createHttpRequest(requestId, pr
   var listner = new HttpResponseListener(requestId, callback);
   chan.setRequestHeader("X-ID", requestId, false);
   chan.setRequestHeader("Cache-control", "no-store", false);
   chan.QueryInterface(Ci.nsISupportsPriority).priority = priority;
   if (isBlocking) {
     var cos = chan.QueryInterface(Ci.nsIClassOfService);
     cos.addClassFlags(Ci.nsIClassOfService.Leader);
   }
-  chan.asyncOpen2(listner);
+  chan.asyncOpen(listner);
   log("Create http request id=" + requestId);
 }
 
 function setup_dummyHttpRequests(callback) {
   log("setup_dummyHttpRequests");
   for (var i = 0; i < maxConnections ; i++) {
     createHttpRequest(i, i, false, callback);
     do_test_pending();
--- a/netwerk/test/unit/test_bug1378385_http1.js
+++ b/netwerk/test/unit/test_bug1378385_http1.js
@@ -61,17 +61,17 @@ function serverStopListener() {
 function createHttpRequest(windowId, requestId, priority) {
   let uri = baseURL;
   var chan = make_channel(uri);
   chan.topLevelOuterContentWindowId = windowId;
   chan.QueryInterface(Ci.nsISupportsPriority).priority = priority;
   var listner = new HttpResponseListener(requestId);
   chan.setRequestHeader("X-ID", requestId, false);
   chan.setRequestHeader("Cache-control", "no-store", false);
-  chan.asyncOpen2(listner);
+  chan.asyncOpen(listner);
   log("Create http request id=" + requestId);
 }
 
 function setup_dummyHttpRequests() {
   log("setup_dummyHttpRequests");
   for (var i = 0; i < maxConnections ; i++) {
     createHttpRequest(0, i, Ci.nsISupportsPriority.PRIORITY_NORMAL);
     do_test_pending();
--- a/netwerk/test/unit/test_bug1411316_http1.js
+++ b/netwerk/test/unit/test_bug1411316_http1.js
@@ -43,17 +43,17 @@ function serverStopListener() {
 }
 
 function createHttpRequest(status) {
   let uri = baseURL;
   var chan = make_channel(uri);
   var listner = new HttpResponseListener(++requestId, status);
   chan.setRequestHeader("X-ID", requestId, false);
   chan.setRequestHeader("Cache-control", "no-store", false);
-  chan.asyncOpen2(listner);
+  chan.asyncOpen(listner);
   log("Create http request id=" + requestId);
 }
 
 function setupHttpRequests(status) {
   log("setupHttpRequests");
   for (var i = 0; i < maxConnections ; i++) {
     createHttpRequest(status);
     do_test_pending();
--- a/netwerk/test/unit/test_bug203271.js
+++ b/netwerk/test/unit/test_bug203271.js
@@ -102,17 +102,17 @@ function setupChannel(suffix, value) {
     var httpChan = chan.QueryInterface(Ci.nsIHttpChannel);
     httpChan.requestMethod = "GET"; // default value, just being paranoid...
     httpChan.setRequestHeader("x-request", value, false);
     return httpChan;
 }
 
 function triggerNextTest() {
     var channel = setupChannel(tests[index].url, tests[index].server);
-    channel.asyncOpen2(new ChannelListener(checkValueAndTrigger, channel));
+    channel.asyncOpen(new ChannelListener(checkValueAndTrigger, channel));
 }
 
 function checkValueAndTrigger(request, data, ctx) {
     logit(index, data, ctx);
     Assert.equal(tests[index].expected, data);
 
     if (index < tests.length - 1) {
         var delay = tests[index++].delay;
--- a/netwerk/test/unit/test_bug248970_cookie.js
+++ b/netwerk/test/unit/test_bug248970_cookie.js
@@ -17,17 +17,17 @@ function makeChan(path) {
     uri: "http://localhost:" + httpserver.identity.primaryPort + "/" + path,
     loadUsingSystemPrincipal: true
   }).QueryInterface(Ci.nsIHttpChannel);
 }
 
 function setup_chan(path, isPrivate, callback) {
   var chan = makeChan(path);
   chan.QueryInterface(Ci.nsIPrivateBrowsingChannel).setPrivate(isPrivate);
-  chan.asyncOpen2(new ChannelListener(callback));  
+  chan.asyncOpen(new ChannelListener(callback));  
  }
 
 function set_cookie(value, callback) {
   return setup_chan('set?cookie=' + value, false, callback);
 }
 
 function set_private_cookie(value, callback) {
   return setup_chan('set?cookie=' + value, true, callback);
--- a/netwerk/test/unit/test_bug263127.js
+++ b/netwerk/test/unit/test_bug263127.js
@@ -50,12 +50,12 @@ function run_test() {
   if (targetFile.exists())
     targetFile.remove(false);
 
   var downloader = Cc["@mozilla.org/network/downloader;1"]
                      .createInstance(Ci.nsIDownloader);
   downloader.init(listener, targetFile);
 
   // Start download
-  channel.asyncOpen2(downloader);
+  channel.asyncOpen(downloader);
 
   do_test_pending();
 }
--- a/netwerk/test/unit/test_bug282432.js
+++ b/netwerk/test/unit/test_bug282432.js
@@ -33,10 +33,10 @@ function run_test() {
 
   // This file does not exist.
   let file = do_get_file("_NOT_EXIST_.txt", true);
   Assert.ok(!file.exists());
   let channel = NetUtil.newChannel({
     uri: ios.newFileURI(file),
     loadUsingSystemPrincipal: true
   });
-  channel.asyncOpen2(listener);
+  channel.asyncOpen(listener);
 }
--- a/netwerk/test/unit/test_bug331825.js
+++ b/netwerk/test/unit/test_bug331825.js
@@ -26,17 +26,17 @@ function run_test() {
   // make request
   var channel = NetUtil.newChannel({
     uri: "http://localhost:" + server.identity.primaryPort + "/bug" + BUGID,
     loadUsingSystemPrincipal: true
   });
 
   channel.QueryInterface(Ci.nsIHttpChannel);
   channel.setRequestHeader("If-None-Match", "foobar", false);
-  channel.asyncOpen2(new TestListener());
+  channel.asyncOpen(new TestListener());
 
   do_test_pending();
 }
 
 // PATH HANDLER FOR /bug331825
 function bug331825(metadata, response) {
   response.setStatusLine(metadata.httpVersion, 304, "Not Modified");
 }
--- a/netwerk/test/unit/test_bug337744.js
+++ b/netwerk/test/unit/test_bug337744.js
@@ -36,28 +36,28 @@ function get_channel(spec)
   var channel = NetUtil.newChannel({
     uri: NetUtil.newURI(spec),
     loadingPrincipal: principal,
     securityFlags: Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
     contentPolicyType: Ci.nsIContentPolicy.TYPE_OTHER
   });
 
   try {
-    channel.asyncOpen2(null);
-    ok(false, "asyncOpen2() of URI: " + spec + "should throw");
+    channel.asyncOpen(null);
+    ok(false, "asyncOpen() of URI: " + spec + "should throw");
   }
   catch (e) {
     // make sure we get the right error code in the exception
     // ERROR code for NS_ERROR_DOM_BAD_URI is 1012
     equal(e.code, 1012);
   }
 
   try {
-    channel.open2();
-    ok(false, "Open2() of uri: " + spec + "should throw");
+    channel.open();
+    ok(false, "Open() of uri: " + spec + "should throw");
   }
   catch (e) {
     // make sure we get the right error code in the exception
     // ERROR code for NS_ERROR_DOM_BAD_URI is 1012
     equal(e.code, 1012);
   }
 
   return channel;
--- a/netwerk/test/unit/test_bug369787.js
+++ b/netwerk/test/unit/test_bug369787.js
@@ -55,17 +55,17 @@ function run_test() {
   server.start(-1);
 
   // make request
   channel = NetUtil.newChannel({
     uri: "http://localhost:" + server.identity.primaryPort + "/bug" + BUGID,
     loadUsingSystemPrincipal: true
   });
   channel.QueryInterface(Ci.nsIHttpChannel);
-  channel.asyncOpen2(new TestListener());
+  channel.asyncOpen(new TestListener());
 
   do_test_pending();
 }
 
 // PATH HANDLER FOR /bug369787
 function bug369787(metadata, response) {
   /* do nothing */
 }
--- a/netwerk/test/unit/test_bug401564.js
+++ b/netwerk/test/unit/test_bug401564.js
@@ -37,12 +37,12 @@ function run_test()
 
   var chan = NetUtil.newChannel({
     uri: "http://localhost:" + httpserver.identity.primaryPort + "/redirect",
     loadUsingSystemPrincipal: true
   });
   chan.QueryInterface(Ci.nsIHttpChannel);
   chan.setRequestHeader("Accept", acceptType, false);
 
-  chan.asyncOpen2(new ChannelListener(dummyHandler, null));
+  chan.asyncOpen(new ChannelListener(dummyHandler, null));
 
   do_test_pending();
 }
--- a/netwerk/test/unit/test_bug412945.js
+++ b/netwerk/test/unit/test_bug412945.js
@@ -23,17 +23,17 @@ function run_test() {
   // make request
   var channel = NetUtil.newChannel({
     uri: "http://localhost:" + httpserv.identity.primaryPort + "/bug412945",
     loadUsingSystemPrincipal: true
   });
 
   channel.QueryInterface(Ci.nsIHttpChannel);
   channel.requestMethod = "POST";
-  channel.asyncOpen2(new TestListener(), null);
+  channel.asyncOpen(new TestListener(), null);
 
   do_test_pending();
 }
 
 function bug412945(metadata, response) {
   if (!metadata.hasHeader("Content-Length") ||
       metadata.getHeader("Content-Length") != "0")
   {
--- a/netwerk/test/unit/test_bug455311.js
+++ b/netwerk/test/unit/test_bug455311.js
@@ -95,17 +95,17 @@ RequestObserver.prototype = {
 function test_cancel()
 {
   var chan = NetUtil.newChannel({
     uri: linkURI,
     loadUsingSystemPrincipal: true
   });
   Assert.equal(chan.URI, linkURI);
   Assert.equal(chan.originalURI, linkURI);
-  chan.asyncOpen2(new RequestObserver(linkURI, newURI, do_test_finished));
+  chan.asyncOpen(new RequestObserver(linkURI, newURI, do_test_finished));
   Assert.ok(chan.isPending());
   chan.cancel(Cr.NS_ERROR_ABORT);
   Assert.ok(chan.isPending());
 }
 
 function run_test()
 {
   if (mozinfo.os != "win" && mozinfo.os != "linux") {
@@ -118,11 +118,11 @@ function run_test()
   do_test_pending();
   var chan = NetUtil.newChannel({
     uri: linkURI,
     loadUsingSystemPrincipal: true
   });
   Assert.equal(chan.URI, linkURI);
   Assert.equal(chan.originalURI, linkURI);
   chan.notificationCallbacks = new NotificationCallbacks(linkURI, newURI);
-  chan.asyncOpen2(new RequestObserver(linkURI, newURI, test_cancel));
+  chan.asyncOpen(new RequestObserver(linkURI, newURI, test_cancel));
   Assert.ok(chan.isPending());
 }
--- a/netwerk/test/unit/test_bug468426.js
+++ b/netwerk/test/unit/test_bug468426.js
@@ -43,17 +43,17 @@ function setupChannel(suffix, value, coo
     httpChan.setRequestHeader("x-request", value, false);
     if (cookie != null)
         httpChan.setRequestHeader("Cookie", cookie, false);
     return httpChan;
 }
 
 function triggerNextTest() {
     var channel = setupChannel(tests[index].url, tests[index].server, tests[index].cookie);
-    channel.asyncOpen2(new ChannelListener(checkValueAndTrigger, null));
+    channel.asyncOpen(new ChannelListener(checkValueAndTrigger, null));
 }
 
 function checkValueAndTrigger(request, data, ctx) {
     Assert.equal(tests[index].expected, data);
 
     if (index < tests.length - 1) {
         index++;
         // This call happens in onStopRequest from the channel. Opening a new
--- a/netwerk/test/unit/test_bug468594.js
+++ b/netwerk/test/unit/test_bug468594.js
@@ -64,17 +64,17 @@ function setupChannel(suffix, value) {
     var httpChan = chan.QueryInterface(Ci.nsIHttpChannel);
     httpChan.requestMethod = "GET";
     httpChan.setRequestHeader("x-request", value, false);
     return httpChan;
 }
 
 function triggerNextTest() {
     var channel = setupChannel(tests[index].url, tests[index].server);
-    channel.asyncOpen2(new ChannelListener(checkValueAndTrigger, null));
+    channel.asyncOpen(new ChannelListener(checkValueAndTrigger, null));
 }
 
 function checkValueAndTrigger(request, data, ctx) {
     logit(index, data);
     Assert.equal(tests[index].expected, data);
 
     if (index < tests.length-1) {
         index++;
--- a/netwerk/test/unit/test_bug482601.js
+++ b/netwerk/test/unit/test_bug482601.js
@@ -100,17 +100,17 @@ function storeCache(aCacheEntry, aRespon
   aCacheEntry.close();
 }
 
 function test_nocache() {
   observers_called = "";
 
   var chan = makeChan("http://localhost:" + httpserv.identity.primaryPort +
                       "/bug482601/nocache");
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 }
 
 function test_partial() {
    asyncOpenCacheEntry("http://localhost:" + httpserv.identity.primaryPort +
                        "/bug482601/partial",
                        "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
                        test_partial2);
 }
@@ -126,17 +126,17 @@ function test_partial2(status, entry) {
              "Content-Length: 10\r\n" +
              "Content-Type: text/plain\r\n",
              "0123");
 
   observers_called = "";
 
   var chan = makeChan("http://localhost:" + httpserv.identity.primaryPort +
                       "/bug482601/partial");
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 }
 
 function test_cached() {
    asyncOpenCacheEntry("http://localhost:" + httpserv.identity.primaryPort +
                        "/bug482601/cached",
                        "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
                        test_cached2);
 }
@@ -153,17 +153,17 @@ function test_cached2(status, entry) {
              "Content-Type: text/plain\r\n",
              "0123456789");
 
   observers_called = "";
 
   var chan = makeChan("http://localhost:" + httpserv.identity.primaryPort +
                       "/bug482601/cached");
   chan.loadFlags = Ci.nsIRequest.VALIDATE_ALWAYS;
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 }
 
 function test_only_from_cache() {
    asyncOpenCacheEntry("http://localhost:" + httpserv.identity.primaryPort +
                        "/bug482601/only_from_cache",
                        "disk", Ci.nsICacheStorage.OPEN_NORMALLY, null,
                        test_only_from_cache2);
 }
@@ -180,17 +180,17 @@ function test_only_from_cache2(status, e
              "Content-Type: text/plain\r\n",
              "0123456789");
 
   observers_called = "";
 
   var chan = makeChan("http://localhost:" + httpserv.identity.primaryPort +
                       "/bug482601/only_from_cache");
   chan.loadFlags = Ci.nsICachingChannel.LOAD_ONLY_FROM_CACHE;
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 }
 
 
 // PATHS
 
 // /bug482601/nocache
 function bug482601_nocache(metadata, response) {
   response.setHeader("Content-Type", "text/plain", false);
--- a/netwerk/test/unit/test_bug482934.js
+++ b/netwerk/test/unit/test_bug482934.js
@@ -87,17 +87,17 @@ function run_test()
 //    server returns 304 -> client receives 304
 add_test(() => {
   response_code = "304";
   response_body = "";
   request_time = "Thu, 1 Jan 2009 00:00:00 GMT";
   response_time = "Thu, 1 Jan 2009 00:00:00 GMT";
 
   var ch = make_channel(resource_url);
-  ch.asyncOpen2(new ChannelListener(function(aRequest, aData) {
+  ch.asyncOpen(new ChannelListener(function(aRequest, aData) {
     Assert.ok(hit_server);
     Assert.equal(aRequest.QueryInterface(Ci.nsIHttpChannel).responseStatus, 304);
     Assert.ok(!cache_storage.exists(make_uri(resource_url), ""));
     Assert.equal(aRequest.getResponseHeader("Returned-From-Handler"), "1");
 
     run_next_test();
   }, null));
 });
@@ -106,17 +106,17 @@ add_test(() => {
 //    server returns 200 -> result is cached
 add_test(() => {
   response_code = "200";
   response_body = "content_body";
   request_time = "Thu, 1 Jan 2009 00:00:00 GMT";
   response_time = "Fri, 2 Jan 2009 00:00:00 GMT";
 
   var ch = make_channel(resource_url);
-  ch.asyncOpen2(new ChannelListener(function(aRequest, aData) {
+  ch.asyncOpen(new ChannelListener(function(aRequest, aData) {
     Assert.ok(hit_server);
     Assert.equal(aRequest.QueryInterface(Ci.nsIHttpChannel).responseStatus, 200);
     Assert.ok(cache_storage.exists(make_uri(resource_url), ""));
 
     check_cached_data(response_body, run_next_test);
   }, null));
 });
 
@@ -125,17 +125,17 @@ add_test(() => {
 add_test(() => {
   response_code = "304";
   var cached_body = response_body;
   response_body = "";
   request_time = "Fri, 2 Jan 2009 00:00:00 GMT";
   response_time = "Fri, 2 Jan 2009 00:00:00 GMT";
 
   var ch = make_channel(resource_url);
-  ch.asyncOpen2(new ChannelListener(function(aRequest, aData) {
+  ch.asyncOpen(new ChannelListener(function(aRequest, aData) {
     Assert.ok(hit_server);
     Assert.equal(aRequest.QueryInterface(Ci.nsIHttpChannel).responseStatus, 304);
     Assert.ok(cache_storage.exists(make_uri(resource_url), ""));
     Assert.equal(aRequest.getResponseHeader("Returned-From-Handler"), "1");
     Assert.equal(aData, "");
 
     // Check the cache data is not changed
     check_cached_data(cached_body, run_next_test);
@@ -145,17 +145,17 @@ add_test(() => {
 // 4. send custom conditional request when we have an entry
 //    server returns 200 -> result is cached
 add_test(() => {
   response_code = "200";
   response_body = "updated_content_body";
   request_time = "Fri, 2 Jan 2009 00:00:00 GMT";
   response_time = "Sat, 3 Jan 2009 00:00:00 GMT";
   var ch = make_channel(resource_url);
-  ch.asyncOpen2(new ChannelListener(function(aRequest, aData) {
+  ch.asyncOpen(new ChannelListener(function(aRequest, aData) {
     Assert.ok(hit_server);
     Assert.equal(aRequest.QueryInterface(Ci.nsIHttpChannel).responseStatus, 200);
     Assert.ok(cache_storage.exists(make_uri(resource_url), ""));
 
     // Check the cache data is updated
     check_cached_data(response_body, () => {
       run_next_test();
       httpserver.stop(do_test_finished);
--- a/netwerk/test/unit/test_bug490095.js
+++ b/netwerk/test/unit/test_bug490095.js
@@ -49,17 +49,17 @@ function setupChannel(suffix, value) {
     httpChan.setRequestHeader("x-request", value, false);
     return httpChan;
 }
 
 function triggerNextTest() {
     var test = tests[index];
     var channel = setupChannel(test.url, test.server);
     if (test.flags) channel.loadFlags = test.flags;
-    channel.asyncOpen2(new ChannelListener(checkValueAndTrigger, null));
+    channel.asyncOpen(new ChannelListener(checkValueAndTrigger, null));
 }
 
 function checkValueAndTrigger(request, data, ctx) {
     logit(index, data);
     Assert.equal(tests[index].expected, data);
 
     if (index < tests.length-1) {
         index++;
--- a/netwerk/test/unit/test_bug510359.js
+++ b/netwerk/test/unit/test_bug510359.js
@@ -17,17 +17,17 @@ function setupChannel(suffix, value) {
     httpChan.requestMethod = "GET";
     httpChan.setRequestHeader("x-request", value, false);
     httpChan.setRequestHeader("Cookie", "c="+value, false);
     return httpChan;
 }
 
 function triggerNextTest() {
     var channel = setupChannel(tests[index].url, tests[index].server);
-    channel.asyncOpen2(new ChannelListener(checkValueAndTrigger, null));
+    channel.asyncOpen(new ChannelListener(checkValueAndTrigger, null));
 }
 
 function checkValueAndTrigger(request, data, ctx) {
     Assert.equal(tests[index].expected, data);
 
     if (index < tests.length - 1) {
         index++;
         triggerNextTest();
--- a/netwerk/test/unit/test_bug528292.js
+++ b/netwerk/test/unit/test_bug528292.js
@@ -74,17 +74,17 @@ function run_test()
   // Set a cookie on one of the URIs.  It doesn't matter which one, since
   // they're both from the same host, which is enough for the cookie service
   // to send the cookie with both requests.
   var postRedirectURI = ioService.newURI(postRedirectURL);
   Cc["@mozilla.org/cookieService;1"].getService(Ci.nsICookieService).
     setCookieString(postRedirectURI, null, sentCookieVal, chan);
 
   // Load the pre-redirect URI.
-  chan.asyncOpen2(new ChannelListener(finish_test, null));
+  chan.asyncOpen(new ChannelListener(finish_test, null));
   do_test_pending();
 }
 
 function finish_test(event)
 {
   Assert.equal(receivedCookieVal, sentCookieVal);
   httpServer.stop(do_test_finished);
 }
--- a/netwerk/test/unit/test_bug536324_64bit_content_length.js
+++ b/netwerk/test/unit/test_bug536324_64bit_content_length.js
@@ -46,17 +46,17 @@ function hugeContentLength(metadata, res
   response.finish();
 }
 
 function test_hugeContentLength() {
   var chan = NetUtil.newChannel({
     uri: "http://localhost:" + httpServer.identity.primaryPort + "/",
     loadUsingSystemPrincipal: true
   }).QueryInterface(Ci.nsIHttpChannel);
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 }
 
 add_test(test_hugeContentLength);
 
 function run_test() {
   httpServer = new HttpServer();
   httpServer.registerPathHandler("/", hugeContentLength);
   httpServer.start(-1);
--- a/netwerk/test/unit/test_bug561042.js
+++ b/netwerk/test/unit/test_bug561042.js
@@ -34,11 +34,11 @@ function run_test() {
     server.start(SERVER_PORT);
     server.registerPathHandler('/', function(metadata, response) {
         response.setStatusLine(metadata.httpVersion, 200, "OK");
         response.setHeader("Set-Cookie", "BigCookie=" + cookie, false);
         response.write("Hello world");
     });
     var chan = NetUtil.newChannel({uri: baseURL, loadUsingSystemPrincipal: true})
                       .QueryInterface(Ci.nsIHttpChannel);
-    chan.asyncOpen2(listener);
+    chan.asyncOpen(listener);
     do_test_pending();
 }
--- a/netwerk/test/unit/test_bug561276.js
+++ b/netwerk/test/unit/test_bug561276.js
@@ -32,17 +32,17 @@ function run_test()
     httpserver.registerPathHandler("/redirect2", redirectHandler2);
     httpserver.start(-1);
 
     // clear cache
     evict_cache_entries();
 
     // load first time
     var channel = setupChannel("/redirect1");
-    channel.asyncOpen2(new ChannelListener(checkValueAndTrigger, null));
+    channel.asyncOpen(new ChannelListener(checkValueAndTrigger, null));
 
     do_test_pending();
 }
 
 function redirectHandler1(metadata, response)
 {
     // first time we return a cacheable 302 pointing to next redirect
 	if (iteration < 1) {
--- a/netwerk/test/unit/test_bug586908.js
+++ b/netwerk/test/unit/test_bug586908.js
@@ -50,17 +50,17 @@ function run_test() {
     "network.proxy.type",
     Ci.nsIProtocolProxyService.PROXYCONFIG_SYSTEM);
 
   // clear cache
   evict_cache_entries();
 
   var chan = makeChan("http://localhost:" + httpserv.identity.primaryPort +
                       "/target");
-  chan.asyncOpen2(new ChannelListener(checkValue, null));
+  chan.asyncOpen(new ChannelListener(checkValue, null));
 
   do_test_pending();
 }
 
 var called = false, failed = false;
 function redirect(metadata, response) {
   // If called second time, just return the PAC but set failed-flag
   if (called) {
--- a/netwerk/test/unit/test_bug596443.js
+++ b/netwerk/test/unit/test_bug596443.js
@@ -57,23 +57,23 @@ function run_test() {
 
     // make sure we have a profile so we can use the disk-cache
     do_get_profile();
 
     // clear cache
     evict_cache_entries();
 
     var ch0 = setupChannel("/bug596443", "Response0", Ci.nsIRequest.LOAD_BYPASS_CACHE);
-    ch0.asyncOpen2(new Listener("Response0"));
+    ch0.asyncOpen(new Listener("Response0"));
 
     var ch1 = setupChannel("/bug596443", "Response1", Ci.nsIRequest.LOAD_BYPASS_CACHE);
-    ch1.asyncOpen2(new Listener("Response1"));
+    ch1.asyncOpen(new Listener("Response1"));
 
     var ch2 = setupChannel("/bug596443", "Should not be used");
-    ch2.asyncOpen2(new Listener("Response1")); // Note param: we expect this to come from cache
+    ch2.asyncOpen(new Listener("Response1")); // Note param: we expect this to come from cache
 
     do_test_pending();
 }
 
 function triggerHandlers() {
     do_timeout(100, handlers[1]);
     do_timeout(100, handlers[0]);
 }
--- a/netwerk/test/unit/test_bug618835.js
+++ b/netwerk/test/unit/test_bug618835.js
@@ -26,46 +26,46 @@ function InitialListener() { }
 InitialListener.prototype = {
     onStartRequest: function(request, context) { },
     onStopRequest: function(request, context, status) {
         Assert.equal(1, numberOfCLHandlerCalls);
         executeSoon(function() {
             var channel = setupChannel("http://localhost:" +
                                        httpserv.identity.primaryPort + "/post");
             channel.requestMethod = "POST";
-            channel.asyncOpen2(new RedirectingListener());
+            channel.asyncOpen(new RedirectingListener());
         });
     }
 };
 
 // Verify that Location-URI has been loaded once, reload post_target
 function RedirectingListener() { }
 RedirectingListener.prototype = {
     onStartRequest: function(request, context) { },
     onStopRequest: function(request, context, status) {
         Assert.equal(1, numberOfHandlerCalls);
         executeSoon(function() {
             var channel = setupChannel("http://localhost:" +
                                        httpserv.identity.primaryPort + "/post");
             channel.requestMethod = "POST";
-            channel.asyncOpen2(new VerifyingListener());
+            channel.asyncOpen(new VerifyingListener());
         });
     }
 };
 
 // Verify that Location-URI has been loaded twice (cached entry invalidated),
 // reload Content-Location-URI
 function VerifyingListener() { }
 VerifyingListener.prototype = {
     onStartRequest: function(request, context) { },
     onStopRequest: function(request, context, status) {
         Assert.equal(2, numberOfHandlerCalls);
         var channel = setupChannel("http://localhost:" +
                                    httpserv.identity.primaryPort + "/cl");
-        channel.asyncOpen2(new FinalListener());
+        channel.asyncOpen(new FinalListener());
     }
 };
 
 // Verify that Location-URI has been loaded twice (cached entry invalidated),
 // stop test
 function FinalListener() { }
 FinalListener.prototype = {
     onStartRequest: function(request, context) { },
@@ -83,17 +83,17 @@ function run_test() {
   httpserv.start(-1);
 
   // Clear cache
   evict_cache_entries();
 
   // Load Content-Location URI into cache and start the chain of loads
   var channel = setupChannel("http://localhost:" +
                              httpserv.identity.primaryPort + "/cl");
-  channel.asyncOpen2(new InitialListener());
+  channel.asyncOpen(new InitialListener());
 
   do_test_pending();
 }
 
 var numberOfCLHandlerCalls = 0;
 function content_location(metadata, response) {
     numberOfCLHandlerCalls++;
     response.setStatusLine(metadata.httpVersion, 200, "Ok");
--- a/netwerk/test/unit/test_bug633743.js
+++ b/netwerk/test/unit/test_bug633743.js
@@ -53,17 +53,17 @@ Test.prototype = {
   run: function() {
     var channel = make_channel();
     channel.loadFlags = this._flags;
     channel.setRequestHeader(VALUE_HDR_NAME, this._sendVal, false);
     channel.setRequestHeader(VARY_HDR_NAME, this._varyHdr, false);
     if (this._cacheHdr)
         channel.setRequestHeader(CACHECTRL_HDR_NAME, this._cacheHdr, false);
 
-    channel.asyncOpen2(this);
+    channel.asyncOpen(this);
   }
 };
 
 var gTests = [
 // Test LOAD_FROM_CACHE: Load cache-entry
   new Test(Ci.nsIRequest.LOAD_NORMAL,
           "entity-initial", // hdr-value used to vary
           "request1", // echoed by handler
--- a/netwerk/test/unit/test_bug650995.js
+++ b/netwerk/test/unit/test_bug650995.js
@@ -86,41 +86,41 @@ function InitializeCacheDevices(memDevic
         prefService.setBoolPref("browser.cache.disk.enable", diskDevice);
         if (diskDevice) {
             cap = prefService.getIntPref("browser.cache.disk.capacity", 0);
             if (cap == 0) {
                 prefService.setIntPref("browser.cache.disk.capacity", 1024);
             }
         }
         var channel = setupChannel("/bug650995", "Initial value");
-        channel.asyncOpen2(new ChannelListener(nextTest, null));
+        channel.asyncOpen(new ChannelListener(nextTest, null));
     }
 }
 
 function TestCacheEntrySize(setSizeFunc, firstRequest, secondRequest, secondExpectedReply) {
 
     // Initially, this test used 10 bytes as the limit for caching entries.
     // Since we now use 1K granularity we have to extend lengths to be larger
     // than 1K if it is larger than 10
     if (firstRequest.length > 10)
         firstRequest = repeatToLargerThan1K(firstRequest);
     if (secondExpectedReply.length > 10)
         secondExpectedReply = repeatToLargerThan1K(secondExpectedReply);
 
     this.start = function() {
         setSizeFunc();
         var channel = setupChannel("/bug650995", firstRequest);
-        channel.asyncOpen2(new ChannelListener(this.initialLoad, this));
+        channel.asyncOpen(new ChannelListener(this.initialLoad, this));
     },
 
     this.initialLoad = function(request, data, ctx) {
         Assert.equal(firstRequest, data);
         var channel = setupChannel("/bug650995", secondRequest);
         executeSoon(function() {
-            channel.asyncOpen2(new ChannelListener(ctx.testAndTriggerNext, ctx));
+            channel.asyncOpen(new ChannelListener(ctx.testAndTriggerNext, ctx));
             });
     },
 
     this.testAndTriggerNext = function(request, data, ctx) {
         Assert.equal(secondExpectedReply, data);
         executeSoon(nextTest);
     }
 }
--- a/netwerk/test/unit/test_bug659569.js
+++ b/netwerk/test/unit/test_bug659569.js
@@ -26,17 +26,17 @@ function run_test()
     httpserver.registerPathHandler("/redirect2", redirectHandler2);
     httpserver.start(-1);
 
     // clear cache
     evict_cache_entries();
 
     // load first time
     var channel = setupChannel("/redirect1");
-    channel.asyncOpen2(new ChannelListener(checkValueAndTrigger, null));
+    channel.asyncOpen(new ChannelListener(checkValueAndTrigger, null));
     do_test_pending();
 }
 
 function redirectHandler1(metadata, response)
 {
 	if (!metadata.hasHeader("Cookie")) {
 	    response.setStatusLine(metadata.httpVersion, 302, "Found");
 	    response.setHeader("Cache-Control", "max-age=600", false);
--- a/netwerk/test/unit/test_bug667907.js
+++ b/netwerk/test/unit/test_bug667907.js
@@ -52,25 +52,25 @@ listener.prototype = listener_proto;
 function run_test()
 {
   httpserver = new HttpServer();
   httpserver.registerPathHandler(simplePath, simpleHandler);
   httpserver.registerPathHandler(normalPath, normalHandler);
   httpserver.start(-1);
 
   var channel = make_channel(uri1);
-  channel.asyncOpen2(new listener("text/plain", function() { run_test2();}));
+  channel.asyncOpen(new listener("text/plain", function() { run_test2();}));
 
   do_test_pending();
 }
 
 function run_test2()
 {
   var channel = make_channel(uri2);
-  channel.asyncOpen2(new listener("text/html", function() {
+  channel.asyncOpen(new listener("text/html", function() {
 	  httpserver.stop(do_test_finished);
   }));
 }
 
 function simpleHandler(metadata, response)
 {
   response.seizePower();
   response.bodyOutputStream.write(httpbody, httpbody.length);
--- a/netwerk/test/unit/test_bug669001.js
+++ b/netwerk/test/unit/test_bug669001.js
@@ -103,17 +103,17 @@ function nextTest()
   tests[0].prepare();
 
   dump("Testing with User-Agent: " + getUA() + "\n");
   var chan = make_channel(URI);
 
   // Give the old channel a chance to close the cache entry first.
   // XXX This is actually a race condition that might be considered a bug...
   executeSoon(function() {
-    chan.asyncOpen2(new ChannelListener(checkAndShiftTest, null));
+    chan.asyncOpen(new ChannelListener(checkAndShiftTest, null));
   });
 }
 
 function checkAndShiftTest(request, response)
 {
   tests[0].test(response);
 
   tests.shift();
--- a/netwerk/test/unit/test_bug770243.js
+++ b/netwerk/test/unit/test_bug770243.js
@@ -134,53 +134,53 @@ function sync_and_run_next_test()
     tests.shift()();
   });
 }
 
 var tests = [
   // Test 1: 200 (cacheable)
   function() {
     var ch = makeChan();
-    ch.asyncOpen2(new ChannelListener(function(req, body) {
+    ch.asyncOpen(new ChannelListener(function(req, body) {
       Assert.equal(body, "Response body 1");
       sync_and_run_next_test();
     }, null, CL_NOT_FROM_CACHE));
   },
 
   // Test 2: 401 and 200 + new content
   function() {
     var ch = makeChan();
-    ch.asyncOpen2(new ChannelListener(function(req, body) {
+    ch.asyncOpen(new ChannelListener(function(req, body) {
       Assert.equal(body, "Response body 2");
       sync_and_run_next_test();
     }, null, CL_NOT_FROM_CACHE));
   },
 
   // Test 3: 401 and 304
   function() {
     var ch = makeChan();
-    ch.asyncOpen2(new ChannelListener(function(req, body) {
+    ch.asyncOpen(new ChannelListener(function(req, body) {
       Assert.equal(body, "Response body 2");
       sync_and_run_next_test();
     }, null, CL_FROM_CACHE));
   },
 
   // Test 4: 407 and 200 + new content
   function() {
     var ch = makeChan();
-    ch.asyncOpen2(new ChannelListener(function(req, body) {
+    ch.asyncOpen(new ChannelListener(function(req, body) {
       Assert.equal(body, "Response body 3");
       sync_and_run_next_test();
     }, null, CL_NOT_FROM_CACHE));
   },
 
   // Test 5: 407 and 304
   function() {
     var ch = makeChan();
-    ch.asyncOpen2(new ChannelListener(function(req, body) {
+    ch.asyncOpen(new ChannelListener(function(req, body) {
       Assert.equal(body, "Response body 3");
       sync_and_run_next_test();
     }, null, CL_FROM_CACHE));
   },
 
   // End of test run
   function() {
     httpserv.stop(do_test_finished);
--- a/netwerk/test/unit/test_bug812167.js
+++ b/netwerk/test/unit/test_bug812167.js
@@ -65,17 +65,17 @@ function check_response(path, request, b
   asyncOpenCacheEntry(path, "disk", Ci.nsICacheStorage.OPEN_READONLY, null, function(status, entry) {
     Assert.equal(status, 0);
 
     // Expired entry is on disk, no-store entry is in memory
     Assert.equal(entry.persistent, expectedExpiration);
 
     // Do the request again and check the server handler is called appropriately
     var chan = make_channel(path);
-    chan.asyncOpen2(new ChannelListener(function(request, buffer) {
+    chan.asyncOpen(new ChannelListener(function(request, buffer) {
       Assert.equal(buffer, responseBody);
 
       if (expectedExpiration) {
         // Handler had to be called second time
         Assert.equal(redirectHandler_ExpiresInPast_calls, 2);
       }
       else {
         // Handler had to be called second time (no-store forces validate),
@@ -87,26 +87,26 @@ function check_response(path, request, b
       continuation();
     }, null));
   });
 }
 
 function run_test_no_store()
 {
   var chan = make_channel(randomURI1);
-  chan.asyncOpen2(new ChannelListener(function(request, buffer) {
+  chan.asyncOpen(new ChannelListener(function(request, buffer) {
     // Cache-control: no-store response should only be found in the memory cache.
     check_response(randomURI1, request, buffer, false, run_test_expires_past);
   }, null));
 }
 
 function run_test_expires_past()
 {
   var chan = make_channel(randomURI2);
-  chan.asyncOpen2(new ChannelListener(function(request, buffer) {
+  chan.asyncOpen(new ChannelListener(function(request, buffer) {
     // Expires: -1 response should not be found in any cache.
     check_response(randomURI2, request, buffer, true, finish_test);
   }, null));
 }
 
 function finish_test()
 {
   httpserver.stop(do_test_finished);
--- a/netwerk/test/unit/test_bug856978.js
+++ b/netwerk/test/unit/test_bug856978.js
@@ -112,24 +112,24 @@ function run_test() {
   httpServer.registerPathHandler(authPath, authHandler);
   httpServer.start(8888);
 
   tests[0]();
 }
 
 function startAuthHeaderTest() {
   var chan = makeChan(authCredsURL);
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 
   do_test_pending();
 }
 
 function removeAuthHeaderTest() {
   // After caching the auth credentials in the first test, lets try to remove
   // the authorization header now...
   requestObserver = new RequestObserver();
   var chan = makeChan(authURL);
   // Indicating that the request is coming from the second test.
   chan.setRequestHeader("Test", "1", false);
-  chan.asyncOpen2(listener);
+  chan.asyncOpen(listener);
 
   do_test_pending();
 }
--- a/netwerk/test/unit/test_bug894586.js
+++ b/netwerk/test/unit/test_bug894586.js
@@ -65,34 +65,28 @@ ProtocolHandler.prototype = {
   contentCharset: "UTF-8",
   get contentLength() {
     return -1;
   },
   set contentLength(val) {
     throw Components.Exception("Setting content length", NS_ERROR_NOT_IMPLEMENTED);
   },
   open: function() {
+    // throws an error if security checks fail
+    contentSecManager.performSecurityCheck(this, null);
+
     var file = do_get_file("test_bug894586.js", false);
     Assert.ok(file.exists());
     var url = Services.io.newFileURI(file);
-    return NetUtil.newChannel({uri: url, loadUsingSystemPrincipal: true}).open2();
-  },
-  open2: function() {
-    // throws an error if security checks fail
-    contentSecManager.performSecurityCheck(this, null);
-    return this.open();
+    return NetUtil.newChannel({uri: url, loadUsingSystemPrincipal: true}).open();
   },
   asyncOpen: function(aListener, aContext) {
     throw Components.Exception("Not implemented",
                                Cr.NS_ERROR_NOT_IMPLEMENTED);
   },
-  asyncOpen2: function(aListener, aContext) {
-    throw Components.Exception("Not implemented",
-                               Cr.NS_ERROR_NOT_IMPLEMENTED);
-  },
   contentDisposition: Ci.nsIChannel.DISPOSITION_INLINE,
   get contentDispositionFilename() {
     throw Components.Exception("No file name",
                                Cr.NS_ERROR_NOT_AVAILABLE);
   },
   get contentDispositionHeader() {
     throw Components.Exception("No header",
                                Cr.NS_ERROR_NOT_AVAILABLE);
--- a/netwerk/test/unit/test_cache-control_request.js
+++ b/netwerk/test/unit/test_cache-control_request.js
@@ -100,258 +100,258 @@ function run_test()
 // Here starts the list of tests