Bug 1550945 - Part 2, M-C part: Hook into nsNetUtil::NS_NewURI(). r=valentin a=aryx,npotb DONTBUILD
authorJorg K <jorgk@jorgk.com>
Wed, 29 May 2019 11:23:04 +0200
changeset 538763 537b6d1915e8d78f1da3112f0579d6101b6abda8
parent 538762 3a79d3be67486be1d30bda47988cf8c76ee3a3ee
child 538845 d78adc84bde8cb23a2e34c444d48406bd198c797
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvalentin, aryx, npotb
bugs1550945
milestone69.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 1550945 - Part 2, M-C part: Hook into nsNetUtil::NS_NewURI(). r=valentin a=aryx,npotb DONTBUILD
netwerk/base/nsNetUtil.cpp
--- a/netwerk/base/nsNetUtil.cpp
+++ b/netwerk/base/nsNetUtil.cpp
@@ -100,16 +100,20 @@
 #include "nsViewSourceHandler.h"
 #include "nsJARURI.h"
 #include "nsIconURI.h"
 #include "nsAboutProtocolHandler.h"
 #include "nsResProtocolHandler.h"
 #include "mozilla/net/ExtensionProtocolHandler.h"
 #include <limits>
 
+#if defined(MOZ_THUNDERBIRD) || defined(MOZ_SUITE)
+#  include "nsNewMailnewsURI.h"
+#endif
+
 using namespace mozilla;
 using namespace mozilla::net;
 using mozilla::dom::BlobURLProtocolHandler;
 using mozilla::dom::ClientInfo;
 using mozilla::dom::PerformanceStorage;
 using mozilla::dom::ServiceWorkerDescriptor;
 
 #define MAX_RECURSION_COUNT 50
@@ -1874,16 +1878,20 @@ nsresult NS_NewURI(nsIURI** aURI, const 
       MOZ_DIAGNOSTIC_ASSERT(newScheme == scheme);
     }
 
     return NS_MutateURI(new nsSimpleURI::Mutator())
         .SetSpec(newSpec)
         .Finalize(aURI);
   }
 
+#if defined(MOZ_THUNDERBIRD) || defined(MOZ_SUITE)
+  return NS_NewMailnewsURI(aURI, aSpec, aCharset, aBaseURI, aIOService);
+#endif
+
   // Falls back to external protocol handler.
   return NS_MutateURI(new nsSimpleURI::Mutator()).SetSpec(aSpec).Finalize(aURI);
 }
 
 nsresult NS_GetSanitizedURIStringFromURI(nsIURI* aUri,
                                          nsAString& aSanitizedSpec) {
   aSanitizedSpec.Truncate();