WebKit Bugzilla
Attachment 357501 Details for
Bug 192789
: Allow passing nil as session state to [WKWebView _restoreSessionState:]
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192789-20181217164753.patch (text/plain), 3.97 KB, created by
Chris Dumez
on 2018-12-17 16:47:54 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2018-12-17 16:47:54 PST
Size:
3.97 KB
patch
obsolete
>Subversion Revision: 239294 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 00c097afeda38753805fd4fdcf809ac849c5e408..fda37528e8b5b350b5ed895ad3a6af9093af6884 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,16 @@ >+2018-12-17 Chris Dumez <cdumez@apple.com> >+ >+ Allow passing nil as session state to [WKWebView _restoreSessionState:] >+ https://bugs.webkit.org/show_bug.cgi?id=192789 >+ <rdar://problem/46755277> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Allow passing nil as session state to [WKWebView _restoreSessionState:] instead of crashing. >+ >+ * UIProcess/API/Cocoa/WKWebView.mm: >+ (-[WKWebView _restoreSessionState:andNavigate:]): >+ > 2018-12-17 Chris Dumez <cdumez@apple.com> > > Unreviewed, revert recent CrashReporterClient build fixes as they are no longer needed. >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm b/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >index ba2048eabaab68cd733825c64f8b920fab96441e..8dc30f18dcd36705c2e89f2f9bda017d85132d8e 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >@@ -4712,7 +4712,7 @@ - (void)_restoreFromSessionStateData:(NSData *)sessionStateData > > - (WKNavigation *)_restoreSessionState:(_WKSessionState *)sessionState andNavigate:(BOOL)navigate > { >- return wrapper(_page->restoreFromSessionState(sessionState->_sessionState, navigate)); >+ return wrapper(_page->restoreFromSessionState(sessionState ? sessionState->_sessionState : WebKit::SessionState { }, navigate)); > } > > - (void)_close >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index e7c0324a8cc02f13896c2d323169ed189ed6796a..77810e7e89269a11f390710f927e67178514585a 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,16 @@ >+2018-12-17 Chris Dumez <cdumez@apple.com> >+ >+ Allow passing nil as session state to [WKWebView _restoreSessionState:] >+ https://bugs.webkit.org/show_bug.cgi?id=192789 >+ <rdar://problem/46755277> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add API test coverage. >+ >+ * TestWebKitAPI/Tests/WebKit/WKBackForwardList.mm: >+ (TEST): >+ > 2018-12-17 Daniel Bates <dabates@apple.com> > > Support concatenating StringView with other string types >diff --git a/Tools/TestWebKitAPI/Tests/WebKit/WKBackForwardList.mm b/Tools/TestWebKitAPI/Tests/WebKit/WKBackForwardList.mm >index 14b80e31511cba37d10dd11db9a51ee68f3b9e68..71a556463a3e57859e55b4f87d735c8be9212621 100644 >--- a/Tools/TestWebKitAPI/Tests/WebKit/WKBackForwardList.mm >+++ b/Tools/TestWebKitAPI/Tests/WebKit/WKBackForwardList.mm >@@ -103,6 +103,37 @@ TEST(WKBackForwardList, CanNotGoBackAfterRestoringEmptySessionState) > EXPECT_EQ((NSUInteger)0, newList.forwardList.count); > } > >+TEST(WKBackForwardList, RestoringNilSessionState) >+{ >+ auto webView = adoptNS([[WKWebView alloc] init]); >+ >+ [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:loadableURL1]]]; >+ [webView _test_waitForDidFinishNavigation]; >+ >+ [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:loadableURL2]]]; >+ [webView _test_waitForDidFinishNavigation]; >+ >+ WKBackForwardList *list = [webView backForwardList]; >+ EXPECT_EQ(YES, [webView canGoBack]); >+ EXPECT_EQ(NO, [webView canGoForward]); >+ EXPECT_EQ((NSUInteger)1, list.backList.count); >+ EXPECT_EQ((NSUInteger)0, list.forwardList.count); >+ >+ auto singlePageWebView = adoptNS([[WKWebView alloc] init]); >+ >+ [singlePageWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:loadableURL1]]]; >+ [singlePageWebView _test_waitForDidFinishNavigation]; >+ >+ [webView _restoreSessionState:nil andNavigate:NO]; >+ >+ WKBackForwardList *newList = [webView backForwardList]; >+ >+ EXPECT_EQ(YES, [webView canGoBack]); >+ EXPECT_EQ(NO, [webView canGoForward]); >+ EXPECT_EQ((NSUInteger)1, newList.backList.count); >+ EXPECT_EQ((NSUInteger)0, newList.forwardList.count); >+} >+ > static bool done; > static size_t navigations; >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192789
:
357500
| 357501