Title: [96680] trunk/Source/WebKit2
- Revision
- 96680
- Author
- [email protected]
- Date
- 2011-10-05 01:03:01 -0700 (Wed, 05 Oct 2011)
Log Message
[GTK] Use WKRetainPtr for WK types in WebKit2 GTK+
https://bugs.webkit.org/show_bug.cgi?id=69404
Reviewed by Martin Robinson.
* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkitWebContextFinalize):
(createDefaultWebContext):
(webkitWebContextGetWKContext):
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkit_web_view_load_uri):
(webkit_web_view_load_alternate_html):
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (96679 => 96680)
--- trunk/Source/WebKit2/ChangeLog 2011-10-05 06:07:51 UTC (rev 96679)
+++ trunk/Source/WebKit2/ChangeLog 2011-10-05 08:03:01 UTC (rev 96680)
@@ -1,3 +1,18 @@
+2011-10-05 Carlos Garcia Campos <[email protected]>
+
+ [GTK] Use WKRetainPtr for WK types in WebKit2 GTK+
+ https://bugs.webkit.org/show_bug.cgi?id=69404
+
+ Reviewed by Martin Robinson.
+
+ * UIProcess/API/gtk/WebKitWebContext.cpp:
+ (webkitWebContextFinalize):
+ (createDefaultWebContext):
+ (webkitWebContextGetWKContext):
+ * UIProcess/API/gtk/WebKitWebView.cpp:
+ (webkit_web_view_load_uri):
+ (webkit_web_view_load_alternate_html):
+
2011-10-04 Kent Tamura <[email protected]>
Introduce feature flags for incomplete input types
Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp (96679 => 96680)
--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp 2011-10-05 06:07:51 UTC (rev 96679)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp 2011-10-05 08:03:01 UTC (rev 96680)
@@ -22,23 +22,18 @@
#include "WebKitWebContextPrivate.h"
#include <WebKit2/WKContext.h>
+#include <WebKit2/WKRetainPtr.h>
#include <WebKit2/WKType.h>
struct _WebKitWebContextPrivate {
- WKContextRef context;
+ WKRetainPtr<WKContextRef> context;
};
G_DEFINE_TYPE(WebKitWebContext, webkit_web_context, G_TYPE_OBJECT)
static void webkitWebContextFinalize(GObject* object)
{
- WebKitWebContext* context = WEBKIT_WEB_CONTEXT(object);
-
- WKRelease(context->priv->context);
- context->priv->context = 0;
-
- context->priv->~WebKitWebContextPrivate();
-
+ WEBKIT_WEB_CONTEXT(object)->priv->~WebKitWebContextPrivate();
G_OBJECT_CLASS(webkit_web_context_parent_class)->finalize(object);
}
@@ -62,7 +57,7 @@
{
WebKitWebContext* webContext = WEBKIT_WEB_CONTEXT(g_object_new(WEBKIT_TYPE_WEB_CONTEXT, NULL));
webContext->priv->context = WKContextGetSharedProcessContext();
- WKContextSetCacheModel(webContext->priv->context, kWKCacheModelPrimaryWebBrowser);
+ WKContextSetCacheModel(webContext->priv->context.get(), kWKCacheModelPrimaryWebBrowser);
return webContext;
}
@@ -83,6 +78,6 @@
{
g_assert(WEBKIT_IS_WEB_CONTEXT(context));
- return context->priv->context;
+ return context->priv->context.get();
}
Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp (96679 => 96680)
--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp 2011-10-05 06:07:51 UTC (rev 96679)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp 2011-10-05 08:03:01 UTC (rev 96680)
@@ -26,6 +26,7 @@
#include "WebKitPrivate.h"
#include "WebPageProxy.h"
#include <WebKit2/WKBase.h>
+#include <WebKit2/WKRetainPtr.h>
#include <WebKit2/WKURL.h>
#include <wtf/gobject/GRefPtr.h>
#include <wtf/text/CString.h>
@@ -216,10 +217,9 @@
g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
g_return_if_fail(uri);
- WKURLRef url = ""
+ WKRetainPtr<WKURLRef> url(AdoptWK, WKURLCreateWithUTF8CString(uri));
WebPageProxy* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView));
- WKPageLoadURL(toAPI(page), url);
- WKRelease(url);
+ WKPageLoadURL(toAPI(page), url.get());
}
/**
@@ -243,16 +243,11 @@
g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
g_return_if_fail(content);
- WKStringRef htmlString = WKStringCreateWithUTF8CString(content);
- WKURLRef baseURL = baseURI ? WKURLCreateWithUTF8CString(baseURI) : 0;
- WKURLRef unreachableURL = unreachableURI ? WKURLCreateWithUTF8CString(unreachableURI) : 0;
+ WKRetainPtr<WKStringRef> htmlString(AdoptWK, WKStringCreateWithUTF8CString(content));
+ WKRetainPtr<WKURLRef> baseURL = baseURI ? adoptWK(WKURLCreateWithUTF8CString(baseURI)) : 0;
+ WKRetainPtr<WKURLRef> unreachableURL = unreachableURI ? adoptWK(WKURLCreateWithUTF8CString(unreachableURI)) : 0;
WebPageProxy* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView));
- WKPageLoadAlternateHTMLString(toAPI(page), htmlString, baseURL, unreachableURL);
- WKRelease(htmlString);
- if (baseURL)
- WKRelease(baseURL);
- if (unreachableURL)
- WKRelease(unreachableURL);
+ WKPageLoadAlternateHTMLString(toAPI(page), htmlString.get(), baseURL.get(), unreachableURL.get());
}
/**
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes