Changeset 107092 in webkit


Ignore:
Timestamp:
Feb 8, 2012 8:31:14 AM (12 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK] Fix a crash when WebKitWebView is created without a WebContext
https://bugs.webkit.org/show_bug.cgi?id=78104

Reviewed by Philippe Normand.

  • UIProcess/API/gtk/WebKitWebView.cpp:

(webkitWebViewSetProperty): Make sure WebKitWebView:web-context
property is initialized to the default web context when a web
context is not passed to g_object_new().

  • UIProcess/API/gtk/tests/TestWebKitWebView.cpp:

(testWebViewDefaultContext): Check that a web view created with
g_object_new has the default context.

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r107090 r107092  
     12012-02-08  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Fix a crash when WebKitWebView is created without a WebContext
     4        https://bugs.webkit.org/show_bug.cgi?id=78104
     5
     6        Reviewed by Philippe Normand.
     7
     8        * UIProcess/API/gtk/WebKitWebView.cpp:
     9        (webkitWebViewSetProperty): Make sure WebKitWebView:web-context
     10        property is initialized to the default web context when a web
     11        context is not passed to g_object_new().
     12        * UIProcess/API/gtk/tests/TestWebKitWebView.cpp:
     13        (testWebViewDefaultContext): Check that a web view created with
     14        g_object_new has the default context.
     15
    1162012-02-08  Michael Brüning  <michael.bruning@nokia.com>
    217
  • trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp

    r107087 r107092  
    181181
    182182    switch (propId) {
    183     case PROP_WEB_CONTEXT:
    184         webView->priv->context = WEBKIT_WEB_CONTEXT(g_value_get_object(value));
     183    case PROP_WEB_CONTEXT: {
     184        gpointer webContext = g_value_get_object(value);
     185        webView->priv->context = webContext ? WEBKIT_WEB_CONTEXT(webContext) : webkit_web_context_get_default();
    185186        break;
     187    }
    186188    case PROP_ZOOM_LEVEL:
    187189        webkit_web_view_set_zoom_level(webView, g_value_get_double(value));
  • trunk/Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebView.cpp

    r104145 r107092  
    2727{
    2828    g_assert(webkit_web_view_get_context(test->m_webView) == webkit_web_context_get_default());
     29
     30    // Check that a web view created with g_object_new has the default context.
     31    GRefPtr<WebKitWebView> webView = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW, NULL));
     32    g_assert(webkit_web_view_get_context(webView.get()) == webkit_web_context_get_default());
    2933}
    3034
Note: See TracChangeset for help on using the changeset viewer.