Changeset 96680 in webkit
- Timestamp:
- Oct 5, 2011 1:03:01 AM (13 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r96678 r96680 1 2011-10-05 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Use WKRetainPtr for WK types in WebKit2 GTK+ 4 https://bugs.webkit.org/show_bug.cgi?id=69404 5 6 Reviewed by Martin Robinson. 7 8 * UIProcess/API/gtk/WebKitWebContext.cpp: 9 (webkitWebContextFinalize): 10 (createDefaultWebContext): 11 (webkitWebContextGetWKContext): 12 * UIProcess/API/gtk/WebKitWebView.cpp: 13 (webkit_web_view_load_uri): 14 (webkit_web_view_load_alternate_html): 15 1 16 2011-10-04 Kent Tamura <tkent@chromium.org> 2 17 -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp
r96317 r96680 23 23 #include "WebKitWebContextPrivate.h" 24 24 #include <WebKit2/WKContext.h> 25 #include <WebKit2/WKRetainPtr.h> 25 26 #include <WebKit2/WKType.h> 26 27 27 28 struct _WebKitWebContextPrivate { 28 WK ContextRefcontext;29 WKRetainPtr<WKContextRef> context; 29 30 }; 30 31 … … 33 34 static void webkitWebContextFinalize(GObject* object) 34 35 { 35 WebKitWebContext* context = WEBKIT_WEB_CONTEXT(object); 36 37 WKRelease(context->priv->context); 38 context->priv->context = 0; 39 40 context->priv->~WebKitWebContextPrivate(); 41 36 WEBKIT_WEB_CONTEXT(object)->priv->~WebKitWebContextPrivate(); 42 37 G_OBJECT_CLASS(webkit_web_context_parent_class)->finalize(object); 43 38 } … … 63 58 WebKitWebContext* webContext = WEBKIT_WEB_CONTEXT(g_object_new(WEBKIT_TYPE_WEB_CONTEXT, NULL)); 64 59 webContext->priv->context = WKContextGetSharedProcessContext(); 65 WKContextSetCacheModel(webContext->priv->context , kWKCacheModelPrimaryWebBrowser);60 WKContextSetCacheModel(webContext->priv->context.get(), kWKCacheModelPrimaryWebBrowser); 66 61 return webContext; 67 62 } … … 84 79 g_assert(WEBKIT_IS_WEB_CONTEXT(context)); 85 80 86 return context->priv->context ;81 return context->priv->context.get(); 87 82 } 88 83 -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
r96614 r96680 27 27 #include "WebPageProxy.h" 28 28 #include <WebKit2/WKBase.h> 29 #include <WebKit2/WKRetainPtr.h> 29 30 #include <WebKit2/WKURL.h> 30 31 #include <wtf/gobject/GRefPtr.h> … … 217 218 g_return_if_fail(uri); 218 219 219 WKURLRef url = WKURLCreateWithUTF8CString(uri); 220 WebPageProxy* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView)); 221 WKPageLoadURL(toAPI(page), url); 222 WKRelease(url); 220 WKRetainPtr<WKURLRef> url(AdoptWK, WKURLCreateWithUTF8CString(uri)); 221 WebPageProxy* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView)); 222 WKPageLoadURL(toAPI(page), url.get()); 223 223 } 224 224 … … 244 244 g_return_if_fail(content); 245 245 246 WKStringRef htmlString = WKStringCreateWithUTF8CString(content); 247 WKURLRef baseURL = baseURI ? WKURLCreateWithUTF8CString(baseURI) : 0; 248 WKURLRef unreachableURL = unreachableURI ? WKURLCreateWithUTF8CString(unreachableURI) : 0; 249 WebPageProxy* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView)); 250 WKPageLoadAlternateHTMLString(toAPI(page), htmlString, baseURL, unreachableURL); 251 WKRelease(htmlString); 252 if (baseURL) 253 WKRelease(baseURL); 254 if (unreachableURL) 255 WKRelease(unreachableURL); 246 WKRetainPtr<WKStringRef> htmlString(AdoptWK, WKStringCreateWithUTF8CString(content)); 247 WKRetainPtr<WKURLRef> baseURL = baseURI ? adoptWK(WKURLCreateWithUTF8CString(baseURI)) : 0; 248 WKRetainPtr<WKURLRef> unreachableURL = unreachableURI ? adoptWK(WKURLCreateWithUTF8CString(unreachableURI)) : 0; 249 WebPageProxy* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView)); 250 WKPageLoadAlternateHTMLString(toAPI(page), htmlString.get(), baseURL.get(), unreachableURL.get()); 256 251 } 257 252
Note: See TracChangeset
for help on using the changeset viewer.