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-128967-20140219224819.patch (text/plain), 7.37 KB, created by
Zan Dobersek
on 2014-02-19 13:48:20 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Zan Dobersek
Created:
2014-02-19 13:48:20 PST
Size:
7.37 KB
patch
obsolete
>Subversion Revision: 164364 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 0d624d4f281623afb171068843ae7ecbd5dc9161..82e85c11ac0d6c81cc916f1670869607cbd065d5 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,25 @@ >+2014-02-19 Zan Dobersek <zdobersek@igalia.com> >+ >+ Move to using std::unique_ptr for VisitedLinkState, CheckedRadioButtons >+ https://bugs.webkit.org/show_bug.cgi?id=128967 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Replace uses of OwnPtr and PassOwnPtr in the VisitedLinkState and >+ CheckedRadioButtons classes with std::unique_ptr. >+ >+ * dom/CheckedRadioButtons.cpp: >+ (WebCore::RadioButtonGroup::RadioButtonGroup): >+ (WebCore::RadioButtonGroup::remove): >+ (WebCore::CheckedRadioButtons::addButton): >+ (WebCore::CheckedRadioButtons::removeButton): >+ * dom/CheckedRadioButtons.h: >+ * dom/Document.cpp: >+ (WebCore::Document::Document): >+ * dom/Document.h: >+ * dom/VisitedLinkState.cpp: >+ * dom/VisitedLinkState.h: >+ > 2014-02-19 Brady Eidson <beidson@apple.com> > > Add settings/preferences for enabling image controls >diff --git a/Source/WebCore/dom/CheckedRadioButtons.cpp b/Source/WebCore/dom/CheckedRadioButtons.cpp >index 5e223b9186b3647628cfcda0f9f746158c13c3ce..e65162712a28bdc5678614cf56a142e5599cfbe1 100644 >--- a/Source/WebCore/dom/CheckedRadioButtons.cpp >+++ b/Source/WebCore/dom/CheckedRadioButtons.cpp >@@ -29,7 +29,7 @@ namespace WebCore { > class RadioButtonGroup { > WTF_MAKE_FAST_ALLOCATED; > public: >- static PassOwnPtr<RadioButtonGroup> create(); >+ RadioButtonGroup(); > bool isEmpty() const { return m_members.isEmpty(); } > bool isRequired() const { return m_requiredCount; } > HTMLInputElement* checkedButton() const { return m_checkedButton; } >@@ -40,7 +40,6 @@ public: > bool contains(HTMLInputElement*) const; > > private: >- RadioButtonGroup(); > void setNeedsValidityCheckForAllButtons(); > bool isValid() const; > void setCheckedButton(HTMLInputElement*); >@@ -51,16 +50,11 @@ private: > }; > > RadioButtonGroup::RadioButtonGroup() >- : m_checkedButton(0) >+ : m_checkedButton(nullptr) > , m_requiredCount(0) > { > } > >-PassOwnPtr<RadioButtonGroup> RadioButtonGroup::create() >-{ >- return adoptPtr(new RadioButtonGroup); >-} >- > inline bool RadioButtonGroup::isValid() const > { > return !isRequired() || m_checkedButton; >@@ -140,7 +134,7 @@ void RadioButtonGroup::remove(HTMLInputElement* button) > --m_requiredCount; > } > if (m_checkedButton == button) >- m_checkedButton = 0; >+ m_checkedButton = nullptr; > > if (m_members.isEmpty()) { > ASSERT(!m_requiredCount); >@@ -190,11 +184,11 @@ void CheckedRadioButtons::addButton(HTMLInputElement* element) > return; > > if (!m_nameToGroupMap) >- m_nameToGroupMap = adoptPtr(new NameToGroupMap); >+ m_nameToGroupMap = std::make_unique<NameToGroupMap>(); > >- OwnPtr<RadioButtonGroup>& group = m_nameToGroupMap->add(element->name().impl(), PassOwnPtr<RadioButtonGroup>()).iterator->value; >+ std::unique_ptr<RadioButtonGroup>& group = m_nameToGroupMap->add(element->name().impl(), nullptr).iterator->value; > if (!group) >- group = RadioButtonGroup::create(); >+ group = std::make_unique<RadioButtonGroup>(); > group->add(element); > } > >@@ -263,7 +257,7 @@ void CheckedRadioButtons::removeButton(HTMLInputElement* element) > // of m_nameToGroupMap from AtomicStringImpl* to RefPtr<AtomicStringImpl>. > m_nameToGroupMap->remove(it); > if (m_nameToGroupMap->isEmpty()) >- m_nameToGroupMap.clear(); >+ m_nameToGroupMap.reset(); > } > } > >diff --git a/Source/WebCore/dom/CheckedRadioButtons.h b/Source/WebCore/dom/CheckedRadioButtons.h >index bb3570da90f5dbf38cfb1ebf68815c15a293d47b..056901c86d21873141a7dfe937bb8b4e0a84c76c 100644 >--- a/Source/WebCore/dom/CheckedRadioButtons.h >+++ b/Source/WebCore/dom/CheckedRadioButtons.h >@@ -21,9 +21,9 @@ > #ifndef CheckedRadioButtons_h > #define CheckedRadioButtons_h > >+#include <memory> > #include <wtf/Forward.h> > #include <wtf/HashMap.h> >-#include <wtf/OwnPtr.h> > > namespace WebCore { > >@@ -44,8 +44,8 @@ public: > bool isInRequiredGroup(HTMLInputElement*) const; > > private: >- typedef HashMap<AtomicStringImpl*, OwnPtr<RadioButtonGroup>> NameToGroupMap; >- OwnPtr<NameToGroupMap> m_nameToGroupMap; >+ typedef HashMap<AtomicStringImpl*, std::unique_ptr<RadioButtonGroup>> NameToGroupMap; >+ std::unique_ptr<NameToGroupMap> m_nameToGroupMap; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index 2eb16eb5f3ccb8972192906cd1de7efa4ed172a0..d5c337372b19ce831b6156369ae362ba4ee3407c 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -420,7 +420,7 @@ Document::Document(Frame* frame, const URL& url, unsigned documentClasses, unsig > , m_listenerTypes(0) > , m_mutationObserverTypes(0) > , m_styleSheetCollection(*this) >- , m_visitedLinkState(VisitedLinkState::create(*this)) >+ , m_visitedLinkState(std::make_unique<VisitedLinkState>(*this)) > , m_visuallyOrdered(false) > , m_readyState(Complete) > , m_bParsing(false) >diff --git a/Source/WebCore/dom/Document.h b/Source/WebCore/dom/Document.h >index 3ac85c4dab5602fb54e4470d47bcb7a201abc03d..522b9afef653101032d02e1693288c140ddd00aa 100644 >--- a/Source/WebCore/dom/Document.h >+++ b/Source/WebCore/dom/Document.h >@@ -52,6 +52,7 @@ > #include "UserActionElementSet.h" > #include "ViewportArguments.h" > #include <chrono> >+#include <memory> > #include <wtf/Deque.h> > #include <wtf/HashSet.h> > #include <wtf/OwnPtr.h> >@@ -1424,7 +1425,7 @@ private: > Color m_linkColor; > Color m_visitedLinkColor; > Color m_activeLinkColor; >- const OwnPtr<VisitedLinkState> m_visitedLinkState; >+ const std::unique_ptr<VisitedLinkState> m_visitedLinkState; > > bool m_visuallyOrdered; > ReadyState m_readyState; >diff --git a/Source/WebCore/dom/VisitedLinkState.cpp b/Source/WebCore/dom/VisitedLinkState.cpp >index 3b12f6c805a38af5465f4ea051d48dd9b351724a..a75442b414d178747b98cb9dd168e27f0a1ec1ad 100644 >--- a/Source/WebCore/dom/VisitedLinkState.cpp >+++ b/Source/WebCore/dom/VisitedLinkState.cpp >@@ -53,11 +53,6 @@ inline static const AtomicString* linkAttribute(Element& element) > return 0; > } > >-PassOwnPtr<VisitedLinkState> VisitedLinkState::create(Document& document) >-{ >- return adoptPtr(new VisitedLinkState(document)); >-} >- > VisitedLinkState::VisitedLinkState(Document& document) > : m_document(document) > { >diff --git a/Source/WebCore/dom/VisitedLinkState.h b/Source/WebCore/dom/VisitedLinkState.h >index 60273bb10871ac71d42f55937222917f4f79655f..0e8c439d0002bed71dce253d1f06b4480c573a5a 100644 >--- a/Source/WebCore/dom/VisitedLinkState.h >+++ b/Source/WebCore/dom/VisitedLinkState.h >@@ -33,7 +33,6 @@ > #include "LinkHash.h" > #include "RenderStyleConstants.h" > #include <wtf/HashSet.h> >-#include <wtf/OwnPtr.h> > > namespace WebCore { > >@@ -42,15 +41,13 @@ class Document; > class VisitedLinkState { > WTF_MAKE_FAST_ALLOCATED; > public: >- static PassOwnPtr<VisitedLinkState> create(Document&); >+ explicit VisitedLinkState(Document&); > > void invalidateStyleForAllLinks(); > void invalidateStyleForLink(LinkHash); > EInsideLink determineLinkState(Element*); > > private: >- explicit VisitedLinkState(Document&); >- > EInsideLink determineLinkStateSlowCase(Element&); > > Document& m_document;
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
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 128967
:
224669
|
224673