Fix for https://bugs.webkit.org/show_bug.cgi?id=41073
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Jun 2010 16:06:33 +0000 (16:06 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Jun 2010 16:06:33 +0000 (16:06 +0000)
WebKit2: Flesh out more of the InjectedBundle client API

Reviewed by Anders Carlsson.

WebKit2:

* WebProcess/InjectedBundle/API/c/WKBundle.h:
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::willDestroyPage):
* WebProcess/InjectedBundle/InjectedBundle.h:
* WebProcess/InjectedBundle/InjectedBundlePageClient.cpp:
(WebKit::InjectedBundlePageClient::didStartProvisionalLoadForFrame):
(WebKit::InjectedBundlePageClient::didReceiveServerRedirectForProvisionalLoadForFrame):
(WebKit::InjectedBundlePageClient::didFailProvisionalLoadWithErrorForFrame):
(WebKit::InjectedBundlePageClient::didCommitLoadForFrame):
(WebKit::InjectedBundlePageClient::didFinishLoadForFrame):
(WebKit::InjectedBundlePageClient::didFailLoadWithErrorForFrame):
(WebKit::InjectedBundlePageClient::didReceiveTitleForFrame):
* WebProcess/InjectedBundle/InjectedBundlePageClient.h:
* WebProcess/InjectedBundle/mac/InjectedBundleMac.cpp:
(WebKit::InjectedBundle::load): Add some error logging on failure to load the bundle.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
(WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
(WebKit::WebFrameLoaderClient::dispatchDidReceiveTitle):
(WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
(WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
(WebKit::WebFrameLoaderClient::dispatchDidFailLoad):
(WebKit::WebFrameLoaderClient::dispatchDidFinishLoad):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::close):
* mac/WebKit2.exp:

WebKitTools:

* MiniBrowser/mac/WebBundle/WebBundleMain.m:
(_didStartProvisionalLoadForFrame):
(_didReceiveServerRedirectForProvisionalLoadForFrame):
(_didFailProvisionalLoadWithErrorForFrame):
(_didCommitLoadForFrame):
(_didFinishLoadForFrame):
(_didFailLoadWithErrorForFrame):
(_didReceiveTitleForFrame):
(_didClearWindowForFrame):
(_didCreatePage):
(_willDestroyPage):
(WKBundleInitialize):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@61689 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 files changed:
WebKit2/ChangeLog
WebKit2/WebProcess/InjectedBundle/API/c/WKBundle.h
WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
WebKit2/WebProcess/InjectedBundle/InjectedBundle.cpp
WebKit2/WebProcess/InjectedBundle/InjectedBundle.h
WebKit2/WebProcess/InjectedBundle/InjectedBundlePageClient.cpp
WebKit2/WebProcess/InjectedBundle/InjectedBundlePageClient.h
WebKit2/WebProcess/InjectedBundle/mac/InjectedBundleMac.cpp
WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
WebKit2/WebProcess/WebPage/WebPage.cpp
WebKit2/mac/WebKit2.exp
WebKitTools/ChangeLog
WebKitTools/MiniBrowser/mac/WebBundle/WebBundleMain.m

index 2cbc75a9991cff3ad2b87a3f230b80db140a6634..8be22679ee2639c852ca30128d7dba1ff6e955da 100644 (file)
@@ -1,3 +1,38 @@
+2010-06-23  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Anders Carlsson.
+
+        Fix for https://bugs.webkit.org/show_bug.cgi?id=41073
+        WebKit2: Flesh out more of the InjectedBundle client API
+
+        * WebProcess/InjectedBundle/API/c/WKBundle.h:
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::willDestroyPage):
+        * WebProcess/InjectedBundle/InjectedBundle.h:
+        * WebProcess/InjectedBundle/InjectedBundlePageClient.cpp:
+        (WebKit::InjectedBundlePageClient::didStartProvisionalLoadForFrame):
+        (WebKit::InjectedBundlePageClient::didReceiveServerRedirectForProvisionalLoadForFrame):
+        (WebKit::InjectedBundlePageClient::didFailProvisionalLoadWithErrorForFrame):
+        (WebKit::InjectedBundlePageClient::didCommitLoadForFrame):
+        (WebKit::InjectedBundlePageClient::didFinishLoadForFrame):
+        (WebKit::InjectedBundlePageClient::didFailLoadWithErrorForFrame):
+        (WebKit::InjectedBundlePageClient::didReceiveTitleForFrame):
+        * WebProcess/InjectedBundle/InjectedBundlePageClient.h:
+        * WebProcess/InjectedBundle/mac/InjectedBundleMac.cpp:
+        (WebKit::InjectedBundle::load): Add some error logging on failure to load the bundle.
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad):
+        (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad):
+        (WebKit::WebFrameLoaderClient::dispatchDidReceiveTitle):
+        (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
+        (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
+        (WebKit::WebFrameLoaderClient::dispatchDidFailLoad):
+        (WebKit::WebFrameLoaderClient::dispatchDidFinishLoad):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::close):
+        * mac/WebKit2.exp:
+
 2010-06-22  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Sam Weinig.
index be8062921012855983c352c939cd87f9e19cca60..a4e0246ccd09fab50e337ce34d324e22d82cb037 100644 (file)
@@ -35,12 +35,14 @@ extern "C" {
 
 // Client
 typedef void (*WKBundleDidCreatePageCallback)(WKBundleRef bundle, WKBundlePageRef page, const void *clientInfo);
+typedef void (*WKBundleWillDestroyPageCallback)(WKBundleRef bundle, WKBundlePageRef page, const void *clientInfo);
 typedef void (*WKBundleDidRecieveMessageCallback)(WKBundleRef bundle, WKStringRef message, const void *clientInfo);
 
 struct WKBundleClient {
     int                                                                 version;
     const void *                                                        clientInfo;
     WKBundleDidCreatePageCallback                                       didCreatePage;
+    WKBundleWillDestroyPageCallback                                     willDestroyPage;
     WKBundleDidRecieveMessageCallback                                   didRecieveMessage;
 };
 typedef struct WKBundleClient WKBundleClient;
index 2d4d0d74a4c0fff69cb4e83b72d87767383758b9..f35cf7f08be59227d4c46946c3eaa21511c2fe0e 100644 (file)
@@ -35,12 +35,26 @@ extern "C" {
 #endif
 
 // Client
-typedef void (*WKBundleDidClearWindowObjectForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, JSContextRef ctx, JSObjectRef window, const void *clientInfo);
+typedef void (*WKBundlePageDidStartProvisionalLoadForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo);
+typedef void (*WKBundlePageDidReceiveServerRedirectForProvisionalLoadForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo);
+typedef void (*WKBundlePageDidFailProvisionalLoadWithErrorForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo); // FIXME: Add WKErrorRef.
+typedef void (*WKBundlePageDidCommitLoadForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo);
+typedef void (*WKBundlePageDidFinishLoadForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo);
+typedef void (*WKBundlePageDidFailLoadWithErrorForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo); // FIXME: Add WKErrorRef.
+typedef void (*WKBundlePageDidReceiveTitleForFrameCallback)(WKBundlePageRef page, WKStringRef title, WKBundleFrameRef frame, const void *clientInfo);
+typedef void (*WKBundlePageDidClearWindowObjectForFrameCallback)(WKBundlePageRef page, WKBundleFrameRef frame, JSContextRef ctx, JSObjectRef window, const void *clientInfo);
 
 struct WKBundlePageClient {
     int                                                                 version;
     const void *                                                        clientInfo;
-    WKBundleDidClearWindowObjectForFrameCallback                        didClearWindowObjectForFrame;
+    WKBundlePageDidStartProvisionalLoadForFrameCallback                 didStartProvisionalLoadForFrame;
+    WKBundlePageDidReceiveServerRedirectForProvisionalLoadForFrameCallback    didReceiveServerRedirectForProvisionalLoadForFrame;
+    WKBundlePageDidFailProvisionalLoadWithErrorForFrameCallback         didFailProvisionalLoadWithErrorForFrame;
+    WKBundlePageDidCommitLoadForFrameCallback                           didCommitLoadForFrame;
+    WKBundlePageDidFinishLoadForFrameCallback                           didFinishLoadForFrame;
+    WKBundlePageDidFailLoadWithErrorForFrameCallback                    didFailLoadWithErrorForFrame;
+    WKBundlePageDidReceiveTitleForFrameCallback                         didReceiveTitleForFrame;
+    WKBundlePageDidClearWindowObjectForFrameCallback                    didClearWindowObjectForFrame;
 };
 typedef struct WKBundlePageClient WKBundlePageClient;
 
index 1e7fc23203f5e605d44205d6719a92495915d17c..2636731ffd71322947024fd9c13664e54adeae99 100644 (file)
@@ -65,6 +65,12 @@ void InjectedBundle::didCreatePage(WebPage* page)
         m_client.didCreatePage(toRef(this), toRef(page), m_client.clientInfo);
 }
 
+void InjectedBundle::willDestroyPage(WebPage* page)
+{
+    if (m_client.willDestroyPage)
+        m_client.willDestroyPage(toRef(this), toRef(page), m_client.clientInfo);
+}
+
 void InjectedBundle::didRecieveMessage(const WebCore::String& message)
 {
     if (m_client.didRecieveMessage)
index fd865a3c7c9cf8577f8ac37e0d42a66252aacd4f..e953e27e1dfb94c03197c9e9ad2b539d033f3123 100644 (file)
@@ -57,6 +57,7 @@ public:
 
     // Callback hooks
     void didCreatePage(WebPage*);
+    void willDestroyPage(WebPage*);
     void didRecieveMessage(const WebCore::String&);
 
 private:
index 150a7dd9e636956154e866597b1ffd5ee9f72129..73d4ceb92acdd777475cd25ace5118bb598c36ae 100644 (file)
@@ -9,7 +9,11 @@
 
 #include "InjectedBundlePageClient.h"
 
+#include "WKAPICast.h"
 #include "WKBundleAPICast.h"
+#include <WebCore/PlatformString.h>
+
+using namespace WebCore;
 
 namespace WebKit {
 
@@ -26,6 +30,48 @@ void InjectedBundlePageClient::initialize(WKBundlePageClient* client)
         memset(&m_client, 0, sizeof(m_client));
 }
 
+void InjectedBundlePageClient::didStartProvisionalLoadForFrame(WebPage* page, WebFrame* frame)
+{
+    if (m_client.didStartProvisionalLoadForFrame)
+        m_client.didStartProvisionalLoadForFrame(toRef(page), toRef(frame), m_client.clientInfo);
+}
+
+void InjectedBundlePageClient::didReceiveServerRedirectForProvisionalLoadForFrame(WebPage* page, WebFrame* frame)
+{
+    if (m_client.didReceiveServerRedirectForProvisionalLoadForFrame)
+        m_client.didReceiveServerRedirectForProvisionalLoadForFrame(toRef(page), toRef(frame), m_client.clientInfo);
+}
+
+void InjectedBundlePageClient::didFailProvisionalLoadWithErrorForFrame(WebPage* page, WebFrame* frame)
+{
+    if (m_client.didFailProvisionalLoadWithErrorForFrame)
+        m_client.didFailProvisionalLoadWithErrorForFrame(toRef(page), toRef(frame), m_client.clientInfo);
+}
+
+void InjectedBundlePageClient::didCommitLoadForFrame(WebPage* page, WebFrame* frame)
+{
+    if (m_client.didCommitLoadForFrame)
+        m_client.didCommitLoadForFrame(toRef(page), toRef(frame), m_client.clientInfo);
+}
+
+void InjectedBundlePageClient::didFinishLoadForFrame(WebPage* page, WebFrame* frame)
+{
+    if (m_client.didFinishLoadForFrame)
+        m_client.didFinishLoadForFrame(toRef(page), toRef(frame), m_client.clientInfo);
+}
+
+void InjectedBundlePageClient::didFailLoadWithErrorForFrame(WebPage* page, WebFrame* frame)
+{
+    if (m_client.didFailLoadWithErrorForFrame)
+        m_client.didFailLoadWithErrorForFrame(toRef(page), toRef(frame), m_client.clientInfo);
+}
+
+void InjectedBundlePageClient::didReceiveTitleForFrame(WebPage* page, const String& title, WebFrame* frame)
+{
+    if (m_client.didReceiveTitleForFrame)
+        m_client.didReceiveTitleForFrame(toRef(page), toRef(title.impl()), toRef(frame), m_client.clientInfo);
+}
+
 void InjectedBundlePageClient::didClearWindowObjectForFrame(WebPage* page, WebFrame* frame, JSContextRef ctx, JSObjectRef window)
 {
     if (m_client.didClearWindowObjectForFrame)
index 2eb063b406441e1acf9654f7d619e23ed6da5118..c27c5f6d1aca0ad6d4640cd1c3ce19a60b86ae32 100644 (file)
 #include "WKBundlePage.h"
 #include <JavaScriptCore/JSBase.h>
 
+namespace WebCore {
+    class String;
+}
+
 namespace WebKit {
 
 class WebPage;
@@ -39,6 +43,13 @@ public:
     InjectedBundlePageClient();
     void initialize(WKBundlePageClient*);
 
+    void didStartProvisionalLoadForFrame(WebPage*, WebFrame*);
+    void didReceiveServerRedirectForProvisionalLoadForFrame(WebPage*, WebFrame*);
+    void didFailProvisionalLoadWithErrorForFrame(WebPage*, WebFrame*);
+    void didCommitLoadForFrame(WebPage*, WebFrame*);
+    void didFinishLoadForFrame(WebPage*, WebFrame*);
+    void didFailLoadWithErrorForFrame(WebPage*, WebFrame*);
+    void didReceiveTitleForFrame(WebPage*, const WebCore::String&, WebFrame*);
     void didClearWindowObjectForFrame(WebPage*, WebFrame*, JSContextRef, JSObjectRef);
 
 private:
index 7948a2b1f2a770d99f9a5d42687e502089cdeb19..1df08e2bd6cd810e9b68c1d31cbe2fbf0f9dd828 100644 (file)
@@ -36,23 +36,33 @@ namespace WebKit {
 bool InjectedBundle::load()
 {
     RetainPtr<CFStringRef> injectedBundlePathStr(AdoptCF, CFStringCreateWithCharacters(0, reinterpret_cast<const UniChar*>(m_path.characters()), m_path.length()));
-    if (!injectedBundlePathStr)
+    if (!injectedBundlePathStr) {
+        fprintf(stderr, "InjectedBundle::load failed - Could not create the path string.\n");
         return false;
+    }
     
     RetainPtr<CFURLRef> bundleURL(AdoptCF, CFURLCreateWithFileSystemPath(0, injectedBundlePathStr.get(), kCFURLPOSIXPathStyle, false));
-    if (!bundleURL)
+    if (!bundleURL) {
+        fprintf(stderr, "InjectedBundle::load failed - Could not create the url from the path string.\n");
         return false;
+    }
 
     m_platformBundle = CFBundleCreate(0, bundleURL.get());
-    if (!m_platformBundle)
+    if (!m_platformBundle) {
+        fprintf(stderr, "InjectedBundle::load failed - Could not create the bundle.\n");
         return false;
+    }
         
-    if (!CFBundleLoadExecutable(m_platformBundle))
+    if (!CFBundleLoadExecutable(m_platformBundle)) {
+        fprintf(stderr, "InjectedBundle::load failed - Could not load the executable from the bundle.\n");
         return false;
+    }
 
     WKBundleInitializeFunctionPtr initializeFunction = reinterpret_cast<WKBundleInitializeFunctionPtr>(CFBundleGetFunctionPointerForName(m_platformBundle, CFSTR("WKBundleInitialize")));
-    if (!initializeFunction)
+    if (!initializeFunction) {
+        fprintf(stderr, "InjectedBundle::load failed - Could not find the initialize function in the bundle executable.\n");
         return false;
+    }
 
     initializeFunction(toRef(this));
     return true;
index 45818295a9bfc9f43d9a2b19757a0020dce89758..8ee439e8e16b10a2fb3caf1fe4acba1f7430ef62 100644 (file)
@@ -178,6 +178,10 @@ void WebFrameLoaderClient::dispatchDidReceiveServerRedirectForProvisionalLoad()
     if (!webPage)
         return;
 
+    // Notify the bundle client.
+    webPage->injectedBundleClient().didReceiveServerRedirectForProvisionalLoadForFrame(webPage, m_frame);
+
+    // Notify the UIProcess.
     WebProcess::shared().connection()->send(WebPageProxyMessage::DidReceiveServerRedirectForProvisionalLoadForFrame, webPage->pageID(), CoreIPC::In(m_frame->frameID()));
 }
 
@@ -230,6 +234,10 @@ void WebFrameLoaderClient::dispatchDidStartProvisionalLoad()
     DocumentLoader* provisionalLoader = m_frame->coreFrame()->loader()->provisionalDocumentLoader();
     const String& url = provisionalLoader->url().string();
 
+    // Notify the bundle client.
+    webPage->injectedBundleClient().didStartProvisionalLoadForFrame(webPage, m_frame);
+
+    // Notify the UIProcess.
     WebProcess::shared().connection()->send(WebPageProxyMessage::DidStartProvisionalLoadForFrame, webPage->pageID(), CoreIPC::In(m_frame->frameID(), url));
 }
 
@@ -239,6 +247,10 @@ void WebFrameLoaderClient::dispatchDidReceiveTitle(const String& title)
     if (!webPage)
         return;
 
+    // Notify the bundle client.
+    webPage->injectedBundleClient().didReceiveTitleForFrame(webPage, title, m_frame);
+
+    // Notify the UIProcess.
     WebProcess::shared().connection()->send(WebPageProxyMessage::DidReceiveTitleForFrame, webPage->pageID(), CoreIPC::In(m_frame->frameID(), title));
 }
 
@@ -253,6 +265,10 @@ void WebFrameLoaderClient::dispatchDidCommitLoad()
     if (!webPage)
         return;
 
+    // Notify the bundle client.
+    webPage->injectedBundleClient().didCommitLoadForFrame(webPage, m_frame);
+
+    // Notify the UIProcess.
     WebProcess::shared().connection()->send(WebPageProxyMessage::DidCommitLoadForFrame, webPage->pageID(), CoreIPC::In(m_frame->frameID()));
 }
 
@@ -262,6 +278,10 @@ void WebFrameLoaderClient::dispatchDidFailProvisionalLoad(const ResourceError&)
     if (!webPage)
         return;
 
+    // Notify the bundle client.
+    webPage->injectedBundleClient().didFailProvisionalLoadWithErrorForFrame(webPage, m_frame);
+
+    // Notify the UIProcess.
     WebProcess::shared().connection()->send(WebPageProxyMessage::DidFailProvisionalLoadForFrame, webPage->pageID(), CoreIPC::In(m_frame->frameID()));
 }
 
@@ -271,6 +291,10 @@ void WebFrameLoaderClient::dispatchDidFailLoad(const ResourceError&)
     if (!webPage)
         return;
 
+    // Notify the bundle client.
+    webPage->injectedBundleClient().didFailLoadWithErrorForFrame(webPage, m_frame);
+
+    // Notify the UIProcess.
     WebProcess::shared().connection()->send(WebPageProxyMessage::DidFailLoadForFrame, webPage->pageID(), CoreIPC::In(m_frame->frameID()));
 }
 
@@ -285,6 +309,10 @@ void WebFrameLoaderClient::dispatchDidFinishLoad()
     if (!webPage)
         return;
 
+    // Notify the bundle client.
+    webPage->injectedBundleClient().didFinishLoadForFrame(webPage, m_frame);
+
+    // Notify the UIProcess.
     WebProcess::shared().connection()->send(WebPageProxyMessage::DidFinishLoadForFrame, webPage->pageID(), CoreIPC::In(m_frame->frameID()));
 }
 
index 216473eacfe66967b4e29ad0141534dbf024b509..1f87984b33bb8e05ffe24584fac386f109e3a1ab 100644 (file)
@@ -147,6 +147,9 @@ void WebPage::removeWebFrame(uint64_t frameID)
 
 void WebPage::close()
 {
+    if (WebProcess::shared().injectedBundle())
+        WebProcess::shared().injectedBundle()->willDestroyPage(this);
+
     m_mainFrame->coreFrame()->loader()->detachFromParent();
 
     delete m_page;
index a24a6bb6c50e86373ae845f014537ae36027371e..802f4609badfe6c4d1515759c7db398d5b4895c7 100644 (file)
@@ -34,6 +34,7 @@ _WKPageNamespaceRelease
 _WKPageNamespaceRetain
 _WKPageRelease
 _WKPageReload
+_WKPageRenderTreeExternalRepresentation
 _WKPageRetain
 _WKPageSetPageHistoryClient
 _WKPageSetPageLoaderClient
index 536ba39d888c21f128486a4a18b89e0e785c3b8b..25544f70cbce1644a743411f9097459a0836c538 100644 (file)
@@ -1,3 +1,23 @@
+2010-06-23  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Anders Carlsson.
+
+        Fix for https://bugs.webkit.org/show_bug.cgi?id=41073
+        WebKit2: Flesh out more of the InjectedBundle client API
+
+        * MiniBrowser/mac/WebBundle/WebBundleMain.m:
+        (_didStartProvisionalLoadForFrame):
+        (_didReceiveServerRedirectForProvisionalLoadForFrame):
+        (_didFailProvisionalLoadWithErrorForFrame):
+        (_didCommitLoadForFrame):
+        (_didFinishLoadForFrame):
+        (_didFailLoadWithErrorForFrame):
+        (_didReceiveTitleForFrame):
+        (_didClearWindowForFrame):
+        (_didCreatePage):
+        (_willDestroyPage):
+        (WKBundleInitialize):
+
 2010-06-23  Yuzo Fujishima  <yuzo@google.com>
 
         Reviewed by Shinichiro Hamaji.
index ad382dc946ab30f3c56608ebab32acbacde12d41..b611e3a817b8e8007fce9556d830f55af4684e34 100644 (file)
 
 static WKBundleRef globalBundle;
 
-void _didClearWindow(WKBundlePageRef page, WKBundleFrameRef frame, JSContextRef ctx, JSObjectRef window, const void *clientInfo)
+// WKBundlePageClient
+
+void _didStartProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
+{
+}
+
+void _didReceiveServerRedirectForProvisionalLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
+{
+}
+
+void _didFailProvisionalLoadWithErrorForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
+{
+}
+
+void _didCommitLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
+{
+}
+
+void _didFinishLoadForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
+{
+}
+
+void _didFailLoadWithErrorForFrame(WKBundlePageRef page, WKBundleFrameRef frame, const void *clientInfo)
+{
+}
+
+void _didReceiveTitleForFrame(WKBundlePageRef page, WKStringRef title, WKBundleFrameRef frame, const void *clientInfo)
+{
+}
+
+void _didClearWindowForFrame(WKBundlePageRef page, WKBundleFrameRef frame, JSContextRef ctx, JSObjectRef window, const void *clientInfo)
 {
     CFURLRef cfURL = WKURLCopyCFURL(0, WKBundlePageGetMainFrameURL(page));
     NSLog(@"WKBundlePageClient - _didClearWindowForFrame %@", [(NSURL *)cfURL absoluteString]);
@@ -45,18 +75,33 @@ void _didClearWindow(WKBundlePageRef page, WKBundleFrameRef frame, JSContextRef
     WKStringRelease(message);
 }
 
-void _didCreatePage(WKBundlePageRef bundle, WKBundlePageRef page, const void* clientInfo)
+
+// WKBundleClient
+
+void _didCreatePage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo)
 {
     NSLog(@"WKBundleClient - didCreatePage\n");
 
     WKBundlePageClient client = {
         0,
         0,
-        _didClearWindow
+        _didStartProvisionalLoadForFrame,
+        _didReceiveServerRedirectForProvisionalLoadForFrame,
+        _didFailProvisionalLoadWithErrorForFrame,
+        _didCommitLoadForFrame,
+        _didFinishLoadForFrame,
+        _didFailLoadWithErrorForFrame,
+        _didReceiveTitleForFrame,
+        _didClearWindowForFrame
     };
     WKBundlePageSetClient(page, &client);
 }
 
+void _willDestroyPage(WKBundleRef bundle, WKBundlePageRef page, const void* clientInfo)
+{
+    NSLog(@"WKBundleClient - willDestroyPage\n");
+}
+
 void _didRecieveMessage(WKBundleRef bundle, WKStringRef message, const void *clientInfo)
 {
     CFStringRef cfMessage = WKStringCopyCFString(0, message);
@@ -72,6 +117,7 @@ void WKBundleInitialize(WKBundleRef bundle)
         0,
         0,
         _didCreatePage,
+        _willDestroyPage,
         _didRecieveMessage
     };
     WKBundleSetClient(bundle, &client);