Changeset 84926 in webkit


Ignore:
Timestamp:
Apr 26, 2011 10:21:42 AM (13 years ago)
Author:
abarth@webkit.org
Message:

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

Reviewed by Eric Seidel.

DumpRenderTree/chromium should play nice with strict OwnPtrs
https://bugs.webkit.org/show_bug.cgi?id=59458

All these changes are pretty straight forward.

  • DumpRenderTree/chromium/CppBoundClass.cpp: (GetterPropertyCallback::GetterPropertyCallback): (CppBoundClass::bindGetterCallback):
  • DumpRenderTree/chromium/CppBoundClass.h: (CppBoundClass::bindProperty): (CppBoundClass::bindFallbackCallback): (CppBoundClass::bindFallbackMethod):
  • DumpRenderTree/chromium/DRTDevToolsClient.cpp: (DRTDevToolsClient::DRTDevToolsClient):
  • DumpRenderTree/chromium/TestEventPrinter.cpp: (TestEventPrinter::createDRTPrinter): (TestEventPrinter::createTestShellPrinter):
  • DumpRenderTree/chromium/TestEventPrinter.h:
  • DumpRenderTree/chromium/TestShell.cpp: (TestShell::TestShell): (TestShell::createMainWindow): (TestShell::createDRTDevToolsClient):
  • DumpRenderTree/chromium/WebViewHost.cpp: (WebViewHost::geolocationClientMock): (WebViewHost::speechInputController): (WebViewHost::deviceOrientationClientMock): (WebViewHost::reset): (WebViewHost::navigate): (WebViewHost::setPendingExtraData): (WebViewHost::canvas):
  • DumpRenderTree/chromium/WebViewHost.h:
Location:
trunk/Tools
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r84924 r84926  
     12011-04-26  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        DumpRenderTree/chromium should play nice with strict OwnPtrs
     6        https://bugs.webkit.org/show_bug.cgi?id=59458
     7
     8        All these changes are pretty straight forward.
     9
     10        * DumpRenderTree/chromium/CppBoundClass.cpp:
     11        (GetterPropertyCallback::GetterPropertyCallback):
     12        (CppBoundClass::bindGetterCallback):
     13        * DumpRenderTree/chromium/CppBoundClass.h:
     14        (CppBoundClass::bindProperty):
     15        (CppBoundClass::bindFallbackCallback):
     16        (CppBoundClass::bindFallbackMethod):
     17        * DumpRenderTree/chromium/DRTDevToolsClient.cpp:
     18        (DRTDevToolsClient::DRTDevToolsClient):
     19        * DumpRenderTree/chromium/TestEventPrinter.cpp:
     20        (TestEventPrinter::createDRTPrinter):
     21        (TestEventPrinter::createTestShellPrinter):
     22        * DumpRenderTree/chromium/TestEventPrinter.h:
     23        * DumpRenderTree/chromium/TestShell.cpp:
     24        (TestShell::TestShell):
     25        (TestShell::createMainWindow):
     26        (TestShell::createDRTDevToolsClient):
     27        * DumpRenderTree/chromium/WebViewHost.cpp:
     28        (WebViewHost::geolocationClientMock):
     29        (WebViewHost::speechInputController):
     30        (WebViewHost::deviceOrientationClientMock):
     31        (WebViewHost::reset):
     32        (WebViewHost::navigate):
     33        (WebViewHost::setPendingExtraData):
     34        (WebViewHost::canvas):
     35        * DumpRenderTree/chromium/WebViewHost.h:
     36
    1372011-04-26  Adam Roben  <aroben@apple.com>
    238
  • trunk/Tools/DumpRenderTree/chromium/CppBoundClass.cpp

    r73317 r84926  
    7474class GetterPropertyCallback : public CppBoundClass::PropertyCallback {
    7575public:
    76     GetterPropertyCallback(CppBoundClass::GetterCallback* callback)
    77         : m_callback(callback) { }
     76    GetterPropertyCallback(PassOwnPtr<CppBoundClass::GetterCallback> callback)
     77        : m_callback(callback)
     78    {
     79    }
    7880
    7981    virtual bool getValue(CppVariant* value)
     
    291293}
    292294
    293 void CppBoundClass::bindGetterCallback(const string& name, GetterCallback* callback)
     295void CppBoundClass::bindGetterCallback(const string& name, PassOwnPtr<GetterCallback> callback)
    294296{
    295297    PropertyCallback* propertyCallback = callback ? new GetterPropertyCallback(callback) : 0;
  • trunk/Tools/DumpRenderTree/chromium/CppBoundClass.h

    r76248 r84926  
    4848#include <wtf/Noncopyable.h>
    4949#include <wtf/OwnPtr.h>
     50#include <wtf/PassOwnPtr.h>
    5051#include <wtf/Vector.h>
    5152
     
    160161    // Bind Javascript property |name| to the C++ getter callback |callback|.
    161162    // This can be used to create read-only properties.
    162     void bindGetterCallback(const std::string&, GetterCallback*);
     163    void bindGetterCallback(const std::string&, PassOwnPtr<GetterCallback>);
    163164
    164165    // A wrapper for BindGetterCallback, to simplify the common case of binding a
     
    168169    void bindProperty(const std::string& name, void (T::*method)(CppVariant*))
    169170    {
    170         GetterCallback* callback = new MemberGetterCallback<T>(static_cast<T*>(this), method);
    171         bindGetterCallback(name, callback);
     171        OwnPtr<GetterCallback> callback = adoptPtr(new MemberGetterCallback<T>(static_cast<T*>(this), method));
     172        bindGetterCallback(name, callback.release());
    172173    }
    173174
     
    189190    // fallback always returns true when checked for a method's
    190191    // existence).
    191     void bindFallbackCallback(Callback* fallbackCallback)
    192     {
    193         m_fallbackCallback.set(fallbackCallback);
     192    void bindFallbackCallback(PassOwnPtr<Callback> fallbackCallback)
     193    {
     194        m_fallbackCallback = fallbackCallback;
    194195    }
    195196
     
    202203    {
    203204        if (method) {
    204             Callback* callback = new MemberCallback<T>(static_cast<T*>(this), method);
    205             bindFallbackCallback(callback);
     205            OwnPtr<Callback> callback = adoptPtr(new MemberCallback<T>(static_cast<T*>(this), method));
     206            bindFallbackCallback(callback.release());
    206207        } else
    207             bindFallbackCallback(0);
     208            bindFallbackCallback(PassOwnPtr<Callback>());
    208209    }
    209210
  • trunk/Tools/DumpRenderTree/chromium/DRTDevToolsClient.cpp

    r79322 r84926  
    3333
    3434#include "DRTDevToolsAgent.h"
    35 
    3635#include "WebDevToolsAgent.h"
    3736#include "WebDevToolsFrontend.h"
     
    4039#include "WebView.h"
    4140#include "webkit/support/webkit_support.h"
     41#include <wtf/PassOwnPtr.h>
    4242
    4343using namespace WebKit;
     
    4747    , m_drtDevToolsAgent(agent)
    4848{
    49     m_webDevToolsFrontend.set(WebDevToolsFrontend::create(m_webView,
    50                                                           this,
    51                                                           WebString::fromUTF8("en-US")));
     49    m_webDevToolsFrontend = adoptPtr(WebDevToolsFrontend::create(m_webView, this, WebString::fromUTF8("en-US")));
    5250    m_drtDevToolsAgent->attach(this);
    5351}
  • trunk/Tools/DumpRenderTree/chromium/TestEventPrinter.cpp

    r68466 r84926  
    6060};
    6161
    62 TestEventPrinter* TestEventPrinter::createDRTPrinter()
     62PassOwnPtr<TestEventPrinter> TestEventPrinter::createDRTPrinter()
    6363{
    64     return new DRTPrinter;
     64    return adoptPtr(new DRTPrinter);
    6565}
    6666
    67 TestEventPrinter* TestEventPrinter::createTestShellPrinter()
     67PassOwnPtr<TestEventPrinter> TestEventPrinter::createTestShellPrinter()
    6868{
    69     return new TestShellPrinter;
     69    return adoptPtr(new TestShellPrinter);
    7070}
    7171
  • trunk/Tools/DumpRenderTree/chromium/TestEventPrinter.h

    r75971 r84926  
    3232#define TestEventPrinter_h
    3333
     34#include <wtf/PassOwnPtr.h>
     35
    3436class TestEventPrinter {
    3537public:
    36     static TestEventPrinter* createDRTPrinter();
    37     static TestEventPrinter* createTestShellPrinter();
     38    static PassOwnPtr<TestEventPrinter> createDRTPrinter();
     39    static PassOwnPtr<TestEventPrinter> createTestShellPrinter();
    3840
    3941    virtual void handleTestHeader(const char* url) const = 0;
  • trunk/Tools/DumpRenderTree/chromium/TestShell.cpp

    r84361 r84926  
    112112    WebRuntimeFeatures::enableFileSystem(true);
    113113    WebRuntimeFeatures::enableJavaScriptI18NAPI(true);
    114     m_accessibilityController.set(new AccessibilityController(this));
    115     m_layoutTestController.set(new LayoutTestController(this));
    116     m_eventSender.set(new EventSender(this));
    117     m_plainTextController.set(new PlainTextController());
    118     m_textInputController.set(new TextInputController(this));
    119     m_notificationPresenter.set(new NotificationPresenter(this));
    120     m_printer.set(m_testShellMode ? TestEventPrinter::createTestShellPrinter() : TestEventPrinter::createDRTPrinter());
     114    m_accessibilityController = adoptPtr(new AccessibilityController(this));
     115    m_layoutTestController = adoptPtr(new LayoutTestController(this));
     116    m_eventSender = adoptPtr(new EventSender(this));
     117    m_plainTextController = adoptPtr(new PlainTextController());
     118    m_textInputController = adoptPtr(new TextInputController(this));
     119    m_notificationPresenter = adoptPtr(new NotificationPresenter(this));
     120    m_printer = m_testShellMode ? TestEventPrinter::createTestShellPrinter() : TestEventPrinter::createDRTPrinter();
    121121
    122122    // 30 second is the same as the value in Mac DRT.
     
    131131void TestShell::createMainWindow()
    132132{
    133     m_drtDevToolsAgent.set(new DRTDevToolsAgent);
     133    m_drtDevToolsAgent = adoptPtr(new DRTDevToolsAgent);
    134134    m_webViewHost = createNewWindow(WebURL(), m_drtDevToolsAgent.get());
    135135    m_webView = m_webViewHost->webView();
     
    148148void TestShell::createDRTDevToolsClient(DRTDevToolsAgent* agent)
    149149{
    150     m_drtDevToolsClient.set(new DRTDevToolsClient(agent, m_devTools->webView()));
     150    m_drtDevToolsClient = adoptPtr(new DRTDevToolsClient(agent, m_devTools->webView()));
    151151}
    152152
  • trunk/Tools/DumpRenderTree/chromium/WebViewHost.cpp

    r84199 r84926  
    607607{
    608608    if (!m_geolocationClientMock)
    609         m_geolocationClientMock.set(WebGeolocationClientMock::create());
     609        m_geolocationClientMock = adoptPtr(WebGeolocationClientMock::create());
    610610    return m_geolocationClientMock.get();
    611611}
     
    614614{
    615615    if (!m_speechInputControllerMock)
    616         m_speechInputControllerMock.set(WebSpeechInputControllerMock::create(listener));
     616        m_speechInputControllerMock = adoptPtr(WebSpeechInputControllerMock::create(listener));
    617617    return m_speechInputControllerMock.get();
    618618}
     
    621621{
    622622    if (!m_deviceOrientationClientMock.get())
    623         m_deviceOrientationClientMock.set(WebDeviceOrientationClientMock::create());
     623        m_deviceOrientationClientMock = adoptPtr(WebDeviceOrientationClientMock::create());
    624624    return m_deviceOrientationClientMock.get();
    625625}
     
    11971197    m_canvas.clear();
    11981198
    1199     m_navigationController.set(new TestNavigationController(this));
     1199    m_navigationController = adoptPtr(new TestNavigationController(this));
    12001200
    12011201    m_pendingExtraData.clear();
     
    12831283    // the page initiated any load resulting from JS execution.
    12841284    if (!GURL(entry.URL()).SchemeIs("javascript"))
    1285         setPendingExtraData(new TestShellExtraData(entry.pageID()));
     1285        setPendingExtraData(adoptPtr(new TestShellExtraData(entry.pageID())));
    12861286
    12871287    // If we are reloading, then WebKit will use the state of the current page.
     
    12981298
    12991299    // In case LoadRequest failed before DidCreateDataSource was called.
    1300     setPendingExtraData(0);
     1300    setPendingExtraData(PassOwnPtr<TestShellExtraData>());
    13011301
    13021302    // Restore focus to the main frame prior to loading new request.
     
    14331433}
    14341434
    1435 void WebViewHost::setPendingExtraData(TestShellExtraData* extraData)
    1436 {
    1437     m_pendingExtraData.set(extraData);
     1435void WebViewHost::setPendingExtraData(PassOwnPtr<TestShellExtraData> extraData)
     1436{
     1437    m_pendingExtraData = extraData;
    14381438}
    14391439
     
    15201520    WebSize widgetSize = webWidget()->size();
    15211521    resetScrollRect();
    1522     m_canvas.set(skia::CreateBitmapCanvas(
    1523         widgetSize.width, widgetSize.height, true));
     1522    m_canvas = adoptPtr(skia::CreateBitmapCanvas(widgetSize.width, widgetSize.height, true));
    15241523    return m_canvas.get();
    15251524}
  • trunk/Tools/DumpRenderTree/chromium/WebViewHost.h

    r84199 r84926  
    8282    void setEditCommand(const std::string& name, const std::string& value);
    8383    void clearEditCommand();
    84     void setPendingExtraData(TestShellExtraData*);
     84    void setPendingExtraData(PassOwnPtr<TestShellExtraData>);
    8585
    8686    void paintRect(const WebKit::WebRect&);
Note: See TracChangeset for help on using the changeset viewer.