WebKit Bugzilla
Attachment 362335 Details for
Bug 194777
: Check the existence of the frame in Document::hasFrameSpecificStorageAccess() and Document::setHasFrameSpecificStorageAccess()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for landing
bug-194777-20190218142944.patch (text/plain), 9.69 KB, created by
John Wilander
on 2019-02-18 14:29:44 PST
(
hide
)
Description:
Patch for landing
Filename:
MIME Type:
Creator:
John Wilander
Created:
2019-02-18 14:29:44 PST
Size:
9.69 KB
patch
obsolete
>Subversion Revision: 241662 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 2141a8fc3dfb31427975501667bd3751a04b2ce6..1b0e912c9876d8a1f9a22b9730104acad4bc1b19 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,22 @@ >+2019-02-18 John Wilander <wilander@apple.com> >+ >+ Check the existence of the frame in Document::hasFrameSpecificStorageAccess() and Document::setHasFrameSpecificStorageAccess() >+ https://bugs.webkit.org/show_bug.cgi?id=194777 >+ <rdar://problem/47731945> >+ >+ Reviewed by Geoffrey Garen and Chris Dumez. >+ >+ Test: http/tests/storageAccess/remove-requesting-iframe.html >+ >+ * dom/Document.cpp: >+ (WebCore::Document::hasFrameSpecificStorageAccess const): >+ Now checks for the existence of the frame. >+ (WebCore::Document::setHasFrameSpecificStorageAccess): >+ Now checks for the existence of the frame. >+ * loader/ResourceLoadObserver.cpp: >+ (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): >+ Now checks that the session ID is valid. >+ > 2019-02-17 David Kilzer <ddkilzer@apple.com> > > Unreviewed, rolling out r241620. >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index d0b91b0a519f5512dfb263e01769e40fbecb72fb..4f777be2c03794405244c22496b16540b0c74e1f 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,16 @@ >+2019-02-18 John Wilander <wilander@apple.com> >+ >+ Check the existence of the frame in Document::hasFrameSpecificStorageAccess() and Document::setHasFrameSpecificStorageAccess() >+ https://bugs.webkit.org/show_bug.cgi?id=194777 >+ <rdar://problem/47731945> >+ >+ Reviewed by Geoffrey Garen and Chris Dumez. >+ >+ * NetworkProcess/NetworkConnectionToWebProcess.cpp: >+ (WebKit::NetworkConnectionToWebProcess::logUserInteraction): >+ Now returns early if the incoming session ID is invalid. >+ Added an ASSERT to help us find other call sites passing invalid session IDs. >+ > 2019-02-18 Carlos Garcia Campos <cgarcia@igalia.com> > > [GTK] Crash while filling selection data during drag and drop >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index 050555ba9491f47ca0bb4dfdaaa193d9ac54edf9..416ffe0ff19bdd5ff4e9d33ded85c111700d2dd6 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -8458,12 +8458,13 @@ void Document::updateMainArticleElementAfterLayout() > #if ENABLE(RESOURCE_LOAD_STATISTICS) > bool Document::hasFrameSpecificStorageAccess() const > { >- return m_frame->loader().client().hasFrameSpecificStorageAccess(); >+ return m_frame && m_frame->loader().client().hasFrameSpecificStorageAccess(); > } > > void Document::setHasFrameSpecificStorageAccess(bool value) > { >- m_frame->loader().client().setHasFrameSpecificStorageAccess(value); >+ if (m_frame) >+ m_frame->loader().client().setHasFrameSpecificStorageAccess(value); > } > > bool Document::hasRequestedPageSpecificStorageAccessWithUserInteraction(const String& primaryDomain) >diff --git a/Source/WebCore/loader/ResourceLoadObserver.cpp b/Source/WebCore/loader/ResourceLoadObserver.cpp >index a363155017020c977f5de547c5e9b8216ade29e0..30dfaa0a43ea16216ea6fe134679021561639735 100644 >--- a/Source/WebCore/loader/ResourceLoadObserver.cpp >+++ b/Source/WebCore/loader/ResourceLoadObserver.cpp >@@ -193,7 +193,7 @@ void ResourceLoadObserver::logWebSocketLoading(const URL& targetURL, const URL& > > void ResourceLoadObserver::logUserInteractionWithReducedTimeResolution(const Document& document) > { >- if (!shouldLog(document.sessionID().isEphemeral())) >+ if (!document.sessionID().isValid() || !shouldLog(document.sessionID().isEphemeral())) > return; > > auto& url = document.url(); >diff --git a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp >index 3df43c46ddbb355683b5459ff38b56589770ffca..b1c7213275101318b727602355a07614b0b280fa 100644 >--- a/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp >+++ b/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp >@@ -587,6 +587,10 @@ void NetworkConnectionToWebProcess::removeStorageAccessForAllFramesOnPage(PAL::S > > void NetworkConnectionToWebProcess::logUserInteraction(PAL::SessionID sessionID, const String& topLevelOrigin) > { >+ ASSERT(sessionID.isValid()); >+ if (!sessionID.isValid()) >+ return; >+ > if (auto networkSession = networkProcess().networkSession(sessionID)) { > if (auto* resourceLoadStatistics = networkSession->resourceLoadStatistics()) > resourceLoadStatistics->logUserInteraction(topLevelOrigin, [] { }); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index aff6228eb60819cc69266067fa02eada18d9bc28..e808d9cf96007ed921e5afbcbb61f5f570ba2740 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2019-02-18 John Wilander <wilander@apple.com> >+ >+ Check the existence of the frame in Document::hasFrameSpecificStorageAccess() and Document::setHasFrameSpecificStorageAccess() >+ https://bugs.webkit.org/show_bug.cgi?id=194777 >+ <rdar://problem/47731945> >+ >+ Reviewed by Geoffrey Garen and Chris Dumez. >+ >+ * http/tests/storageAccess/remove-requesting-iframe-expected.txt: Added. >+ * http/tests/storageAccess/remove-requesting-iframe.html: Added. >+ * http/tests/storageAccess/resources/request-storage-access-and-immediately-postmessage-iframe.html: Added. >+ > 2019-02-17 Fujii Hironori <Hironori.Fujii@sony.com> > > Use dumpJSConsoleLogInStdErr=true webkit-test-runner option for non-imported tests instead of using DumpJSConsoleLogInStdErr expectation in TestExpectations >diff --git a/LayoutTests/http/tests/storageAccess/remove-requesting-iframe-expected.txt b/LayoutTests/http/tests/storageAccess/remove-requesting-iframe-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..70546d293279430943623e99c37b717636b230d2 >--- /dev/null >+++ b/LayoutTests/http/tests/storageAccess/remove-requesting-iframe-expected.txt >@@ -0,0 +1,10 @@ >+Tests that Storage Access API calls work well for removed frames. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+PASS iframe removed. >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/http/tests/storageAccess/remove-requesting-iframe.html b/LayoutTests/http/tests/storageAccess/remove-requesting-iframe.html >new file mode 100644 >index 0000000000000000000000000000000000000000..d53a22f8f6be8bf24e3464870949d142e34cffce >--- /dev/null >+++ b/LayoutTests/http/tests/storageAccess/remove-requesting-iframe.html >@@ -0,0 +1,62 @@ >+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] --> >+<html> >+<head> >+ <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no"> >+ <script src="/js-test-resources/js-test.js"></script> >+ <script src="/js-test-resources/ui-helper.js"></script> >+ <script src="/resourceLoadStatistics/resources/util.js"></script> >+</head> >+<body onload="runTest()"> >+<script> >+ description("Tests that Storage Access API calls work well for removed frames."); >+ jsTestIsAsync = true; >+ >+ function finishTest() { >+ setEnableFeature(false, finishJSTest); >+ } >+ >+ function receiveMessage() { >+ requestingiframe.remove(); >+ testPassed("iframe removed."); >+ setTimeout(finishTest, 0.5); >+ } >+ >+ window.addEventListener("message", receiveMessage, false); >+ >+ function activateElement(elementId) { >+ var element = document.getElementById(elementId); >+ var centerX = element.offsetLeft + element.offsetWidth / 2; >+ var centerY = element.offsetTop + element.offsetHeight / 2; >+ UIHelper.activateAt(centerX, centerY).then( >+ function () { >+ if (window.eventSender) >+ eventSender.keyDown("escape"); >+ else { >+ testFailed("No eventSender."); >+ finishTest(); >+ } >+ }, >+ function () { >+ testFailed("Promise rejected."); >+ finishTest(); >+ } >+ ); >+ } >+ >+ const iframeID = "requestingiframe"; >+ const iframeSource = "http://localhost:8000/storageAccess/resources/request-storage-access-and-immediately-postmessage-iframe.html"; >+ >+ function runTest() { >+ let iframeElement = document.createElement("iframe"); >+ iframeElement.onload = function() { >+ testRunner.statisticsUpdateCookieBlocking(function() { >+ activateElement(iframeID); >+ }); >+ }; >+ iframeElement.id = iframeID; >+ iframeElement.src = iframeSource; >+ document.body.appendChild(iframeElement); >+ } >+</script> >+</body> >+</html> >\ No newline at end of file >diff --git a/LayoutTests/http/tests/storageAccess/resources/request-storage-access-and-immediately-postmessage-iframe.html b/LayoutTests/http/tests/storageAccess/resources/request-storage-access-and-immediately-postmessage-iframe.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2840fc135094f60d15ac9a126ba27d7acc63bce5 >--- /dev/null >+++ b/LayoutTests/http/tests/storageAccess/resources/request-storage-access-and-immediately-postmessage-iframe.html >@@ -0,0 +1,15 @@ >+<html> >+<head> >+ <script> >+ if (internals) >+ internals.setUserGrantsStorageAccess(true); >+ >+ function makeRequestWithUserGesture() { >+ document.requestStorageAccess(); >+ top.postMessage("API called.", "http://127.0.0.1:8000"); >+ } >+ </script> >+</head> >+<body onclick="makeRequestWithUserGesture()"> >+</body> >+</html> >\ No newline at end of file
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 194777
:
362301
|
362321
| 362335