Skip to content

Instantly share code, notes, and snippets.

@Adenilson
Created February 14, 2013 17:22
Show Gist options
  • Save Adenilson/4954425 to your computer and use it in GitHub Desktop.
Save Adenilson/4954425 to your computer and use it in GitHub Desktop.
ouch
adenilson@asusbloat:~/apps/webkit/Webkit$ git diff
diff --git a/Tools/TestWebKitAPI/Tests/WebKit2/ResizeWindowAfterCrash.cpp b/Tools/TestWebKitAPI/Tests/WebKit2/ResizeWindowA
index 3f0539c..5285a39 100644
--- a/Tools/TestWebKitAPI/Tests/WebKit2/ResizeWindowAfterCrash.cpp
+++ b/Tools/TestWebKitAPI/Tests/WebKit2/ResizeWindowAfterCrash.cpp
@@ -28,12 +28,14 @@
#include "PlatformWebView.h"
#include "Test.h"
#include <WebKit2/WKRetainPtr.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
namespace TestWebKitAPI {
static bool resizeAfterCrash = false;
static bool done = false;
-static PlatformWebView *webView = 0;
+static OwnPtr<PlatformWebView> webView;
static void didFinishLoad(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
{
@@ -70,8 +72,7 @@ static void didCrash(WKPageRef page, const void*)
TEST(WebKit2, ResizeWindowAfterCrash)
{
WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreate());
- // TODO: use a smart/shared pointer here
- webView = new PlatformWebView(context.get());
+ webView = adoptPtr(new PlatformWebView(context.get()));
WKPageLoaderClient loaderClient;
memset(&loaderClient, 0, sizeof(loaderClient));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment