Changeset 85405 in webkit


Ignore:
Timestamp:
Apr 30, 2011 9:16:34 PM (13 years ago)
Author:
abarth@webkit.org
Message:

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

Reviewed by Adam Barth.

Enable strict OwnPtr for GTK
https://bugs.webkit.org/show_bug.cgi?id=59861

  • wtf/OwnPtr.h:

2011-04-30 Martin Robinson <mrobinson@igalia.com>

Reviewed by Adam Barth.

Enable strict mode for OwnPtr and PassOwnPtr
https://bugs.webkit.org/show_bug.cgi?id=59428

Fix assignments and .set() calls with OwnPtr to use adoptPtr. Have GeolocationService
factory methods return a PassOwnPtr.

No new tests. This should not change functionality.

  • platform/GeolocationService.cpp: (WebCore::createGeolocationServiceNull): (WebCore::GeolocationService::create):
  • platform/GeolocationService.h:
  • platform/android/GeolocationServiceAndroid.cpp: (WebCore::GeolocationServiceAndroid::create):
  • platform/android/GeolocationServiceAndroid.h:
  • platform/efl/GeolocationServiceEfl.cpp: (WebCore::GeolocationServiceEfl::create):
  • platform/efl/GeolocationServiceEfl.h:
  • platform/graphics/cairo/CairoUtilities.cpp: (WebCore::appendPathToCairoContext):
  • platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::drawPathShadow): (WebCore::GraphicsContext::clip):
  • platform/graphics/cairo/ImageBufferCairo.cpp: (WebCore::ImageBuffer::ImageBuffer):
  • platform/graphics/cairo/OwnPtrCairo.h:
  • platform/graphics/cairo/PathCairo.cpp: (WebCore::Path::Path): (WebCore::Path::operator=): (WebCore::Path::apply):
  • platform/gtk/GeolocationServiceGtk.cpp: (WebCore::GeolocationServiceGtk::create):
  • platform/gtk/GeolocationServiceGtk.h:
  • platform/mock/GeolocationServiceMock.cpp: (WebCore::GeolocationServiceMock::create):
  • platform/mock/GeolocationServiceMock.h:
Location:
trunk/Source
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r85404 r85405  
     12011-04-30  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Enable strict OwnPtr for GTK
     6        https://bugs.webkit.org/show_bug.cgi?id=59861
     7
     8        * wtf/OwnPtr.h:
     9
    1102011-04-30  Gavin Barraclough  <barraclough@apple.com>
    211
  • trunk/Source/JavaScriptCore/wtf/OwnPtr.h

    r85343 r85405  
    3030
    3131// Remove this once we make all WebKit code compatible with stricter rules about OwnPtr.
    32 #if !PLATFORM(MAC) && !PLATFORM(CHROMIUM) && !PLATFORM(QT)
     32#if !PLATFORM(MAC) && !PLATFORM(CHROMIUM) && !PLATFORM(QT) && !PLATFORM(GTK)
    3333#define LOOSE_OWN_PTR
    3434#endif
  • trunk/Source/WebCore/ChangeLog

    r85402 r85405  
     12011-04-30  Martin Robinson  <mrobinson@igalia.com>
     2
     3        Reviewed by Adam Barth.
     4
     5        Enable strict mode for OwnPtr and PassOwnPtr
     6        https://bugs.webkit.org/show_bug.cgi?id=59428
     7
     8        Fix assignments and .set() calls with OwnPtr to use adoptPtr. Have GeolocationService
     9        factory methods return a PassOwnPtr.
     10
     11        No new tests. This should not change functionality.
     12
     13        * platform/GeolocationService.cpp:
     14        (WebCore::createGeolocationServiceNull):
     15        (WebCore::GeolocationService::create):
     16        * platform/GeolocationService.h:
     17        * platform/android/GeolocationServiceAndroid.cpp:
     18        (WebCore::GeolocationServiceAndroid::create):
     19        * platform/android/GeolocationServiceAndroid.h:
     20        * platform/efl/GeolocationServiceEfl.cpp:
     21        (WebCore::GeolocationServiceEfl::create):
     22        * platform/efl/GeolocationServiceEfl.h:
     23        * platform/graphics/cairo/CairoUtilities.cpp:
     24        (WebCore::appendPathToCairoContext):
     25        * platform/graphics/cairo/GraphicsContextCairo.cpp:
     26        (WebCore::drawPathShadow):
     27        (WebCore::GraphicsContext::clip):
     28        * platform/graphics/cairo/ImageBufferCairo.cpp:
     29        (WebCore::ImageBuffer::ImageBuffer):
     30        * platform/graphics/cairo/OwnPtrCairo.h:
     31        * platform/graphics/cairo/PathCairo.cpp:
     32        (WebCore::Path::Path):
     33        (WebCore::Path::operator=):
     34        (WebCore::Path::apply):
     35        * platform/gtk/GeolocationServiceGtk.cpp:
     36        (WebCore::GeolocationServiceGtk::create):
     37        * platform/gtk/GeolocationServiceGtk.h:
     38        * platform/mock/GeolocationServiceMock.cpp:
     39        (WebCore::GeolocationServiceMock::create):
     40        * platform/mock/GeolocationServiceMock.h:
     41
    1422011-04-30  Pavel Feldman  <pfeldman@chromium.org>
    243
  • trunk/Source/WebCore/platform/GeolocationService.cpp

    r59779 r85405  
    3737
    3838#if !ENABLE(GEOLOCATION) || ENABLE(CLIENT_BASED_GEOLOCATION)
    39 static GeolocationService* createGeolocationServiceNull(GeolocationServiceClient*)
     39static PassOwnPtr<GeolocationService> createGeolocationServiceNull(GeolocationServiceClient*)
    4040{
    4141    return 0;
     
    4848#endif
    4949
    50 GeolocationService* GeolocationService::create(GeolocationServiceClient* client)
     50PassOwnPtr<GeolocationService> GeolocationService::create(GeolocationServiceClient* client)
    5151{
    5252    return (*s_factoryFunction)(client);
  • trunk/Source/WebCore/platform/GeolocationService.h

    r79028 r85405  
    2828
    2929#include <wtf/Noncopyable.h>
     30#include <wtf/PassOwnPtr.h>
    3031
    3132namespace WebCore {
     
    4647    WTF_MAKE_NONCOPYABLE(GeolocationService);
    4748public:
    48     static GeolocationService* create(GeolocationServiceClient*);
     49    static PassOwnPtr<GeolocationService> create(GeolocationServiceClient*);
    4950    virtual ~GeolocationService() { }
    5051
     
    6263
    6364    static void useMock();
    64     typedef GeolocationService* (FactoryFunction)(GeolocationServiceClient*);
     65    typedef PassOwnPtr<GeolocationService> (FactoryFunction)(GeolocationServiceClient*);
    6566    static void setCustomMockFactory(FactoryFunction);
    6667
  • trunk/Source/WebCore/platform/android/GeolocationServiceAndroid.cpp

    r71602 r85405  
    4848// register with the platform location service. It is the platform service that
    4949// handles making sure that updates are passed to all Geolocation objects.
    50 GeolocationService* GeolocationServiceAndroid::create(GeolocationServiceClient* client)
     50PassOwnPtr<GeolocationService> GeolocationServiceAndroid::create(GeolocationServiceClient* client)
    5151{
    5252    return new GeolocationServiceAndroid(client);
  • trunk/Source/WebCore/platform/android/GeolocationServiceAndroid.h

    r51071 r85405  
    4242class GeolocationServiceAndroid : public GeolocationService {
    4343public:
    44     static GeolocationService* create(GeolocationServiceClient*);
     44    static PassOwnPtr<GeolocationService> create(GeolocationServiceClient*);
    4545
    4646    virtual ~GeolocationServiceAndroid() { };
  • trunk/Source/WebCore/platform/efl/GeolocationServiceEfl.cpp

    r81556 r85405  
    3131GeolocationService::FactoryFunction* GeolocationService::s_factoryFunction = &GeolocationServiceEfl::create;
    3232
    33 GeolocationService* GeolocationServiceEfl::create(GeolocationServiceClient* client)
     33PassOwnPtr<GeolocationService> GeolocationServiceEfl::create(GeolocationServiceClient* client)
    3434{
    3535    return new GeolocationServiceEfl(client);
  • trunk/Source/WebCore/platform/efl/GeolocationServiceEfl.h

    r81556 r85405  
    3232class GeolocationServiceEfl : public GeolocationService {
    3333public:
    34     static GeolocationService* create(GeolocationServiceClient*);
     34    static PassOwnPtr<GeolocationService> create(GeolocationServiceClient*);
    3535    ~GeolocationServiceEfl();
    3636
  • trunk/Source/WebCore/platform/graphics/cairo/CairoUtilities.cpp

    r83945 r85405  
    6666void appendPathToCairoContext(cairo_t* to, cairo_t* from)
    6767{
    68     OwnPtr<cairo_path_t> cairoPath(cairo_copy_path(from));
     68    OwnPtr<cairo_path_t> cairoPath = adoptPtr(cairo_copy_path(from));
    6969    cairo_append_path(to, cairoPath.get());
    7070}
  • trunk/Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp

    r85279 r85405  
    151151    // Calculate the extents of the rendered solid paths.
    152152    cairo_t* cairoContext = context->platformContext()->cr();
    153     OwnPtr<cairo_path_t> path(cairo_copy_path(cairoContext));
     153    OwnPtr<cairo_path_t> path = adoptPtr(cairo_copy_path(cairoContext));
    154154
    155155    FloatRect solidFigureExtents;
     
    10331033
    10341034    cairo_t* cr = platformContext()->cr();
    1035     OwnPtr<cairo_path_t> p(cairo_copy_path(path.platformPath()->context()));
    1036     cairo_append_path(cr, p.get());
     1035    OwnPtr<cairo_path_t> pathCopy = adoptPtr(cairo_copy_path(path.platformPath()->context()));
     1036    cairo_append_path(cr, pathCopy.get());
    10371037    cairo_fill_rule_t savedFillRule = cairo_get_fill_rule(cr);
    10381038    cairo_set_fill_rule(cr, CAIRO_FILL_RULE_WINDING);
  • trunk/Source/WebCore/platform/graphics/cairo/ImageBufferCairo.cpp

    r83932 r85405  
    8585    RefPtr<cairo_t> cr = adoptRef(cairo_create(m_data.m_surface));
    8686    m_data.m_platformContext.setCr(cr.get());
    87     m_context.set(new GraphicsContext(&m_data.m_platformContext));
     87    m_context = adoptPtr(new GraphicsContext(&m_data.m_platformContext));
    8888    success = true;
    8989}
  • trunk/Source/WebCore/platform/graphics/cairo/OwnPtrCairo.h

    r80744 r85405  
    2222
    2323#include "OwnPtr.h"
     24#include "PassOwnPtr.h"
    2425
    2526#if USE(FREETYPE)
  • trunk/Source/WebCore/platform/graphics/cairo/PathCairo.cpp

    r83945 r85405  
    5454{
    5555    cairo_t* cr = platformPath()->context();
    56     OwnPtr<cairo_path_t> p(cairo_copy_path(other.platformPath()->context()));
    57     cairo_append_path(cr, p.get());
     56    OwnPtr<cairo_path_t> pathCopy = adoptPtr(cairo_copy_path(other.platformPath()->context()));
     57    cairo_append_path(cr, pathCopy.get());
    5858}
    5959
     
    6565    clear();
    6666    cairo_t* cr = platformPath()->context();
    67     OwnPtr<cairo_path_t> p(cairo_copy_path(other.platformPath()->context()));
    68     cairo_append_path(cr, p.get());
     67    OwnPtr<cairo_path_t> pathCopy = adoptPtr(cairo_copy_path(other.platformPath()->context()));
     68    cairo_append_path(cr, pathCopy.get());
    6969    return *this;
    7070}
     
    320320{
    321321    cairo_t* cr = platformPath()->context();
    322     OwnPtr<cairo_path_t> path(cairo_copy_path(cr));
     322    OwnPtr<cairo_path_t> pathCopy = adoptPtr(cairo_copy_path(cr));
    323323    cairo_path_data_t* data;
    324324    PathElement pelement;
     
    326326    pelement.points = points;
    327327
    328     for (int i = 0; i < path->num_data; i += path->data[i].header.length) {
    329         data = &path->data[i];
     328    for (int i = 0; i < pathCopy->num_data; i += pathCopy->data[i].header.length) {
     329        data = &pathCopy->data[i];
    330330        switch (data->header.type) {
    331331        case CAIRO_PATH_MOVE_TO:
  • trunk/Source/WebCore/platform/gtk/GeolocationServiceGtk.cpp

    r66887 r85405  
    3939namespace WebCore {
    4040
    41 GeolocationService* GeolocationServiceGtk::create(GeolocationServiceClient* client)
     41PassOwnPtr<GeolocationService> GeolocationServiceGtk::create(GeolocationServiceClient* client)
    4242{
    4343    return new GeolocationServiceGtk(client);
  • trunk/Source/WebCore/platform/gtk/GeolocationServiceGtk.h

    r66887 r85405  
    3333    class GeolocationServiceGtk : public GeolocationService {
    3434    public:
    35         static GeolocationService* create(GeolocationServiceClient*);
     35        static PassOwnPtr<GeolocationService> create(GeolocationServiceClient*);
    3636        ~GeolocationServiceGtk();
    3737
  • trunk/Source/WebCore/platform/mock/GeolocationServiceMock.cpp

    r56781 r85405  
    4141RefPtr<PositionError>* GeolocationServiceMock::s_lastError;
    4242
    43 GeolocationService* GeolocationServiceMock::create(GeolocationServiceClient* client)
     43PassOwnPtr<GeolocationService> GeolocationServiceMock::create(GeolocationServiceClient* client)
    4444{
    4545    initStatics();
  • trunk/Source/WebCore/platform/mock/GeolocationServiceMock.h

    r48144 r85405  
    4242class GeolocationServiceMock : public GeolocationService {
    4343  public:
    44     static GeolocationService* create(GeolocationServiceClient*);
     44    static PassOwnPtr<GeolocationService> create(GeolocationServiceClient*);
    4545
    4646    GeolocationServiceMock(GeolocationServiceClient*);
Note: See TracChangeset for help on using the changeset viewer.