Bug 1629866 - Set the srcdoc to a void string if INTERNAL_LOAD_FLAGS_IS_SRCDOC is set, to appease assertion in DocumentChannelChild::RecvRedirectToRealChannel. r=mattwoodrow
authorPeter Van der Beken <peterv@propagandism.org>
Tue, 19 May 2020 20:11:44 +0000
changeset 530883 78efea3a8998a3def8baa9c9435befbbbc11173a
parent 530882 26ed03b47566a439290598ca635c0d25e513062a
child 530884 60d5e1d6b152b6a24c8faa7ca13bfe41fdfc5b13
push id37433
push userdluca@mozilla.com
push dateWed, 20 May 2020 03:39:31 +0000
treeherdermozilla-central@855249e545c3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1629866, 1598523
milestone78.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 1629866 - Set the srcdoc to a void string if INTERNAL_LOAD_FLAGS_IS_SRCDOC is set, to appease assertion in DocumentChannelChild::RecvRedirectToRealChannel. r=mattwoodrow Bug 1598523 added an assertion that if INTERNAL_LOAD_FLAGS_IS_SRCDOC is not set in a load state's load flags, then the srcdoc must be a void string. nsDocShell::Reload never set srcdoc to a void string in that case, and wasn't fixed up. Differential Revision: https://phabricator.services.mozilla.com/D75908
docshell/base/nsDocShell.cpp
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -3952,16 +3952,18 @@ nsDocShell::Reload(uint32_t aReloadFlags
 
     nsAutoString contentTypeHint;
     doc->GetContentType(contentTypeHint);
 
     if (doc->IsSrcdocDocument()) {
       doc->GetSrcdocData(srcdoc);
       flags |= INTERNAL_LOAD_FLAGS_IS_SRCDOC;
       baseURI = doc->GetBaseURI();
+    } else {
+      srcdoc = VoidString();
     }
     nsCOMPtr<nsIChannel> chan = doc->GetChannel();
     if (chan) {
       uint32_t loadFlags;
       chan->GetLoadFlags(&loadFlags);
       loadReplace = loadFlags & nsIChannel::LOAD_REPLACE;
       nsCOMPtr<nsIHttpChannel> httpChan(do_QueryInterface(chan));
       if (httpChan) {