REGRESSION(223307): ASSERTION in WebCore::ResourceLoadObserver::logUserInteractionWit...
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Oct 2017 18:05:59 +0000 (18:05 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Oct 2017 18:05:59 +0000 (18:05 +0000)
https://bugs.webkit.org/show_bug.cgi?id=178342
<rdar://problem/35008505>

Reviewed by Chris Dumez.

In r223307 I mistakenly used 'topDocument->topDocument()' because of a copy/paste error. I should have just used
'topDocument'.

Tests: CommandBackForwardTestWKWebView in TestWebKitAPI.

* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): We might enter this routine at a time
where there is no page. If so, we should return early and not log credit.
* page/EventHandler.cpp:
(WebCore::EventHandler::keyEvent): Correct the argument passed to the log function.

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

Source/WebCore/ChangeLog
Source/WebCore/loader/ResourceLoadObserver.cpp
Source/WebCore/page/EventHandler.cpp

index e35b039..e9d5c4d 100644 (file)
@@ -1,3 +1,22 @@
+2017-10-16  Brent Fulgham  <bfulgham@apple.com>
+
+        REGRESSION(223307): ASSERTION in WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution
+        https://bugs.webkit.org/show_bug.cgi?id=178342
+        <rdar://problem/35008505>
+
+        Reviewed by Chris Dumez.
+
+        In r223307 I mistakenly used 'topDocument->topDocument()' because of a copy/paste error. I should have just used
+        'topDocument'.
+
+        Tests: CommandBackForwardTestWKWebView in TestWebKitAPI.
+
+        * loader/ResourceLoadObserver.cpp:
+        (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): We might enter this routine at a time
+        where there is no page. If so, we should return early and not log credit.
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::keyEvent): Correct the argument passed to the log function.
+
 2017-10-15  Filip Pizlo  <fpizlo@apple.com>
 
         Make some asserts into release asserts
index a2b1684..d3c5511 100644 (file)
@@ -274,11 +274,11 @@ void ResourceLoadObserver::logWebSocketLoading(const Frame* frame, const URL& ta
 
 void ResourceLoadObserver::logUserInteractionWithReducedTimeResolution(const Document& document)
 {
-    ASSERT(document.page());
-
     if (!shouldLog(document.page()))
         return;
 
+    ASSERT(document.page());
+
     auto& url = document.url();
     if (url.isBlankURL() || url.isEmpty())
         return;
index 999f1d1..4d9bb1b 100644 (file)
@@ -3130,7 +3130,7 @@ bool EventHandler::keyEvent(const PlatformKeyboardEvent& keyEvent)
         if (!wasHandled)
             topDocument->setUserDidInteractWithPage(savedUserDidInteractWithPage);
         else
-            ResourceLoadObserver::shared().logUserInteractionWithReducedTimeResolution(topDocument->topDocument());
+            ResourceLoadObserver::shared().logUserInteractionWithReducedTimeResolution(*topDocument);
     }
 
     return wasHandled;