[WinCairo][MiniBrowser][WebKit] REGRESSION(r235398): ASSERTION FAILED: !m_client...
authorHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 8 Sep 2018 00:37:16 +0000 (00:37 +0000)
committerHironori.Fujii@sony.com <Hironori.Fujii@sony.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 8 Sep 2018 00:37:16 +0000 (00:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=189336

Reviewed by Alex Christensen.

WKPageSetPageLoaderClient is deprecated. Replaced it with
WKPageSetPageNavigationClient.

* MiniBrowser/win/WebKitBrowserWindow.cpp:
(WebKitBrowserWindow::WebKitBrowserWindow):
Call WKPageSetPageNavigationClient instead of WKPageSetPageLoaderClient.
(WebKitBrowserWindow::didFinishNavigation):
Copied from didReceiveTitleForFrame. Use WKPageCopyTitle to get the title.
(WebKitBrowserWindow::didCommitNavigation):
Copied from didCommitLoadForFrame. Use WKPageCopyCommittedURL to get the URL.
(WebKitBrowserWindow::didReceiveTitleForFrame): Deleted.
(WebKitBrowserWindow::didCommitLoadForFrame): Deleted.
* MiniBrowser/win/WebKitBrowserWindow.h: Renamed the class methods.

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

Tools/ChangeLog
Tools/MiniBrowser/win/WebKitBrowserWindow.cpp
Tools/MiniBrowser/win/WebKitBrowserWindow.h

index b0f05d5..e79d95b 100644 (file)
@@ -1,3 +1,24 @@
+2018-09-07  Fujii Hironori  <Hironori.Fujii@sony.com>
+
+        [WinCairo][MiniBrowser][WebKit] REGRESSION(r235398): ASSERTION FAILED: !m_client.didReceiveTitleForFrame
+        https://bugs.webkit.org/show_bug.cgi?id=189336
+
+        Reviewed by Alex Christensen.
+
+        WKPageSetPageLoaderClient is deprecated. Replaced it with
+        WKPageSetPageNavigationClient.
+
+        * MiniBrowser/win/WebKitBrowserWindow.cpp:
+        (WebKitBrowserWindow::WebKitBrowserWindow):
+        Call WKPageSetPageNavigationClient instead of WKPageSetPageLoaderClient.
+        (WebKitBrowserWindow::didFinishNavigation):
+        Copied from didReceiveTitleForFrame. Use WKPageCopyTitle to get the title.
+        (WebKitBrowserWindow::didCommitNavigation):
+        Copied from didCommitLoadForFrame. Use WKPageCopyCommittedURL to get the URL.
+        (WebKitBrowserWindow::didReceiveTitleForFrame): Deleted.
+        (WebKitBrowserWindow::didCommitLoadForFrame): Deleted.
+        * MiniBrowser/win/WebKitBrowserWindow.h: Renamed the class methods.
+
 2018-09-07  Daniel Bates  <dabates@apple.com>
 
         [iOS] uiController.typeCharacterUsingHardwareKeyboard("`", ...) dispatches DOM key events for ~
index e658a4e..01b62e1 100644 (file)
@@ -91,10 +91,10 @@ WebKitBrowserWindow::WebKitBrowserWindow(HWND mainWnd, HWND urlBarWnd)
     m_view = adoptWK(WKViewCreate(rect, conf.get(), mainWnd));
     auto page = WKViewGetPage(m_view.get());
 
-    WKPageLoaderClientV0 loadClient = {{ 0, this }};
-    loadClient.didReceiveTitleForFrame = didReceiveTitleForFrame;
-    loadClient.didCommitLoadForFrame = didCommitLoadForFrame;
-    WKPageSetPageLoaderClient(page, &loadClient.base);
+    WKPageNavigationClientV0 navigationClient = {{ 0, this }};
+    navigationClient.didFinishNavigation = didFinishNavigation;
+    navigationClient.didCommitNavigation = didCommitNavigation;
+    WKPageSetPageNavigationClient(page, &navigationClient.base);
 }
 
 HRESULT WebKitBrowserWindow::init()
@@ -213,22 +213,19 @@ static WebKitBrowserWindow& toWebKitBrowserWindow(const void *clientInfo)
     return *const_cast<WebKitBrowserWindow*>(static_cast<const WebKitBrowserWindow*>(clientInfo));
 }
 
-void WebKitBrowserWindow::didReceiveTitleForFrame(WKPageRef page, WKStringRef title, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
+void WebKitBrowserWindow::didFinishNavigation(WKPageRef page, WKNavigationRef navigation, WKTypeRef userData, const void* clientInfo)
 {
-    if (!WKFrameIsMainFrame(frame))
-        return;
-    std::wstring titleString = createString(title) + L" [WebKit]";
+    WKRetainPtr<WKStringRef> title = adoptWK(WKPageCopyTitle(page));
+    std::wstring titleString = createString(title.get()) + L" [WebKit]";
     auto& thisWindow = toWebKitBrowserWindow(clientInfo);
     SetWindowText(thisWindow.m_hMainWnd, titleString.c_str());
 }
 
-void WebKitBrowserWindow::didCommitLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void *clientInfo)
+void WebKitBrowserWindow::didCommitNavigation(WKPageRef page, WKNavigationRef navigation, WKTypeRef userData, const void* clientInfo)
 {
-    if (!WKFrameIsMainFrame(frame))
-        return;
     auto& thisWindow = toWebKitBrowserWindow(clientInfo);
 
-    WKRetainPtr<WKURLRef> wkurl = adoptWK(WKFrameCopyURL(frame));
+    WKRetainPtr<WKURLRef> wkurl = adoptWK(WKPageCopyCommittedURL(page));
     std::wstring urlString = createString(wkurl.get());
     SetWindowText(thisWindow.m_urlBarWnd, urlString.c_str());
 }
index 1583d74..a7ac900 100644 (file)
@@ -57,8 +57,8 @@ private:
     void zoomIn() override;
     void zoomOut() override;
 
-    static void didReceiveTitleForFrame(WKPageRef, WKStringRef, WKFrameRef, WKTypeRef, const void *);
-    static void didCommitLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef, const void *);
+    static void didFinishNavigation(WKPageRef, WKNavigationRef, WKTypeRef, const void*);
+    static void didCommitNavigation(WKPageRef, WKNavigationRef, WKTypeRef, const void*);
 
     WKRetainPtr<WKViewRef> m_view;
     HWND m_hMainWnd { nullptr };