Bug 1004202 - Stop calling PrepareToStartLoad in nsDocumentViewer::LoadStart. r=smaug, a=lsblakk
authorMs2ger <ms2ger@gmail.com>
Sat, 03 May 2014 09:34:00 +0200
changeset 192200 c219fc2b4cc2
parent 192199 dfe6e2beb722
child 192201 5958a9259d6a
push id3519
push userryanvm@gmail.com
push date2014-05-05 16:58 +0000
treeherdermozilla-beta@c219fc2b4cc2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, lsblakk
bugs1004202, 968805
milestone30.0
Bug 1004202 - Stop calling PrepareToStartLoad in nsDocumentViewer::LoadStart. r=smaug, a=lsblakk Before bug 968805, none of the callers would reach this branch. The callers in nsContentDLF.cpp call LoadStart immediately after constructing the nsDocumentViewer, so they hit the !mDocument case, and the comparison was always false for the caller in nsHTMLDocument::Open, as it passed an nsIHTMLDocument pointer, so the nsISupports pointers being compared were always different. (XPCOM rules require SameCOMIdentity in this case, to avoid exactly this issue.) I tested that the removed code was never reached after a backout of bug 968805.
layout/base/nsDocumentViewer.cpp
--- a/layout/base/nsDocumentViewer.cpp
+++ b/layout/base/nsDocumentViewer.cpp
@@ -554,20 +554,16 @@ nsDocumentViewer::~nsDocumentViewer()
  */
 /* virtual */ void
 nsDocumentViewer::LoadStart(nsIDocument* aDocument)
 {
   MOZ_ASSERT(aDocument);
 
   if (!mDocument) {
     mDocument = aDocument;
-  } else if (mDocument == aDocument) {
-    // Reset the document viewer's state back to what it was
-    // when the document load started.
-    PrepareToStartLoad();
   }
 }
 
 nsresult
 nsDocumentViewer::SyncParentSubDocMap()
 {
   nsCOMPtr<nsIDocShellTreeItem> item(mContainer);
   nsCOMPtr<nsPIDOMWindow> pwin(do_GetInterface(item));