2011-04-27 Darin Adler <darin@apple.com>
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Apr 2011 21:25:22 +0000 (21:25 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Apr 2011 21:25:22 +0000 (21:25 +0000)
        Reviewed by David Levin.

        Fix strict OwnPtr issues seen in about 30 more files
        https://bugs.webkit.org/show_bug.cgi?id=59615

        * bindings/js/JSCallbackData.h:
        (WebCore::DeleteCallbackDataTask::create): Use adoptPtr.
        * bindings/js/JSMessageEventCustom.cpp:
        (WebCore::JSMessageEvent::initMessageEvent): Use adoptPtr.
        * css/CSSParser.cpp:
        (WebCore::CSSParser::updateSpecifiersWithElementName): Use OwnPtr,
        adoptPtr, and release.
        * dom/MessageEvent.cpp:
        (WebCore::MessageEvent::initMessageEvent): Use OwnPtr, adoptPtr,
        and release.
        * dom/MessagePortChannel.cpp:
        (WebCore::MessagePortChannel::EventData::create): Use adoptPtr.
        * dom/ScriptExecutionContext.cpp:
        (WebCore::ProcessMessagesSoonTask::create): Use adoptPtr.
        * dom/XMLDocumentParserLibxml2.cpp:
        (WebCore::XMLDocumentParser::doEnd): Use adoptPtr.
        * dom/default/PlatformMessagePortChannel.cpp:
        (WebCore::MessagePortChannel::create): Use adoptPtr.
        * html/HTMLFormControlElement.cpp:
        (WebCore::HTMLFormControlElement::detach): Use nullptr.
        * inspector/InspectorAgent.cpp:
        (WebCore::PostWorkerNotificationToFrontendTask::create): Use adoptPtr.
        * inspector/InspectorConsoleAgent.cpp:
        (WebCore::InspectorConsoleAgent::addMessageToConsole): Use adoptPtr.
        (WebCore::InspectorConsoleAgent::didReceiveResponse): Use adoptPtr.
        (WebCore::InspectorConsoleAgent::didFailLoading): Use adoptPtr.
        * inspector/InspectorController.cpp:
        (WebCore::InspectorController::connectFrontend): Use adoptPtr.
        * inspector/InspectorDOMAgent.cpp:
        (WebCore::InspectorDOMAgent::didInvalidateStyleAttr): Use adoptPtr.
        * inspector/InspectorResourceAgent.cpp:
        (WebCore::InspectorResourceAgent::InspectorResourceAgent): Use adoptPtr.
        * page/FrameActionScheduler.cpp:
        (WebCore::FrameActionScheduler::scheduleEvent): Use adoptPtr.
        * platform/graphics/ShadowBlur.cpp:
        (WebCore::ScratchBuffer::clearScratchBuffer): Use nullptr.
        * platform/graphics/ca/GraphicsLayerCA.cpp:
        (WebCore::GraphicsLayer::create): Use adoptPtr.
        (WebCore::GraphicsLayerCA::ensureCloneLayers): Use adoptPtr.
        (WebCore::GraphicsLayerCA::removeCloneLayers): Use nullptr.
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::setMaxMarginBeforeValues): Use adoptPtr.
        (WebCore::RenderBlock::setMaxMarginAfterValues): Use adoptPtr.
        (WebCore::RenderBlock::setPaginationStrut): Use adoptPtr.
        (WebCore::RenderBlock::setPageLogicalOffset): Use adoptPtr.
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::destroyGraphicsLayer): Use nullptr.
        (WebCore::RenderLayerBacking::updateClippingLayers): Use nullptr.
        (WebCore::RenderLayerBacking::updateForegroundLayer): Use nullptr.
        (WebCore::RenderLayerBacking::updateMaskLayer): Use nullptr.
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::updateOverflowControlsLayers): Use nullptr.
        (WebCore::RenderLayerCompositor::ensureRootPlatformLayer): Use nullptr.
        (WebCore::RenderLayerCompositor::destroyRootPlatformLayer): Use nullptr.
        * rendering/style/StyleRareNonInheritedData.cpp:
        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): Removed
        explicit initializations of OwnPtr members to 0. Use adoptPtr.
        * workers/SharedWorkerContext.cpp:
        (WebCore::createConnectEvent): Use adoptPtr.
        * workers/Worker.cpp:
        (WebCore::Worker::notifyFinished): Use nullptr.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@85094 268f45cc-cd09-0410-ab3c-d52691b4dbfc

22 files changed:
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSCallbackData.h
Source/WebCore/bindings/js/JSMessageEventCustom.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/dom/MessageEvent.cpp
Source/WebCore/dom/MessagePortChannel.cpp
Source/WebCore/dom/ScriptExecutionContext.cpp
Source/WebCore/dom/XMLDocumentParserLibxml2.cpp
Source/WebCore/dom/default/PlatformMessagePortChannel.cpp
Source/WebCore/html/HTMLFormControlElement.cpp
Source/WebCore/inspector/InspectorAgent.cpp
Source/WebCore/inspector/InspectorConsoleAgent.cpp
Source/WebCore/inspector/InspectorController.cpp
Source/WebCore/inspector/InspectorDOMAgent.cpp
Source/WebCore/inspector/InspectorResourceAgent.cpp
Source/WebCore/page/FrameActionScheduler.cpp
Source/WebCore/platform/graphics/ShadowBlur.cpp
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/rendering/RenderBlock.cpp
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/workers/SharedWorkerContext.cpp

index 994ba7e..1208d6e 100644 (file)
@@ -1,3 +1,72 @@
+2011-04-27  Darin Adler  <darin@apple.com>
+
+        Reviewed by David Levin.
+
+        Fix strict OwnPtr issues seen in about 30 more files
+        https://bugs.webkit.org/show_bug.cgi?id=59615
+
+        * bindings/js/JSCallbackData.h:
+        (WebCore::DeleteCallbackDataTask::create): Use adoptPtr.
+        * bindings/js/JSMessageEventCustom.cpp:
+        (WebCore::JSMessageEvent::initMessageEvent): Use adoptPtr.
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::updateSpecifiersWithElementName): Use OwnPtr,
+        adoptPtr, and release.
+        * dom/MessageEvent.cpp:
+        (WebCore::MessageEvent::initMessageEvent): Use OwnPtr, adoptPtr,
+        and release.
+        * dom/MessagePortChannel.cpp:
+        (WebCore::MessagePortChannel::EventData::create): Use adoptPtr.
+        * dom/ScriptExecutionContext.cpp:
+        (WebCore::ProcessMessagesSoonTask::create): Use adoptPtr.
+        * dom/XMLDocumentParserLibxml2.cpp:
+        (WebCore::XMLDocumentParser::doEnd): Use adoptPtr.
+        * dom/default/PlatformMessagePortChannel.cpp:
+        (WebCore::MessagePortChannel::create): Use adoptPtr.
+        * html/HTMLFormControlElement.cpp:
+        (WebCore::HTMLFormControlElement::detach): Use nullptr.
+        * inspector/InspectorAgent.cpp:
+        (WebCore::PostWorkerNotificationToFrontendTask::create): Use adoptPtr.
+        * inspector/InspectorConsoleAgent.cpp:
+        (WebCore::InspectorConsoleAgent::addMessageToConsole): Use adoptPtr.
+        (WebCore::InspectorConsoleAgent::didReceiveResponse): Use adoptPtr.
+        (WebCore::InspectorConsoleAgent::didFailLoading): Use adoptPtr.
+        * inspector/InspectorController.cpp:
+        (WebCore::InspectorController::connectFrontend): Use adoptPtr.
+        * inspector/InspectorDOMAgent.cpp:
+        (WebCore::InspectorDOMAgent::didInvalidateStyleAttr): Use adoptPtr.
+        * inspector/InspectorResourceAgent.cpp:
+        (WebCore::InspectorResourceAgent::InspectorResourceAgent): Use adoptPtr.
+        * page/FrameActionScheduler.cpp:
+        (WebCore::FrameActionScheduler::scheduleEvent): Use adoptPtr.
+        * platform/graphics/ShadowBlur.cpp:
+        (WebCore::ScratchBuffer::clearScratchBuffer): Use nullptr.
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayer::create): Use adoptPtr.
+        (WebCore::GraphicsLayerCA::ensureCloneLayers): Use adoptPtr.
+        (WebCore::GraphicsLayerCA::removeCloneLayers): Use nullptr.
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::setMaxMarginBeforeValues): Use adoptPtr.
+        (WebCore::RenderBlock::setMaxMarginAfterValues): Use adoptPtr.
+        (WebCore::RenderBlock::setPaginationStrut): Use adoptPtr.
+        (WebCore::RenderBlock::setPageLogicalOffset): Use adoptPtr.
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::destroyGraphicsLayer): Use nullptr.
+        (WebCore::RenderLayerBacking::updateClippingLayers): Use nullptr.
+        (WebCore::RenderLayerBacking::updateForegroundLayer): Use nullptr.
+        (WebCore::RenderLayerBacking::updateMaskLayer): Use nullptr.
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::updateOverflowControlsLayers): Use nullptr.
+        (WebCore::RenderLayerCompositor::ensureRootPlatformLayer): Use nullptr.
+        (WebCore::RenderLayerCompositor::destroyRootPlatformLayer): Use nullptr.
+        * rendering/style/StyleRareNonInheritedData.cpp:
+        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): Removed
+        explicit initializations of OwnPtr members to 0. Use adoptPtr.
+        * workers/SharedWorkerContext.cpp:
+        (WebCore::createConnectEvent): Use adoptPtr.
+        * workers/Worker.cpp:
+        (WebCore::Worker::notifyFinished): Use nullptr.
+
 2011-04-27  Enrica Casucci  <enrica@apple.com>
 
         Reviewed by Darin Adler.
index 94ca48d..e1500e7 100644 (file)
@@ -77,7 +77,7 @@ class DeleteCallbackDataTask : public ScriptExecutionContext::Task {
 public:
     static PassOwnPtr<DeleteCallbackDataTask> create(JSCallbackData* data)
     {
-        return new DeleteCallbackDataTask(data);
+        return adoptPtr(new DeleteCallbackDataTask(data));
     }
 
     virtual void performTask(ScriptExecutionContext*)
index 54f2b80..439664a 100644 (file)
@@ -67,7 +67,7 @@ JSC::JSValue JSMessageEvent::initMessageEvent(JSC::ExecState* exec)
     DOMWindow* sourceArg = toDOMWindow(exec->argument(6));
     OwnPtr<MessagePortArray> messagePorts;
     if (!exec->argument(7).isUndefinedOrNull()) {
-        messagePorts = new MessagePortArray();
+        messagePorts = adoptPtr(new MessagePortArray);
         fillMessagePortArray(exec, exec->argument(7), *messagePorts);
         if (exec->hadException())
             return jsUndefined();
index cf853dd..8f7b7dd 100644 (file)
@@ -6387,9 +6387,9 @@ void CSSParser::updateSpecifiersWithElementName(const AtomicString& namespacePre
     if (elementName == starAtom && m_defaultNamespace == starAtom)
         return;
 
-    CSSParserSelector* elementNameSelector = new CSSParserSelector;
+    OwnPtr<CSSParserSelector> elementNameSelector = adoptPtr(new CSSParserSelector);
     elementNameSelector->setTag(tag);
-    lastShadowDescendant->setTagHistory(elementNameSelector);
+    lastShadowDescendant->setTagHistory(elementNameSelector.release());
     lastShadowDescendant->setRelation(CSSSelector::ShadowDescendant);
 }
 
index 3c84642..b433381 100644 (file)
@@ -77,12 +77,12 @@ MessagePort* MessageEvent::messagePort()
 
 void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> data, const String& origin, const String& lastEventId, DOMWindow* source, MessagePort* port)
 {
-    MessagePortArray* ports = 0;
+    OwnPtr<MessagePortArray> ports;
     if (port) {
-        ports = new MessagePortArray();
+        ports = adoptPtr(new MessagePortArray);
         ports->append(port);
     }
-    initMessageEvent(type, canBubble, cancelable, data, origin, lastEventId, source, ports);
+    initMessageEvent(type, canBubble, cancelable, data, origin, lastEventId, source, ports.release());
 }
 
 bool MessageEvent::isMessageEvent() const 
index cb431a1..367f7ed 100644 (file)
@@ -35,7 +35,7 @@ namespace WebCore {
 
 PassOwnPtr<MessagePortChannel::EventData> MessagePortChannel::EventData::create(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels)
 {
-    return new EventData(message, channels);
+    return adoptPtr(new EventData(message, channels));
 }
 
 MessagePortChannel::EventData::EventData(PassRefPtr<SerializedScriptValue> message, PassOwnPtr<MessagePortChannelArray> channels)
index b9a1e92..9b5dd6f 100644 (file)
@@ -60,7 +60,7 @@ class ProcessMessagesSoonTask : public ScriptExecutionContext::Task {
 public:
     static PassOwnPtr<ProcessMessagesSoonTask> create()
     {
-        return new ProcessMessagesSoonTask;
+        return adoptPtr(new ProcessMessagesSoonTask);
     }
 
     virtual void performTask(ScriptExecutionContext* context)
index d8787fc..9f9c92f 100644 (file)
@@ -1351,7 +1351,7 @@ void XMLDocumentParser::doEnd()
 
     if (m_sawXSLTransform) {
         void* doc = xmlDocPtrForString(document()->cachedResourceLoader(), m_originalSourceForTransform, document()->url().string());
-        document()->setTransformSource(new TransformSource(doc));
+        document()->setTransformSource(adoptPtr(new TransformSource(doc)));
 
         document()->setParsing(false); // Make the document think it's done, so it will apply XSL stylesheets.
         document()->styleSelectorChanged(RecalcStyleImmediately);
index 9e0e7dc..20ffec4 100644 (file)
@@ -44,7 +44,7 @@ void MessagePortChannel::createChannel(PassRefPtr<MessagePort> port1, PassRefPtr
 
 PassOwnPtr<MessagePortChannel> MessagePortChannel::create(PassRefPtr<PlatformMessagePortChannel> channel)
 {
-    return new MessagePortChannel(channel);
+    return adoptPtr(new MessagePortChannel(channel));
 }
 
 MessagePortChannel::MessagePortChannel(PassRefPtr<PlatformMessagePortChannel> channel)
index 847e454..d5080a0 100644 (file)
@@ -81,7 +81,7 @@ HTMLFormControlElement::~HTMLFormControlElement()
 
 void HTMLFormControlElement::detach()
 {
-    m_validationMessage = 0;
+    m_validationMessage = nullptr;
     HTMLElement::detach();
 }
 
index eb2f36e..0941ab7 100644 (file)
@@ -330,7 +330,7 @@ class PostWorkerNotificationToFrontendTask : public ScriptExecutionContext::Task
 public:
     static PassOwnPtr<PostWorkerNotificationToFrontendTask> create(PassRefPtr<InspectorWorkerResource> worker, InspectorAgent::WorkerAction action)
     {
-        return new PostWorkerNotificationToFrontendTask(worker, action);
+        return adoptPtr(new PostWorkerNotificationToFrontendTask(worker, action));
     }
 
 private:
index 53d647f..1c31969 100644 (file)
@@ -128,14 +128,14 @@ void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageTyp
 {
     if (!m_inspectorAgent->enabled())
         return;
-    addConsoleMessage(new ConsoleMessage(source, type, level, message, arguments, callStack));
+    addConsoleMessage(adoptPtr(new ConsoleMessage(source, type, level, message, arguments, callStack)));
 }
 
 void InspectorConsoleAgent::addMessageToConsole(MessageSource source, MessageType type, MessageLevel level, const String& message, unsigned lineNumber, const String& sourceID)
 {
     if (!m_inspectorAgent->enabled())
         return;
-    addConsoleMessage(new ConsoleMessage(source, type, level, message, lineNumber, sourceID));
+    addConsoleMessage(adoptPtr(new ConsoleMessage(source, type, level, message, lineNumber, sourceID)));
 }
 
 void InspectorConsoleAgent::startTiming(const String& title)
@@ -207,7 +207,7 @@ void InspectorConsoleAgent::didReceiveResponse(unsigned long identifier, const R
 
     if (response.httpStatusCode() >= 400) {
         String message = makeString("Failed to load resource: the server responded with a status of ", String::number(response.httpStatusCode()), " (", response.httpStatusText(), ')');
-        addConsoleMessage(new ConsoleMessage(OtherMessageSource, NetworkErrorMessageType, ErrorMessageLevel, message, response.url().string(), identifier));
+        addConsoleMessage(adoptPtr(new ConsoleMessage(OtherMessageSource, NetworkErrorMessageType, ErrorMessageLevel, message, response.url().string(), identifier)));
     }
 }
 
@@ -220,7 +220,7 @@ void InspectorConsoleAgent::didFailLoading(unsigned long identifier, const Resou
     String message = "Failed to load resource";
     if (!error.localizedDescription().isEmpty())
         message += ": " + error.localizedDescription();
-    addConsoleMessage(new ConsoleMessage(OtherMessageSource, NetworkErrorMessageType, ErrorMessageLevel, message, error.failingURL(), identifier));
+    addConsoleMessage(adoptPtr(new ConsoleMessage(OtherMessageSource, NetworkErrorMessageType, ErrorMessageLevel, message, error.failingURL(), identifier)));
 }
 
 void InspectorConsoleAgent::setMonitoringXHREnabled(ErrorString*, bool enabled)
index 98ddbcc..269f7be 100644 (file)
@@ -105,7 +105,7 @@ void InspectorController::stopTimelineProfiler()
 void InspectorController::connectFrontend()
 {
     m_openingFrontend = false;
-    m_inspectorFrontend = new InspectorFrontend(m_inspectorClient);
+    m_inspectorFrontend = adoptPtr(new InspectorFrontend(m_inspectorClient));
     m_injectedScriptManager->injectedScriptHost()->setFrontend(m_inspectorFrontend.get());
     m_inspectorAgent->setFrontend(m_inspectorFrontend.get());
 
@@ -114,7 +114,7 @@ void InspectorController::connectFrontend()
     InspectorInstrumentation::frontendCreated();
 
     ASSERT(m_inspectorClient);
-    m_inspectorBackendDispatcher = new InspectorBackendDispatcher(
+    m_inspectorBackendDispatcher = adoptPtr(new InspectorBackendDispatcher(
         m_inspectorClient,
 #if ENABLE(OFFLINE_WEB_APPLICATIONS)
         m_inspectorAgent->applicationCacheAgent(),
@@ -144,7 +144,7 @@ void InspectorController::connectFrontend()
 #if ENABLE(WORKERS)
         , m_inspectorAgent->workerAgent()
 #endif
-    );
+    ));
 
     if (m_startUserInitiatedDebuggingWhenFrontedIsConnected) {
         m_inspectorFrontend->inspector()->startUserInitiatedDebugging();
index 10c1a71..b285caf 100644 (file)
@@ -1293,7 +1293,7 @@ void InspectorDOMAgent::didInvalidateStyleAttr(Node* node)
         return;
 
     if (!m_revalidateStyleAttrTask)
-        m_revalidateStyleAttrTask = new RevalidateStyleAttributeTask(this);
+        m_revalidateStyleAttrTask = adoptPtr(new RevalidateStyleAttributeTask(this));
     m_revalidateStyleAttrTask->scheduleFor(static_cast<Element*>(node));
 }
 
index 1a8b729..3cc8e44 100644 (file)
@@ -374,10 +374,10 @@ InspectorResourceAgent::InspectorResourceAgent(InstrumentingAgents* instrumentin
     , m_state(state)
 {
     if (backgroundEventsCollectionEnabled()) {
-        m_eventsCollector = new EventsCollector();
-        m_inspectorFrontendProxy = new InspectorFrontendProxy(m_eventsCollector.get());
+        m_eventsCollector = adoptPtr(new EventsCollector);
+        m_inspectorFrontendProxy = adoptPtr(new InspectorFrontendProxy(m_eventsCollector.get()));
         // Create mock frontend, so we can collect network events.
-        m_mockFrontend = new InspectorFrontend::Network(m_inspectorFrontendProxy.get());
+        m_mockFrontend = adoptPtr(new InspectorFrontend::Network(m_inspectorFrontendProxy.get()));
         m_frontend = m_mockFrontend.get();
         enable();
     } else
index 66d9b3c..cf193cc 100644 (file)
@@ -104,7 +104,7 @@ void FrameActionScheduler::scheduleAction(PassOwnPtr<FrameAction> action)
 
 void FrameActionScheduler::scheduleEvent(PassRefPtr<Event> event, PassRefPtr<Node> eventTarget)
 {
-    scheduleAction(new EventFrameAction(event, eventTarget));
+    scheduleAction(adoptPtr(new EventFrameAction(event, eventTarget)));
 }
 
 
index 8b5c7f6..b3d1f89 100644 (file)
@@ -140,7 +140,7 @@ private:
     
     void clearScratchBuffer()
     {
-        m_imageBuffer = 0;
+        m_imageBuffer = nullptr;
         m_lastRadius = FloatSize();
     }
 
index 2597847..54f7b02 100644 (file)
@@ -239,7 +239,7 @@ static bool animationHasStepsTimingFunction(const KeyframeValueList& valueList,
 
 PassOwnPtr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerClient* client)
 {
-    return new GraphicsLayerCA(client);
+    return adoptPtr(new GraphicsLayerCA(client));
 }
 
 GraphicsLayerCA::GraphicsLayerCA(GraphicsLayerClient* client)
@@ -2151,13 +2151,13 @@ void GraphicsLayerCA::ensureCloneLayers(CloneID cloneID, RefPtr<PlatformCALayer>
     contentsLayer = 0;
 
     if (!m_layerClones)
-        m_layerClones = new LayerMap;
+        m_layerClones = adoptPtr(new LayerMap);
 
     if (!m_structuralLayerClones && m_structuralLayer)
-        m_structuralLayerClones = new LayerMap;
+        m_structuralLayerClones = adoptPtr(new LayerMap);
 
     if (!m_contentsLayerClones && m_contentsLayer)
-        m_contentsLayerClones = new LayerMap;
+        m_contentsLayerClones = adoptPtr(new LayerMap);
 
     primaryLayer = findOrMakeClone(cloneID, m_layer.get(), m_layerClones.get(), cloneLevel);
     structuralLayer = findOrMakeClone(cloneID, m_structuralLayer.get(), m_structuralLayerClones.get(), cloneLevel);
@@ -2166,9 +2166,9 @@ void GraphicsLayerCA::ensureCloneLayers(CloneID cloneID, RefPtr<PlatformCALayer>
 
 void GraphicsLayerCA::removeCloneLayers()
 {
-    m_layerClones = 0;
-    m_structuralLayerClones = 0;
-    m_contentsLayerClones = 0;
+    m_layerClones = nullptr;
+    m_structuralLayerClones = nullptr;
+    m_contentsLayerClones = nullptr;
 }
 
 FloatPoint GraphicsLayerCA::positionForCloneRootLayer() const
index 0a0471d..23bc323 100644 (file)
@@ -5587,7 +5587,7 @@ void RenderBlock::setMaxMarginBeforeValues(int pos, int neg)
     if (!m_rareData) {
         if (pos == RenderBlockRareData::positiveMarginBeforeDefault(this) && neg == RenderBlockRareData::negativeMarginBeforeDefault(this))
             return;
-        m_rareData = new RenderBlockRareData(this);
+        m_rareData = adoptPtr(new RenderBlockRareData(this));
     }
     m_rareData->m_margins.setPositiveMarginBefore(pos);
     m_rareData->m_margins.setNegativeMarginBefore(neg);
@@ -5598,7 +5598,7 @@ void RenderBlock::setMaxMarginAfterValues(int pos, int neg)
     if (!m_rareData) {
         if (pos == RenderBlockRareData::positiveMarginAfterDefault(this) && neg == RenderBlockRareData::negativeMarginAfterDefault(this))
             return;
-        m_rareData = new RenderBlockRareData(this);
+        m_rareData = adoptPtr(new RenderBlockRareData(this));
     }
     m_rareData->m_margins.setPositiveMarginAfter(pos);
     m_rareData->m_margins.setNegativeMarginAfter(neg);
@@ -5609,7 +5609,7 @@ void RenderBlock::setPaginationStrut(int strut)
     if (!m_rareData) {
         if (!strut)
             return;
-        m_rareData = new RenderBlockRareData(this);
+        m_rareData = adoptPtr(new RenderBlockRareData(this));
     }
     m_rareData->m_paginationStrut = strut;
 }
@@ -5619,7 +5619,7 @@ void RenderBlock::setPageLogicalOffset(int logicalOffset)
     if (!m_rareData) {
         if (!logicalOffset)
             return;
-        m_rareData = new RenderBlockRareData(this);
+        m_rareData = adoptPtr(new RenderBlockRareData(this));
     }
     m_rareData->m_pageLogicalOffset = logicalOffset;
 }
index e591442..f4d771f 100644 (file)
@@ -123,10 +123,10 @@ void RenderLayerBacking::destroyGraphicsLayer()
     if (m_graphicsLayer)
         m_graphicsLayer->removeFromParent();
 
-    m_graphicsLayer = 0;
-    m_foregroundLayer = 0;
-    m_clippingLayer = 0;
-    m_maskLayer = 0;
+    m_graphicsLayer = nullptr;
+    m_foregroundLayer = nullptr;
+    m_clippingLayer = nullptr;
+    m_maskLayer = nullptr;
 }
 
 void RenderLayerBacking::updateLayerOpacity(const RenderStyle* style)
@@ -541,7 +541,7 @@ bool RenderLayerBacking::updateClippingLayers(bool needsAncestorClip, bool needs
         }
     } else if (m_ancestorClippingLayer) {
         m_ancestorClippingLayer->removeFromParent();
-        m_ancestorClippingLayer = 0;
+        m_ancestorClippingLayer = nullptr;
         layersChanged = true;
     }
     
@@ -556,7 +556,7 @@ bool RenderLayerBacking::updateClippingLayers(bool needsAncestorClip, bool needs
         }
     } else if (m_clippingLayer) {
         m_clippingLayer->removeFromParent();
-        m_clippingLayer = 0;
+        m_clippingLayer = nullptr;
         layersChanged = true;
     }
     
@@ -652,7 +652,7 @@ bool RenderLayerBacking::updateForegroundLayer(bool needsForegroundLayer)
         }
     } else if (m_foregroundLayer) {
         m_foregroundLayer->removeFromParent();
-        m_foregroundLayer = 0;
+        m_foregroundLayer = nullptr;
         layerChanged = true;
     }
 
@@ -678,7 +678,7 @@ bool RenderLayerBacking::updateMaskLayer(bool needsMaskLayer)
             layerChanged = true;
         }
     } else if (m_maskLayer) {
-        m_maskLayer = 0;
+        m_maskLayer = nullptr;
         layerChanged = true;
     }
 
index 790e109..0eb12cc 100644 (file)
@@ -1508,7 +1508,7 @@ void RenderLayerCompositor::updateOverflowControlsLayers()
         layersChanged = true;
     } else if (m_layerForHorizontalScrollbar) {
         m_layerForHorizontalScrollbar->removeFromParent();
-        m_layerForHorizontalScrollbar = 0;
+        m_layerForHorizontalScrollbar = nullptr;
         layersChanged = true;
     }
 
@@ -1521,7 +1521,7 @@ void RenderLayerCompositor::updateOverflowControlsLayers()
         layersChanged = true;
     } else if (m_layerForVerticalScrollbar) {
         m_layerForVerticalScrollbar->removeFromParent();
-        m_layerForVerticalScrollbar = 0;
+        m_layerForVerticalScrollbar = nullptr;
         layersChanged = true;
     }
 
@@ -1534,7 +1534,7 @@ void RenderLayerCompositor::updateOverflowControlsLayers()
         layersChanged = true;
     } else if (m_layerForScrollCorner) {
         m_layerForScrollCorner->removeFromParent();
-        m_layerForScrollCorner = 0;
+        m_layerForScrollCorner = nullptr;
         layersChanged = true;
     }
 
@@ -1593,9 +1593,9 @@ void RenderLayerCompositor::ensureRootPlatformLayer()
         }
     } else {
         if (m_overflowControlsHostLayer) {
-            m_overflowControlsHostLayer = 0;
-            m_clipLayer = 0;
-            m_scrollLayer = 0;
+            m_overflowControlsHostLayer = nullptr;
+            m_clipLayer = nullptr;
+            m_scrollLayer = nullptr;
         }
     }
 
@@ -1615,30 +1615,30 @@ void RenderLayerCompositor::destroyRootPlatformLayer()
 
     if (m_layerForHorizontalScrollbar) {
         m_layerForHorizontalScrollbar->removeFromParent();
-        m_layerForHorizontalScrollbar = 0;
+        m_layerForHorizontalScrollbar = nullptr;
         if (Scrollbar* horizontalScrollbar = m_renderView->frameView()->verticalScrollbar())
             m_renderView->frameView()->invalidateScrollbar(horizontalScrollbar, IntRect(IntPoint(0, 0), horizontalScrollbar->frameRect().size()));
     }
 
     if (m_layerForVerticalScrollbar) {
         m_layerForVerticalScrollbar->removeFromParent();
-        m_layerForVerticalScrollbar = 0;
+        m_layerForVerticalScrollbar = nullptr;
         if (Scrollbar* verticalScrollbar = m_renderView->frameView()->verticalScrollbar())
             m_renderView->frameView()->invalidateScrollbar(verticalScrollbar, IntRect(IntPoint(0, 0), verticalScrollbar->frameRect().size()));
     }
 
     if (m_layerForScrollCorner) {
-        m_layerForScrollCorner = 0;
+        m_layerForScrollCorner = nullptr;
         m_renderView->frameView()->invalidateScrollCorner();
     }
 
     if (m_overflowControlsHostLayer) {
-        m_overflowControlsHostLayer = 0;
-        m_clipLayer = 0;
-        m_scrollLayer = 0;
+        m_overflowControlsHostLayer = nullptr;
+        m_clipLayer = nullptr;
+        m_scrollLayer = nullptr;
     }
     ASSERT(!m_scrollLayer);
-    m_rootPlatformLayer = 0;
+    m_rootPlatformLayer = nullptr;
 }
 
 void RenderLayerCompositor::attachRootPlatformLayer(RootLayerAttachment attachment)
index cd76e3b..24002e4 100644 (file)
@@ -44,7 +44,7 @@ namespace WebCore {
 
 PassRefPtr<MessageEvent> createConnectEvent(PassRefPtr<MessagePort> port)
 {
-    RefPtr<MessageEvent> event = MessageEvent::create(new MessagePortArray(1, port));
+    RefPtr<MessageEvent> event = MessageEvent::create(adoptPtr(new MessagePortArray(1, port)));
     event->initEvent(eventNames().connectEvent, false, false);
     return event;
 }