Diff
Modified: trunk/Source/WebCore/ChangeLog (195523 => 195524)
--- trunk/Source/WebCore/ChangeLog 2016-01-25 05:23:49 UTC (rev 195523)
+++ trunk/Source/WebCore/ChangeLog 2016-01-25 06:13:09 UTC (rev 195524)
@@ -1,3 +1,42 @@
+2016-01-24 Gyuyoung Kim <gyuyoung....@webkit.org>
+
+ Reduce PassRefPtr uses in dom - 4
+ https://bugs.webkit.org/show_bug.cgi?id=153270
+
+ Reviewed by Darin Adler.
+
+ As a step to remove PassRefPtr uses, this patch reduces the uses in WebCore/dom.
+
+ * bindings/js/JSDeviceMotionEventCustom.cpp:
+ (WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
+ * dom/DeviceMotionData.cpp:
+ (WebCore::DeviceMotionData::create):
+ (WebCore::DeviceMotionData::DeviceMotionData):
+ * dom/DeviceMotionData.h:
+ * dom/Document.cpp:
+ (WebCore::Document::setBodyOrFrameset):
+ (WebCore::Document::setFocusedElement):
+ (WebCore::Document::setDecoder):
+ (WebCore::Document::pushCurrentScript):
+ * dom/Document.h:
+ * dom/Event.cpp:
+ (WebCore::Event::cloneFor):
+ * dom/Event.h:
+ * dom/MouseEvent.cpp:
+ (WebCore::MouseEvent::cloneFor):
+ * dom/MouseEvent.h:
+ * dom/NodeIterator.cpp:
+ (WebCore::NodeIterator::NodePointer::NodePointer):
+ (WebCore::NodeIterator::NodeIterator):
+ * dom/NodeIterator.h:
+ (WebCore::NodeIterator::create):
+ * html/RadioInputType.cpp:
+ (WebCore::RadioInputType::handleKeydownEvent):
+ * platform/ios/DeviceMotionClientIOS.mm:
+ (WebCore::DeviceMotionClientIOS::motionChanged):
+ * xml/XSLTProcessor.cpp:
+ (WebCore::XSLTProcessor::createDocumentFromSource):
+
2016-01-24 Myles C. Maxfield <mmaxfi...@apple.com>
[Font Loading] General cleanup
Modified: trunk/Source/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp (195523 => 195524)
--- trunk/Source/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp 2016-01-25 05:23:49 UTC (rev 195523)
+++ trunk/Source/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp 2016-01-25 06:13:09 UTC (rev 195524)
@@ -188,8 +188,8 @@
bool intervalProvided = !state.argument(6).isUndefinedOrNull();
double interval = state.argument(6).toNumber(&state);
- RefPtr<DeviceMotionData> deviceMotionData = DeviceMotionData::create(acceleration, accelerationIncludingGravity, rotationRate, intervalProvided, interval);
- wrapped().initDeviceMotionEvent(type, bubbles, cancelable, deviceMotionData.get());
+ auto deviceMotionData = DeviceMotionData::create(WTFMove(acceleration), WTFMove(accelerationIncludingGravity), WTFMove(rotationRate), intervalProvided, interval);
+ wrapped().initDeviceMotionEvent(type, bubbles, cancelable, deviceMotionData.ptr());
return jsUndefined();
}
Modified: trunk/Source/WebCore/dom/DeviceMotionData.cpp (195523 => 195524)
--- trunk/Source/WebCore/dom/DeviceMotionData.cpp 2016-01-25 05:23:49 UTC (rev 195523)
+++ trunk/Source/WebCore/dom/DeviceMotionData.cpp 2016-01-25 06:13:09 UTC (rev 195524)
@@ -68,10 +68,9 @@
return adoptRef(*new DeviceMotionData);
}
-Ref<DeviceMotionData> DeviceMotionData::create(PassRefPtr<Acceleration> acceleration, PassRefPtr<Acceleration> accelerationIncludingGravity,
- PassRefPtr<RotationRate> rotationRate, bool canProvideInterval, double interval)
+Ref<DeviceMotionData> DeviceMotionData::create(RefPtr<Acceleration>&& acceleration, RefPtr<Acceleration>&& accelerationIncludingGravity, RefPtr<RotationRate>&& rotationRate, bool canProvideInterval, double interval)
{
- return adoptRef(*new DeviceMotionData(acceleration, accelerationIncludingGravity, rotationRate, canProvideInterval, interval));
+ return adoptRef(*new DeviceMotionData(WTFMove(acceleration), WTFMove(accelerationIncludingGravity), WTFMove(rotationRate), canProvideInterval, interval));
}
DeviceMotionData::DeviceMotionData()
@@ -80,11 +79,10 @@
{
}
-DeviceMotionData::DeviceMotionData(PassRefPtr<Acceleration> acceleration, PassRefPtr<Acceleration> accelerationIncludingGravity,
- PassRefPtr<RotationRate> rotationRate, bool canProvideInterval, double interval)
- : m_acceleration(acceleration)
- , m_accelerationIncludingGravity(accelerationIncludingGravity)
- , m_rotationRate(rotationRate)
+DeviceMotionData::DeviceMotionData(RefPtr<Acceleration>&& acceleration, RefPtr<Acceleration>&& accelerationIncludingGravity, RefPtr<RotationRate>&& rotationRate, bool canProvideInterval, double interval)
+ : m_acceleration(WTFMove(acceleration))
+ , m_accelerationIncludingGravity(WTFMove(accelerationIncludingGravity))
+ , m_rotationRate(WTFMove(rotationRate))
, m_canProvideInterval(canProvideInterval)
, m_interval(interval)
{
Modified: trunk/Source/WebCore/dom/DeviceMotionData.h (195523 => 195524)
--- trunk/Source/WebCore/dom/DeviceMotionData.h 2016-01-25 05:23:49 UTC (rev 195523)
+++ trunk/Source/WebCore/dom/DeviceMotionData.h 2016-01-25 06:13:09 UTC (rev 195524)
@@ -26,7 +26,6 @@
#ifndef DeviceMotionData_h
#define DeviceMotionData_h
-#include <wtf/PassRefPtr.h>
#include <wtf/RefCounted.h>
#include <wtf/RefPtr.h>
@@ -83,8 +82,7 @@
};
WEBCORE_EXPORT static Ref<DeviceMotionData> create();
- WEBCORE_EXPORT static Ref<DeviceMotionData> create(PassRefPtr<Acceleration>, PassRefPtr<Acceleration> accelerationIncludingGravity,
- PassRefPtr<RotationRate> rotationRate, bool canProvideInterval, double interval);
+ WEBCORE_EXPORT static Ref<DeviceMotionData> create(RefPtr<Acceleration>&&, RefPtr<Acceleration>&& accelerationIncludingGravity, RefPtr<RotationRate>&&, bool canProvideInterval, double interval);
const Acceleration* acceleration() const { return m_acceleration.get(); }
const Acceleration* accelerationIncludingGravity() const { return m_accelerationIncludingGravity.get(); }
@@ -94,8 +92,7 @@
private:
DeviceMotionData();
- DeviceMotionData(PassRefPtr<Acceleration> acceleration, PassRefPtr<Acceleration> accelerationIncludingGravity,
- PassRefPtr<RotationRate> rotationRate, bool canProvideInterval, double interval);
+ DeviceMotionData(RefPtr<Acceleration>&&, RefPtr<Acceleration>&& accelerationIncludingGravity, RefPtr<RotationRate>&&, bool canProvideInterval, double interval);
RefPtr<Acceleration> m_acceleration;
RefPtr<Acceleration> m_accelerationIncludingGravity;
Modified: trunk/Source/WebCore/dom/Document.cpp (195523 => 195524)
--- trunk/Source/WebCore/dom/Document.cpp 2016-01-25 05:23:49 UTC (rev 195523)
+++ trunk/Source/WebCore/dom/Document.cpp 2016-01-25 06:13:09 UTC (rev 195524)
@@ -2586,10 +2586,8 @@
return nullptr;
}
-void Document::setBodyOrFrameset(PassRefPtr<HTMLElement> prpNewBody, ExceptionCode& ec)
+void Document::setBodyOrFrameset(RefPtr<HTMLElement>&& newBody, ExceptionCode& ec)
{
- RefPtr<HTMLElement> newBody = prpNewBody;
-
// FIXME: This does not support setting a <frameset> Element, only a <body>. This does
// not match the HTML specification:
// https://html.spec.whatwg.org/multipage/dom.html#dom-document-body
@@ -3764,10 +3762,9 @@
}
#endif
-bool Document::setFocusedElement(PassRefPtr<Element> prpNewFocusedElement, FocusDirection direction)
+bool Document::setFocusedElement(Element* element, FocusDirection direction)
{
- RefPtr<Element> newFocusedElement = prpNewFocusedElement;
-
+ RefPtr<Element> newFocusedElement = element;
// Make sure newFocusedElement is actually in this document
if (newFocusedElement && (&newFocusedElement->document() != this))
return true;
@@ -4572,9 +4569,9 @@
return true;
}
-void Document::setDecoder(PassRefPtr<TextResourceDecoder> decoder)
+void Document::setDecoder(RefPtr<TextResourceDecoder>&& decoder)
{
- m_decoder = decoder;
+ m_decoder = WTFMove(decoder);
}
URL Document::completeURL(const String& url, const URL& baseURLOverride) const
@@ -4841,7 +4838,7 @@
return command(this, commandName).value();
}
-void Document::pushCurrentScript(PassRefPtr<HTMLScriptElement> newCurrentScript)
+void Document::pushCurrentScript(HTMLScriptElement* newCurrentScript)
{
ASSERT(newCurrentScript);
m_currentScriptStack.append(newCurrentScript);
Modified: trunk/Source/WebCore/dom/Document.h (195523 => 195524)
--- trunk/Source/WebCore/dom/Document.h 2016-01-25 05:23:49 UTC (rev 195523)
+++ trunk/Source/WebCore/dom/Document.h 2016-01-25 06:13:09 UTC (rev 195524)
@@ -733,7 +733,7 @@
String selectedStylesheetSet() const;
void setSelectedStylesheetSet(const String&);
- WEBCORE_EXPORT bool setFocusedElement(PassRefPtr<Element>, FocusDirection = FocusDirectionNone);
+ WEBCORE_EXPORT bool setFocusedElement(Element*, FocusDirection = FocusDirectionNone);
Element* focusedElement() const { return m_focusedElement.get(); }
UserActionElementSet& userActionElements() { return m_userActionElements; }
const UserActionElementSet& userActionElements() const { return m_userActionElements; }
@@ -924,7 +924,7 @@
HTMLBodyElement* body() const;
WEBCORE_EXPORT HTMLElement* bodyOrFrameset() const;
- void setBodyOrFrameset(PassRefPtr<HTMLElement>, ExceptionCode&);
+ void setBodyOrFrameset(RefPtr<HTMLElement>&&, ExceptionCode&);
Location* location() const;
@@ -957,7 +957,7 @@
JSModuleLoader* moduleLoader() { return m_moduleLoader.get(); }
HTMLScriptElement* currentScript() const { return !m_currentScriptStack.isEmpty() ? m_currentScriptStack.last().get() : nullptr; }
- void pushCurrentScript(PassRefPtr<HTMLScriptElement>);
+ void pushCurrentScript(HTMLScriptElement*);
void popCurrentScript();
#if ENABLE(XSLT)
@@ -1056,7 +1056,7 @@
WEBCORE_EXPORT void setShouldCreateRenderers(bool);
bool shouldCreateRenderers();
- void setDecoder(PassRefPtr<TextResourceDecoder>);
+ void setDecoder(RefPtr<TextResourceDecoder>&&);
TextResourceDecoder* decoder() const { return m_decoder.get(); }
WEBCORE_EXPORT String displayStringModifiedByEncoding(const String&) const;
Modified: trunk/Source/WebCore/dom/Event.cpp (195523 => 195524)
--- trunk/Source/WebCore/dom/Event.cpp 2016-01-25 05:23:49 UTC (rev 195523)
+++ trunk/Source/WebCore/dom/Event.cpp 2016-01-25 06:13:09 UTC (rev 195524)
@@ -157,7 +157,7 @@
return false;
}
-PassRefPtr<Event> Event::cloneFor(HTMLIFrameElement*) const
+Ref<Event> Event::cloneFor(HTMLIFrameElement*) const
{
return Event::create(type(), bubbles(), cancelable());
}
Modified: trunk/Source/WebCore/dom/Event.h (195523 => 195524)
--- trunk/Source/WebCore/dom/Event.h 2016-01-25 05:23:49 UTC (rev 195523)
+++ trunk/Source/WebCore/dom/Event.h 2016-01-25 06:13:09 UTC (rev 195524)
@@ -179,7 +179,7 @@
bool isBeingDispatched() const { return eventPhase(); }
- virtual PassRefPtr<Event> cloneFor(HTMLIFrameElement*) const;
+ virtual Ref<Event> cloneFor(HTMLIFrameElement*) const;
virtual EventTarget* relatedTarget() const { return nullptr; }
Modified: trunk/Source/WebCore/dom/MouseEvent.cpp (195523 => 195524)
--- trunk/Source/WebCore/dom/MouseEvent.cpp 2016-01-25 05:23:49 UTC (rev 195523)
+++ trunk/Source/WebCore/dom/MouseEvent.cpp 2016-01-25 06:13:09 UTC (rev 195524)
@@ -237,10 +237,10 @@
return iframe->offsetTop() - frameView->scrollY() + innerClientY;
}
-PassRefPtr<Event> MouseEvent::cloneFor(HTMLIFrameElement* iframe) const
+Ref<Event> MouseEvent::cloneFor(HTMLIFrameElement* iframe) const
{
ASSERT(iframe);
- RefPtr<MouseEvent> clonedMouseEvent = MouseEvent::create();
+ Ref<MouseEvent> clonedMouseEvent = MouseEvent::create();
Frame* frame = iframe->document().frame();
FrameView* frameView = frame ? frame->view() : nullptr;
clonedMouseEvent->initMouseEvent(type(), bubbles(), cancelable(),
@@ -253,7 +253,7 @@
// Nullifies relatedTarget.
0);
clonedMouseEvent->setForce(force());
- return clonedMouseEvent.release();
+ return WTFMove(clonedMouseEvent);
}
Ref<SimulatedMouseEvent> SimulatedMouseEvent::create(const AtomicString& eventType, AbstractView* view, PassRefPtr<Event> underlyingEvent, Element* target)
Modified: trunk/Source/WebCore/dom/MouseEvent.h (195523 => 195524)
--- trunk/Source/WebCore/dom/MouseEvent.h 2016-01-25 05:23:49 UTC (rev 195523)
+++ trunk/Source/WebCore/dom/MouseEvent.h 2016-01-25 06:13:09 UTC (rev 195524)
@@ -104,7 +104,7 @@
virtual int which() const override;
- virtual PassRefPtr<Event> cloneFor(HTMLIFrameElement*) const override;
+ virtual Ref<Event> cloneFor(HTMLIFrameElement*) const override;
protected:
MouseEvent(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, AbstractView*,
Modified: trunk/Source/WebCore/dom/NodeIterator.cpp (195523 => 195524)
--- trunk/Source/WebCore/dom/NodeIterator.cpp 2016-01-25 05:23:49 UTC (rev 195523)
+++ trunk/Source/WebCore/dom/NodeIterator.cpp 2016-01-25 06:13:09 UTC (rev 195524)
@@ -37,7 +37,7 @@
{
}
-NodeIterator::NodePointer::NodePointer(PassRefPtr<Node> n, bool b)
+NodeIterator::NodePointer::NodePointer(Node* n, bool b)
: node(n)
, isPointerBeforeNode(b)
{
@@ -76,7 +76,7 @@
return node;
}
-NodeIterator::NodeIterator(PassRefPtr<Node> rootNode, unsigned long whatToShow, RefPtr<NodeFilter>&& filter)
+NodeIterator::NodeIterator(Node* rootNode, unsigned long whatToShow, RefPtr<NodeFilter>&& filter)
: NodeIteratorBase(*rootNode, whatToShow, WTFMove(filter))
, m_referenceNode(root(), true)
{
Modified: trunk/Source/WebCore/dom/NodeIterator.h (195523 => 195524)
--- trunk/Source/WebCore/dom/NodeIterator.h 2016-01-25 05:23:49 UTC (rev 195523)
+++ trunk/Source/WebCore/dom/NodeIterator.h 2016-01-25 06:13:09 UTC (rev 195524)
@@ -37,7 +37,7 @@
class NodeIterator : public ScriptWrappable, public RefCounted<NodeIterator>, public NodeIteratorBase {
public:
- static Ref<NodeIterator> create(PassRefPtr<Node> rootNode, unsigned long whatToShow, RefPtr<NodeFilter>&& filter)
+ static Ref<NodeIterator> create(Node* rootNode, unsigned long whatToShow, RefPtr<NodeFilter>&& filter)
{
return adoptRef(*new NodeIterator(rootNode, whatToShow, WTFMove(filter)));
}
@@ -54,13 +54,13 @@
void nodeWillBeRemoved(Node&);
private:
- NodeIterator(PassRefPtr<Node>, unsigned long whatToShow, RefPtr<NodeFilter>&&);
+ NodeIterator(Node*, unsigned long whatToShow, RefPtr<NodeFilter>&&);
struct NodePointer {
RefPtr<Node> node;
bool isPointerBeforeNode;
NodePointer();
- NodePointer(PassRefPtr<Node>, bool);
+ NodePointer(Node*, bool);
void clear();
bool moveToNext(Node* root);
bool moveToPrevious(Node* root);
Modified: trunk/Source/WebCore/html/RadioInputType.cpp (195523 => 195524)
--- trunk/Source/WebCore/html/RadioInputType.cpp 2016-01-25 05:23:49 UTC (rev 195523)
+++ trunk/Source/WebCore/html/RadioInputType.cpp 2016-01-25 06:13:09 UTC (rev 195524)
@@ -90,7 +90,7 @@
if (inputElement->form() != element().form())
break;
if (inputElement->isRadioButton() && inputElement->name() == element().name() && inputElement->isFocusable()) {
- element().document().setFocusedElement(inputElement);
+ element().document().setFocusedElement(inputElement.get());
inputElement->dispatchSimulatedClick(event, SendNoEvents, DoNotShowPressedLook);
event->setDefaultHandled();
return;
Modified: trunk/Source/WebCore/platform/ios/DeviceMotionClientIOS.mm (195523 => 195524)
--- trunk/Source/WebCore/platform/ios/DeviceMotionClientIOS.mm 2016-01-25 05:23:49 UTC (rev 195523)
+++ trunk/Source/WebCore/platform/ios/DeviceMotionClientIOS.mm 2016-01-25 06:13:09 UTC (rev 195524)
@@ -120,7 +120,7 @@
}
#endif // PLATFORM(IOS_SIMULATOR)
- m_currentDeviceMotionData = DeviceMotionData::create(acceleration, accelerationIncludingGravity, rotationRate, true, kMotionUpdateInterval);
+ m_currentDeviceMotionData = DeviceMotionData::create(WTFMove(acceleration), WTFMove(accelerationIncludingGravity), WTFMove(rotationRate), true, kMotionUpdateInterval);
m_controller->didChangeDeviceMotion(m_currentDeviceMotionData.get());
}
Modified: trunk/Source/WebCore/xml/XSLTProcessor.cpp (195523 => 195524)
--- trunk/Source/WebCore/xml/XSLTProcessor.cpp 2016-01-25 05:23:49 UTC (rev 195523)
+++ trunk/Source/WebCore/xml/XSLTProcessor.cpp 2016-01-25 06:13:09 UTC (rev 195524)
@@ -103,7 +103,7 @@
RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create(sourceMIMEType);
decoder->setEncoding(sourceEncoding.isEmpty() ? UTF8Encoding() : TextEncoding(sourceEncoding), TextResourceDecoder::EncodingFromXMLHeader);
- result->setDecoder(decoder.release());
+ result->setDecoder(WTFMove(decoder));
result->setContent(documentSource);
Modified: trunk/Source/WebKit/win/ChangeLog (195523 => 195524)
--- trunk/Source/WebKit/win/ChangeLog 2016-01-25 05:23:49 UTC (rev 195523)
+++ trunk/Source/WebKit/win/ChangeLog 2016-01-25 06:13:09 UTC (rev 195524)
@@ -1,3 +1,15 @@
+2016-01-24 Gyuyoung Kim <gyuyoung....@webkit.org>
+
+ Reduce PassRefPtr uses in dom - 4
+ https://bugs.webkit.org/show_bug.cgi?id=153270
+
+ Reviewed by Darin Adler.
+
+ As a step to remove PassRefPtr uses, this patch reduces the uses in WebCore/dom.
+
+ * Plugins/PluginView.cpp:
+ (WebCore::PluginView::focusPluginElement):
+
2016-01-17 Ada Chan <adac...@apple.com>
Add a mode parameter to MediaControllerInterface::supportsFullscreen() and ChromeClient::supportsVideoFullscreen().
Modified: trunk/Source/WebKit2/ChangeLog (195523 => 195524)
--- trunk/Source/WebKit2/ChangeLog 2016-01-25 05:23:49 UTC (rev 195523)
+++ trunk/Source/WebKit2/ChangeLog 2016-01-25 06:13:09 UTC (rev 195524)
@@ -1,3 +1,15 @@
+2016-01-24 Gyuyoung Kim <gyuyoung....@webkit.org>
+
+ Reduce PassRefPtr uses in dom - 4
+ https://bugs.webkit.org/show_bug.cgi?id=153270
+
+ Reviewed by Darin Adler.
+
+ As a step to remove PassRefPtr uses, this patch reduces the uses in WebCore/dom.
+
+ * WebProcess/Plugins/PluginView.cpp:
+ (WebKit::PluginView::focusPluginElement):
+
2016-01-23 Alex Christensen <achristen...@webkit.org>
CMake build fix after r195494.
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp (195523 => 195524)
--- trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp 2016-01-25 05:23:49 UTC (rev 195523)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp 2016-01-25 06:13:09 UTC (rev 195524)
@@ -1151,7 +1151,7 @@
if (Page* page = frame()->page())
page->focusController().setFocusedElement(m_pluginElement.get(), frame());
else
- frame()->document()->setFocusedElement(m_pluginElement);
+ frame()->document()->setFocusedElement(m_pluginElement.get());
}
void PluginView::pendingURLRequestsTimerFired()