Diff
Modified: trunk/Source/WebCore/ChangeLog (193407 => 193408)
--- trunk/Source/WebCore/ChangeLog 2015-12-04 04:51:20 UTC (rev 193407)
+++ trunk/Source/WebCore/ChangeLog 2015-12-04 05:21:45 UTC (rev 193408)
@@ -1,3 +1,37 @@
+2015-12-03 Gyuyoung Kim <[email protected]>
+
+ Reduce uses of PassRefPtr in DOM - 1
+ https://bugs.webkit.org/show_bug.cgi?id=149788
+
+ Reviewed by Darin Adler.
+
+ As a step to purge PassRefPtr, this patch reduces the uses in WebCore/dom.
+
+ * dom/ChildListMutationScope.cpp:
+ (WebCore::ChildListMutationAccumulator::getOrCreate):
+ * dom/ChildListMutationScope.h:
+ * dom/ClipboardEvent.cpp:
+ (WebCore::ClipboardEvent::ClipboardEvent):
+ * dom/ClipboardEvent.h:
+ * dom/CompositionEvent.cpp:
+ (WebCore::CompositionEvent::CompositionEvent):
+ (WebCore::CompositionEvent::initCompositionEvent):
+ * dom/CompositionEvent.h:
+ * dom/DOMNamedFlowCollection.cpp:
+ (WebCore::DOMNamedFlowCollection::item):
+ * dom/DOMNamedFlowCollection.h:
+ * dom/DOMStringList.h:
+ * dom/DeviceMotionController.cpp:
+ (WebCore::DeviceMotionController::getLastEvent):
+ * dom/DeviceMotionController.h:
+ * dom/DeviceOrientationController.cpp:
+ (WebCore::DeviceOrientationController::getLastEvent):
+ * dom/DeviceOrientationController.h:
+ * editing/Editor.cpp:
+ (WebCore::Editor::dispatchCPPEvent):
+ * page/DeviceController.h:
+ (WebCore::DeviceController::getLastEvent):
+
2015-12-03 Said Abou-Hallawa <[email protected]>
Remove the use of GraphicsContextStateSaver from RenderLayer::paintLayerByApplyingTransform
Modified: trunk/Source/WebCore/dom/ChildListMutationScope.cpp (193407 => 193408)
--- trunk/Source/WebCore/dom/ChildListMutationScope.cpp 2015-12-04 04:51:20 UTC (rev 193407)
+++ trunk/Source/WebCore/dom/ChildListMutationScope.cpp 2015-12-04 05:21:45 UTC (rev 193408)
@@ -61,7 +61,7 @@
accumulatorMap().remove(m_target.ptr());
}
-PassRefPtr<ChildListMutationAccumulator> ChildListMutationAccumulator::getOrCreate(ContainerNode& target)
+RefPtr<ChildListMutationAccumulator> ChildListMutationAccumulator::getOrCreate(ContainerNode& target)
{
AccumulatorMap::AddResult result = accumulatorMap().add(&target, nullptr);
RefPtr<ChildListMutationAccumulator> accumulator;
@@ -71,7 +71,7 @@
accumulator = adoptRef(new ChildListMutationAccumulator(target, MutationObserverInterestGroup::createForChildListMutation(target)));
result.iterator->value = accumulator.get();
}
- return accumulator.release();
+ return accumulator;
}
inline bool ChildListMutationAccumulator::isAddedNodeInOrder(Node& child)
Modified: trunk/Source/WebCore/dom/ChildListMutationScope.h (193407 => 193408)
--- trunk/Source/WebCore/dom/ChildListMutationScope.h 2015-12-04 04:51:20 UTC (rev 193407)
+++ trunk/Source/WebCore/dom/ChildListMutationScope.h 2015-12-04 05:21:45 UTC (rev 193408)
@@ -46,7 +46,7 @@
// ChildListMutationAccumulator is not meant to be used directly; ChildListMutationScope is the public interface.
class ChildListMutationAccumulator : public RefCounted<ChildListMutationAccumulator> {
public:
- static PassRefPtr<ChildListMutationAccumulator> getOrCreate(ContainerNode&);
+ static RefPtr<ChildListMutationAccumulator> getOrCreate(ContainerNode&);
~ChildListMutationAccumulator();
void childAdded(Node&);
Modified: trunk/Source/WebCore/dom/ClipboardEvent.cpp (193407 => 193408)
--- trunk/Source/WebCore/dom/ClipboardEvent.cpp 2015-12-04 04:51:20 UTC (rev 193407)
+++ trunk/Source/WebCore/dom/ClipboardEvent.cpp 2015-12-04 05:21:45 UTC (rev 193408)
@@ -32,7 +32,7 @@
{
}
-ClipboardEvent::ClipboardEvent(const AtomicString& eventType, bool canBubble, bool cancelable, PassRefPtr<DataTransfer> dataTransfer)
+ClipboardEvent::ClipboardEvent(const AtomicString& eventType, bool canBubble, bool cancelable, DataTransfer* dataTransfer)
: Event(eventType, canBubble, cancelable), m_dataTransfer(dataTransfer)
{
}
Modified: trunk/Source/WebCore/dom/ClipboardEvent.h (193407 => 193408)
--- trunk/Source/WebCore/dom/ClipboardEvent.h 2015-12-04 04:51:20 UTC (rev 193407)
+++ trunk/Source/WebCore/dom/ClipboardEvent.h 2015-12-04 05:21:45 UTC (rev 193408)
@@ -38,7 +38,7 @@
{
return adoptRef(*new ClipboardEvent);
}
- static Ref<ClipboardEvent> create(const AtomicString& type, bool canBubbleArg, bool cancelableArg, PassRefPtr<DataTransfer> clipboardArg)
+ static Ref<ClipboardEvent> create(const AtomicString& type, bool canBubbleArg, bool cancelableArg, DataTransfer* clipboardArg)
{
return adoptRef(*new ClipboardEvent(type, canBubbleArg, cancelableArg, clipboardArg));
}
@@ -47,7 +47,7 @@
private:
ClipboardEvent();
- ClipboardEvent(const AtomicString& type, bool canBubbleArg, bool cancelableArg, PassRefPtr<DataTransfer>);
+ ClipboardEvent(const AtomicString& type, bool canBubbleArg, bool cancelableArg, DataTransfer*);
virtual EventInterface eventInterface() const override;
virtual bool isClipboardEvent() const override;
Modified: trunk/Source/WebCore/dom/CompositionEvent.cpp (193407 => 193408)
--- trunk/Source/WebCore/dom/CompositionEvent.cpp 2015-12-04 04:51:20 UTC (rev 193407)
+++ trunk/Source/WebCore/dom/CompositionEvent.cpp 2015-12-04 05:21:45 UTC (rev 193408)
@@ -39,7 +39,7 @@
{
}
-CompositionEvent::CompositionEvent(const AtomicString& type, PassRefPtr<AbstractView> view, const String& data)
+CompositionEvent::CompositionEvent(const AtomicString& type, AbstractView* view, const String& data)
: UIEvent(type, true, true, view, 0)
, m_data(data)
{
@@ -55,7 +55,7 @@
{
}
-void CompositionEvent::initCompositionEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView> view, const String& data)
+void CompositionEvent::initCompositionEvent(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view, const String& data)
{
if (dispatched())
return;
Modified: trunk/Source/WebCore/dom/CompositionEvent.h (193407 => 193408)
--- trunk/Source/WebCore/dom/CompositionEvent.h 2015-12-04 04:51:20 UTC (rev 193407)
+++ trunk/Source/WebCore/dom/CompositionEvent.h 2015-12-04 05:21:45 UTC (rev 193408)
@@ -44,7 +44,7 @@
return adoptRef(*new CompositionEvent);
}
- static Ref<CompositionEvent> create(const AtomicString& type, PassRefPtr<AbstractView> view, const String& data)
+ static Ref<CompositionEvent> create(const AtomicString& type, AbstractView* view, const String& data)
{
return adoptRef(*new CompositionEvent(type, view, data));
}
@@ -56,7 +56,7 @@
virtual ~CompositionEvent();
- void initCompositionEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView>, const String& data);
+ void initCompositionEvent(const AtomicString& type, bool canBubble, bool cancelable, AbstractView*, const String& data);
String data() const { return m_data; }
@@ -64,7 +64,7 @@
private:
CompositionEvent();
- CompositionEvent(const AtomicString& type, PassRefPtr<AbstractView>, const String&);
+ CompositionEvent(const AtomicString& type, AbstractView*, const String&);
CompositionEvent(const AtomicString& type, const CompositionEventInit&);
String m_data;
Modified: trunk/Source/WebCore/dom/DOMNamedFlowCollection.cpp (193407 => 193408)
--- trunk/Source/WebCore/dom/DOMNamedFlowCollection.cpp 2015-12-04 04:51:20 UTC (rev 193407)
+++ trunk/Source/WebCore/dom/DOMNamedFlowCollection.cpp 2015-12-04 05:21:45 UTC (rev 193408)
@@ -43,7 +43,7 @@
return m_namedFlows.size();
}
-PassRefPtr<WebKitNamedFlow> DOMNamedFlowCollection::item(unsigned long index) const
+RefPtr<WebKitNamedFlow> DOMNamedFlowCollection::item(unsigned long index) const
{
if (index >= static_cast<unsigned long>(m_namedFlows.size()))
return nullptr;
Modified: trunk/Source/WebCore/dom/DOMNamedFlowCollection.h (193407 => 193408)
--- trunk/Source/WebCore/dom/DOMNamedFlowCollection.h 2015-12-04 04:51:20 UTC (rev 193407)
+++ trunk/Source/WebCore/dom/DOMNamedFlowCollection.h 2015-12-04 05:21:45 UTC (rev 193408)
@@ -31,7 +31,6 @@
#include "NamedFlowCollection.h"
#include <wtf/ListHashSet.h>
-#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
@@ -48,7 +47,7 @@
}
unsigned long length() const;
- PassRefPtr<WebKitNamedFlow> item(unsigned long index) const;
+ RefPtr<WebKitNamedFlow> item(unsigned long index) const;
RefPtr<WebKitNamedFlow> namedItem(const AtomicString& name) const;
Vector<AtomicString> supportedPropertyNames();
Modified: trunk/Source/WebCore/dom/DOMStringList.h (193407 => 193408)
--- trunk/Source/WebCore/dom/DOMStringList.h 2015-12-04 04:51:20 UTC (rev 193407)
+++ trunk/Source/WebCore/dom/DOMStringList.h 2015-12-04 05:21:45 UTC (rev 193408)
@@ -26,7 +26,6 @@
#ifndef DOMStringList_h
#define DOMStringList_h
-#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/Vector.h>
#include <wtf/text/WTFString.h>
Modified: trunk/Source/WebCore/editing/Editor.cpp (193407 => 193408)
--- trunk/Source/WebCore/editing/Editor.cpp 2015-12-04 04:51:20 UTC (rev 193407)
+++ trunk/Source/WebCore/editing/Editor.cpp 2015-12-04 05:21:45 UTC (rev 193408)
@@ -851,7 +851,7 @@
RefPtr<DataTransfer> dataTransfer = DataTransfer::createForCopyAndPaste(policy);
- Ref<Event> event = ClipboardEvent::create(eventType, true, true, dataTransfer);
+ Ref<Event> event = ClipboardEvent::create(eventType, true, true, dataTransfer.get());
target->dispatchEvent(event);
bool noDefaultProcessing = event->defaultPrevented();
if (noDefaultProcessing && policy == DataTransferAccessPolicy::Writable) {