2011-04-26 David Levin <levin@chromium.org>
authorlevin@chromium.org <levin@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Apr 2011 06:08:32 +0000 (06:08 +0000)
committerlevin@chromium.org <levin@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 27 Apr 2011 06:08:32 +0000 (06:08 +0000)
        Reviewed by Eric Seidel.

        Fix some strict PassOwnPtr issues in WebCore.
        https://bugs.webkit.org/show_bug.cgi?id=59563

        * css/SVGCSSStyleSelector.cpp:
        (WebCore::CSSStyleSelector::applySVGProperty):
        * html/canvas/WebGLRenderingContext.cpp:
        (WebCore::WebGLRenderingContext::create):
        (WebCore::WebGLRenderingContext::~WebGLRenderingContext):
        * platform/text/TextCodecLatin1.cpp:
        (WebCore::newStreamingTextDecoderWindowsLatin1):
        * platform/text/TextCodecUTF16.cpp:
        (WebCore::newStreamingTextDecoderUTF16LE):
        (WebCore::newStreamingTextDecoderUTF16BE):
        * platform/text/TextCodecUserDefined.cpp:
        (WebCore::newStreamingTextDecoderUserDefined):
        * platform/text/mac/TextCodecMac.cpp:
        (WebCore::newTextCodecMac):
        * workers/Worker.cpp:
        (WebCore::Worker::notifyFinished):

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

Source/WebCore/ChangeLog
Source/WebCore/css/SVGCSSStyleSelector.cpp
Source/WebCore/html/canvas/WebGLRenderingContext.cpp
Source/WebCore/platform/text/TextCodecLatin1.cpp
Source/WebCore/platform/text/TextCodecUTF16.cpp
Source/WebCore/platform/text/TextCodecUserDefined.cpp
Source/WebCore/platform/text/mac/TextCodecMac.cpp
Source/WebCore/workers/Worker.cpp

index 69187ec..40eeb85 100644 (file)
@@ -1,3 +1,27 @@
+2011-04-26  David Levin  <levin@chromium.org>
+
+        Reviewed by Eric Seidel.
+
+        Fix some strict PassOwnPtr issues in WebCore.
+        https://bugs.webkit.org/show_bug.cgi?id=59563
+
+        * css/SVGCSSStyleSelector.cpp:
+        (WebCore::CSSStyleSelector::applySVGProperty):
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::create):
+        (WebCore::WebGLRenderingContext::~WebGLRenderingContext):
+        * platform/text/TextCodecLatin1.cpp:
+        (WebCore::newStreamingTextDecoderWindowsLatin1):
+        * platform/text/TextCodecUTF16.cpp:
+        (WebCore::newStreamingTextDecoderUTF16LE):
+        (WebCore::newStreamingTextDecoderUTF16BE):
+        * platform/text/TextCodecUserDefined.cpp:
+        (WebCore::newStreamingTextDecoderUserDefined):
+        * platform/text/mac/TextCodecMac.cpp:
+        (WebCore::newTextCodecMac):
+        * workers/Worker.cpp:
+        (WebCore::Worker::notifyFinished):
+
 2011-04-26  Justin Novosad  <junov@chromium.org>
 
         Reviewed by Kenneth Russell.
index 47e3fc3..b0e769d 100644 (file)
@@ -562,9 +562,9 @@ void CSSStyleSelector::applySVGProperty(int id, CSSValue* value)
             break;
         case CSSPropertyWebkitSvgShadow: {
             if (isInherit)
-                return svgstyle->setShadow(m_parentStyle->svgStyle()->shadow() ? new ShadowData(*m_parentStyle->svgStyle()->shadow()) : 0);
+                return svgstyle->setShadow(adoptPtr(m_parentStyle->svgStyle()->shadow() ? new ShadowData(*m_parentStyle->svgStyle()->shadow()) : 0));
             if (isInitial || primitiveValue) // initial | none
-                return svgstyle->setShadow(0);
+                return svgstyle->setShadow(PassOwnPtr<ShadowData>());
 
             if (!value->isValueList())
                 return;
@@ -588,8 +588,8 @@ void CSSStyleSelector::applySVGProperty(int id, CSSValue* value)
             ASSERT(!item->spread);
             ASSERT(!item->style);
                 
-            ShadowData* shadowData = new ShadowData(x, y, blur, 0, Normal, false, color.isValid() ? color : Color::transparent);
-            svgstyle->setShadow(shadowData);
+            OwnPtr<ShadowData> shadowData = adoptPtr(new ShadowData(x, y, blur, 0, Normal, false, color.isValid() ? color : Color::transparent));
+            svgstyle->setShadow(shadowData.release());
             return;
         }
         case CSSPropertyVectorEffect: {
index 6d95386..4cd1031 100644 (file)
@@ -371,10 +371,10 @@ PassOwnPtr<WebGLRenderingContext> WebGLRenderingContext::create(HTMLCanvasElemen
 
     if (!context) {
         canvas->dispatchEvent(WebGLContextEvent::create(eventNames().webglcontextcreationerrorEvent, false, true, "Could not create a WebGL context."));
-        return 0;
+        return PassOwnPtr<WebGLRenderingContext>();
     }
 
-    return new WebGLRenderingContext(canvas, context, attributes);
+    return adoptPtr(new WebGLRenderingContext(canvas, context, attributes));
 }
 
 WebGLRenderingContext::WebGLRenderingContext(HTMLCanvasElement* passedCanvas, PassRefPtr<GraphicsContext3D> context,
@@ -473,7 +473,7 @@ void WebGLRenderingContext::setupFlags()
 WebGLRenderingContext::~WebGLRenderingContext()
 {
     detachAndRemoveAllObjects();
-    m_context->setContextLostCallback(0);
+    m_context->setContextLostCallback(PassOwnPtr<GraphicsContext3D::ContextLostCallback>());
 }
 
 void WebGLRenderingContext::markContextChanged()
index d1c633b..15acda9 100644 (file)
@@ -104,7 +104,7 @@ void TextCodecLatin1::registerEncodingNames(EncodingNameRegistrar registrar)
 
 static PassOwnPtr<TextCodec> newStreamingTextDecoderWindowsLatin1(const TextEncoding&, const void*)
 {
-    return new TextCodecLatin1;
+    return adoptPtr(new TextCodecLatin1);
 }
 
 void TextCodecLatin1::registerCodecs(TextCodecRegistrar registrar)
index 4ceed23..76bce83 100644 (file)
@@ -52,12 +52,12 @@ void TextCodecUTF16::registerEncodingNames(EncodingNameRegistrar registrar)
 
 static PassOwnPtr<TextCodec> newStreamingTextDecoderUTF16LE(const TextEncoding&, const void*)
 {
-    return new TextCodecUTF16(true);
+    return adoptPtr(new TextCodecUTF16(true));
 }
 
 static PassOwnPtr<TextCodec> newStreamingTextDecoderUTF16BE(const TextEncoding&, const void*)
 {
-    return new TextCodecUTF16(false);
+    return adoptPtr(new TextCodecUTF16(false));
 }
 
 void TextCodecUTF16::registerCodecs(TextCodecRegistrar registrar)
index 70d8673..d81dc76 100644 (file)
@@ -41,7 +41,7 @@ void TextCodecUserDefined::registerEncodingNames(EncodingNameRegistrar registrar
 
 static PassOwnPtr<TextCodec> newStreamingTextDecoderUserDefined(const TextEncoding&, const void*)
 {
-    return new TextCodecUserDefined;
+    return adoptPtr(new TextCodecUserDefined);
 }
 
 void TextCodecUserDefined::registerCodecs(TextCodecRegistrar registrar)
index 64d0485..c830580 100644 (file)
@@ -67,7 +67,7 @@ void TextCodecMac::registerEncodingNames(EncodingNameRegistrar registrar)
 
 static PassOwnPtr<TextCodec> newTextCodecMac(const TextEncoding&, const void* additionalData)
 {
-    return new TextCodecMac(*static_cast<const TECTextEncodingID*>(additionalData));
+    return adoptPtr(new TextCodecMac(*static_cast<const TECTextEncodingID*>(additionalData)));
 }
 
 void TextCodecMac::registerCodecs(TextCodecRegistrar registrar)
index d3d3896..33aec4d 100644 (file)
@@ -136,7 +136,7 @@ void Worker::notifyFinished()
         InspectorInstrumentation::didStartWorkerContext(scriptExecutionContext(), m_contextProxy, shouldStartPaused);
         InspectorInstrumentation::scriptImported(scriptExecutionContext(), m_scriptLoader->identifier(), m_scriptLoader->script());
     }
-    m_scriptLoader = 0;
+    m_scriptLoader = nullptr;
 
     unsetPendingActivity(this);
 }