Changeset 196257 in webkit


Ignore:
Timestamp:
Feb 8, 2016 10:43:18 AM (8 years ago)
Author:
commit-queue@webkit.org
Message:

[GTK] Fix crash when creating webview with g_object_new
https://bugs.webkit.org/show_bug.cgi?id=153989

Patch by Danilo Cesar Lemes de Paula <danilo.cesar@collabora.co.uk> on 2016-02-08
Reviewed by Carlos Garcia Campos.

g_object_new(WEBKIT_TYPE_WEB_VIEW, NULL) crashes webkit
as _WebKitWebViewBasePrivate constructor requires a mainloop, but
webkit is only initialized when a context is created (which
doesn't happen with a direct call to g_object_new).

  • UIProcess/API/gtk/WebKitWebViewBase.cpp:

(webkit_web_view_base_class_init):

Location:
trunk/Source/WebKit2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r196256 r196257  
     12016-02-08  Danilo Cesar Lemes de Paula  <danilo.cesar@collabora.co.uk>
     2
     3        [GTK] Fix crash when creating webview with g_object_new
     4        https://bugs.webkit.org/show_bug.cgi?id=153989
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        g_object_new(WEBKIT_TYPE_WEB_VIEW, NULL) crashes webkit
     9        as _WebKitWebViewBasePrivate constructor requires a mainloop, but
     10        webkit is only initialized when a context is created (which
     11        doesn't happen with a direct call to g_object_new).
     12
     13        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
     14        (webkit_web_view_base_class_init):
     15
    1162016-02-08  Commit Queue  <commit-queue@webkit.org>
    217
  • trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp

    r196256 r196257  
    4343#include "WebFullScreenClientGtk.h"
    4444#include "WebInspectorProxy.h"
     45#include "WebKit2Initialize.h"
    4546#include "WebKitAuthenticationDialog.h"
    4647#include "WebKitPrivate.h"
     
    11031104    containerClass->remove = webkitWebViewBaseContainerRemove;
    11041105    containerClass->forall = webkitWebViewBaseContainerForall;
     1106
     1107    // Before creating a WebKitWebViewBasePriv we need to be sure that WebKit is started.
     1108    // Usually starting a context triggers InitializeWebKit2, but in case
     1109    // we create a view without asking before for a default_context we get a crash.
     1110    WebKit::InitializeWebKit2();
    11051111}
    11061112
Note: See TracChangeset for help on using the changeset viewer.