Title: [164420] trunk/Source/WebCore
Revision
164420
Author
[email protected]
Date
2014-02-20 01:46:47 -0800 (Thu, 20 Feb 2014)

Log Message

Move to using std::unique_ptr for Document and related classes
https://bugs.webkit.org/show_bug.cgi?id=129063

Reviewed by Anders Carlsson.

Replace uses of OwnPtr and PassOwnPtr in the Document and related classes with std::unique_ptr.

* dom/DOMImplementation.h:
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::removedLastRef):
(WebCore::Document::selectorQueryCache):
(WebCore::Document::implementation):
(WebCore::Document::formController):
(WebCore::Document::createStyleResolver):
(WebCore::Document::clearStyleResolver):
(WebCore::Document::clearAXObjectCache):
(WebCore::Document::axObjectCache):
(WebCore::Document::setParsing):
(WebCore::Document::styleResolverChanged):
(WebCore::Document::setTransformSource):
(WebCore::Document::accessSVGExtensions):
(WebCore::Document::sharedObjectPoolClearTimerFired):
(WebCore::Document::didAddTouchEventHandler):
* dom/Document.h:
* dom/DocumentEventQueue.cpp:
(WebCore::DocumentEventQueue::DocumentEventQueue):
* dom/DocumentEventQueue.h:
* dom/DocumentMarkerController.cpp:
(WebCore::DocumentMarkerController::addMarker):
* dom/DocumentMarkerController.h:
* dom/DocumentSharedObjectPool.cpp:
* dom/DocumentSharedObjectPool.h:
* dom/DocumentStyleSheetCollection.cpp:
(WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets):
(WebCore::DocumentStyleSheetCollection::activeStyleSheetsContains):
* dom/DocumentStyleSheetCollection.h:
* dom/DocumentType.h:
* html/FormController.h:
* rendering/TextAutosizer.h:
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::doEnd):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (164419 => 164420)


--- trunk/Source/WebCore/ChangeLog	2014-02-20 09:10:50 UTC (rev 164419)
+++ trunk/Source/WebCore/ChangeLog	2014-02-20 09:46:47 UTC (rev 164420)
@@ -1,3 +1,48 @@
+2014-02-20  Zan Dobersek  <[email protected]>
+
+        Move to using std::unique_ptr for Document and related classes
+        https://bugs.webkit.org/show_bug.cgi?id=129063
+
+        Reviewed by Anders Carlsson.
+
+        Replace uses of OwnPtr and PassOwnPtr in the Document and related classes with std::unique_ptr.
+
+        * dom/DOMImplementation.h:
+        * dom/Document.cpp:
+        (WebCore::Document::Document):
+        (WebCore::Document::removedLastRef):
+        (WebCore::Document::selectorQueryCache):
+        (WebCore::Document::implementation):
+        (WebCore::Document::formController):
+        (WebCore::Document::createStyleResolver):
+        (WebCore::Document::clearStyleResolver):
+        (WebCore::Document::clearAXObjectCache):
+        (WebCore::Document::axObjectCache):
+        (WebCore::Document::setParsing):
+        (WebCore::Document::styleResolverChanged):
+        (WebCore::Document::setTransformSource):
+        (WebCore::Document::accessSVGExtensions):
+        (WebCore::Document::sharedObjectPoolClearTimerFired):
+        (WebCore::Document::didAddTouchEventHandler):
+        * dom/Document.h:
+        * dom/DocumentEventQueue.cpp:
+        (WebCore::DocumentEventQueue::DocumentEventQueue):
+        * dom/DocumentEventQueue.h:
+        * dom/DocumentMarkerController.cpp:
+        (WebCore::DocumentMarkerController::addMarker):
+        * dom/DocumentMarkerController.h:
+        * dom/DocumentSharedObjectPool.cpp:
+        * dom/DocumentSharedObjectPool.h:
+        * dom/DocumentStyleSheetCollection.cpp:
+        (WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets):
+        (WebCore::DocumentStyleSheetCollection::activeStyleSheetsContains):
+        * dom/DocumentStyleSheetCollection.h:
+        * dom/DocumentType.h:
+        * html/FormController.h:
+        * rendering/TextAutosizer.h:
+        * xml/parser/XMLDocumentParserLibxml2.cpp:
+        (WebCore::XMLDocumentParser::doEnd):
+
 2014-02-20  Mihnea Ovidenie  <[email protected]>
 
         [CSSRegions] Add helper method for region clipping flow content

Modified: trunk/Source/WebCore/dom/DOMImplementation.h (164419 => 164420)


--- trunk/Source/WebCore/dom/DOMImplementation.h	2014-02-20 09:10:50 UTC (rev 164419)
+++ trunk/Source/WebCore/dom/DOMImplementation.h	2014-02-20 09:46:47 UTC (rev 164420)
@@ -26,6 +26,7 @@
 
 #include "Document.h"
 #include "MediaPlayer.h"
+#include <memory>
 #include <wtf/Forward.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
@@ -44,7 +45,8 @@
 class DOMImplementation : public ScriptWrappable {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    static PassOwnPtr<DOMImplementation> create(Document& document) { return adoptPtr(new DOMImplementation(document)); }
+    explicit DOMImplementation(Document&);
+
     
     void ref() { m_document.ref(); }
     void deref() { m_document.deref(); }
@@ -70,8 +72,6 @@
     static bool isTextMIMEType(const String& MIMEType);
 
 private:
-    explicit DOMImplementation(Document&);
-
     Document& m_document;
 };
 

Modified: trunk/Source/WebCore/dom/Document.cpp (164419 => 164420)


--- trunk/Source/WebCore/dom/Document.cpp	2014-02-20 09:10:50 UTC (rev 164419)
+++ trunk/Source/WebCore/dom/Document.cpp	2014-02-20 09:46:47 UTC (rev 164420)
@@ -435,7 +435,7 @@
     , m_updateFocusAppearanceRestoresSelection(false)
     , m_ignoreDestructiveWriteCount(0)
     , m_titleSetExplicitly(false)
-    , m_markers(adoptPtr(new DocumentMarkerController))
+    , m_markers(std::make_unique<DocumentMarkerController>())
     , m_updateFocusAppearanceTimer(this, &Document::updateFocusAppearanceTimerFired)
     , m_resetHiddenFocusElementTimer(this, &Document::resetHiddenFocusElementTimer)
     , m_cssTarget(nullptr)
@@ -520,7 +520,7 @@
     m_cachedResourceLoader->setDocument(this);
 
 #if ENABLE(TEXT_AUTOSIZING)
-    m_textAutosizer = TextAutosizer::create(this);
+    m_textAutosizer = std::make_unique<TextAutosizer>(this);
 #endif
 
     resetLinkColor();
@@ -665,7 +665,7 @@
 
         destroyTreeScopeData();
         removeDetachedChildren();
-        m_formController.clear();
+        m_formController = nullptr;
         
         m_markers->detach();
         
@@ -745,7 +745,7 @@
 SelectorQueryCache& Document::selectorQueryCache()
 {
     if (!m_selectorQueryCache)
-        m_selectorQueryCache = adoptPtr(new SelectorQueryCache());
+        m_selectorQueryCache = std::make_unique<SelectorQueryCache>();
     return *m_selectorQueryCache;
 }
 
@@ -796,7 +796,7 @@
 DOMImplementation* Document::implementation()
 {
     if (!m_implementation)
-        m_implementation = DOMImplementation::create(*this);
+        m_implementation = std::make_unique<DOMImplementation>(*this);
     return m_implementation.get();
 }
 
@@ -1602,7 +1602,7 @@
 FormController& Document::formController()
 {
     if (!m_formController)
-        m_formController = FormController::create();
+        m_formController = std::make_unique<FormController>();
     return *m_formController;
 }
 
@@ -1922,13 +1922,13 @@
     bool matchAuthorAndUserStyles = true;
     if (Settings* settings = this->settings())
         matchAuthorAndUserStyles = settings->authorAndUserStylesEnabled();
-    m_styleResolver = adoptPtr(new StyleResolver(*this, matchAuthorAndUserStyles));
+    m_styleResolver = std::make_unique<StyleResolver>(*this, matchAuthorAndUserStyles);
     m_styleSheetCollection.combineCSSFeatureFlags();
 }
 
 void Document::clearStyleResolver()
 {
-    m_styleResolver.clear();
+    m_styleResolver = nullptr;
 }
 
 void Document::createRenderTree()
@@ -2156,7 +2156,7 @@
     ASSERT(&topDocument() == this);
     // Clear the cache member variable before calling delete because attempts
     // are made to access it during destruction.
-    m_axObjectCache.clear();
+    m_axObjectCache = nullptr;
 }
 
 AXObjectCache* Document::existingAXObjectCache() const
@@ -2184,7 +2184,7 @@
 
     ASSERT(&topDocument == this || !m_axObjectCache);
     if (!topDocument.m_axObjectCache)
-        topDocument.m_axObjectCache = adoptPtr(new AXObjectCache(topDocument));
+        topDocument.m_axObjectCache = std::make_unique<AXObjectCache>(topDocument);
     return topDocument.m_axObjectCache.get();
 }
 
@@ -2465,7 +2465,7 @@
     m_bParsing = b;
 
     if (m_bParsing && !m_sharedObjectPool)
-        m_sharedObjectPool = DocumentSharedObjectPool::create();
+        m_sharedObjectPool = std::make_unique<DocumentSharedObjectPool>();
 
     if (!m_bParsing && view())
         view()->scheduleRelayout();
@@ -3179,7 +3179,7 @@
     // Don't bother updating, since we haven't loaded all our style info yet
     // and haven't calculated the style selector for the first time.
     if (!hasLivingRenderTree() || (!m_didCalculateStyleResolver && !haveStylesheetsLoaded())) {
-        m_styleResolver.clear();
+        m_styleResolver = nullptr;
         return;
     }
     m_didCalculateStyleResolver = true;
@@ -4228,9 +4228,9 @@
     InspectorInstrumentation::frameDocumentUpdated(ownerFrame);
 }
 
-void Document::setTransformSource(PassOwnPtr<TransformSource> source)
+void Document::setTransformSource(std::unique_ptr<TransformSource> source)
 {
-    m_transformSource = source;
+    m_transformSource = std::move(source);
 }
 
 #endif
@@ -4304,7 +4304,7 @@
 SVGDocumentExtensions* Document::accessSVGExtensions()
 {
     if (!m_svgExtensions)
-        m_svgExtensions = adoptPtr(new SVGDocumentExtensions(this));
+        m_svgExtensions = std::make_unique<SVGDocumentExtensions>(this);
     return m_svgExtensions.get();
 }
 
@@ -4420,7 +4420,7 @@
 
 void Document::sharedObjectPoolClearTimerFired(Timer<Document>&)
 {
-    m_sharedObjectPool.clear();
+    m_sharedObjectPool = nullptr;
 }
 
 void Document::didAccessStyleResolver()
@@ -5608,7 +5608,7 @@
 {
 #if ENABLE(TOUCH_EVENTS)
     if (!m_touchEventTargets.get())
-        m_touchEventTargets = adoptPtr(new TouchEventTargetSet);
+        m_touchEventTargets = std::make_unique<TouchEventTargetSet>();
     m_touchEventTargets->add(handler);
     if (Document* parent = parentDocument()) {
         parent->didAddTouchEventHandler(this);

Modified: trunk/Source/WebCore/dom/Document.h (164419 => 164420)


--- trunk/Source/WebCore/dom/Document.h	2014-02-20 09:10:50 UTC (rev 164419)
+++ trunk/Source/WebCore/dom/Document.h	2014-02-20 09:46:47 UTC (rev 164420)
@@ -950,7 +950,7 @@
     PassRefPtr<Document> transformSourceDocument() { return m_transformSourceDocument; }
     void setTransformSourceDocument(Document* doc) { m_transformSourceDocument = doc; }
 
-    void setTransformSource(PassOwnPtr<TransformSource>);
+    void setTransformSource(std::unique_ptr<TransformSource>);
     TransformSource* transformSource() const { return m_transformSource.get(); }
 #endif
 
@@ -1345,7 +1345,7 @@
 
     DeferrableOneShotTimer<Document> m_styleResolverThrowawayTimer;
 
-    OwnPtr<StyleResolver> m_styleResolver;
+    std::unique_ptr<StyleResolver> m_styleResolver;
     bool m_didCalculateStyleResolver;
     bool m_hasNodesWithPlaceholderStyle;
     bool m_needsNotifyRemoveAllPendingStylesheet;
@@ -1386,7 +1386,7 @@
 
     String m_baseTarget;
 
-    OwnPtr<DOMImplementation> m_implementation;
+    std::unique_ptr<DOMImplementation> m_implementation;
 
     RefPtr<CSSStyleSheet> m_elementSheet;
 
@@ -1419,7 +1419,7 @@
     DocumentStyleSheetCollection m_styleSheetCollection;
     RefPtr<StyleSheetList> m_styleSheetList;
 
-    OwnPtr<FormController> m_formController;
+    std::unique_ptr<FormController> m_formController;
 
     Color m_linkColor;
     Color m_visitedLinkColor;
@@ -1451,8 +1451,8 @@
     bool m_titleSetExplicitly;
     RefPtr<Element> m_titleElement;
 
-    OwnPtr<AXObjectCache> m_axObjectCache;
-    const OwnPtr<DocumentMarkerController> m_markers;
+    std::unique_ptr<AXObjectCache> m_axObjectCache;
+    const std::unique_ptr<DocumentMarkerController> m_markers;
     
     Timer<Document> m_updateFocusAppearanceTimer;
     Timer<Document> m_resetHiddenFocusElementTimer;
@@ -1475,7 +1475,7 @@
     Vector<RefPtr<HTMLScriptElement>> m_currentScriptStack;
 
 #if ENABLE(XSLT)
-    OwnPtr<TransformSource> m_transformSource;
+    std::unique_ptr<TransformSource> m_transformSource;
     RefPtr<Document> m_transformSourceDocument;
 #endif
 
@@ -1497,7 +1497,7 @@
 
     RefPtr<XPathEvaluator> m_xpathEvaluator;
 
-    OwnPtr<SVGDocumentExtensions> m_svgExtensions;
+    std::unique_ptr<SVGDocumentExtensions> m_svgExtensions;
 
 #if ENABLE(DASHBOARD_SUPPORT)
     Vector<AnnotatedRegionValue> m_annotatedRegions;
@@ -1527,7 +1527,7 @@
 
     DocumentOrderedMap m_imagesByUsemap;
 
-    OwnPtr<SelectorQueryCache> m_selectorQueryCache;
+    std::unique_ptr<SelectorQueryCache> m_selectorQueryCache;
 
     DocumentClassFlags m_documentClasses;
 
@@ -1579,7 +1579,7 @@
     
     unsigned m_wheelEventHandlerCount;
 #if ENABLE(TOUCH_EVENTS)
-    OwnPtr<TouchEventTargetSet> m_touchEventTargets;
+    std::unique_ptr<TouchEventTargetSet> m_touchEventTargets;
 #endif
 
     double m_lastHandledUserGestureTimestamp;
@@ -1632,7 +1632,7 @@
 #endif
 
 #if ENABLE(TEXT_AUTOSIZING)
-    OwnPtr<TextAutosizer> m_textAutosizer;
+    std::unique_ptr<TextAutosizer> m_textAutosizer;
 #endif
 
     void platformSuspendOrStopActiveDOMObjects();
@@ -1651,7 +1651,7 @@
     void sharedObjectPoolClearTimerFired(Timer<Document>&);
     Timer<Document> m_sharedObjectPoolClearTimer;
 
-    OwnPtr<DocumentSharedObjectPool> m_sharedObjectPool;
+    std::unique_ptr<DocumentSharedObjectPool> m_sharedObjectPool;
 
 #ifndef NDEBUG
     bool m_didDispatchViewportPropertiesChanged;

Modified: trunk/Source/WebCore/dom/DocumentEventQueue.cpp (164419 => 164420)


--- trunk/Source/WebCore/dom/DocumentEventQueue.cpp	2014-02-20 09:10:50 UTC (rev 164419)
+++ trunk/Source/WebCore/dom/DocumentEventQueue.cpp	2014-02-20 09:46:47 UTC (rev 164420)
@@ -38,18 +38,13 @@
     
 class DocumentEventQueue::Timer final : public SuspendableTimer {
 public:
-    static PassOwnPtr<Timer> create(DocumentEventQueue& eventQueue)
-    {
-        return adoptPtr(new Timer(eventQueue));
-    }
-
-private:
     Timer(DocumentEventQueue& eventQueue)
         : SuspendableTimer(&eventQueue.m_document)
         , m_eventQueue(eventQueue)
     {
     }
 
+private:
     virtual void fired() override
     {
         ASSERT(!isSuspended());
@@ -61,7 +56,7 @@
 
 DocumentEventQueue::DocumentEventQueue(Document& document)
     : m_document(document)
-    , m_pendingEventTimer(Timer::create(*this))
+    , m_pendingEventTimer(std::make_unique<Timer>(*this))
     , m_isClosed(false)
 {
     m_pendingEventTimer->suspendIfNeeded();

Modified: trunk/Source/WebCore/dom/DocumentEventQueue.h (164419 => 164420)


--- trunk/Source/WebCore/dom/DocumentEventQueue.h	2014-02-20 09:10:50 UTC (rev 164419)
+++ trunk/Source/WebCore/dom/DocumentEventQueue.h	2014-02-20 09:46:47 UTC (rev 164420)
@@ -29,9 +29,9 @@
 #define DocumentEventQueue_h
 
 #include "EventQueue.h"
+#include <memory>
 #include <wtf/HashSet.h>
 #include <wtf/ListHashSet.h>
-#include <wtf/OwnPtr.h>
 
 namespace WebCore {
 
@@ -57,7 +57,7 @@
     class Timer;
 
     Document& m_document;
-    OwnPtr<Timer> m_pendingEventTimer;
+    std::unique_ptr<Timer> m_pendingEventTimer;
     ListHashSet<RefPtr<Event>, 16> m_queuedEvents;
     HashSet<Node*> m_nodesWithQueuedScrollEvents;
     bool m_isClosed;

Modified: trunk/Source/WebCore/dom/DocumentMarkerController.cpp (164419 => 164420)


--- trunk/Source/WebCore/dom/DocumentMarkerController.cpp	2014-02-20 09:10:50 UTC (rev 164419)
+++ trunk/Source/WebCore/dom/DocumentMarkerController.cpp	2014-02-20 09:46:47 UTC (rev 164420)
@@ -168,10 +168,10 @@
 
     m_possiblyExistingMarkerTypes.add(newMarker.type());
 
-    OwnPtr<MarkerList>& list = m_markers.add(node, nullptr).iterator->value;
+    std::unique_ptr<MarkerList>& list = m_markers.add(node, nullptr).iterator->value;
 
     if (!list) {
-        list = adoptPtr(new MarkerList);
+        list = std::make_unique<MarkerList>();
         list->append(RenderedDocumentMarker(newMarker));
 #if PLATFORM(IOS)
     } else if (newMarker.type() == DocumentMarker::DictationPhraseWithAlternatives || newMarker.type() == DocumentMarker::DictationResult) {

Modified: trunk/Source/WebCore/dom/DocumentMarkerController.h (164419 => 164420)


--- trunk/Source/WebCore/dom/DocumentMarkerController.h	2014-02-20 09:10:50 UTC (rev 164419)
+++ trunk/Source/WebCore/dom/DocumentMarkerController.h	2014-02-20 09:46:47 UTC (rev 164420)
@@ -29,6 +29,7 @@
 
 #include "DocumentMarker.h"
 #include "IntRect.h"
+#include <memory>
 #include <wtf/HashMap.h>
 #include <wtf/Vector.h>
 
@@ -96,7 +97,7 @@
     void addMarker(Node*, const DocumentMarker&);
 
     typedef Vector<RenderedDocumentMarker> MarkerList;
-    typedef HashMap<RefPtr<Node>, OwnPtr<MarkerList>> MarkerMap;
+    typedef HashMap<RefPtr<Node>, std::unique_ptr<MarkerList>> MarkerMap;
     bool possiblyHasMarkers(DocumentMarker::MarkerTypes);
     void removeMarkersFromList(MarkerMap::iterator, DocumentMarker::MarkerTypes);
 

Modified: trunk/Source/WebCore/dom/DocumentSharedObjectPool.cpp (164419 => 164420)


--- trunk/Source/WebCore/dom/DocumentSharedObjectPool.cpp	2014-02-20 09:10:50 UTC (rev 164419)
+++ trunk/Source/WebCore/dom/DocumentSharedObjectPool.cpp	2014-02-20 09:46:47 UTC (rev 164420)
@@ -59,12 +59,4 @@
     return *cachedData;
 }
 
-DocumentSharedObjectPool::DocumentSharedObjectPool()
-{
 }
-
-DocumentSharedObjectPool::~DocumentSharedObjectPool()
-{
-}
-
-}

Modified: trunk/Source/WebCore/dom/DocumentSharedObjectPool.h (164419 => 164420)


--- trunk/Source/WebCore/dom/DocumentSharedObjectPool.h	2014-02-20 09:10:50 UTC (rev 164419)
+++ trunk/Source/WebCore/dom/DocumentSharedObjectPool.h	2014-02-20 09:46:47 UTC (rev 164420)
@@ -27,8 +27,8 @@
 #ifndef DocumentSharedObjectPool_h
 #define DocumentSharedObjectPool_h
 
+#include <memory>
 #include <wtf/HashMap.h>
-#include <wtf/PassOwnPtr.h>
 #include <wtf/RefPtr.h>
 #include <wtf/text/StringHash.h>
 
@@ -39,14 +39,9 @@
 
 class DocumentSharedObjectPool {
 public:
-    static PassOwnPtr<DocumentSharedObjectPool> create() { return adoptPtr(new DocumentSharedObjectPool); }
-    ~DocumentSharedObjectPool();
-
     PassRef<ShareableElementData> cachedShareableElementDataWithAttributes(const Vector<Attribute>&);
 
 private:
-    DocumentSharedObjectPool();
-
     typedef HashMap<unsigned, RefPtr<ShareableElementData>, AlreadyHashed> ShareableElementDataCache;
     ShareableElementDataCache m_shareableElementDataCache;
 };

Modified: trunk/Source/WebCore/dom/DocumentStyleSheetCollection.cpp (164419 => 164420)


--- trunk/Source/WebCore/dom/DocumentStyleSheetCollection.cpp	2014-02-20 09:10:50 UTC (rev 164419)
+++ trunk/Source/WebCore/dom/DocumentStyleSheetCollection.cpp	2014-02-20 09:46:47 UTC (rev 164420)
@@ -467,7 +467,7 @@
         resetCSSFeatureFlags();
     }
 
-    m_weakCopyOfActiveStyleSheetListForFastLookup.clear();
+    m_weakCopyOfActiveStyleSheetListForFastLookup = nullptr;
     m_activeAuthorStyleSheets.swap(activeCSSStyleSheets);
     m_styleSheetsForStyleSheetList.swap(activeStyleSheets);
 
@@ -480,7 +480,7 @@
 bool DocumentStyleSheetCollection::activeStyleSheetsContains(const CSSStyleSheet* sheet) const
 {
     if (!m_weakCopyOfActiveStyleSheetListForFastLookup) {
-        m_weakCopyOfActiveStyleSheetListForFastLookup = adoptPtr(new HashSet<const CSSStyleSheet*>);
+        m_weakCopyOfActiveStyleSheetListForFastLookup = std::make_unique<HashSet<const CSSStyleSheet*>>();
         for (unsigned i = 0; i < m_activeAuthorStyleSheets.size(); ++i)
             m_weakCopyOfActiveStyleSheetListForFastLookup->add(m_activeAuthorStyleSheets[i].get());
     }

Modified: trunk/Source/WebCore/dom/DocumentStyleSheetCollection.h (164419 => 164420)


--- trunk/Source/WebCore/dom/DocumentStyleSheetCollection.h	2014-02-20 09:10:50 UTC (rev 164419)
+++ trunk/Source/WebCore/dom/DocumentStyleSheetCollection.h	2014-02-20 09:46:47 UTC (rev 164420)
@@ -28,6 +28,7 @@
 #ifndef DocumentStyleSheetCollection_h
 #define DocumentStyleSheetCollection_h
 
+#include <memory>
 #include <wtf/FastMalloc.h>
 #include <wtf/ListHashSet.h>
 #include <wtf/RefPtr.h>
@@ -132,7 +133,7 @@
     Vector<RefPtr<CSSStyleSheet>> m_activeAuthorStyleSheets;
 
     // This is a mirror of m_activeAuthorStyleSheets that gets populated on demand for activeStyleSheetsContains().
-    mutable OwnPtr<HashSet<const CSSStyleSheet*>> m_weakCopyOfActiveStyleSheetListForFastLookup;
+    mutable std::unique_ptr<HashSet<const CSSStyleSheet*>> m_weakCopyOfActiveStyleSheetListForFastLookup;
 
     // Track the number of currently loading top-level stylesheets needed for rendering.
     // Sheets loaded using the @import directive are not included in this count.

Modified: trunk/Source/WebCore/dom/DocumentType.h (164419 => 164420)


--- trunk/Source/WebCore/dom/DocumentType.h	2014-02-20 09:10:50 UTC (rev 164419)
+++ trunk/Source/WebCore/dom/DocumentType.h	2014-02-20 09:46:47 UTC (rev 164420)
@@ -37,9 +37,9 @@
         return adoptRef(new DocumentType(document, name, publicId, systemId));
     }
 
-    // FIXME: We never fill m_entities and m_notations. Current implementation of NamedNodeMap doesn't work without an associated Element yet.
-    NamedNodeMap* entities() const { return m_entities.get(); }
-    NamedNodeMap* notations() const { return m_notations.get(); }
+    // FIXME: We return null entities and notations. Current implementation of NamedNodeMap doesn't work without an associated Element yet.
+    NamedNodeMap* entities() const { return nullptr; }
+    NamedNodeMap* notations() const { return nullptr; }
 
     const String& name() const { return m_name; }
     const String& publicId() const { return m_publicId; }
@@ -54,9 +54,6 @@
     virtual NodeType nodeType() const override;
     virtual PassRefPtr<Node> cloneNode(bool deep) override;
 
-    OwnPtr<NamedNodeMap> m_entities;
-    OwnPtr<NamedNodeMap> m_notations;
-
     String m_name;
     String m_publicId;
     String m_systemId;

Modified: trunk/Source/WebCore/html/FormController.h (164419 => 164420)


--- trunk/Source/WebCore/html/FormController.h	2014-02-20 09:10:50 UTC (rev 164419)
+++ trunk/Source/WebCore/html/FormController.h	2014-02-20 09:46:47 UTC (rev 164420)
@@ -74,10 +74,7 @@
 class FormController {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    static OwnPtr<FormController> create()
-    {
-        return adoptPtr(new FormController);
-    }
+    FormController();
     ~FormController();
 
     CheckedRadioButtons& checkedRadioButtons() { return m_checkedRadioButtons; }
@@ -101,7 +98,6 @@
     typedef ListHashSet<RefPtr<HTMLFormControlElementWithState>, 64> FormElementListHashSet;
     typedef HashMap<RefPtr<AtomicStringImpl>, OwnPtr<SavedFormState>> SavedFormStateMap;
 
-    FormController();
     static OwnPtr<SavedFormStateMap> createSavedFormStateMap(const FormElementListHashSet&);
     FormControlState takeStateForFormElement(const HTMLFormControlElementWithState&);
     static void formStatesFromStateVector(const Vector<String>&, SavedFormStateMap&);

Modified: trunk/Source/WebCore/rendering/TextAutosizer.h (164419 => 164420)


--- trunk/Source/WebCore/rendering/TextAutosizer.h	2014-02-20 09:10:50 UTC (rev 164419)
+++ trunk/Source/WebCore/rendering/TextAutosizer.h	2014-02-20 09:46:47 UTC (rev 164420)
@@ -46,8 +46,7 @@
     WTF_MAKE_NONCOPYABLE(TextAutosizer);
 
 public:
-    static PassOwnPtr<TextAutosizer> create(Document* document) { return adoptPtr(new TextAutosizer(document)); }
-
+    explicit TextAutosizer(Document*);
     virtual ~TextAutosizer();
 
     bool processSubtree(RenderObject* layoutRoot);
@@ -61,8 +60,6 @@
         LastToFirst
     };
 
-    explicit TextAutosizer(Document*);
-
     float clusterMultiplier(WritingMode, const TextAutosizingWindowInfo&, float textWidth) const;
 
     void processClusterInternal(TextAutosizingClusterInfo&, RenderBlock* container, RenderObject* subtreeRoot, const TextAutosizingWindowInfo&, float multiplier);

Modified: trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp (164419 => 164420)


--- trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp	2014-02-20 09:10:50 UTC (rev 164419)
+++ trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp	2014-02-20 09:46:47 UTC (rev 164420)
@@ -1374,7 +1374,7 @@
         xmlTreeViewer.transformDocumentToTreeView();
     } else if (m_sawXSLTransform) {
         void* doc = xmlDocPtrForString(document()->cachedResourceLoader(), m_originalSourceForTransform.toString(), document()->url().string());
-        document()->setTransformSource(adoptPtr(new TransformSource(doc)));
+        document()->setTransformSource(std::make_unique<TransformSource>(doc));
 
         document()->setParsing(false); // Make the document think it's done, so it will apply XSL stylesheets.
         document()->styleResolverChanged(RecalcStyleImmediately);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to