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):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@85020 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 69187ec..40eeb85 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -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.
diff --git a/Source/WebCore/css/SVGCSSStyleSelector.cpp b/Source/WebCore/css/SVGCSSStyleSelector.cpp
index 47e3fc3..b0e769d 100644
--- a/Source/WebCore/css/SVGCSSStyleSelector.cpp
+++ b/Source/WebCore/css/SVGCSSStyleSelector.cpp
@@ -562,9 +562,9 @@
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 @@
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: {
diff --git a/Source/WebCore/html/canvas/WebGLRenderingContext.cpp b/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
index 6d95386..4cd1031 100644
--- a/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -371,10 +371,10 @@
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 @@
WebGLRenderingContext::~WebGLRenderingContext()
{
detachAndRemoveAllObjects();
- m_context->setContextLostCallback(0);
+ m_context->setContextLostCallback(PassOwnPtr<GraphicsContext3D::ContextLostCallback>());
}
void WebGLRenderingContext::markContextChanged()
diff --git a/Source/WebCore/platform/text/TextCodecLatin1.cpp b/Source/WebCore/platform/text/TextCodecLatin1.cpp
index d1c633b..15acda9 100644
--- a/Source/WebCore/platform/text/TextCodecLatin1.cpp
+++ b/Source/WebCore/platform/text/TextCodecLatin1.cpp
@@ -104,7 +104,7 @@
static PassOwnPtr<TextCodec> newStreamingTextDecoderWindowsLatin1(const TextEncoding&, const void*)
{
- return new TextCodecLatin1;
+ return adoptPtr(new TextCodecLatin1);
}
void TextCodecLatin1::registerCodecs(TextCodecRegistrar registrar)
diff --git a/Source/WebCore/platform/text/TextCodecUTF16.cpp b/Source/WebCore/platform/text/TextCodecUTF16.cpp
index 4ceed23e..76bce83 100644
--- a/Source/WebCore/platform/text/TextCodecUTF16.cpp
+++ b/Source/WebCore/platform/text/TextCodecUTF16.cpp
@@ -52,12 +52,12 @@
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)
diff --git a/Source/WebCore/platform/text/TextCodecUserDefined.cpp b/Source/WebCore/platform/text/TextCodecUserDefined.cpp
index 70d8673..d81dc76 100644
--- a/Source/WebCore/platform/text/TextCodecUserDefined.cpp
+++ b/Source/WebCore/platform/text/TextCodecUserDefined.cpp
@@ -41,7 +41,7 @@
static PassOwnPtr<TextCodec> newStreamingTextDecoderUserDefined(const TextEncoding&, const void*)
{
- return new TextCodecUserDefined;
+ return adoptPtr(new TextCodecUserDefined);
}
void TextCodecUserDefined::registerCodecs(TextCodecRegistrar registrar)
diff --git a/Source/WebCore/platform/text/mac/TextCodecMac.cpp b/Source/WebCore/platform/text/mac/TextCodecMac.cpp
index 64d0485..c830580 100644
--- a/Source/WebCore/platform/text/mac/TextCodecMac.cpp
+++ b/Source/WebCore/platform/text/mac/TextCodecMac.cpp
@@ -67,7 +67,7 @@
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)
diff --git a/Source/WebCore/workers/Worker.cpp b/Source/WebCore/workers/Worker.cpp
index d3d3896..33aec4d 100644
--- a/Source/WebCore/workers/Worker.cpp
+++ b/Source/WebCore/workers/Worker.cpp
@@ -136,7 +136,7 @@
InspectorInstrumentation::didStartWorkerContext(scriptExecutionContext(), m_contextProxy, shouldStartPaused);
InspectorInstrumentation::scriptImported(scriptExecutionContext(), m_scriptLoader->identifier(), m_scriptLoader->script());
}
- m_scriptLoader = 0;
+ m_scriptLoader = nullptr;
unsetPendingActivity(this);
}