Bug 700659 - Slay nsHashSets in parser. r=hsivonen, smaug
authorNathan Froyd <froydnj@mozilla.com>
Tue, 08 Nov 2011 15:22:47 -0500
changeset 87745 0c9a34063fb209860c0928004b17b2f958ac456d
parent 87744 2651ff8e19e98b5484c4c833ebeb62f61bba271c
child 87746 71f16a6905eb68c40d7c167d42c115356b4246cc
push id22143
push userphilringnalda@gmail.com
push dateSun, 26 Feb 2012 23:12:35 +0000
treeherdermozilla-central@b98fc24ac54b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsivonen, smaug
bugs700659
milestone13.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 700659 - Slay nsHashSets in parser. r=hsivonen, smaug
parser/html/nsHtml5TreeOpExecutor.cpp
parser/html/nsHtml5TreeOpExecutor.h
--- a/parser/html/nsHtml5TreeOpExecutor.cpp
+++ b/parser/html/nsHtml5TreeOpExecutor.cpp
@@ -918,17 +918,17 @@ nsHtml5TreeOpExecutor::ConvertIfNotPrelo
     NS_WARNING("Failed to create a URI");
     return nsnull;
   }
   nsCAutoString spec;
   uri->GetSpec(spec);
   if (mPreloadedURLs.Contains(spec)) {
     return nsnull;
   }
-  mPreloadedURLs.Put(spec);
+  mPreloadedURLs.PutEntry(spec);
   return uri.forget();
 }
 
 void
 nsHtml5TreeOpExecutor::PreloadScript(const nsAString& aURL,
                                      const nsAString& aCharset,
                                      const nsAString& aType)
 {
--- a/parser/html/nsHtml5TreeOpExecutor.h
+++ b/parser/html/nsHtml5TreeOpExecutor.h
@@ -51,18 +51,19 @@
 #include "nsContentSink.h"
 #include "nsNodeInfoManager.h"
 #include "nsHtml5DocumentMode.h"
 #include "nsIScriptElement.h"
 #include "nsIParser.h"
 #include "nsCOMArray.h"
 #include "nsAHtml5TreeOpSink.h"
 #include "nsHtml5TreeOpStage.h"
-#include "nsHashSets.h"
 #include "nsIURI.h"
+#include "nsTHashtable.h"
+#include "nsHashKeys.h"
 
 class nsHtml5Parser;
 class nsHtml5TreeBuilder;
 class nsHtml5Tokenizer;
 class nsHtml5StreamParser;
 
 typedef nsIContent* nsIContentPtr;
 
@@ -103,17 +104,17 @@ class nsHtml5TreeOpExecutor : public nsC
     nsTArray<nsIContentPtr>              mElementsSeenInThisAppendBatch;
     nsTArray<nsHtml5PendingNotification> mPendingNotifications;
     nsHtml5StreamParser*                 mStreamParser;
     nsCOMArray<nsIContent>               mOwnedElements;
     
     /**
      * URLs already preloaded/preloading.
      */
-    nsCStringHashSet mPreloadedURLs;
+    nsTHashtable<nsCStringHashKey> mPreloadedURLs;
 
     nsCOMPtr<nsIURI> mSpeculationBaseURI;
 
     nsCOMPtr<nsIURI> mViewSourceBaseURI;
 
     /**
      * Whether the parser has started
      */