Fold
authorBenjamin Smedberg <benjamin@smedbergs.us>
Fri, 11 Jul 2008 15:03:39 -0400
changeset 151 02eb136bf089
parent 150 1c04169f4d45
child 152 4c630a56956e
push id30
push userbsmedberg@mozilla.com
push dateSun, 13 Jul 2008 14:45:31 +0000
Fold
nsRangeStore-okonstack
nsRangeStore-okonstack2
nsURIHashKey-okonstack
nsURIHashKey-okonstack2
series
xpcom-request-context2
xpcom-request-contexts
--- a/nsRangeStore-okonstack
+++ b/nsRangeStore-okonstack
@@ -1,8 +1,196 @@
+* * *
+
+diff --git a/editor/libeditor/base/nsSelectionState.cpp b/editor/libeditor/base/nsSelectionState.cpp
+--- a/editor/libeditor/base/nsSelectionState.cpp
++++ b/editor/libeditor/base/nsSelectionState.cpp
+@@ -273,9 +273,9 @@ nsRangeUpdater::SelAdjCreateNode(nsIDOMN
+     item = (nsRangeStore*)mArray.ElementAt(i);
+     if (!item) return NS_ERROR_NULL_POINTER;
+     
+-    if ((item->startNode.get() == aParent) && (item->startOffset > aPosition))
++    if ((item->startNode == aParent) && (item->startOffset > aPosition))
+       item->startOffset++;
+-    if ((item->endNode.get() == aParent) && (item->endOffset > aPosition))
++    if ((item->endNode == aParent) && (item->endOffset > aPosition))
+       item->endOffset++;
+   }
+   return NS_OK;
+@@ -309,9 +309,9 @@ nsRangeUpdater::SelAdjDeleteNode(nsIDOMN
+     item = (nsRangeStore*)mArray.ElementAt(i);
+     if (!item) return NS_ERROR_NULL_POINTER;
+     
+-    if ((item->startNode.get() == parent) && (item->startOffset > offset))
++    if ((item->startNode == parent) && (item->startOffset > offset))
+       item->startOffset--;
+-    if ((item->endNode.get() == parent) && (item->endOffset > offset))
++    if ((item->endNode == parent) && (item->endOffset > offset))
+       item->endOffset--;
+       
+     // check for range endpoints that are in aNode
+@@ -371,7 +371,7 @@ nsRangeUpdater::SelAdjSplitNode(nsIDOMNo
+     item = (nsRangeStore*)mArray.ElementAt(i);
+     if (!item) return NS_ERROR_NULL_POINTER;
+     
+-    if (item->startNode.get() == aOldRightNode)
++    if (item->startNode == aOldRightNode)
+     {
+       if (item->startOffset > aOffset)
+       {
+@@ -382,7 +382,7 @@ nsRangeUpdater::SelAdjSplitNode(nsIDOMNo
+         item->startNode = aNewLeftNode;
+       }
+     }
+-    if (item->endNode.get() == aOldRightNode)
++    if (item->endNode == aOldRightNode)
+     {
+       if (item->endOffset > aOffset)
+       {
+@@ -417,7 +417,7 @@ nsRangeUpdater::SelAdjJoinNodes(nsIDOMNo
+     item = (nsRangeStore*)mArray.ElementAt(i);
+     if (!item) return NS_ERROR_NULL_POINTER;
+     
+-    if (item->startNode.get() == aParent)
++    if (item->startNode == aParent)
+     {
+       // adjust start point in aParent
+       if (item->startOffset > aOffset)
+@@ -431,18 +431,18 @@ nsRangeUpdater::SelAdjJoinNodes(nsIDOMNo
+         item->startOffset = aOldLeftNodeLength;
+       }
+     }
+-    else if (item->startNode.get() == aRightNode)
++    else if (item->startNode == aRightNode)
+     {
+       // adjust start point in aRightNode
+       item->startOffset += aOldLeftNodeLength;
+     }
+-    else if (item->startNode.get() == aLeftNode)
++    else if (item->startNode == aLeftNode)
+     {
+       // adjust start point in aLeftNode
+       item->startNode = aRightNode;
+     }
+ 
+-    if (item->endNode.get() == aParent)
++    if (item->endNode == aParent)
+     {
+       // adjust end point in aParent
+       if (item->endOffset > aOffset)
+@@ -456,12 +456,12 @@ nsRangeUpdater::SelAdjJoinNodes(nsIDOMNo
+         item->endOffset = aOldLeftNodeLength;
+       }
+     }
+-    else if (item->endNode.get() == aRightNode)
++    else if (item->endNode == aRightNode)
+     {
+       // adjust end point in aRightNode
+        item->endOffset += aOldLeftNodeLength;
+     }
+-    else if (item->endNode.get() == aLeftNode)
++    else if (item->endNode == aLeftNode)
+     {
+       // adjust end point in aLeftNode
+       item->endNode = aRightNode;
+@@ -489,9 +489,9 @@ nsRangeUpdater::SelAdjInsertText(nsIDOMC
+     item = (nsRangeStore*)mArray.ElementAt(i);
+     if (!item) return NS_ERROR_NULL_POINTER;
+     
+-    if ((item->startNode.get() == node) && (item->startOffset > aOffset))
++    if ((item->startNode == node) && (item->startOffset > aOffset))
+       item->startOffset += len;
+-    if ((item->endNode.get() == node) && (item->endOffset > aOffset))
++    if ((item->endNode == node) && (item->endOffset > aOffset))
+       item->endOffset += len;
+   }
+   return NS_OK;
+@@ -514,12 +514,12 @@ nsRangeUpdater::SelAdjDeleteText(nsIDOMC
+     item = (nsRangeStore*)mArray.ElementAt(i);
+     if (!item) return NS_ERROR_NULL_POINTER;
+     
+-    if ((item->startNode.get() == node) && (item->startOffset > aOffset))
++    if ((item->startNode == node) && (item->startOffset > aOffset))
+     {
+       item->startOffset -= aLength;
+       if (item->startOffset < 0) item->startOffset = 0;
+     }
+-    if ((item->endNode.get() == node) && (item->endOffset > aOffset))
++    if ((item->endNode == node) && (item->endOffset > aOffset))
+     {
+       item->endOffset -= aLength;
+       if (item->endOffset < 0) item->endOffset = 0;
+@@ -555,9 +555,9 @@ nsRangeUpdater::DidReplaceContainer(nsID
+     item = (nsRangeStore*)mArray.ElementAt(i);
+     if (!item) return NS_ERROR_NULL_POINTER;
+     
+-    if (item->startNode.get() == aOriginalNode)
++    if (item->startNode == aOriginalNode)
+       item->startNode = aNewNode;
+-    if (item->endNode.get() == aOriginalNode)
++    if (item->endNode == aOriginalNode)
+       item->endNode = aNewNode;
+   }
+   return NS_OK;
+@@ -590,20 +590,20 @@ nsRangeUpdater::DidRemoveContainer(nsIDO
+     item = (nsRangeStore*)mArray.ElementAt(i);
+     if (!item) return NS_ERROR_NULL_POINTER;
+     
+-    if (item->startNode.get() == aNode)
++    if (item->startNode == aNode)
+     {
+       item->startNode = aParent;
+       item->startOffset += aOffset;
+     }
+-    else if ((item->startNode.get() == aParent) && (item->startOffset > aOffset))
++    else if ((item->startNode == aParent) && (item->startOffset > aOffset))
+       item->startOffset += (PRInt32)aNodeOrigLen-1;
+       
+-    if (item->endNode.get() == aNode)
++    if (item->endNode == aNode)
+     {
+       item->endNode = aParent;
+       item->endOffset += aOffset;
+     }
+-    else if ((item->endNode.get() == aParent) && (item->endOffset > aOffset))
++    else if ((item->endNode == aParent) && (item->endOffset > aOffset))
+       item->endOffset += (PRInt32)aNodeOrigLen-1;
+   }
+   return NS_OK;
+@@ -655,15 +655,15 @@ nsRangeUpdater::DidMoveNode(nsIDOMNode *
+     if (!item) return NS_ERROR_NULL_POINTER;
+     
+     // like a delete in aOldParent
+-    if ((item->startNode.get() == aOldParent) && (item->startOffset > aOldOffset))
++    if ((item->startNode == aOldParent) && (item->startOffset > aOldOffset))
+       item->startOffset--;
+-    if ((item->endNode.get() == aOldParent) && (item->endOffset > aOldOffset))
++    if ((item->endNode == aOldParent) && (item->endOffset > aOldOffset))
+       item->endOffset--;
+       
+     // and like an insert in aNewParent
+-    if ((item->startNode.get() == aNewParent) && (item->startOffset > aNewOffset))
++    if ((item->startNode == aNewParent) && (item->startOffset > aNewOffset))
+       item->startOffset++;
+-    if ((item->endNode.get() == aNewParent) && (item->endOffset > aNewOffset))
++    if ((item->endNode == aNewParent) && (item->endOffset > aNewOffset))
+       item->endOffset++;
+   }
+   return NS_OK;
+@@ -689,8 +689,8 @@ nsresult nsRangeStore::StoreRange(nsIDOM
+ nsresult nsRangeStore::StoreRange(nsIDOMRange *aRange)
+ {
+   if (!aRange) return NS_ERROR_NULL_POINTER;
+-  aRange->GetStartContainer(getter_AddRefs(startNode));
+-  aRange->GetEndContainer(getter_AddRefs(endNode));
++  aRange->GetStartContainer(&startNode);
++  aRange->GetEndContainer(&endNode);
+   aRange->GetStartOffset(&startOffset);
+   aRange->GetEndOffset(&endOffset);
+   return NS_OK;
 diff --git a/editor/libeditor/base/nsSelectionState.h b/editor/libeditor/base/nsSelectionState.h
 --- a/editor/libeditor/base/nsSelectionState.h
 +++ b/editor/libeditor/base/nsSelectionState.h
 @@ -53,16 +53,20 @@ class nsISelection;
   */
  
  // first a helper struct for saving/setting ranges
 -struct nsRangeStore 
deleted file mode 100644
--- a/nsRangeStore-okonstack2
+++ /dev/null
@@ -1,186 +0,0 @@
-diff --git a/editor/libeditor/base/nsSelectionState.cpp b/editor/libeditor/base/nsSelectionState.cpp
---- a/editor/libeditor/base/nsSelectionState.cpp
-+++ b/editor/libeditor/base/nsSelectionState.cpp
-@@ -273,9 +273,9 @@ nsRangeUpdater::SelAdjCreateNode(nsIDOMN
-     item = (nsRangeStore*)mArray.ElementAt(i);
-     if (!item) return NS_ERROR_NULL_POINTER;
-     
--    if ((item->startNode.get() == aParent) && (item->startOffset > aPosition))
-+    if ((item->startNode == aParent) && (item->startOffset > aPosition))
-       item->startOffset++;
--    if ((item->endNode.get() == aParent) && (item->endOffset > aPosition))
-+    if ((item->endNode == aParent) && (item->endOffset > aPosition))
-       item->endOffset++;
-   }
-   return NS_OK;
-@@ -309,9 +309,9 @@ nsRangeUpdater::SelAdjDeleteNode(nsIDOMN
-     item = (nsRangeStore*)mArray.ElementAt(i);
-     if (!item) return NS_ERROR_NULL_POINTER;
-     
--    if ((item->startNode.get() == parent) && (item->startOffset > offset))
-+    if ((item->startNode == parent) && (item->startOffset > offset))
-       item->startOffset--;
--    if ((item->endNode.get() == parent) && (item->endOffset > offset))
-+    if ((item->endNode == parent) && (item->endOffset > offset))
-       item->endOffset--;
-       
-     // check for range endpoints that are in aNode
-@@ -371,7 +371,7 @@ nsRangeUpdater::SelAdjSplitNode(nsIDOMNo
-     item = (nsRangeStore*)mArray.ElementAt(i);
-     if (!item) return NS_ERROR_NULL_POINTER;
-     
--    if (item->startNode.get() == aOldRightNode)
-+    if (item->startNode == aOldRightNode)
-     {
-       if (item->startOffset > aOffset)
-       {
-@@ -382,7 +382,7 @@ nsRangeUpdater::SelAdjSplitNode(nsIDOMNo
-         item->startNode = aNewLeftNode;
-       }
-     }
--    if (item->endNode.get() == aOldRightNode)
-+    if (item->endNode == aOldRightNode)
-     {
-       if (item->endOffset > aOffset)
-       {
-@@ -417,7 +417,7 @@ nsRangeUpdater::SelAdjJoinNodes(nsIDOMNo
-     item = (nsRangeStore*)mArray.ElementAt(i);
-     if (!item) return NS_ERROR_NULL_POINTER;
-     
--    if (item->startNode.get() == aParent)
-+    if (item->startNode == aParent)
-     {
-       // adjust start point in aParent
-       if (item->startOffset > aOffset)
-@@ -431,18 +431,18 @@ nsRangeUpdater::SelAdjJoinNodes(nsIDOMNo
-         item->startOffset = aOldLeftNodeLength;
-       }
-     }
--    else if (item->startNode.get() == aRightNode)
-+    else if (item->startNode == aRightNode)
-     {
-       // adjust start point in aRightNode
-       item->startOffset += aOldLeftNodeLength;
-     }
--    else if (item->startNode.get() == aLeftNode)
-+    else if (item->startNode == aLeftNode)
-     {
-       // adjust start point in aLeftNode
-       item->startNode = aRightNode;
-     }
- 
--    if (item->endNode.get() == aParent)
-+    if (item->endNode == aParent)
-     {
-       // adjust end point in aParent
-       if (item->endOffset > aOffset)
-@@ -456,12 +456,12 @@ nsRangeUpdater::SelAdjJoinNodes(nsIDOMNo
-         item->endOffset = aOldLeftNodeLength;
-       }
-     }
--    else if (item->endNode.get() == aRightNode)
-+    else if (item->endNode == aRightNode)
-     {
-       // adjust end point in aRightNode
-        item->endOffset += aOldLeftNodeLength;
-     }
--    else if (item->endNode.get() == aLeftNode)
-+    else if (item->endNode == aLeftNode)
-     {
-       // adjust end point in aLeftNode
-       item->endNode = aRightNode;
-@@ -489,9 +489,9 @@ nsRangeUpdater::SelAdjInsertText(nsIDOMC
-     item = (nsRangeStore*)mArray.ElementAt(i);
-     if (!item) return NS_ERROR_NULL_POINTER;
-     
--    if ((item->startNode.get() == node) && (item->startOffset > aOffset))
-+    if ((item->startNode == node) && (item->startOffset > aOffset))
-       item->startOffset += len;
--    if ((item->endNode.get() == node) && (item->endOffset > aOffset))
-+    if ((item->endNode == node) && (item->endOffset > aOffset))
-       item->endOffset += len;
-   }
-   return NS_OK;
-@@ -514,12 +514,12 @@ nsRangeUpdater::SelAdjDeleteText(nsIDOMC
-     item = (nsRangeStore*)mArray.ElementAt(i);
-     if (!item) return NS_ERROR_NULL_POINTER;
-     
--    if ((item->startNode.get() == node) && (item->startOffset > aOffset))
-+    if ((item->startNode == node) && (item->startOffset > aOffset))
-     {
-       item->startOffset -= aLength;
-       if (item->startOffset < 0) item->startOffset = 0;
-     }
--    if ((item->endNode.get() == node) && (item->endOffset > aOffset))
-+    if ((item->endNode == node) && (item->endOffset > aOffset))
-     {
-       item->endOffset -= aLength;
-       if (item->endOffset < 0) item->endOffset = 0;
-@@ -555,9 +555,9 @@ nsRangeUpdater::DidReplaceContainer(nsID
-     item = (nsRangeStore*)mArray.ElementAt(i);
-     if (!item) return NS_ERROR_NULL_POINTER;
-     
--    if (item->startNode.get() == aOriginalNode)
-+    if (item->startNode == aOriginalNode)
-       item->startNode = aNewNode;
--    if (item->endNode.get() == aOriginalNode)
-+    if (item->endNode == aOriginalNode)
-       item->endNode = aNewNode;
-   }
-   return NS_OK;
-@@ -590,20 +590,20 @@ nsRangeUpdater::DidRemoveContainer(nsIDO
-     item = (nsRangeStore*)mArray.ElementAt(i);
-     if (!item) return NS_ERROR_NULL_POINTER;
-     
--    if (item->startNode.get() == aNode)
-+    if (item->startNode == aNode)
-     {
-       item->startNode = aParent;
-       item->startOffset += aOffset;
-     }
--    else if ((item->startNode.get() == aParent) && (item->startOffset > aOffset))
-+    else if ((item->startNode == aParent) && (item->startOffset > aOffset))
-       item->startOffset += (PRInt32)aNodeOrigLen-1;
-       
--    if (item->endNode.get() == aNode)
-+    if (item->endNode == aNode)
-     {
-       item->endNode = aParent;
-       item->endOffset += aOffset;
-     }
--    else if ((item->endNode.get() == aParent) && (item->endOffset > aOffset))
-+    else if ((item->endNode == aParent) && (item->endOffset > aOffset))
-       item->endOffset += (PRInt32)aNodeOrigLen-1;
-   }
-   return NS_OK;
-@@ -655,15 +655,15 @@ nsRangeUpdater::DidMoveNode(nsIDOMNode *
-     if (!item) return NS_ERROR_NULL_POINTER;
-     
-     // like a delete in aOldParent
--    if ((item->startNode.get() == aOldParent) && (item->startOffset > aOldOffset))
-+    if ((item->startNode == aOldParent) && (item->startOffset > aOldOffset))
-       item->startOffset--;
--    if ((item->endNode.get() == aOldParent) && (item->endOffset > aOldOffset))
-+    if ((item->endNode == aOldParent) && (item->endOffset > aOldOffset))
-       item->endOffset--;
-       
-     // and like an insert in aNewParent
--    if ((item->startNode.get() == aNewParent) && (item->startOffset > aNewOffset))
-+    if ((item->startNode == aNewParent) && (item->startOffset > aNewOffset))
-       item->startOffset++;
--    if ((item->endNode.get() == aNewParent) && (item->endOffset > aNewOffset))
-+    if ((item->endNode == aNewParent) && (item->endOffset > aNewOffset))
-       item->endOffset++;
-   }
-   return NS_OK;
-@@ -689,8 +689,8 @@ nsresult nsRangeStore::StoreRange(nsIDOM
- nsresult nsRangeStore::StoreRange(nsIDOMRange *aRange)
- {
-   if (!aRange) return NS_ERROR_NULL_POINTER;
--  aRange->GetStartContainer(getter_AddRefs(startNode));
--  aRange->GetEndContainer(getter_AddRefs(endNode));
-+  aRange->GetStartContainer(&startNode);
-+  aRange->GetEndContainer(&endNode);
-   aRange->GetStartOffset(&startOffset);
-   aRange->GetEndOffset(&endOffset);
-   return NS_OK;
--- a/nsURIHashKey-okonstack
+++ b/nsURIHashKey-okonstack
@@ -1,27 +1,34 @@
+* * *
+
 diff --git a/layout/style/nsCSSLoader.h b/layout/style/nsCSSLoader.h
 --- a/layout/style/nsCSSLoader.h
 +++ b/layout/style/nsCSSLoader.h
-@@ -230,9 +230,13 @@ public:
+@@ -229,13 +229,17 @@ public:
                             const void *entryStore)
      : nsURIHashKey(aKey->mKey, entryStore), mPrincipal(aKey->mPrincipal)
    {
 +    NS_GetGC()->WriteBarrierTrap(entryStore, aKey->mPrincipal);
    }
 +
 +  // this constructor may only be called if the hashkey is allocated
 +  // on the stack!
    nsURIAndPrincipalHashKey(nsIURI* aURI, nsIPrincipal* aPrincipal)
 -    : nsURIHashKey(aURI, this), mPrincipal(aPrincipal)
 +    : nsURIHashKey(aURI, nsnull), mPrincipal(aPrincipal)
    {
    }
    nsURIAndPrincipalHashKey(const nsURIAndPrincipalHashKey& toCopy)
-@@ -273,7 +277,7 @@ public:
+-    : nsURIHashKey(toCopy)
++    : nsURIHashKey(toCopy), mPrincipal(toCopy.mPrincipal)
+   {
+     NS_NOTREACHED("This code doesn't work!");
+   }
+@@ -272,7 +276,7 @@ public:
    enum { ALLOW_MEMMOVE = PR_TRUE };
   
  protected:
 -  nsCOMPtr<nsIPrincipal> mPrincipal;
 +  nsIPrincipal *const mPrincipal;
  };
  
  /***********************************************************************
deleted file mode 100644
--- a/nsURIHashKey-okonstack2
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/layout/style/nsCSSLoader.h b/layout/style/nsCSSLoader.h
---- a/layout/style/nsCSSLoader.h
-+++ b/layout/style/nsCSSLoader.h
-@@ -239,7 +239,7 @@ public:
-   {
-   }
-   nsURIAndPrincipalHashKey(const nsURIAndPrincipalHashKey& toCopy)
--    : nsURIHashKey(toCopy)
-+    : nsURIHashKey(toCopy), mPrincipal(toCopy.mPrincipal)
-   {
-     NS_NOTREACHED("This code doesn't work!");
-   }
--- a/series
+++ b/series
@@ -187,16 +187,13 @@ nsTransitionKey-sucky-hack
 WalkState-okonstack
 nsMorkReader-stackclass
 LazyMessage-okonstack
 PendingLookup-constmembers
 nsProxiedService-stackclass
 nsNSSCertificate-nostack
 workaround-TestProxies-garburator-crash
 BookmarkImportFrame-notonstack
-nsURIHashKey-okonstack2
-nsRangeStore-okonstack2
-xpcom-request-context2
 empty-patch-before-automatic
 automatic-garburator
 automatic-gcobject
 automatic-remove-addrefs
 empty-patch-after-automatic
deleted file mode 100644
--- a/xpcom-request-context2
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git a/config/config.mk b/config/config.mk
---- a/config/config.mk
-+++ b/config/config.mk
-@@ -510,6 +510,8 @@ JAVA_DIST_DIR = $(DEPTH)/$(JAVA_GEN_DIR)
- JAVA_DIST_DIR = $(DEPTH)/$(JAVA_GEN_DIR)
- JAVA_IFACES_PKG_NAME = org/mozilla/interfaces
- 
-+REQUIRES += js
-+
- REQ_INCLUDES	= -I$(srcdir) -I. $(foreach d,$(REQUIRES),-I$(DIST)/include/$d) -I$(DIST)/include 
- ifdef LIBXUL_SDK
- REQ_INCLUDES_SDK = $(foreach d,$(REQUIRES),-I$(LIBXUL_SDK)/include/$d) -I$(LIBXUL_SDK)/include
--- a/xpcom-request-contexts
+++ b/xpcom-request-contexts
@@ -1,8 +1,22 @@
+* * *
+
+diff --git a/config/config.mk b/config/config.mk
+--- a/config/config.mk
++++ b/config/config.mk
+@@ -510,6 +510,8 @@ JAVA_DIST_DIR = $(DEPTH)/$(JAVA_GEN_DIR)
+ JAVA_DIST_DIR = $(DEPTH)/$(JAVA_GEN_DIR)
+ JAVA_IFACES_PKG_NAME = org/mozilla/interfaces
+ 
++REQUIRES += js
++
+ REQ_INCLUDES	= -I$(srcdir) -I. $(foreach d,$(REQUIRES),-I$(DIST)/include/$d) -I$(DIST)/include 
+ ifdef LIBXUL_SDK
+ REQ_INCLUDES_SDK = $(foreach d,$(REQUIRES),-I$(LIBXUL_SDK)/include/$d) -I$(LIBXUL_SDK)/include
 diff --git a/xpcom/base/nsTraceRefcntImpl.cpp b/xpcom/base/nsTraceRefcntImpl.cpp
 --- a/xpcom/base/nsTraceRefcntImpl.cpp
 +++ b/xpcom/base/nsTraceRefcntImpl.cpp
 @@ -50,6 +50,7 @@
  #include <math.h>
  #include "nsStackWalk.h"
  #include "nsXPCOMPrivate.h"
 +#include "nsXPCOMRequests.h"