Changeset 195524 in webkit
- Timestamp:
- Jan 24, 2016, 10:13:09 PM (10 years ago)
- Location:
- trunk/Source
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r195523 r195524 1 2016-01-24 Gyuyoung Kim <gyuyoung.kim@webkit.org> 2 3 Reduce PassRefPtr uses in dom - 4 4 https://bugs.webkit.org/show_bug.cgi?id=153270 5 6 Reviewed by Darin Adler. 7 8 As a step to remove PassRefPtr uses, this patch reduces the uses in WebCore/dom. 9 10 * bindings/js/JSDeviceMotionEventCustom.cpp: 11 (WebCore::JSDeviceMotionEvent::initDeviceMotionEvent): 12 * dom/DeviceMotionData.cpp: 13 (WebCore::DeviceMotionData::create): 14 (WebCore::DeviceMotionData::DeviceMotionData): 15 * dom/DeviceMotionData.h: 16 * dom/Document.cpp: 17 (WebCore::Document::setBodyOrFrameset): 18 (WebCore::Document::setFocusedElement): 19 (WebCore::Document::setDecoder): 20 (WebCore::Document::pushCurrentScript): 21 * dom/Document.h: 22 * dom/Event.cpp: 23 (WebCore::Event::cloneFor): 24 * dom/Event.h: 25 * dom/MouseEvent.cpp: 26 (WebCore::MouseEvent::cloneFor): 27 * dom/MouseEvent.h: 28 * dom/NodeIterator.cpp: 29 (WebCore::NodeIterator::NodePointer::NodePointer): 30 (WebCore::NodeIterator::NodeIterator): 31 * dom/NodeIterator.h: 32 (WebCore::NodeIterator::create): 33 * html/RadioInputType.cpp: 34 (WebCore::RadioInputType::handleKeydownEvent): 35 * platform/ios/DeviceMotionClientIOS.mm: 36 (WebCore::DeviceMotionClientIOS::motionChanged): 37 * xml/XSLTProcessor.cpp: 38 (WebCore::XSLTProcessor::createDocumentFromSource): 39 1 40 2016-01-24 Myles C. Maxfield <mmaxfield@apple.com> 2 41 -
trunk/Source/WebCore/bindings/js/JSDeviceMotionEventCustom.cpp
r191887 r195524 189 189 bool intervalProvided = !state.argument(6).isUndefinedOrNull(); 190 190 double interval = state.argument(6).toNumber(&state); 191 RefPtr<DeviceMotionData> deviceMotionData = DeviceMotionData::create(acceleration, accelerationIncludingGravity, rotationRate, intervalProvided, interval);192 wrapped().initDeviceMotionEvent(type, bubbles, cancelable, deviceMotionData. get());191 auto deviceMotionData = DeviceMotionData::create(WTFMove(acceleration), WTFMove(accelerationIncludingGravity), WTFMove(rotationRate), intervalProvided, interval); 192 wrapped().initDeviceMotionEvent(type, bubbles, cancelable, deviceMotionData.ptr()); 193 193 return jsUndefined(); 194 194 } -
trunk/Source/WebCore/dom/DeviceMotionData.cpp
r180441 r195524 69 69 } 70 70 71 Ref<DeviceMotionData> DeviceMotionData::create(PassRefPtr<Acceleration> acceleration, PassRefPtr<Acceleration> accelerationIncludingGravity, 72 PassRefPtr<RotationRate> rotationRate, bool canProvideInterval, double interval) 71 Ref<DeviceMotionData> DeviceMotionData::create(RefPtr<Acceleration>&& acceleration, RefPtr<Acceleration>&& accelerationIncludingGravity, RefPtr<RotationRate>&& rotationRate, bool canProvideInterval, double interval) 73 72 { 74 return adoptRef(*new DeviceMotionData( acceleration, accelerationIncludingGravity, rotationRate, canProvideInterval, interval));73 return adoptRef(*new DeviceMotionData(WTFMove(acceleration), WTFMove(accelerationIncludingGravity), WTFMove(rotationRate), canProvideInterval, interval)); 75 74 } 76 75 … … 81 80 } 82 81 83 DeviceMotionData::DeviceMotionData(PassRefPtr<Acceleration> acceleration, PassRefPtr<Acceleration> accelerationIncludingGravity, 84 PassRefPtr<RotationRate> rotationRate, bool canProvideInterval, double interval) 85 : m_acceleration(acceleration) 86 , m_accelerationIncludingGravity(accelerationIncludingGravity) 87 , m_rotationRate(rotationRate) 82 DeviceMotionData::DeviceMotionData(RefPtr<Acceleration>&& acceleration, RefPtr<Acceleration>&& accelerationIncludingGravity, RefPtr<RotationRate>&& rotationRate, bool canProvideInterval, double interval) 83 : m_acceleration(WTFMove(acceleration)) 84 , m_accelerationIncludingGravity(WTFMove(accelerationIncludingGravity)) 85 , m_rotationRate(WTFMove(rotationRate)) 88 86 , m_canProvideInterval(canProvideInterval) 89 87 , m_interval(interval) -
trunk/Source/WebCore/dom/DeviceMotionData.h
r180441 r195524 27 27 #define DeviceMotionData_h 28 28 29 #include <wtf/PassRefPtr.h>30 29 #include <wtf/RefCounted.h> 31 30 #include <wtf/RefPtr.h> … … 84 83 85 84 WEBCORE_EXPORT static Ref<DeviceMotionData> create(); 86 WEBCORE_EXPORT static Ref<DeviceMotionData> create(PassRefPtr<Acceleration>, PassRefPtr<Acceleration> accelerationIncludingGravity, 87 PassRefPtr<RotationRate> rotationRate, bool canProvideInterval, double interval); 85 WEBCORE_EXPORT static Ref<DeviceMotionData> create(RefPtr<Acceleration>&&, RefPtr<Acceleration>&& accelerationIncludingGravity, RefPtr<RotationRate>&&, bool canProvideInterval, double interval); 88 86 89 87 const Acceleration* acceleration() const { return m_acceleration.get(); } … … 95 93 private: 96 94 DeviceMotionData(); 97 DeviceMotionData(PassRefPtr<Acceleration> acceleration, PassRefPtr<Acceleration> accelerationIncludingGravity, 98 PassRefPtr<RotationRate> rotationRate, bool canProvideInterval, double interval); 95 DeviceMotionData(RefPtr<Acceleration>&&, RefPtr<Acceleration>&& accelerationIncludingGravity, RefPtr<RotationRate>&&, bool canProvideInterval, double interval); 99 96 100 97 RefPtr<Acceleration> m_acceleration; -
trunk/Source/WebCore/dom/Document.cpp
r195520 r195524 2587 2587 } 2588 2588 2589 void Document::setBodyOrFrameset(PassRefPtr<HTMLElement> prpNewBody, ExceptionCode& ec) 2590 { 2591 RefPtr<HTMLElement> newBody = prpNewBody; 2592 2589 void Document::setBodyOrFrameset(RefPtr<HTMLElement>&& newBody, ExceptionCode& ec) 2590 { 2593 2591 // FIXME: This does not support setting a <frameset> Element, only a <body>. This does 2594 2592 // not match the HTML specification: … … 3765 3763 #endif 3766 3764 3767 bool Document::setFocusedElement(PassRefPtr<Element> prpNewFocusedElement, FocusDirection direction) 3768 { 3769 RefPtr<Element> newFocusedElement = prpNewFocusedElement; 3770 3765 bool Document::setFocusedElement(Element* element, FocusDirection direction) 3766 { 3767 RefPtr<Element> newFocusedElement = element; 3771 3768 // Make sure newFocusedElement is actually in this document 3772 3769 if (newFocusedElement && (&newFocusedElement->document() != this)) … … 4573 4570 } 4574 4571 4575 void Document::setDecoder( PassRefPtr<TextResourceDecoder>decoder)4576 { 4577 m_decoder = decoder;4572 void Document::setDecoder(RefPtr<TextResourceDecoder>&& decoder) 4573 { 4574 m_decoder = WTFMove(decoder); 4578 4575 } 4579 4576 … … 4842 4839 } 4843 4840 4844 void Document::pushCurrentScript( PassRefPtr<HTMLScriptElement>newCurrentScript)4841 void Document::pushCurrentScript(HTMLScriptElement* newCurrentScript) 4845 4842 { 4846 4843 ASSERT(newCurrentScript); -
trunk/Source/WebCore/dom/Document.h
r195520 r195524 734 734 void setSelectedStylesheetSet(const String&); 735 735 736 WEBCORE_EXPORT bool setFocusedElement( PassRefPtr<Element>, FocusDirection = FocusDirectionNone);736 WEBCORE_EXPORT bool setFocusedElement(Element*, FocusDirection = FocusDirectionNone); 737 737 Element* focusedElement() const { return m_focusedElement.get(); } 738 738 UserActionElementSet& userActionElements() { return m_userActionElements; } … … 925 925 HTMLBodyElement* body() const; 926 926 WEBCORE_EXPORT HTMLElement* bodyOrFrameset() const; 927 void setBodyOrFrameset( PassRefPtr<HTMLElement>, ExceptionCode&);927 void setBodyOrFrameset(RefPtr<HTMLElement>&&, ExceptionCode&); 928 928 929 929 Location* location() const; … … 958 958 959 959 HTMLScriptElement* currentScript() const { return !m_currentScriptStack.isEmpty() ? m_currentScriptStack.last().get() : nullptr; } 960 void pushCurrentScript( PassRefPtr<HTMLScriptElement>);960 void pushCurrentScript(HTMLScriptElement*); 961 961 void popCurrentScript(); 962 962 … … 1057 1057 bool shouldCreateRenderers(); 1058 1058 1059 void setDecoder( PassRefPtr<TextResourceDecoder>);1059 void setDecoder(RefPtr<TextResourceDecoder>&&); 1060 1060 TextResourceDecoder* decoder() const { return m_decoder.get(); } 1061 1061 -
trunk/Source/WebCore/dom/Event.cpp
r194496 r195524 158 158 } 159 159 160 PassRefPtr<Event> Event::cloneFor(HTMLIFrameElement*) const160 Ref<Event> Event::cloneFor(HTMLIFrameElement*) const 161 161 { 162 162 return Event::create(type(), bubbles(), cancelable()); -
trunk/Source/WebCore/dom/Event.h
r194452 r195524 180 180 bool isBeingDispatched() const { return eventPhase(); } 181 181 182 virtual PassRefPtr<Event> cloneFor(HTMLIFrameElement*) const;182 virtual Ref<Event> cloneFor(HTMLIFrameElement*) const; 183 183 184 184 virtual EventTarget* relatedTarget() const { return nullptr; } -
trunk/Source/WebCore/dom/MouseEvent.cpp
r194896 r195524 238 238 } 239 239 240 PassRefPtr<Event> MouseEvent::cloneFor(HTMLIFrameElement* iframe) const240 Ref<Event> MouseEvent::cloneFor(HTMLIFrameElement* iframe) const 241 241 { 242 242 ASSERT(iframe); 243 Ref Ptr<MouseEvent> clonedMouseEvent = MouseEvent::create();243 Ref<MouseEvent> clonedMouseEvent = MouseEvent::create(); 244 244 Frame* frame = iframe->document().frame(); 245 245 FrameView* frameView = frame ? frame->view() : nullptr; … … 254 254 0); 255 255 clonedMouseEvent->setForce(force()); 256 return clonedMouseEvent.release();256 return WTFMove(clonedMouseEvent); 257 257 } 258 258 -
trunk/Source/WebCore/dom/MouseEvent.h
r194896 r195524 105 105 virtual int which() const override; 106 106 107 virtual PassRefPtr<Event> cloneFor(HTMLIFrameElement*) const override;107 virtual Ref<Event> cloneFor(HTMLIFrameElement*) const override; 108 108 109 109 protected: -
trunk/Source/WebCore/dom/NodeIterator.cpp
r194496 r195524 38 38 } 39 39 40 NodeIterator::NodePointer::NodePointer( PassRefPtr<Node>n, bool b)40 NodeIterator::NodePointer::NodePointer(Node* n, bool b) 41 41 : node(n) 42 42 , isPointerBeforeNode(b) … … 77 77 } 78 78 79 NodeIterator::NodeIterator( PassRefPtr<Node>rootNode, unsigned long whatToShow, RefPtr<NodeFilter>&& filter)79 NodeIterator::NodeIterator(Node* rootNode, unsigned long whatToShow, RefPtr<NodeFilter>&& filter) 80 80 : NodeIteratorBase(*rootNode, whatToShow, WTFMove(filter)) 81 81 , m_referenceNode(root(), true) -
trunk/Source/WebCore/dom/NodeIterator.h
r194496 r195524 38 38 class NodeIterator : public ScriptWrappable, public RefCounted<NodeIterator>, public NodeIteratorBase { 39 39 public: 40 static Ref<NodeIterator> create( PassRefPtr<Node>rootNode, unsigned long whatToShow, RefPtr<NodeFilter>&& filter)40 static Ref<NodeIterator> create(Node* rootNode, unsigned long whatToShow, RefPtr<NodeFilter>&& filter) 41 41 { 42 42 return adoptRef(*new NodeIterator(rootNode, whatToShow, WTFMove(filter))); … … 55 55 56 56 private: 57 NodeIterator( PassRefPtr<Node>, unsigned long whatToShow, RefPtr<NodeFilter>&&);57 NodeIterator(Node*, unsigned long whatToShow, RefPtr<NodeFilter>&&); 58 58 59 59 struct NodePointer { … … 61 61 bool isPointerBeforeNode; 62 62 NodePointer(); 63 NodePointer( PassRefPtr<Node>, bool);63 NodePointer(Node*, bool); 64 64 void clear(); 65 65 bool moveToNext(Node* root); -
trunk/Source/WebCore/html/RadioInputType.cpp
r179143 r195524 91 91 break; 92 92 if (inputElement->isRadioButton() && inputElement->name() == element().name() && inputElement->isFocusable()) { 93 element().document().setFocusedElement(inputElement );93 element().document().setFocusedElement(inputElement.get()); 94 94 inputElement->dispatchSimulatedClick(event, SendNoEvents, DoNotShowPressedLook); 95 95 event->setDefaultHandled(); -
trunk/Source/WebCore/platform/ios/DeviceMotionClientIOS.mm
r161589 r195524 121 121 #endif // PLATFORM(IOS_SIMULATOR) 122 122 123 m_currentDeviceMotionData = DeviceMotionData::create( acceleration, accelerationIncludingGravity, rotationRate, true, kMotionUpdateInterval);123 m_currentDeviceMotionData = DeviceMotionData::create(WTFMove(acceleration), WTFMove(accelerationIncludingGravity), WTFMove(rotationRate), true, kMotionUpdateInterval); 124 124 m_controller->didChangeDeviceMotion(m_currentDeviceMotionData.get()); 125 125 } -
trunk/Source/WebCore/xml/XSLTProcessor.cpp
r195520 r195524 104 104 RefPtr<TextResourceDecoder> decoder = TextResourceDecoder::create(sourceMIMEType); 105 105 decoder->setEncoding(sourceEncoding.isEmpty() ? UTF8Encoding() : TextEncoding(sourceEncoding), TextResourceDecoder::EncodingFromXMLHeader); 106 result->setDecoder( decoder.release());106 result->setDecoder(WTFMove(decoder)); 107 107 108 108 result->setContent(documentSource); -
trunk/Source/WebKit/win/ChangeLog
r195487 r195524 1 2016-01-24 Gyuyoung Kim <gyuyoung.kim@webkit.org> 2 3 Reduce PassRefPtr uses in dom - 4 4 https://bugs.webkit.org/show_bug.cgi?id=153270 5 6 Reviewed by Darin Adler. 7 8 As a step to remove PassRefPtr uses, this patch reduces the uses in WebCore/dom. 9 10 * Plugins/PluginView.cpp: 11 (WebCore::PluginView::focusPluginElement): 12 1 13 2016-01-17 Ada Chan <adachan@apple.com> 2 14 -
trunk/Source/WebKit2/ChangeLog
r195510 r195524 1 2016-01-24 Gyuyoung Kim <gyuyoung.kim@webkit.org> 2 3 Reduce PassRefPtr uses in dom - 4 4 https://bugs.webkit.org/show_bug.cgi?id=153270 5 6 Reviewed by Darin Adler. 7 8 As a step to remove PassRefPtr uses, this patch reduces the uses in WebCore/dom. 9 10 * WebProcess/Plugins/PluginView.cpp: 11 (WebKit::PluginView::focusPluginElement): 12 1 13 2016-01-23 Alex Christensen <achristensen@webkit.org> 2 14 -
trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp
r193468 r195524 1152 1152 page->focusController().setFocusedElement(m_pluginElement.get(), frame()); 1153 1153 else 1154 frame()->document()->setFocusedElement(m_pluginElement );1154 frame()->document()->setFocusedElement(m_pluginElement.get()); 1155 1155 } 1156 1156
Note:
See TracChangeset
for help on using the changeset viewer.