Bug 1518863: Part 0 - Minor extension protocol handler cleanup. r=aswan, a=lizzard
authorKris Maglione <maglione.k@gmail.com>
Tue, 26 Feb 2019 12:58:55 -0800
changeset 516334 392c75fdaebbd9738e2fef7160169ae1e6df390c
parent 516333 e1652912e1d567f8ea49246ed6ee550920afe616
child 516335 29e17fe8593d1c8953e82e243767f0c0d9addad5
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaswan, lizzard
bugs1518863
milestone66.0
Bug 1518863: Part 0 - Minor extension protocol handler cleanup. r=aswan, a=lizzard 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
@@ -411,28 +411,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.
 
   bool haveLoadInfo = aLoadInfo;
   nsCOMPtr<nsIChannel> channel = NS_NewSimpleChannel(