[webkit-help] Embedding WebKit - virtual functions not get instantiated properly.
Seweryn Pływaczyk
s.plywaczyk at gmail.com
Wed Jan 13 02:31:53 PST 2010
Hi
You have probably done initialization in wrong way. It should like like this
(it's my case if you don't have clients you just use Empty ones):
m_pChromeClient = new WebChromeClient();
m_pContextMenuClient = new WebCore::EmptyContextMenuClient();
m_pEditorClient = new WebEditorClient();
m_pDragClient = new WebCore::EmptyDragClient();
m_pInspectorClient = new WebCore::EmptyInspectorClient();
// For WebCore::Frame
m_pFrameLoaderClient = new WebCore::WebFrameLoaderClientCE();
m_pPage = new WebCore::Page(m_pChromeClient,
m_pContextMenuClient,
m_pEditorClient,
m_pDragClient,
m_pInspectorClient);
Now Page has its own chrome client.
2010/1/13 Alex MacCaw <info at eribium.org>
> Very odd error... I've been trying to embed WebKit into my own app.
> Getting this error:
>
> Program received signal EXC_BAD_ACCESS, Could not access memory.
> Reason: KERN_PROTECTION_FAILURE at address: 0x00000008
> 0x01e8c8b0 in WebCore::FrameView::invalidateRect (this=0x475ddb0,
> rect=@0xbfffdf78) at
> /Users/Alex/Downloads/WebKit-r52751/WebCore/page/FrameView.cpp:295
> 295 hostWindow()->repaint(rect, true);
>
>
> On further investigation, it seems none of the virtual methods (from
> HostWindow) exist on Chrome.
> So, an example:
>
> WebCore::Page *page = new WebCore::Page(...);
> page->chrome() // Instance of (WebCore::Chrome*)
> page->chrome()->focus() // Works
> page->chrome()->scrollbarsModeDidChange(); // Triggers null pointer error
>
>
> But if we create our own Chrome instance:
>
> const WebCore::Chrome *chrome = new WebCore::Chrome(page, new
> WebCore::EmptyChromeClient());
> chrome->scrollbarsModeDidChange(); // Works fine
>
>
> Any idea why the virtual functions don't exist with the first example:
>
> --
> http://www.leadthinking.com | http://socialmod.com
>
> _______________________________________________
> webkit-help mailing list
> webkit-help at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-help
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-help/attachments/20100113/c8b56bee/attachment.html>
More information about the webkit-help
mailing list