Changeset 84890 in webkit


Ignore:
Timestamp:
Apr 26, 2011 12:27:39 AM (13 years ago)
Author:
abarth@webkit.org
Message:

2011-04-26 Adam Barth <abarth@webkit.org>

Reviewed by David Levin.

Fix more strict OwnPtr violations in WebCore
https://bugs.webkit.org/show_bug.cgi?id=59433

These manifest in the Chromium build.

  • bindings/v8/ScriptController.cpp: (WebCore::ScriptController::ScriptController):
  • bindings/v8/ScriptDebugServer.cpp: (WebCore::ScriptDebugServer::editScriptSource):
  • bindings/v8/V8DOMMap.cpp: (WebCore::DOMDataStoreHandle::DOMDataStoreHandle):
  • bindings/v8/V8Proxy.cpp: (WebCore::V8Proxy::precompileScript):
  • bindings/v8/WorkerScriptController.cpp: (WebCore::WorkerScriptController::WorkerScriptController):
  • page/Page.cpp: (WebCore::Page::Page): (WebCore::Page::speechInput):
  • platform/PlatformGestureRecognizer.cpp: (WebCore::PlatformGestureRecognizer::create):
  • platform/PlatformGestureRecognizer.h:
  • platform/graphics/chromium/DrawingBufferChromium.cpp: (WebCore::DrawingBuffer::DrawingBuffer):
  • platform/graphics/chromium/cc/CCLayerImpl.cpp: (WebCore::CCLayerImpl::CCLayerImpl):
  • platform/graphics/gpu/Texture.cpp: (WebCore::Texture::create):
  • platform/image-decoders/bmp/BMPImageDecoder.cpp: (WebCore::BMPImageDecoder::decodeHelper):
  • platform/image-decoders/gif/GIFImageDecoder.cpp: (WebCore::GIFImageDecoder::decode):
  • platform/image-decoders/ico/ICOImageDecoder.cpp: (WebCore::ICOImageDecoder::decodeAtIndex):
  • platform/image-decoders/jpeg/JPEGImageDecoder.cpp: (WebCore::JPEGImageDecoder::decode):
  • platform/image-decoders/png/PNGImageDecoder.cpp: (WebCore::PNGImageDecoder::decode):
  • storage/chromium/DatabaseTrackerChromium.cpp: (WebCore::DatabaseTracker::addOpenDatabase):
Location:
trunk/Source/WebCore
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r84888 r84890  
     12011-04-26  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by David Levin.
     4
     5        Fix more strict OwnPtr violations in WebCore
     6        https://bugs.webkit.org/show_bug.cgi?id=59433
     7
     8        These manifest in the Chromium build.
     9
     10        * bindings/v8/ScriptController.cpp:
     11        (WebCore::ScriptController::ScriptController):
     12        * bindings/v8/ScriptDebugServer.cpp:
     13        (WebCore::ScriptDebugServer::editScriptSource):
     14        * bindings/v8/V8DOMMap.cpp:
     15        (WebCore::DOMDataStoreHandle::DOMDataStoreHandle):
     16        * bindings/v8/V8Proxy.cpp:
     17        (WebCore::V8Proxy::precompileScript):
     18        * bindings/v8/WorkerScriptController.cpp:
     19        (WebCore::WorkerScriptController::WorkerScriptController):
     20        * page/Page.cpp:
     21        (WebCore::Page::Page):
     22        (WebCore::Page::speechInput):
     23        * platform/PlatformGestureRecognizer.cpp:
     24        (WebCore::PlatformGestureRecognizer::create):
     25        * platform/PlatformGestureRecognizer.h:
     26        * platform/graphics/chromium/DrawingBufferChromium.cpp:
     27        (WebCore::DrawingBuffer::DrawingBuffer):
     28        * platform/graphics/chromium/cc/CCLayerImpl.cpp:
     29        (WebCore::CCLayerImpl::CCLayerImpl):
     30        * platform/graphics/gpu/Texture.cpp:
     31        (WebCore::Texture::create):
     32        * platform/image-decoders/bmp/BMPImageDecoder.cpp:
     33        (WebCore::BMPImageDecoder::decodeHelper):
     34        * platform/image-decoders/gif/GIFImageDecoder.cpp:
     35        (WebCore::GIFImageDecoder::decode):
     36        * platform/image-decoders/ico/ICOImageDecoder.cpp:
     37        (WebCore::ICOImageDecoder::decodeAtIndex):
     38        * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
     39        (WebCore::JPEGImageDecoder::decode):
     40        * platform/image-decoders/png/PNGImageDecoder.cpp:
     41        (WebCore::PNGImageDecoder::decode):
     42        * storage/chromium/DatabaseTrackerChromium.cpp:
     43        (WebCore::DatabaseTracker::addOpenDatabase):
     44
    1452011-04-25  David Levin  <levin@chromium.org>
    246
  • trunk/Source/WebCore/bindings/v8/ScriptController.cpp

    r79981 r84890  
    113113    , m_paused(false)
    114114    , m_allowPopupsFromPlugin(false)
    115     , m_proxy(new V8Proxy(frame))
     115    , m_proxy(adoptPtr(new V8Proxy(frame)))
    116116#if ENABLE(NETSCAPE_PLUGIN_API)
    117117    , m_windowScriptNPObject(0)
  • trunk/Source/WebCore/bindings/v8/ScriptDebugServer.cpp

    r83601 r84890  
    219219    OwnPtr<v8::Context::Scope> contextScope;
    220220    if (!isPaused())
    221         contextScope.set(new v8::Context::Scope(v8::Debug::GetDebugContext()));
     221        contextScope = adoptPtr(new v8::Context::Scope(v8::Debug::GetDebugContext()));
    222222
    223223    v8::Handle<v8::Function> function = v8::Local<v8::Function>::Cast(m_debuggerScript.get()->Get(v8::String::New("editScriptSource")));
  • trunk/Source/WebCore/bindings/v8/V8DOMMap.cpp

    r73907 r84890  
    4040
    4141DOMDataStoreHandle::DOMDataStoreHandle()
    42     : m_store(new ScopedDOMDataStore(DOMData::getCurrent()))
     42    : m_store(adoptPtr(new ScopedDOMDataStore(DOMData::getCurrent())))
    4343{
    4444}
  • trunk/Source/WebCore/bindings/v8/V8Proxy.cpp

    r84371 r84890  
    322322        return v8::ScriptData::New(cachedMetadata->data(), cachedMetadata->size());
    323323
    324     OwnPtr<v8::ScriptData> scriptData(v8::ScriptData::PreCompile(code));
     324    OwnPtr<v8::ScriptData> scriptData = adoptPtr(v8::ScriptData::PreCompile(code));
    325325    cachedScript->setCachedMetadata(dataTypeID, scriptData->Data(), scriptData->Length());
    326326
  • trunk/Source/WebCore/bindings/v8/WorkerScriptController.cpp

    r83900 r84890  
    5252WorkerScriptController::WorkerScriptController(WorkerContext* workerContext)
    5353    : m_workerContext(workerContext)
    54     , m_proxy(new WorkerContextExecutionProxy(workerContext))
     54    , m_proxy(adoptPtr(new WorkerContextExecutionProxy(workerContext)))
    5555    , m_executionForbidden(false)
    5656{
  • trunk/Source/WebCore/page/Page.cpp

    r84822 r84890  
    133133#endif
    134134#if ENABLE(DEVICE_ORIENTATION)
    135     , m_deviceMotionController(RuntimeEnabledFeatures::deviceMotionEnabled() ? new DeviceMotionController(pageClients.deviceMotionClient) : 0)
    136     , m_deviceOrientationController(RuntimeEnabledFeatures::deviceOrientationEnabled() ? new DeviceOrientationController(this, pageClients.deviceOrientationClient) : 0)
     135    , m_deviceMotionController(RuntimeEnabledFeatures::deviceMotionEnabled() ? adoptPtr(new DeviceMotionController(pageClients.deviceMotionClient)) : PassOwnPtr<DeviceMotionController>())
     136    , m_deviceOrientationController(RuntimeEnabledFeatures::deviceOrientationEnabled() ? adoptPtr(new DeviceOrientationController(this, pageClients.deviceOrientationClient)) : PassOwnPtr<DeviceOrientationController>())
    137137#endif
    138138#if ENABLE(INPUT_SPEECH)
     
    846846    ASSERT(m_speechInputClient);
    847847    if (!m_speechInput.get())
    848         m_speechInput.set(new SpeechInput(m_speechInputClient));
     848        m_speechInput = adoptPtr(new SpeechInput(m_speechInputClient));
    849849    return m_speechInput.get();
    850850}
  • trunk/Source/WebCore/platform/PlatformGestureRecognizer.cpp

    r81618 r84890  
    3939// To get a useful GestureRecognizer, a specific platform should return something
    4040// here that meets its needs. EventHandler will ignore null GestureRecognizers.
    41 PlatformGestureRecognizer* PlatformGestureRecognizer::create()
     41PassOwnPtr<PlatformGestureRecognizer> PlatformGestureRecognizer::create()
    4242{
    43     return 0;
     43    return PassOwnPtr<PlatformGestureRecognizer>();
    4444}
    4545
  • trunk/Source/WebCore/platform/PlatformGestureRecognizer.h

    r81618 r84890  
    3232#define PlatformGestureRecognizer_h
    3333
     34#include <wtf/PassOwnPtr.h>
     35
    3436namespace WebCore {
    3537
     
    4749
    4850public:
     51    static PassOwnPtr<PlatformGestureRecognizer> create();
    4952    virtual ~PlatformGestureRecognizer();
    5053
     
    5558    // Returns true if the event resulted in firing a synthetic event.
    5659    virtual bool processTouchEventForGesture(const PlatformTouchEvent&, EventHandler*, bool handled) = 0;
    57 
    58     // Factory method for GestureManagers.
    59     static PlatformGestureRecognizer* create();
    6060};
    6161
  • trunk/Source/WebCore/platform/graphics/chromium/DrawingBufferChromium.cpp

    r84163 r84890  
    8787    , m_multisampleFBO(0)
    8888    , m_multisampleColorBuffer(0)
    89     , m_internal(new DrawingBufferInternal)
     89    , m_internal(adoptPtr(new DrawingBufferInternal))
    9090#if ENABLE(SKIA_GPU)
    9191    , m_grContext(0)
  • trunk/Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp

    r83915 r84890  
    7777    , m_debugBorderColor(0, 0, 0, 0)
    7878    , m_debugBorderWidth(0)
    79     , m_renderSurface(0)
    8079    , m_layerRenderer(0)
    8180{
  • trunk/Source/WebCore/platform/graphics/gpu/Texture.cpp

    r83960 r84890  
    9393    int numTiles = tiling.numTiles();
    9494
    95     OwnPtr<Vector<unsigned int> > textureIds(new Vector<unsigned int>(numTiles));
     95    OwnPtr<Vector<unsigned int> > textureIds = adoptPtr(new Vector<unsigned int>(numTiles));
    9696    textureIds->fill(0, numTiles);
    9797
  • trunk/Source/WebCore/platform/image-decoders/bmp/BMPImageDecoder.cpp

    r75748 r84890  
    3333
    3434#include "BMPImageReader.h"
     35#include <wtf/PassOwnPtr.h>
    3536
    3637namespace WebCore {
     
    110111
    111112    if (!m_reader) {
    112         m_reader.set(new BMPImageReader(this, m_decodedOffset, imgDataOffset, false));
     113        m_reader = adoptPtr(new BMPImageReader(this, m_decodedOffset, imgDataOffset, false));
    113114        m_reader->setData(m_data.get());
    114115    }
  • trunk/Source/WebCore/platform/image-decoders/gif/GIFImageDecoder.cpp

    r79282 r84890  
    2626#include "config.h"
    2727#include "GIFImageDecoder.h"
     28
    2829#include "GIFImageReader.h"
     30#include <wtf/PassOwnPtr.h>
    2931
    3032namespace WebCore {
     
    313315
    314316    if (!m_reader)
    315         m_reader.set(new GIFImageReader(this));
     317        m_reader = adoptPtr(new GIFImageReader(this));
    316318
    317319    // If we couldn't decode the image but we've received all the data, decoding
  • trunk/Source/WebCore/platform/image-decoders/ico/ICOImageDecoder.cpp

    r75748 r84890  
    3636#include "BMPImageReader.h"
    3737#include "PNGImageDecoder.h"
     38#include <wtf/PassOwnPtr.h>
    3839
    3940namespace WebCore {
     
    192193            // we must not resize it again later (see caution in frameCount()).
    193194            ASSERT(m_frameBufferCache.size() == m_dirEntries.size());
    194             m_bmpReaders[index].set(new BMPImageReader(this, dirEntry.m_imageOffset, 0, true));
     195            m_bmpReaders[index] = adoptPtr(new BMPImageReader(this, dirEntry.m_imageOffset, 0, true));
    195196            m_bmpReaders[index]->setData(m_data.get());
    196197            m_bmpReaders[index]->setBuffer(&m_frameBufferCache[index]);
     
    203204
    204205    if (!m_pngDecoders[index]) {
    205         m_pngDecoders[index].set(
     206        m_pngDecoders[index] = adoptPtr(
    206207            new PNGImageDecoder(m_premultiplyAlpha ? ImageSource::AlphaPremultiplied : ImageSource::AlphaNotPremultiplied,
    207208                                m_ignoreGammaAndColorProfile ? ImageSource::GammaAndColorProfileIgnored : ImageSource::GammaAndColorProfileApplied));
  • trunk/Source/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp

    r78548 r84890  
    4141#include "JPEGImageDecoder.h"
    4242#include <stdio.h>  // Needed by jpeglib.h for FILE.
     43#include <wtf/PassOwnPtr.h>
    4344
    4445#if OS(WINCE) || PLATFORM(BREWMP_SIMULATOR)
     
    529530
    530531    if (!m_reader)
    531         m_reader.set(new JPEGImageReader(this));
     532        m_reader = adoptPtr(new JPEGImageReader(this));
    532533
    533534    // If we couldn't decode the image but we've received all the data, decoding
  • trunk/Source/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp

    r82344 r84890  
    4040#include "config.h"
    4141#include "PNGImageDecoder.h"
     42
    4243#include "png.h"
     44#include <wtf/PassOwnPtr.h>
    4345
    4446#if defined(PNG_LIBPNG_VER_MAJOR) && defined(PNG_LIBPNG_VER_MINOR) && (PNG_LIBPNG_VER_MAJOR > 1 || (PNG_LIBPNG_VER_MAJOR == 1 && PNG_LIBPNG_VER_MINOR >= 4))
     
    425427
    426428    if (!m_reader)
    427         m_reader.set(new PNGImageReader(this));
     429        m_reader = adoptPtr(new PNGImageReader(this));
    428430
    429431    // If we couldn't decode the image but we've received all the data, decoding
  • trunk/Source/WebCore/storage/chromium/DatabaseTrackerChromium.cpp

    r64384 r84890  
    7777    MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
    7878    if (!m_openDatabaseMap)
    79         m_openDatabaseMap.set(new DatabaseOriginMap());
     79        m_openDatabaseMap = adoptPtr(new DatabaseOriginMap());
    8080
    8181    DatabaseNameMap* nameMap = m_openDatabaseMap->get(database->securityOrigin());
Note: See TracChangeset for help on using the changeset viewer.