WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-129669-20140325133824.patch (text/plain), 24.74 KB, created by
Zan Dobersek
on 2014-03-25 13:38:47 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Zan Dobersek
Created:
2014-03-25 13:38:47 PDT
Size:
24.74 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 166247) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,57 @@ >+2014-03-23 Zan Dobersek <zdobersek@igalia.com> >+ >+ Move the rest of Source/WebCore/html/ code to std::unique_ptr >+ https://bugs.webkit.org/show_bug.cgi?id=129669 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Replace the remaining uses of OwnPtr, PassOwnPtr under Source/WebCore/html/ with std::unique_ptr. >+ >+ * html/FormController.cpp: >+ (WebCore::SavedFormState::SavedFormState): >+ (WebCore::SavedFormState::deserialize): >+ (WebCore::FormController::createSavedFormStateMap): >+ (WebCore::FormController::formElementsState): >+ (WebCore::FormController::takeStateForFormElement): >+ (WebCore::FormController::formStatesFromStateVector): >+ * html/FormController.h: >+ * html/HTMLAreaElement.cpp: >+ (WebCore::HTMLAreaElement::mapMouseEvent): >+ * html/HTMLAreaElement.h: >+ * html/HTMLCanvasElement.cpp: >+ (WebCore::HTMLCanvasElement::setSurfaceSize): >+ (WebCore::HTMLCanvasElement::createImageBuffer): >+ * html/HTMLCanvasElement.h: >+ * html/HTMLCollection.h: >+ * html/HTMLEmbedElement.cpp: >+ (WebCore::HTMLEmbedElement::parseAttribute): >+ * html/HTMLFormControlElement.cpp: >+ (WebCore::HTMLFormControlElement::updateVisibleValidationMessage): >+ * html/HTMLFormControlElement.h: >+ * html/HTMLFormElement.cpp: >+ (WebCore::HTMLFormElement::addToPastNamesMap): >+ * html/HTMLFormElement.h: >+ * html/HTMLInputElement.cpp: >+ (WebCore::HTMLInputElement::imageLoader): >+ (WebCore::HTMLInputElement::resetListAttributeTargetObserver): >+ * html/HTMLInputElement.h: >+ (WebCore::HTMLInputElement::hasImageLoader): >+ * html/HTMLObjectElement.cpp: >+ (WebCore::HTMLObjectElement::parseAttribute): >+ * html/HTMLPlugInImageElement.cpp: >+ (WebCore::HTMLPlugInImageElement::startLoadingImage): >+ * html/HTMLPlugInImageElement.h: >+ * html/HTMLVideoElement.cpp: >+ (WebCore::HTMLVideoElement::didAttachRenderers): >+ (WebCore::HTMLVideoElement::parseAttribute): >+ * html/HTMLVideoElement.h: >+ * html/ValidationMessage.cpp: >+ (WebCore::ValidationMessage::ValidationMessage): >+ (WebCore::ValidationMessage::setMessage): >+ (WebCore::ValidationMessage::setMessageDOMAndStartTimer): >+ (WebCore::ValidationMessage::requestToHideMessage): >+ * html/ValidationMessage.h: >+ > 2014-03-25 Jer Noble <jer.noble@apple.com> > > [iOS] Playing video does not disable display sleep. >Index: Source/WebCore/html/FormController.cpp >=================================================================== >--- Source/WebCore/html/FormController.cpp (revision 166247) >+++ Source/WebCore/html/FormController.cpp (working copy) >@@ -173,8 +173,12 @@ class SavedFormState { > WTF_MAKE_FAST_ALLOCATED; > > public: >- static OwnPtr<SavedFormState> create(); >- static OwnPtr<SavedFormState> deserialize(const Vector<String>&, size_t& index); >+ SavedFormState() >+ : m_controlStateCount(0) >+ { >+ } >+ >+ static std::unique_ptr<SavedFormState> deserialize(const Vector<String>&, size_t& index); > void serializeTo(Vector<String>&) const; > bool isEmpty() const { return m_stateForNewFormElements.isEmpty(); } > void appendControlState(const AtomicString& name, const AtomicString& type, const FormControlState&); >@@ -183,24 +187,17 @@ public: > Vector<String> getReferencedFilePaths() const; > > private: >- SavedFormState() : m_controlStateCount(0) { } >- > typedef HashMap<FormElementKey, Deque<FormControlState>, FormElementKeyHash, FormElementKeyHashTraits> FormElementStateMap; > FormElementStateMap m_stateForNewFormElements; > size_t m_controlStateCount; > }; > >-OwnPtr<SavedFormState> SavedFormState::create() >-{ >- return adoptPtr(new SavedFormState); >-} >- > static bool isNotFormControlTypeCharacter(UChar ch) > { > return ch != '-' && (ch > 'z' || ch < 'a'); > } > >-OwnPtr<SavedFormState> SavedFormState::deserialize(const Vector<String>& stateVector, size_t& index) >+std::unique_ptr<SavedFormState> SavedFormState::deserialize(const Vector<String>& stateVector, size_t& index) > { > if (index >= stateVector.size()) > return nullptr; >@@ -208,7 +205,7 @@ OwnPtr<SavedFormState> SavedFormState::d > size_t itemCount = stateVector[index++].toUInt(); > if (!itemCount) > return nullptr; >- OwnPtr<SavedFormState> savedFormState = adoptPtr(new SavedFormState); >+ auto savedFormState = std::make_unique<SavedFormState>(); > while (itemCount--) { > if (index + 1 >= stateVector.size()) > return nullptr; >@@ -219,7 +216,7 @@ OwnPtr<SavedFormState> SavedFormState::d > return nullptr; > savedFormState->appendControlState(name, type, state); > } >- return savedFormState.release(); >+ return std::move(savedFormState); > } > > void SavedFormState::serializeTo(Vector<String>& stateVector) const >@@ -289,13 +286,11 @@ class FormKeyGenerator { > WTF_MAKE_FAST_ALLOCATED; > > public: >- static OwnPtr<FormKeyGenerator> create() { return adoptPtr(new FormKeyGenerator); } >+ FormKeyGenerator() = default; > AtomicString formKey(const HTMLFormControlElementWithState&); > void willDeleteForm(HTMLFormElement*); > > private: >- FormKeyGenerator() { } >- > typedef HashMap<HTMLFormElement*, AtomicString> FormToKeyMap; > typedef HashMap<String, unsigned> FormSignatureToNextIndexMap; > FormToKeyMap m_formToKeyMap; >@@ -399,25 +394,25 @@ static String formStateSignature() > return signature; > } > >-OwnPtr<FormController::SavedFormStateMap> FormController::createSavedFormStateMap(const FormElementListHashSet& controlList) >+std::unique_ptr<FormController::SavedFormStateMap> FormController::createSavedFormStateMap(const FormElementListHashSet& controlList) > { >- OwnPtr<FormKeyGenerator> keyGenerator = FormKeyGenerator::create(); >- OwnPtr<SavedFormStateMap> stateMap = adoptPtr(new SavedFormStateMap); >+ auto keyGenerator = std::make_unique<FormKeyGenerator>(); >+ auto stateMap = std::make_unique<SavedFormStateMap>(); > for (FormElementListHashSet::const_iterator it = controlList.begin(); it != controlList.end(); ++it) { > HTMLFormControlElementWithState* control = it->get(); > if (!control->shouldSaveAndRestoreFormControlState()) > continue; >- SavedFormStateMap::AddResult result = stateMap->add(keyGenerator->formKey(*control).impl(), nullptr); >- if (result.isNewEntry) >- result.iterator->value = SavedFormState::create(); >- result.iterator->value->appendControlState(control->name(), control->type(), control->saveFormControlState()); >+ auto& formState = stateMap->add(keyGenerator->formKey(*control).impl(), nullptr).iterator->value; >+ if (!formState) >+ formState = std::make_unique<SavedFormState>(); >+ formState->appendControlState(control->name(), control->type(), control->saveFormControlState()); > } >- return stateMap.release(); >+ return std::move(stateMap); > } > > Vector<String> FormController::formElementsState() const > { >- OwnPtr<SavedFormStateMap> stateMap = createSavedFormStateMap(m_formElementsWithState); >+ std::unique_ptr<SavedFormStateMap> stateMap = createSavedFormStateMap(m_formElementsWithState); > Vector<String> stateVector; > stateVector.reserveInitialCapacity(m_formElementsWithState.size() * 4); > stateVector.append(formStateSignature()); >@@ -441,7 +436,7 @@ FormControlState FormController::takeSta > if (m_savedFormStateMap.isEmpty()) > return FormControlState(); > if (!m_formKeyGenerator) >- m_formKeyGenerator = FormKeyGenerator::create(); >+ m_formKeyGenerator = std::make_unique<FormKeyGenerator>(); > SavedFormStateMap::iterator it = m_savedFormStateMap.find(m_formKeyGenerator->formKey(control).impl()); > if (it == m_savedFormStateMap.end()) > return FormControlState(); >@@ -461,12 +456,12 @@ void FormController::formStatesFromState > > while (i + 1 < stateVector.size()) { > AtomicString formKey = stateVector[i++]; >- OwnPtr<SavedFormState> state = SavedFormState::deserialize(stateVector, i); >+ std::unique_ptr<SavedFormState> state = SavedFormState::deserialize(stateVector, i); > if (!state) { > i = 0; > break; > } >- map.add(formKey.impl(), state.release()); >+ map.add(formKey.impl(), std::move(state)); > } > if (i != stateVector.size()) > map.clear(); >Index: Source/WebCore/html/FormController.h >=================================================================== >--- Source/WebCore/html/FormController.h (revision 166247) >+++ Source/WebCore/html/FormController.h (working copy) >@@ -96,16 +96,16 @@ public: > > private: > typedef ListHashSet<RefPtr<HTMLFormControlElementWithState>, 64> FormElementListHashSet; >- typedef HashMap<RefPtr<AtomicStringImpl>, OwnPtr<SavedFormState>> SavedFormStateMap; >+ typedef HashMap<RefPtr<AtomicStringImpl>, std::unique_ptr<SavedFormState>> SavedFormStateMap; > >- static OwnPtr<SavedFormStateMap> createSavedFormStateMap(const FormElementListHashSet&); >+ static std::unique_ptr<SavedFormStateMap> createSavedFormStateMap(const FormElementListHashSet&); > FormControlState takeStateForFormElement(const HTMLFormControlElementWithState&); > static void formStatesFromStateVector(const Vector<String>&, SavedFormStateMap&); > > CheckedRadioButtons m_checkedRadioButtons; > FormElementListHashSet m_formElementsWithState; > SavedFormStateMap m_savedFormStateMap; >- OwnPtr<FormKeyGenerator> m_formKeyGenerator; >+ std::unique_ptr<FormKeyGenerator> m_formKeyGenerator; > }; > > } // namespace WebCore >Index: Source/WebCore/html/HTMLAreaElement.cpp >=================================================================== >--- Source/WebCore/html/HTMLAreaElement.cpp (revision 166247) >+++ Source/WebCore/html/HTMLAreaElement.cpp (working copy) >@@ -79,7 +79,7 @@ void HTMLAreaElement::invalidateCachedRe > bool HTMLAreaElement::mapMouseEvent(LayoutPoint location, const LayoutSize& size, HitTestResult& result) > { > if (m_lastSize != size) { >- m_region = adoptPtr(new Path(getRegion(size))); >+ m_region = std::make_unique<Path>(getRegion(size)); > m_lastSize = size; > } > >Index: Source/WebCore/html/HTMLAreaElement.h >=================================================================== >--- Source/WebCore/html/HTMLAreaElement.h (revision 166247) >+++ Source/WebCore/html/HTMLAreaElement.h (working copy) >@@ -64,7 +64,7 @@ private: > Path getRegion(const LayoutSize&) const; > void invalidateCachedRegion(); > >- OwnPtr<Path> m_region; >+ std::unique_ptr<Path> m_region; > std::unique_ptr<Length[]> m_coords; > int m_coordsLen; > LayoutSize m_lastSize; >Index: Source/WebCore/html/HTMLCanvasElement.cpp >=================================================================== >--- Source/WebCore/html/HTMLCanvasElement.cpp (revision 166247) >+++ Source/WebCore/html/HTMLCanvasElement.cpp (working copy) >@@ -447,7 +447,7 @@ void HTMLCanvasElement::setSurfaceSize(c > { > m_size = size; > m_hasCreatedImageBuffer = false; >- m_contextStateSaver.clear(); >+ m_contextStateSaver = nullptr; > m_imageBuffer.reset(); > clearCopiedImage(); > } >@@ -595,7 +595,7 @@ void HTMLCanvasElement::createImageBuffe > if (document().settings() && !document().settings()->antialiased2dCanvasEnabled()) > m_imageBuffer->context()->setShouldAntialias(false); > m_imageBuffer->context()->setStrokeThickness(1); >- m_contextStateSaver = adoptPtr(new GraphicsContextStateSaver(*m_imageBuffer->context())); >+ m_contextStateSaver = std::make_unique<GraphicsContextStateSaver>(*m_imageBuffer->context()); > > JSC::JSLockHolder lock(scriptExecutionContext()->vm()); > size_t numBytes = 4 * m_imageBuffer->internalSize().width() * m_imageBuffer->internalSize().height(); >Index: Source/WebCore/html/HTMLCanvasElement.h >=================================================================== >--- Source/WebCore/html/HTMLCanvasElement.h (revision 166247) >+++ Source/WebCore/html/HTMLCanvasElement.h (working copy) >@@ -191,7 +191,7 @@ private: > mutable bool m_hasCreatedImageBuffer; > mutable bool m_didClearImageBuffer; > mutable std::unique_ptr<ImageBuffer> m_imageBuffer; >- mutable OwnPtr<GraphicsContextStateSaver> m_contextStateSaver; >+ mutable std::unique_ptr<GraphicsContextStateSaver> m_contextStateSaver; > > mutable RefPtr<Image> m_presentedImage; > mutable RefPtr<Image> m_copiedImage; // FIXME: This is temporary for platforms that have to copy the image buffer to render (and for CSSCanvasValue). >Index: Source/WebCore/html/HTMLCollection.h >=================================================================== >--- Source/WebCore/html/HTMLCollection.h (revision 166247) >+++ Source/WebCore/html/HTMLCollection.h (working copy) >@@ -30,6 +30,7 @@ > #include "HTMLNames.h" > #include "LiveNodeList.h" > #include "ScriptWrappable.h" >+#include <memory> > #include <wtf/Forward.h> > #include <wtf/HashMap.h> > #include <wtf/Vector.h> >Index: Source/WebCore/html/HTMLFormControlElement.cpp >=================================================================== >--- Source/WebCore/html/HTMLFormControlElement.cpp (revision 166247) >+++ Source/WebCore/html/HTMLFormControlElement.cpp (working copy) >@@ -392,7 +392,7 @@ void HTMLFormControlElement::updateVisib > if (renderer() && willValidate()) > message = validationMessage().stripWhiteSpace(); > if (!m_validationMessage) >- m_validationMessage = ValidationMessage::create(this); >+ m_validationMessage = std::make_unique<ValidationMessage>(this); > m_validationMessage->updateValidationMessage(message); > } > >Index: Source/WebCore/html/HTMLFormControlElement.h >=================================================================== >--- Source/WebCore/html/HTMLFormControlElement.h (revision 166247) >+++ Source/WebCore/html/HTMLFormControlElement.h (working copy) >@@ -165,7 +165,7 @@ private: > virtual const HTMLFormControlElement& asHTMLElement() const override final { return *this; } > virtual HTMLFormControlElement* asFormNamedItem() override final { return this; } > >- OwnPtr<ValidationMessage> m_validationMessage; >+ std::unique_ptr<ValidationMessage> m_validationMessage; > bool m_disabled : 1; > bool m_isReadOnly : 1; > bool m_isRequired : 1; >Index: Source/WebCore/html/HTMLFormElement.cpp >=================================================================== >--- Source/WebCore/html/HTMLFormElement.cpp (revision 166247) >+++ Source/WebCore/html/HTMLFormElement.cpp (working copy) >@@ -699,7 +699,7 @@ void HTMLFormElement::addToPastNamesMap( > if (pastName.isEmpty()) > return; > if (!m_pastNamesMap) >- m_pastNamesMap = adoptPtr(new PastNamesMap); >+ m_pastNamesMap = std::make_unique<PastNamesMap>(); > m_pastNamesMap->set(pastName.impl(), item); > } > >Index: Source/WebCore/html/HTMLFormElement.h >=================================================================== >--- Source/WebCore/html/HTMLFormElement.h (revision 166247) >+++ Source/WebCore/html/HTMLFormElement.h (working copy) >@@ -28,7 +28,7 @@ > #include "FormState.h" > #include "FormSubmission.h" > #include "HTMLElement.h" >-#include <wtf/OwnPtr.h> >+#include <memory> > > #if ENABLE(IOS_AUTOCORRECT_AND_AUTOCAPITALIZE) > #include "Autocapitalize.h" >@@ -161,7 +161,7 @@ private: > typedef HashMap<RefPtr<AtomicStringImpl>, FormNamedItem*> PastNamesMap; > > FormSubmission::Attributes m_attributes; >- OwnPtr<PastNamesMap> m_pastNamesMap; >+ std::unique_ptr<PastNamesMap> m_pastNamesMap; > > CheckedRadioButtons m_checkedRadioButtons; > >Index: Source/WebCore/html/HTMLInputElement.cpp >=================================================================== >--- Source/WebCore/html/HTMLInputElement.cpp (revision 166247) >+++ Source/WebCore/html/HTMLInputElement.cpp (working copy) >@@ -85,12 +85,11 @@ using namespace HTMLNames; > class ListAttributeTargetObserver : IdTargetObserver { > WTF_MAKE_FAST_ALLOCATED; > public: >- static OwnPtr<ListAttributeTargetObserver> create(const AtomicString& id, HTMLInputElement*); >+ ListAttributeTargetObserver(const AtomicString& id, HTMLInputElement*); >+ > virtual void idTargetChanged() override; > > private: >- ListAttributeTargetObserver(const AtomicString& id, HTMLInputElement*); >- > HTMLInputElement* m_element; > }; > #endif >@@ -142,7 +141,7 @@ PassRefPtr<HTMLInputElement> HTMLInputEl > HTMLImageLoader* HTMLInputElement::imageLoader() > { > if (!m_imageLoader) >- m_imageLoader = adoptPtr(new HTMLImageLoader(*this)); >+ m_imageLoader = std::make_unique<HTMLImageLoader>(*this); > return m_imageLoader.get(); > } > >@@ -1587,7 +1586,7 @@ HTMLDataListElement* HTMLInputElement::d > void HTMLInputElement::resetListAttributeTargetObserver() > { > if (inDocument()) >- m_listAttributeTargetObserver = ListAttributeTargetObserver::create(fastGetAttribute(listAttr), this); >+ m_listAttributeTargetObserver = std::make_unique<ListAttributeTargetObserver>(fastGetAttribute(listAttr), this); > else > m_listAttributeTargetObserver = nullptr; > } >@@ -1856,11 +1855,6 @@ void HTMLInputElement::setWidth(unsigned > } > > #if ENABLE(DATALIST_ELEMENT) >-OwnPtr<ListAttributeTargetObserver> ListAttributeTargetObserver::create(const AtomicString& id, HTMLInputElement* element) >-{ >- return adoptPtr(new ListAttributeTargetObserver(id, element)); >-} >- > ListAttributeTargetObserver::ListAttributeTargetObserver(const AtomicString& id, HTMLInputElement* element) > : IdTargetObserver(element->treeScope().idTargetObserverRegistry(), id) > , m_element(element) >Index: Source/WebCore/html/HTMLInputElement.h >=================================================================== >--- Source/WebCore/html/HTMLInputElement.h (revision 166247) >+++ Source/WebCore/html/HTMLInputElement.h (working copy) >@@ -28,6 +28,7 @@ > #include "FileChooser.h" > #include "HTMLTextFormControlElement.h" > #include "StepRange.h" >+#include <memory> > > #if PLATFORM(IOS) > #include "DateComponents.h" >@@ -322,7 +323,7 @@ public: > virtual void setRangeText(const String& replacement, ExceptionCode&) override; > virtual void setRangeText(const String& replacement, unsigned start, unsigned end, const String& selectionMode, ExceptionCode&) override; > >- bool hasImageLoader() const { return m_imageLoader; } >+ bool hasImageLoader() const { return !!m_imageLoader; } > HTMLImageLoader* imageLoader(); > > #if ENABLE(DATE_AND_TIME_INPUT_TYPES) >@@ -454,9 +455,9 @@ private: > // The ImageLoader must be owned by this element because the loader code assumes > // that it lives as long as its owning element lives. If we move the loader into > // the ImageInput object we may delete the loader while this element lives on. >- OwnPtr<HTMLImageLoader> m_imageLoader; >+ std::unique_ptr<HTMLImageLoader> m_imageLoader; > #if ENABLE(DATALIST_ELEMENT) >- OwnPtr<ListAttributeTargetObserver> m_listAttributeTargetObserver; >+ std::unique_ptr<ListAttributeTargetObserver> m_listAttributeTargetObserver; > #endif > }; > >Index: Source/WebCore/html/HTMLVideoElement.cpp >=================================================================== >--- Source/WebCore/html/HTMLVideoElement.cpp (revision 166247) >+++ Source/WebCore/html/HTMLVideoElement.cpp (working copy) >@@ -86,7 +86,7 @@ void HTMLVideoElement::didAttachRenderer > updateDisplayState(); > if (shouldDisplayPosterImage()) { > if (!m_imageLoader) >- m_imageLoader = adoptPtr(new HTMLImageLoader(*this)); >+ m_imageLoader = std::make_unique<HTMLImageLoader>(*this); > m_imageLoader->updateFromElement(); > if (renderer()) > toRenderImage(renderer())->imageResource().setCachedImage(m_imageLoader->image()); >@@ -125,7 +125,7 @@ void HTMLVideoElement::parseAttribute(co > #endif > if (shouldDisplayPosterImage()) { > if (!m_imageLoader) >- m_imageLoader = adoptPtr(new HTMLImageLoader(*this)); >+ m_imageLoader = std::make_unique<HTMLImageLoader>(*this); > m_imageLoader->updateFromElementIgnoringPreviousError(); > } else { > if (renderer()) >Index: Source/WebCore/html/HTMLVideoElement.h >=================================================================== >--- Source/WebCore/html/HTMLVideoElement.h (revision 166247) >+++ Source/WebCore/html/HTMLVideoElement.h (working copy) >@@ -27,7 +27,9 @@ > #define HTMLVideoElement_h > > #if ENABLE(VIDEO) >+ > #include "HTMLMediaElement.h" >+#include <memory> > > namespace WebCore { > >@@ -95,7 +97,7 @@ private: > virtual void didMoveToNewDocument(Document* oldDocument) override; > virtual void setDisplayMode(DisplayMode) override; > >- OwnPtr<HTMLImageLoader> m_imageLoader; >+ std::unique_ptr<HTMLImageLoader> m_imageLoader; > > AtomicString m_defaultPosterURL; > }; >Index: Source/WebCore/html/ValidationMessage.cpp >=================================================================== >--- Source/WebCore/html/ValidationMessage.cpp (revision 166247) >+++ Source/WebCore/html/ValidationMessage.cpp (working copy) >@@ -46,13 +46,12 @@ > #include "StyleResolver.h" > #include "Text.h" > #include "ValidationMessageClient.h" >-#include <wtf/PassOwnPtr.h> > > namespace WebCore { > > using namespace HTMLNames; > >-ALWAYS_INLINE ValidationMessage::ValidationMessage(HTMLFormControlElement* element) >+ValidationMessage::ValidationMessage(HTMLFormControlElement* element) > : m_element(element) > { > ASSERT(m_element); >@@ -68,11 +67,6 @@ ValidationMessage::~ValidationMessage() > deleteBubbleTree(); > } > >-OwnPtr<ValidationMessage> ValidationMessage::create(HTMLFormControlElement* element) >-{ >- return adoptPtr(new ValidationMessage(element)); >-} >- > ValidationMessageClient* ValidationMessage::validationMessageClient() const > { > if (Page* page = m_element->document().page()) >@@ -113,9 +107,9 @@ void ValidationMessage::setMessage(const > ASSERT(!message.isEmpty()); > m_message = message; > if (!m_bubble) >- m_timer = adoptPtr(new Timer<ValidationMessage>(this, &ValidationMessage::buildBubbleTree)); >+ m_timer = std::make_unique<Timer<ValidationMessage>>(this, &ValidationMessage::buildBubbleTree); > else >- m_timer = adoptPtr(new Timer<ValidationMessage>(this, &ValidationMessage::setMessageDOMAndStartTimer)); >+ m_timer = std::make_unique<Timer<ValidationMessage>>(this, &ValidationMessage::setMessageDOMAndStartTimer); > m_timer->startOneShot(0); > } > >@@ -140,9 +134,9 @@ void ValidationMessage::setMessageDOMAnd > > int magnification = document.page() ? document.page()->settings().validationMessageTimerMagnification() : -1; > if (magnification <= 0) >- m_timer.clear(); >+ m_timer = nullptr; > else { >- m_timer = adoptPtr(new Timer<ValidationMessage>(this, &ValidationMessage::deleteBubbleTree)); >+ m_timer = std::make_unique<Timer<ValidationMessage>>(this, &ValidationMessage::deleteBubbleTree); > m_timer->startOneShot(std::max(5.0, static_cast<double>(m_message.length()) * magnification / 1000)); > } > } >@@ -222,7 +216,7 @@ void ValidationMessage::requestToHideMes > } > > // We must not modify the DOM tree in this context by the same reason as setMessage(). >- m_timer = adoptPtr(new Timer<ValidationMessage>(this, &ValidationMessage::deleteBubbleTree)); >+ m_timer = std::make_unique<Timer<ValidationMessage>>(this, &ValidationMessage::deleteBubbleTree); > m_timer->startOneShot(0); > } > >Index: Source/WebCore/html/ValidationMessage.h >=================================================================== >--- Source/WebCore/html/ValidationMessage.h (revision 166247) >+++ Source/WebCore/html/ValidationMessage.h (working copy) >@@ -32,8 +32,8 @@ > #define ValidationMessage_h > > #include "Timer.h" >+#include <memory> > #include <wtf/Noncopyable.h> >-#include <wtf/OwnPtr.h> > #include <wtf/RefPtr.h> > #include <wtf/text/WTFString.h> > >@@ -49,15 +49,15 @@ class ValidationMessageClient; > class ValidationMessage { > WTF_MAKE_NONCOPYABLE(ValidationMessage); WTF_MAKE_FAST_ALLOCATED; > public: >- static OwnPtr<ValidationMessage> create(HTMLFormControlElement*); >+ explicit ValidationMessage(HTMLFormControlElement*); > ~ValidationMessage(); >+ > void updateValidationMessage(const String&); > void requestToHideMessage(); > bool isVisible() const; > bool shadowTreeContains(const Node&) const; > > private: >- explicit ValidationMessage(HTMLFormControlElement*); > ValidationMessageClient* validationMessageClient() const; > void setMessage(const String&); > void setMessageDOMAndStartTimer(Timer<ValidationMessage>* = 0); >@@ -66,7 +66,7 @@ private: > > HTMLFormControlElement* m_element; > String m_message; >- OwnPtr<Timer<ValidationMessage>> m_timer; >+ std::unique_ptr<Timer<ValidationMessage>> m_timer; > RefPtr<HTMLElement> m_bubble; > RefPtr<HTMLElement> m_messageHeading; > RefPtr<HTMLElement> m_messageBody;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
andersca
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 129669
:
225753
| 227789