Title: [194222] trunk/Source/WebCore

Diff

Modified: trunk/Source/WebCore/ChangeLog (194221 => 194222)


--- trunk/Source/WebCore/ChangeLog	2015-12-17 19:42:04 UTC (rev 194221)
+++ trunk/Source/WebCore/ChangeLog	2015-12-17 19:52:25 UTC (rev 194222)
@@ -1,3 +1,17 @@
+2015-12-17  Commit Queue  <[email protected]>
+
+        Unreviewed, rolling out r194201.
+        https://bugs.webkit.org/show_bug.cgi?id=152391
+
+        Caused crashes with GuardMalloc (Requested by ap|away on
+        #webkit).
+
+        Reverted changeset:
+
+        "Reduce PassRefPtr uses in dom - 2"
+        https://bugs.webkit.org/show_bug.cgi?id=151936
+        http://trac.webkit.org/changeset/194201
+
 2015-12-17  Csaba Osztrogonác  <[email protected]>
 
         Fix unused parameter handling in WebGLRenderingContextBase.cp

Modified: trunk/Source/WebCore/dom/Document.cpp (194221 => 194222)


--- trunk/Source/WebCore/dom/Document.cpp	2015-12-17 19:42:04 UTC (rev 194221)
+++ trunk/Source/WebCore/dom/Document.cpp	2015-12-17 19:52:25 UTC (rev 194222)
@@ -1748,7 +1748,7 @@
         ec = TypeError;
         return nullptr;
     }
-    return TreeWalker::create(*root, whatToShow, WTF::move(filter));
+    return TreeWalker::create(root, whatToShow, WTF::move(filter));
 }
 
 RefPtr<TreeWalker> Document::createTreeWalker(Node* root, unsigned long whatToShow, ExceptionCode& ec)

Modified: trunk/Source/WebCore/dom/NamedFlowCollection.cpp (194221 => 194222)


--- trunk/Source/WebCore/dom/NamedFlowCollection.cpp	2015-12-17 19:42:04 UTC (rev 194221)
+++ trunk/Source/WebCore/dom/NamedFlowCollection.cpp	2015-12-17 19:52:25 UTC (rev 194222)
@@ -76,7 +76,7 @@
         return *namedFlow;
     }
 
-    RefPtr<WebKitNamedFlow> newFlow = WebKitNamedFlow::create(*this, flowName);
+    RefPtr<WebKitNamedFlow> newFlow = WebKitNamedFlow::create(this, flowName);
     m_namedFlows.add(newFlow.get());
 
     InspectorInstrumentation::didCreateNamedFlow(document(), *newFlow);

Modified: trunk/Source/WebCore/dom/NodeIterator.cpp (194221 => 194222)


--- trunk/Source/WebCore/dom/NodeIterator.cpp	2015-12-17 19:42:04 UTC (rev 194221)
+++ trunk/Source/WebCore/dom/NodeIterator.cpp	2015-12-17 19:52:25 UTC (rev 194222)
@@ -77,7 +77,7 @@
 }
 
 NodeIterator::NodeIterator(PassRefPtr<Node> rootNode, unsigned long whatToShow, RefPtr<NodeFilter>&& filter)
-    : NodeIteratorBase(*rootNode, whatToShow, WTF::move(filter))
+    : NodeIteratorBase(rootNode, whatToShow, WTF::move(filter))
     , m_referenceNode(root(), true)
 {
     root()->document().attachNodeIterator(this);

Modified: trunk/Source/WebCore/dom/ScopedEventQueue.h (194221 => 194222)


--- trunk/Source/WebCore/dom/ScopedEventQueue.h	2015-12-17 19:42:04 UTC (rev 194221)
+++ trunk/Source/WebCore/dom/ScopedEventQueue.h	2015-12-17 19:52:25 UTC (rev 194222)
@@ -33,6 +33,7 @@
 
 #include <wtf/NeverDestroyed.h>
 #include <wtf/Noncopyable.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
 #include <wtf/Vector.h>
 

Modified: trunk/Source/WebCore/dom/StaticNodeList.h (194221 => 194222)


--- trunk/Source/WebCore/dom/StaticNodeList.h	2015-12-17 19:42:04 UTC (rev 194221)
+++ trunk/Source/WebCore/dom/StaticNodeList.h	2015-12-17 19:52:25 UTC (rev 194222)
@@ -62,11 +62,11 @@
 
 class StaticElementList final : public NodeList {
 public:
-    static Ref<StaticElementList> adopt(Vector<Ref<Element>>& elements)
+    static PassRefPtr<StaticElementList> adopt(Vector<Ref<Element>>& elements)
     {
-        Ref<StaticElementList> nodeList = adoptRef(*new StaticElementList);
+        RefPtr<StaticElementList> nodeList = adoptRef(new StaticElementList);
         nodeList->m_elements.swap(elements);
-        return nodeList;
+        return nodeList.release();
     }
 
     static Ref<StaticElementList> createEmpty()

Modified: trunk/Source/WebCore/dom/Traversal.cpp (194221 => 194222)


--- trunk/Source/WebCore/dom/Traversal.cpp	2015-12-17 19:42:04 UTC (rev 194221)
+++ trunk/Source/WebCore/dom/Traversal.cpp	2015-12-17 19:52:25 UTC (rev 194222)
@@ -30,7 +30,7 @@
 
 namespace WebCore {
 
-NodeIteratorBase::NodeIteratorBase(Node& rootNode, unsigned long whatToShow, RefPtr<NodeFilter>&& nodeFilter)
+NodeIteratorBase::NodeIteratorBase(PassRefPtr<Node> rootNode, unsigned long whatToShow, RefPtr<NodeFilter>&& nodeFilter)
     : m_root(rootNode)
     , m_whatToShow(whatToShow)
     , m_filter(WTF::move(nodeFilter))

Modified: trunk/Source/WebCore/dom/Traversal.h (194221 => 194222)


--- trunk/Source/WebCore/dom/Traversal.h	2015-12-17 19:42:04 UTC (rev 194221)
+++ trunk/Source/WebCore/dom/Traversal.h	2015-12-17 19:52:25 UTC (rev 194222)
@@ -35,17 +35,17 @@
 
     class NodeIteratorBase {
     public:
-        Node* root() const { return &m_root; }
+        Node* root() const { return m_root.get(); }
         unsigned long whatToShow() const { return m_whatToShow; }
         NodeFilter* filter() const { return m_filter.get(); }
         bool expandEntityReferences() const { return false; }
 
     protected:
-        NodeIteratorBase(Node&, unsigned long whatToShow, RefPtr<NodeFilter>&&);
+        NodeIteratorBase(PassRefPtr<Node>, unsigned long whatToShow, RefPtr<NodeFilter>&&);
         short acceptNode(Node*) const;
 
     private:
-        Node& m_root;
+        RefPtr<Node> m_root;
         unsigned long m_whatToShow;
         RefPtr<NodeFilter> m_filter;
     };

Modified: trunk/Source/WebCore/dom/TreeWalker.cpp (194221 => 194222)


--- trunk/Source/WebCore/dom/TreeWalker.cpp	2015-12-17 19:42:04 UTC (rev 194221)
+++ trunk/Source/WebCore/dom/TreeWalker.cpp	2015-12-17 19:52:25 UTC (rev 194222)
@@ -33,13 +33,13 @@
 
 namespace WebCore {
 
-TreeWalker::TreeWalker(Node& rootNode, unsigned long whatToShow, RefPtr<NodeFilter>&& filter)
+TreeWalker::TreeWalker(PassRefPtr<Node> rootNode, unsigned long whatToShow, RefPtr<NodeFilter>&& filter)
     : NodeIteratorBase(rootNode, whatToShow, WTF::move(filter))
     , m_current(root())
 {
 }
 
-void TreeWalker::setCurrentNode(Node* node, ExceptionCode& ec)
+void TreeWalker::setCurrentNode(PassRefPtr<Node> node, ExceptionCode& ec)
 {
     if (!node) {
         ec = NOT_SUPPORTED_ERR;

Modified: trunk/Source/WebCore/dom/TreeWalker.h (194221 => 194222)


--- trunk/Source/WebCore/dom/TreeWalker.h	2015-12-17 19:42:04 UTC (rev 194221)
+++ trunk/Source/WebCore/dom/TreeWalker.h	2015-12-17 19:52:25 UTC (rev 194222)
@@ -37,13 +37,13 @@
 
     class TreeWalker : public ScriptWrappable, public RefCounted<TreeWalker>, public NodeIteratorBase {
     public:
-        static Ref<TreeWalker> create(Node& rootNode, unsigned long whatToShow, RefPtr<NodeFilter>&& filter)
+        static Ref<TreeWalker> create(PassRefPtr<Node> rootNode, unsigned long whatToShow, RefPtr<NodeFilter>&& filter)
         {
             return adoptRef(*new TreeWalker(rootNode, whatToShow, WTF::move(filter)));
         }                            
 
         Node* currentNode() const { return m_current.get(); }
-        void setCurrentNode(Node*, ExceptionCode&);
+        void setCurrentNode(PassRefPtr<Node>, ExceptionCode&);
 
         Node* parentNode();
         Node* firstChild();
@@ -54,7 +54,7 @@
         Node* nextNode();
 
     private:
-        TreeWalker(Node&, unsigned long whatToShow, RefPtr<NodeFilter>&&);
+        TreeWalker(PassRefPtr<Node>, unsigned long whatToShow, RefPtr<NodeFilter>&&);
         enum class SiblingTraversalType { Previous, Next };
         template<SiblingTraversalType> Node* traverseSiblings();
         

Modified: trunk/Source/WebCore/dom/UserActionElementSet.h (194221 => 194222)


--- trunk/Source/WebCore/dom/UserActionElementSet.h	2015-12-17 19:42:04 UTC (rev 194221)
+++ trunk/Source/WebCore/dom/UserActionElementSet.h	2015-12-17 19:52:25 UTC (rev 194222)
@@ -29,6 +29,7 @@
 #define UserActionElementSet_h
 
 #include <wtf/HashMap.h>
+#include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
 
 namespace WebCore {

Modified: trunk/Source/WebCore/dom/WebKitNamedFlow.cpp (194221 => 194222)


--- trunk/Source/WebCore/dom/WebKitNamedFlow.cpp	2015-12-17 19:42:04 UTC (rev 194221)
+++ trunk/Source/WebCore/dom/WebKitNamedFlow.cpp	2015-12-17 19:52:25 UTC (rev 194222)
@@ -39,7 +39,7 @@
 
 namespace WebCore {
 
-WebKitNamedFlow::WebKitNamedFlow(NamedFlowCollection& manager, const AtomicString& flowThreadName)
+WebKitNamedFlow::WebKitNamedFlow(PassRefPtr<NamedFlowCollection> manager, const AtomicString& flowThreadName)
     : m_flowThreadName(flowThreadName)
     , m_flowManager(manager)
     , m_parentFlowThread(nullptr)
@@ -49,10 +49,10 @@
 WebKitNamedFlow::~WebKitNamedFlow()
 {
     // The named flow is not "strong" referenced from anywhere at this time so it shouldn't be reused if the named flow is recreated.
-    m_flowManager.discardNamedFlow(this);
+    m_flowManager->discardNamedFlow(this);
 }
 
-Ref<WebKitNamedFlow> WebKitNamedFlow::create(NamedFlowCollection& manager, const AtomicString& flowThreadName)
+Ref<WebKitNamedFlow> WebKitNamedFlow::create(PassRefPtr<NamedFlowCollection> manager, const AtomicString& flowThreadName)
 {
     return adoptRef(*new WebKitNamedFlow(manager, flowThreadName));
 }
@@ -64,8 +64,8 @@
 
 bool WebKitNamedFlow::overset() const
 {
-    if (m_flowManager.document())
-        m_flowManager.document()->updateLayoutIgnorePendingStylesheets();
+    if (m_flowManager->document())
+        m_flowManager->document()->updateLayoutIgnorePendingStylesheets();
 
     // The renderer may be destroyed or created after the style update.
     // Because this is called from JS, where the wrapper keeps a reference to the NamedFlow, no guard is necessary.
@@ -92,8 +92,8 @@
 
 int WebKitNamedFlow::firstEmptyRegionIndex() const
 {
-    if (m_flowManager.document())
-        m_flowManager.document()->updateLayoutIgnorePendingStylesheets();
+    if (m_flowManager->document())
+        m_flowManager->document()->updateLayoutIgnorePendingStylesheets();
 
     if (!m_parentFlowThread)
         return -1;
@@ -117,13 +117,13 @@
     return -1;
 }
 
-Ref<NodeList> WebKitNamedFlow::getRegionsByContent(Node* contentNode)
+PassRefPtr<NodeList> WebKitNamedFlow::getRegionsByContent(Node* contentNode)
 {
     if (!contentNode)
         return StaticElementList::createEmpty();
 
-    if (m_flowManager.document())
-        m_flowManager.document()->updateLayoutIgnorePendingStylesheets();
+    if (m_flowManager->document())
+        m_flowManager->document()->updateLayoutIgnorePendingStylesheets();
 
     // The renderer may be destroyed or created after the style update.
     // Because this is called from JS, where the wrapper keeps a reference to the NamedFlow, no guard is necessary.
@@ -151,10 +151,10 @@
     return StaticElementList::adopt(regionElements);
 }
 
-Ref<NodeList> WebKitNamedFlow::getRegions()
+PassRefPtr<NodeList> WebKitNamedFlow::getRegions()
 {
-    if (m_flowManager.document())
-        m_flowManager.document()->updateLayoutIgnorePendingStylesheets();
+    if (m_flowManager->document())
+        m_flowManager->document()->updateLayoutIgnorePendingStylesheets();
 
     // The renderer may be destroyed or created after the style update.
     // Because this is called from JS, where the wrapper keeps a reference to the NamedFlow, no guard is necessary.
@@ -178,10 +178,10 @@
     return StaticElementList::adopt(regionElements);
 }
 
-Ref<NodeList> WebKitNamedFlow::getContent()
+PassRefPtr<NodeList> WebKitNamedFlow::getContent()
 {
-    if (m_flowManager.document())
-        m_flowManager.document()->updateLayoutIgnorePendingStylesheets();
+    if (m_flowManager->document())
+        m_flowManager->document()->updateLayoutIgnorePendingStylesheets();
 
     // The renderer may be destroyed or created after the style update.
     // Because this is called from JS, where the wrapper keeps a reference to the NamedFlow, no guard is necessary.
@@ -216,17 +216,17 @@
     if (flowState() == FlowStateNull)
         return;
 
-    dispatchEvent(UIEvent::create(eventNames().webkitregionoversetchangeEvent, false, false, m_flowManager.document()->defaultView(), 0));
+    dispatchEvent(UIEvent::create(eventNames().webkitregionoversetchangeEvent, false, false, m_flowManager->document()->defaultView(), 0));
 }
 
 ScriptExecutionContext* WebKitNamedFlow::scriptExecutionContext() const
 {
-    return m_flowManager.document();
+    return m_flowManager->document();
 }
 
 Node* WebKitNamedFlow::ownerNode() const
 {
-    return m_flowManager.document();
+    return m_flowManager->document();
 }
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/dom/WebKitNamedFlow.h (194221 => 194222)


--- trunk/Source/WebCore/dom/WebKitNamedFlow.h	2015-12-17 19:42:04 UTC (rev 194221)
+++ trunk/Source/WebCore/dom/WebKitNamedFlow.h	2015-12-17 19:52:25 UTC (rev 194222)
@@ -48,16 +48,16 @@
 
 class WebKitNamedFlow final : public RefCounted<WebKitNamedFlow>, public EventTargetWithInlineData {
 public:
-    static Ref<WebKitNamedFlow> create(NamedFlowCollection& manager, const AtomicString& flowThreadName);
+    static Ref<WebKitNamedFlow> create(PassRefPtr<NamedFlowCollection> manager, const AtomicString& flowThreadName);
 
     ~WebKitNamedFlow();
 
     const AtomicString& name() const;
     bool overset() const;
     int firstEmptyRegionIndex() const;
-    Ref<NodeList> getRegionsByContent(Node*);
-    Ref<NodeList> getRegions();
-    Ref<NodeList> getContent();
+    PassRefPtr<NodeList> getRegionsByContent(Node*);
+    PassRefPtr<NodeList> getRegions();
+    PassRefPtr<NodeList> getContent();
 
     using RefCounted<WebKitNamedFlow>::ref;
     using RefCounted<WebKitNamedFlow>::deref;
@@ -81,7 +81,7 @@
     void dispatchRegionOversetChangeEvent();
 
 private:
-    WebKitNamedFlow(NamedFlowCollection&, const AtomicString&);
+    WebKitNamedFlow(PassRefPtr<NamedFlowCollection>, const AtomicString&);
 
     // EventTarget implementation.
     virtual void refEventTarget() override { ref(); }
@@ -90,7 +90,7 @@
     // The name of the flow thread as specified in CSS.
     AtomicString m_flowThreadName;
 
-    NamedFlowCollection& m_flowManager;
+    RefPtr<NamedFlowCollection> m_flowManager;
     RenderNamedFlowThread* m_parentFlowThread;
 };
 

Modified: trunk/Source/WebCore/dom/WheelEvent.cpp (194221 => 194222)


--- trunk/Source/WebCore/dom/WheelEvent.cpp	2015-12-17 19:42:04 UTC (rev 194221)
+++ trunk/Source/WebCore/dom/WheelEvent.cpp	2015-12-17 19:52:25 UTC (rev 194222)
@@ -65,7 +65,7 @@
 {
 }
 
-WheelEvent::WheelEvent(const PlatformWheelEvent& event, AbstractView* view)
+WheelEvent::WheelEvent(const PlatformWheelEvent& event, PassRefPtr<AbstractView> view)
     : MouseEvent(eventNames().wheelEvent, true, true, event.timestamp(), view, 0, event.globalPosition().x(), event.globalPosition().y(), event.position().x(), event.position().y()
 #if ENABLE(POINTER_LOCK)
                 , 0, 0
@@ -81,7 +81,7 @@
 {
 }
 
-void WheelEvent::initWheelEvent(int rawDeltaX, int rawDeltaY, AbstractView* view, int screenX, int screenY, int pageX, int pageY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
+void WheelEvent::initWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtr<AbstractView> view, int screenX, int screenY, int pageX, int pageY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
 {
     if (dispatched())
         return;
@@ -104,7 +104,7 @@
     initCoordinates(IntPoint(pageX, pageY));
 }
 
-void WheelEvent::initWebKitWheelEvent(int rawDeltaX, int rawDeltaY, AbstractView* view, int screenX, int screenY, int pageX, int pageY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
+void WheelEvent::initWebKitWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtr<AbstractView> view, int screenX, int screenY, int pageX, int pageY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey)
 {
     initWheelEvent(rawDeltaX, rawDeltaY, view, screenX, screenY, pageX, pageY, ctrlKey, altKey, shiftKey, metaKey);
 }

Modified: trunk/Source/WebCore/dom/WheelEvent.h (194221 => 194222)


--- trunk/Source/WebCore/dom/WheelEvent.h	2015-12-17 19:42:04 UTC (rev 194221)
+++ trunk/Source/WebCore/dom/WheelEvent.h	2015-12-17 19:52:25 UTC (rev 194222)
@@ -64,16 +64,16 @@
         return adoptRef(*new WheelEvent(type, initializer));
     }
 
-    static Ref<WheelEvent> create(const PlatformWheelEvent& event, AbstractView* view)
+    static Ref<WheelEvent> create(const PlatformWheelEvent& event, PassRefPtr<AbstractView> view)
     {
         return adoptRef(*new WheelEvent(event, view));
     }
 
-    void initWheelEvent(int rawDeltaX, int rawDeltaY, AbstractView*,
+    void initWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtr<AbstractView>,
         int screenX, int screenY, int pageX, int pageY,
         bool ctrlKey, bool altKey, bool shiftKey, bool metaKey);
 
-    void initWebKitWheelEvent(int rawDeltaX, int rawDeltaY, AbstractView*,
+    void initWebKitWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtr<AbstractView>,
         int screenX, int screenY, int pageX, int pageY,
         bool ctrlKey, bool altKey, bool shiftKey, bool metaKey);
 
@@ -100,7 +100,7 @@
 private:
     WheelEvent();
     WheelEvent(const AtomicString&, const WheelEventInit&);
-    WheelEvent(const PlatformWheelEvent&, AbstractView*);
+    WheelEvent(const PlatformWheelEvent&, PassRefPtr<AbstractView>);
 
     virtual bool isWheelEvent() const override;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to