Bug 1518863: Part 0 - Minor extension protocol handler cleanup. r=aswan
authorKris Maglione <maglione.k@gmail.com>
Tue, 26 Feb 2019 12:58:55 -0800
changeset 519742 00c8f747679c38145ed1f4f8eb11253dea0ba068
parent 519741 bea39e11e1a8d349ae8653e0ed2ba9ed4151e3cd
child 519743 1ea765143cded7a55ff89ba5302db2bb63aac068
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaswan
bugs1518863
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 1518863: Part 0 - Minor extension protocol handler cleanup. r=aswan These are trivial issues that I'd rather keep out of the main patch. Differential Revision: https://phabricator.services.mozilla.com/D21444
netwerk/protocol/res/ExtensionProtocolHandler.cpp
--- a/netwerk/protocol/res/ExtensionProtocolHandler.cpp
+++ b/netwerk/protocol/res/ExtensionProtocolHandler.cpp
@@ -418,28 +418,26 @@ Result<Ok, nsresult> ExtensionProtocolHa
   // Only unpacked resource files and JAR files are remoted.
   // No other moz-extension loads should be reading from the filesystem.
   return Ok();
 }
 
 nsresult ExtensionProtocolHandler::SubstituteChannel(nsIURI* aURI,
                                                      nsILoadInfo* aLoadInfo,
                                                      nsIChannel** result) {
-  nsresult rv;
-  nsCOMPtr<nsIURL> url = do_QueryInterface(aURI, &rv);
-  NS_ENSURE_SUCCESS(rv, rv);
-
   if (mUseRemoteFileChannels) {
     MOZ_TRY(SubstituteRemoteChannel(aURI, aLoadInfo, result));
   }
 
+  nsresult rv;
+  nsCOMPtr<nsIURL> url = do_QueryInterface(aURI, &rv);
+  MOZ_TRY(rv);
+
   nsAutoCString ext;
-  rv = url->GetFileExtension(ext);
-  NS_ENSURE_SUCCESS(rv, rv);
-
+  MOZ_TRY(url->GetFileExtension(ext));
   if (!ext.LowerCaseEqualsLiteral("css")) {
     return NS_OK;
   }
 
   // Filter CSS files to replace locale message tokens with localized strings.
 
   nsCOMPtr<nsIChannel> channel = NS_NewSimpleChannel(
       aURI, aLoadInfo, *result,