PingLoader objects unnecessarily pass through OwnPtr
authorzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Nov 2013 07:10:05 +0000 (07:10 +0000)
committerzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Nov 2013 07:10:05 +0000 (07:10 +0000)
commit66f845651ea189f6316b7bcdb5fa348a1c450fea
tree8bbc6c0eaf997045549dbc59e8455380c8ecffc1
parentf644a997a4dd5df9ad93df3a2f423dd208738cba
PingLoader objects unnecessarily pass through OwnPtr
https://bugs.webkit.org/show_bug.cgi?id=122942

Reviewed by Darin Adler.

There's no need to store new PingLoader objects into an OwnPtr just to leak them out a few lines later
into an unused variable. New objects are created through a new helper method and then left unmanaged as
they're guaranteed to destroy themselves when they receive a response of any kind.

* loader/PingLoader.cpp:
(WebCore::PingLoader::loadImage): Call the new createPingLoader method to spawn the PingLoader.
(WebCore::PingLoader::sendPing): Ditto.
(WebCore::PingLoader::sendViolationReport): Ditto.
(WebCore::PingLoader::createPingLoader): A helper method that creates a new PingLoader object
* loader/PingLoader.h: Declare the new PingLoader::createPingLoader method.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158558 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/loader/PingLoader.cpp
Source/WebCore/loader/PingLoader.h