Skip to content
Permalink
Browse files
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):

Canonical link: https://commits.webkit.org/74739@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@85020 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
David Levin committed Apr 27, 2011
1 parent 0ff1b38 commit fb849d7552904b426b10b6f902c1839a81267103
@@ -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.
@@ -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: {
@@ -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()
@@ -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)
@@ -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)
@@ -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)
@@ -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)
@@ -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);
}

0 comments on commit fb849d7

Please sign in to comment.