<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[248276] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/248276">248276</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2019-08-05 16:00:26 -0700 (Mon, 05 Aug 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>navigator.geolocation wrapper should not become GC-collectable once its frame is detached
https://bugs.webkit.org/show_bug.cgi?id=200436

Reviewed by Darin Adler.

Source/WebCore:

navigator.geolocation wrapper should not become GC-collectable once its frame is detached, given
that it can outlive the frame. Instead, tie the navigator.geolocation wrapper's lifetime to its
Navigator's.

Test: fast/dom/navigator-property-gc-after-frame-detach.html

* Modules/geolocation/Geolocation.cpp:
(WebCore::Geolocation::create):
(WebCore::Geolocation::Geolocation):
(WebCore::Geolocation::navigator):
(WebCore::Geolocation::frame const):
* Modules/geolocation/Geolocation.h:
* Modules/geolocation/Geolocation.idl:
* Modules/geolocation/NavigatorGeolocation.cpp:
(WebCore::NavigatorGeolocation::NavigatorGeolocation):
(WebCore::NavigatorGeolocation::from):
(WebCore::NavigatorGeolocation::geolocation):
(WebCore::NavigatorGeolocation::geolocation const):
* Modules/geolocation/NavigatorGeolocation.h:
* bindings/js/JSNavigatorCustom.cpp:
(WebCore::JSNavigator::visitAdditionalChildren):
* bindings/js/JSWorkerNavigatorCustom.cpp:
(WebCore::JSWorkerNavigator::visitAdditionalChildren):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/IDLAttributes.json:
* page/Navigator.cpp:
(WebCore::Navigator::plugins):
(WebCore::Navigator::mimeTypes):
* page/NavigatorBase.h:
* plugins/DOMMimeTypeArray.cpp:
(WebCore::DOMMimeTypeArray::DOMMimeTypeArray):
* plugins/DOMMimeTypeArray.h:
* plugins/DOMMimeTypeArray.idl:
* plugins/DOMPluginArray.cpp:
(WebCore::DOMPluginArray::DOMPluginArray):
* plugins/DOMPluginArray.h:
* plugins/DOMPluginArray.idl:
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerContainer.idl:

LayoutTests:

Add layout test coverage.

* fast/dom/navigator-property-gc-after-frame-detach-expected.txt: Added.
* fast/dom/navigator-property-gc-after-frame-detach.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformwk2TestExpectations">trunk/LayoutTests/platform/wk2/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesgeolocationGeolocationcpp">trunk/Source/WebCore/Modules/geolocation/Geolocation.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesgeolocationGeolocationh">trunk/Source/WebCore/Modules/geolocation/Geolocation.h</a></li>
<li><a href="#trunkSourceWebCoreModulesgeolocationGeolocationidl">trunk/Source/WebCore/Modules/geolocation/Geolocation.idl</a></li>
<li><a href="#trunkSourceWebCoreModulesgeolocationNavigatorGeolocationcpp">trunk/Source/WebCore/Modules/geolocation/NavigatorGeolocation.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulesgeolocationNavigatorGeolocationh">trunk/Source/WebCore/Modules/geolocation/NavigatorGeolocation.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSNavigatorCustomcpp">trunk/Source/WebCore/bindings/js/JSNavigatorCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSWorkerNavigatorCustomcpp">trunk/Source/WebCore/bindings/js/JSWorkerNavigatorCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsIDLAttributesjson">trunk/Source/WebCore/bindings/scripts/IDLAttributes.json</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowcpp">trunk/Source/WebCore/page/DOMWindow.cpp</a></li>
<li><a href="#trunkSourceWebCorepageNavigatorcpp">trunk/Source/WebCore/page/Navigator.cpp</a></li>
<li><a href="#trunkSourceWebCorepageNavigatorBaseh">trunk/Source/WebCore/page/NavigatorBase.h</a></li>
<li><a href="#trunkSourceWebCorepluginsDOMMimeTypeArraycpp">trunk/Source/WebCore/plugins/DOMMimeTypeArray.cpp</a></li>
<li><a href="#trunkSourceWebCorepluginsDOMMimeTypeArrayh">trunk/Source/WebCore/plugins/DOMMimeTypeArray.h</a></li>
<li><a href="#trunkSourceWebCorepluginsDOMMimeTypeArrayidl">trunk/Source/WebCore/plugins/DOMMimeTypeArray.idl</a></li>
<li><a href="#trunkSourceWebCorepluginsDOMPluginArraycpp">trunk/Source/WebCore/plugins/DOMPluginArray.cpp</a></li>
<li><a href="#trunkSourceWebCorepluginsDOMPluginArrayh">trunk/Source/WebCore/plugins/DOMPluginArray.h</a></li>
<li><a href="#trunkSourceWebCorepluginsDOMPluginArrayidl">trunk/Source/WebCore/plugins/DOMPluginArray.idl</a></li>
<li><a href="#trunkSourceWebCoreworkersserviceServiceWorkerContainerh">trunk/Source/WebCore/workers/service/ServiceWorkerContainer.h</a></li>
<li><a href="#trunkSourceWebCoreworkersserviceServiceWorkerContaineridl">trunk/Source/WebCore/workers/service/ServiceWorkerContainer.idl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastdomnavigatorpropertygcafterframedetachexpectedtxt">trunk/LayoutTests/fast/dom/navigator-property-gc-after-frame-detach-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastdomnavigatorpropertygcafterframedetachhtml">trunk/LayoutTests/fast/dom/navigator-property-gc-after-frame-detach.html</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk1fastdomnavigatorpropertygcafterframedetachexpectedtxt">trunk/LayoutTests/platform/mac-wk1/fast/dom/navigator-property-gc-after-frame-detach-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformwinfastdomnavigatorpropertygcafterframedetachexpectedtxt">trunk/LayoutTests/platform/win/fast/dom/navigator-property-gc-after-frame-detach-expected.txt</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (248275 => 248276)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog      2019-08-05 22:52:17 UTC (rev 248275)
+++ trunk/LayoutTests/ChangeLog 2019-08-05 23:00:26 UTC (rev 248276)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2019-08-05  Chris Dumez  <cdumez@apple.com>
+
+        navigator.geolocation wrapper should not become GC-collectable once its frame is detached
+        https://bugs.webkit.org/show_bug.cgi?id=200436
+
+        Reviewed by Darin Adler.
+
+        Add layout test coverage.
+
+        * fast/dom/navigator-property-gc-after-frame-detach-expected.txt: Added.
+        * fast/dom/navigator-property-gc-after-frame-detach.html: Added.
+
</ins><span class="cx"> 2019-08-05  Devin Rousso  <drousso@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Web Inspector: rename "Stylesheet" to "Style Sheet" to match spec text
</span></span></pre></div>
<a id="trunkLayoutTestsfastdomnavigatorpropertygcafterframedetachexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/navigator-property-gc-after-frame-detach-expected.txt (0 => 248276)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/navigator-property-gc-after-frame-detach-expected.txt                         (rev 0)
+++ trunk/LayoutTests/fast/dom/navigator-property-gc-after-frame-detach-expected.txt    2019-08-05 23:00:26 UTC (rev 248276)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+Tests that Navigator properties do not get GC'd before their Navigator object.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS frameNavigator.geolocation.foo is 1
+PASS frameNavigator.mimeTypes.foo is 1
+PASS frameNavigator.plugins.foo is 1
+PASS frameNavigator.serviceWorker.foo is 1
+
+PASS frameNavigator.geolocation.foo is 1
+PASS frameNavigator.mimeTypes.foo is 1
+PASS frameNavigator.plugins.foo is 1
+PASS frameNavigator.serviceWorker.foo is 1
+
+PASS frameNavigator.geolocation.foo is 1
+PASS frameNavigator.mimeTypes.foo is 1
+PASS frameNavigator.plugins.foo is 1
+PASS frameNavigator.serviceWorker.foo is 1
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastdomnavigatorpropertygcafterframedetachhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/dom/navigator-property-gc-after-frame-detach.html (0 => 248276)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/dom/navigator-property-gc-after-frame-detach.html                         (rev 0)
+++ trunk/LayoutTests/fast/dom/navigator-property-gc-after-frame-detach.html    2019-08-05 23:00:26 UTC (rev 248276)
</span><span class="lines">@@ -0,0 +1,34 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<body>
+<script src="../../resources/js-test.js"></script>
+<iframe id="testFrame" src="about:blank"></iframe>
+<script>
+description("Tests that Navigator properties do not get GC'd before their Navigator object.");
+jsTestIsAsync = true;
+
+var navigatorProperties = [ "geolocation", "mimeTypes", "plugins" ];
+if (navigator.serviceWorker)
+    navigatorProperties.push("serviceWorker");
+
+onload = function() {
+    frameNavigator = document.getElementById("testFrame").contentWindow.navigator;
+    for (let navigatorProperty of navigatorProperties)
+        eval("frameNavigator." + navigatorProperty + ".foo = 1;");
+    document.getElementById("testFrame").remove();
+    for (let navigatorProperty of navigatorProperties)
+        shouldBe("frameNavigator." + navigatorProperty + ".foo", "1");
+    debug("");
+    gc();
+    for (let navigatorProperty of navigatorProperties)
+        shouldBe("frameNavigator." + navigatorProperty + ".foo", "1");
+    debug("");
+    setTimeout(() => {
+        gc();
+        for (let navigatorProperty of navigatorProperties)
+            shouldBe("frameNavigator." + navigatorProperty + ".foo", "1");
+        finishJSTest();
+    }, 10);
+}
+</script>
+</body>
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk1fastdomnavigatorpropertygcafterframedetachexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/mac-wk1/fast/dom/navigator-property-gc-after-frame-detach-expected.txt (0 => 248276)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk1/fast/dom/navigator-property-gc-after-frame-detach-expected.txt                                (rev 0)
+++ trunk/LayoutTests/platform/mac-wk1/fast/dom/navigator-property-gc-after-frame-detach-expected.txt   2019-08-05 23:00:26 UTC (rev 248276)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+Tests that Navigator properties do not get GC'd before their Navigator object.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS frameNavigator.geolocation.foo is 1
+PASS frameNavigator.mimeTypes.foo is 1
+PASS frameNavigator.plugins.foo is 1
+
+PASS frameNavigator.geolocation.foo is 1
+PASS frameNavigator.mimeTypes.foo is 1
+PASS frameNavigator.plugins.foo is 1
+
+PASS frameNavigator.geolocation.foo is 1
+PASS frameNavigator.mimeTypes.foo is 1
+PASS frameNavigator.plugins.foo is 1
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformwinfastdomnavigatorpropertygcafterframedetachexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/platform/win/fast/dom/navigator-property-gc-after-frame-detach-expected.txt (0 => 248276)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/win/fast/dom/navigator-property-gc-after-frame-detach-expected.txt                            (rev 0)
+++ trunk/LayoutTests/platform/win/fast/dom/navigator-property-gc-after-frame-detach-expected.txt       2019-08-05 23:00:26 UTC (rev 248276)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+Tests that Navigator properties do not get GC'd before their Navigator object.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS frameNavigator.geolocation.foo is 1
+PASS frameNavigator.mimeTypes.foo is 1
+PASS frameNavigator.plugins.foo is 1
+
+PASS frameNavigator.geolocation.foo is 1
+PASS frameNavigator.mimeTypes.foo is 1
+PASS frameNavigator.plugins.foo is 1
+
+PASS frameNavigator.geolocation.foo is 1
+PASS frameNavigator.mimeTypes.foo is 1
+PASS frameNavigator.plugins.foo is 1
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformwk2TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/wk2/TestExpectations (248275 => 248276)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/wk2/TestExpectations  2019-08-05 22:52:17 UTC (rev 248275)
+++ trunk/LayoutTests/platform/wk2/TestExpectations     2019-08-05 23:00:26 UTC (rev 248276)
</span><span class="lines">@@ -160,8 +160,6 @@
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/105952 fast/loader/submit-form-while-parsing-2.html [ Pass Failure ]
</span><span class="cx"> 
</span><del>-webkit.org/b/141122 editing/selection/programmatic-selection-on-mac-is-directionless.html [ Pass Failure ]
-
</del><span class="cx"> webkit.org/b/149087 http/tests/cache/disk-cache/disk-cache-cancel.html [ Pass Failure ]
</span><span class="cx"> 
</span><span class="cx"> http/tests/appcache/decide-navigation-policy-after-delay.html [ Pass ]
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (248275 => 248276)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2019-08-05 22:52:17 UTC (rev 248275)
+++ trunk/Source/WebCore/ChangeLog      2019-08-05 23:00:26 UTC (rev 248276)
</span><span class="lines">@@ -1,3 +1,51 @@
</span><ins>+2019-08-05  Chris Dumez  <cdumez@apple.com>
+
+        navigator.geolocation wrapper should not become GC-collectable once its frame is detached
+        https://bugs.webkit.org/show_bug.cgi?id=200436
+
+        Reviewed by Darin Adler.
+
+        navigator.geolocation wrapper should not become GC-collectable once its frame is detached, given
+        that it can outlive the frame. Instead, tie the navigator.geolocation wrapper's lifetime to its
+        Navigator's.
+
+        Test: fast/dom/navigator-property-gc-after-frame-detach.html
+
+        * Modules/geolocation/Geolocation.cpp:
+        (WebCore::Geolocation::create):
+        (WebCore::Geolocation::Geolocation):
+        (WebCore::Geolocation::navigator):
+        (WebCore::Geolocation::frame const):
+        * Modules/geolocation/Geolocation.h:
+        * Modules/geolocation/Geolocation.idl:
+        * Modules/geolocation/NavigatorGeolocation.cpp:
+        (WebCore::NavigatorGeolocation::NavigatorGeolocation):
+        (WebCore::NavigatorGeolocation::from):
+        (WebCore::NavigatorGeolocation::geolocation):
+        (WebCore::NavigatorGeolocation::geolocation const):
+        * Modules/geolocation/NavigatorGeolocation.h:
+        * bindings/js/JSNavigatorCustom.cpp:
+        (WebCore::JSNavigator::visitAdditionalChildren):
+        * bindings/js/JSWorkerNavigatorCustom.cpp:
+        (WebCore::JSWorkerNavigator::visitAdditionalChildren):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (GenerateImplementation):
+        * bindings/scripts/IDLAttributes.json:
+        * page/Navigator.cpp:
+        (WebCore::Navigator::plugins):
+        (WebCore::Navigator::mimeTypes):
+        * page/NavigatorBase.h:
+        * plugins/DOMMimeTypeArray.cpp:
+        (WebCore::DOMMimeTypeArray::DOMMimeTypeArray):
+        * plugins/DOMMimeTypeArray.h:
+        * plugins/DOMMimeTypeArray.idl:
+        * plugins/DOMPluginArray.cpp:
+        (WebCore::DOMPluginArray::DOMPluginArray):
+        * plugins/DOMPluginArray.h:
+        * plugins/DOMPluginArray.idl:
+        * workers/service/ServiceWorkerContainer.h:
+        * workers/service/ServiceWorkerContainer.idl:
+
</ins><span class="cx"> 2019-08-05  Andy Estes  <aestes@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [WebIDL] Support partial dictionaries and conditional dictionary members
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesgeolocationGeolocationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/geolocation/Geolocation.cpp (248275 => 248276)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/geolocation/Geolocation.cpp 2019-08-05 22:52:17 UTC (rev 248275)
+++ trunk/Source/WebCore/Modules/geolocation/Geolocation.cpp    2019-08-05 23:00:26 UTC (rev 248276)
</span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx"> #include "GeolocationError.h"
</span><span class="cx"> #include "GeolocationPosition.h"
</span><span class="cx"> #include "Geoposition.h"
</span><ins>+#include "Navigator.h"
</ins><span class="cx"> #include "Page.h"
</span><span class="cx"> #include "PositionError.h"
</span><span class="cx"> #include "RuntimeApplicationChecks.h"
</span><span class="lines">@@ -129,18 +130,16 @@
</span><span class="cx">     copy = copyToVector(m_idToNotifierMap.values());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Ref<Geolocation> Geolocation::create(ScriptExecutionContext* context)
</del><ins>+Ref<Geolocation> Geolocation::create(Navigator& navigator)
</ins><span class="cx"> {
</span><del>-    auto geolocation = adoptRef(*new Geolocation(context));
</del><ins>+    auto geolocation = adoptRef(*new Geolocation(navigator));
</ins><span class="cx">     geolocation.get().suspendIfNeeded();
</span><span class="cx">     return geolocation;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Geolocation::Geolocation(ScriptExecutionContext* context)
-    : ActiveDOMObject(context)
-    , m_allowGeolocation(Unknown)
-    , m_isSuspended(false)
-    , m_hasChangedPosition(false)
</del><ins>+Geolocation::Geolocation(Navigator& navigator)
+    : ActiveDOMObject(navigator.scriptExecutionContext())
+    , m_navigator(makeWeakPtr(navigator))
</ins><span class="cx">     , m_resumeTimer(*this, &Geolocation::resumeTimerFired)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -731,6 +730,16 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Navigator* Geolocation::navigator()
+{
+    return m_navigator.get();
+}
+
+Frame* Geolocation::frame() const
+{
+    return m_navigator ? m_navigator->frame() : nullptr;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">                                                         
</span><span class="cx"> #endif // ENABLE(GEOLOCATION)
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesgeolocationGeolocationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/geolocation/Geolocation.h (248275 => 248276)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/geolocation/Geolocation.h   2019-08-05 22:52:17 UTC (rev 248275)
+++ trunk/Source/WebCore/Modules/geolocation/Geolocation.h      2019-08-05 23:00:26 UTC (rev 248276)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx"> class Frame;
</span><span class="cx"> class GeoNotifier;
</span><span class="cx"> class GeolocationError;
</span><ins>+class Navigator;
</ins><span class="cx"> class Page;
</span><span class="cx"> class ScriptExecutionContext;
</span><span class="cx"> class SecurityOrigin;
</span><span class="lines">@@ -54,12 +55,11 @@
</span><span class="cx">     WTF_MAKE_ISO_ALLOCATED(Geolocation);
</span><span class="cx">     friend class GeoNotifier;
</span><span class="cx"> public:
</span><del>-    static Ref<Geolocation> create(ScriptExecutionContext*);
</del><ins>+    static Ref<Geolocation> create(Navigator&);
</ins><span class="cx">     WEBCORE_EXPORT ~Geolocation();
</span><span class="cx"> 
</span><span class="cx">     WEBCORE_EXPORT void resetAllGeolocationPermission();
</span><span class="cx">     Document* document() const { return downcast<Document>(scriptExecutionContext()); }
</span><del>-    Frame* frame() const { return document() ? document()->frame() : nullptr; }
</del><span class="cx"> 
</span><span class="cx">     void getCurrentPosition(Ref<PositionCallback>&&, RefPtr<PositionErrorCallback>&&, PositionOptions&&);
</span><span class="cx">     int watchPosition(Ref<PositionCallback>&&, RefPtr<PositionErrorCallback>&&, PositionOptions&&);
</span><span class="lines">@@ -73,8 +73,11 @@
</span><span class="cx">     void setError(GeolocationError&);
</span><span class="cx">     bool shouldBlockGeolocationRequests();
</span><span class="cx"> 
</span><ins>+    Navigator* navigator();
+    WEBCORE_EXPORT Frame* frame() const;
+
</ins><span class="cx"> private:
</span><del>-    explicit Geolocation(ScriptExecutionContext*);
</del><ins>+    explicit Geolocation(Navigator&);
</ins><span class="cx"> 
</span><span class="cx">     Geoposition* lastPosition();
</span><span class="cx"> 
</span><span class="lines">@@ -144,25 +147,20 @@
</span><span class="cx">     bool haveSuitableCachedPosition(const PositionOptions&);
</span><span class="cx">     void makeCachedPositionCallbacks();
</span><span class="cx"> 
</span><ins>+    void resumeTimerFired();
+
+    WeakPtr<Navigator> m_navigator;
</ins><span class="cx">     GeoNotifierSet m_oneShots;
</span><span class="cx">     Watchers m_watchers;
</span><span class="cx">     GeoNotifierSet m_pendingForPermissionNotifiers;
</span><span class="cx">     RefPtr<Geoposition> m_lastPosition;
</span><span class="cx"> 
</span><del>-    enum {
-        Unknown,
-        InProgress,
-        Yes,
-        No
-    } m_allowGeolocation;
-    bool m_isSuspended;
-    bool m_resetOnResume;
-    bool m_hasChangedPosition;
</del><ins>+    enum { Unknown, InProgress, Yes, No } m_allowGeolocation { Unknown };
+    bool m_isSuspended { false };
+    bool m_resetOnResume { false };
+    bool m_hasChangedPosition { false };
</ins><span class="cx">     RefPtr<PositionError> m_errorWaitingForResume;
</span><del>-
-    void resumeTimerFired();
</del><span class="cx">     Timer m_resumeTimer;
</span><del>-
</del><span class="cx">     GeoNotifierSet m_requestsAwaitingCachedPosition;
</span><span class="cx"> };
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesgeolocationGeolocationidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/geolocation/Geolocation.idl (248275 => 248276)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/geolocation/Geolocation.idl 2019-08-05 22:52:17 UTC (rev 248275)
+++ trunk/Source/WebCore/Modules/geolocation/Geolocation.idl    2019-08-05 23:00:26 UTC (rev 248276)
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx"> [
</span><span class="cx">     NoInterfaceObject,
</span><span class="cx">     Conditional=GEOLOCATION, 
</span><del>-    GenerateIsReachable=ImplFrame,
</del><ins>+    GenerateIsReachable=ReachableFromNavigator,
</ins><span class="cx"> ] interface Geolocation {
</span><span class="cx">     // FIXME: PositionErrorCallback should not be nullable
</span><span class="cx">     void getCurrentPosition(PositionCallback successCallback,
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesgeolocationNavigatorGeolocationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/geolocation/NavigatorGeolocation.cpp (248275 => 248276)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/geolocation/NavigatorGeolocation.cpp        2019-08-05 22:52:17 UTC (rev 248275)
+++ trunk/Source/WebCore/Modules/geolocation/NavigatorGeolocation.cpp   2019-08-05 23:00:26 UTC (rev 248276)
</span><span class="lines">@@ -34,8 +34,8 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-NavigatorGeolocation::NavigatorGeolocation(DOMWindow* window)
-    : DOMWindowProperty(window)
</del><ins>+NavigatorGeolocation::NavigatorGeolocation(Navigator& navigator)
+    : m_navigator(navigator)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -46,13 +46,13 @@
</span><span class="cx">     return "NavigatorGeolocation";
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-NavigatorGeolocation* NavigatorGeolocation::from(Navigator* navigator)
</del><ins>+NavigatorGeolocation* NavigatorGeolocation::from(Navigator& navigator)
</ins><span class="cx"> {
</span><del>-    NavigatorGeolocation* supplement = static_cast<NavigatorGeolocation*>(Supplement<Navigator>::from(navigator, supplementName()));
</del><ins>+    NavigatorGeolocation* supplement = static_cast<NavigatorGeolocation*>(Supplement<Navigator>::from(&navigator, supplementName()));
</ins><span class="cx">     if (!supplement) {
</span><del>-        auto newSupplement = std::make_unique<NavigatorGeolocation>(navigator->window());
</del><ins>+        auto newSupplement = std::make_unique<NavigatorGeolocation>(navigator);
</ins><span class="cx">         supplement = newSupplement.get();
</span><del>-        provideTo(navigator, supplementName(), WTFMove(newSupplement));
</del><ins>+        provideTo(&navigator, supplementName(), WTFMove(newSupplement));
</ins><span class="cx">     }
</span><span class="cx">     return supplement;
</span><span class="cx"> }
</span><span class="lines">@@ -67,13 +67,13 @@
</span><span class="cx"> 
</span><span class="cx"> Geolocation* NavigatorGeolocation::geolocation(Navigator& navigator)
</span><span class="cx"> {
</span><del>-    return NavigatorGeolocation::from(&navigator)->geolocation();
</del><ins>+    return NavigatorGeolocation::from(navigator)->geolocation();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Geolocation* NavigatorGeolocation::geolocation() const
</span><span class="cx"> {
</span><span class="cx">     if (!m_geolocation)
</span><del>-        m_geolocation = Geolocation::create(window() ? window()->document() : nullptr);
</del><ins>+        m_geolocation = Geolocation::create(m_navigator);
</ins><span class="cx">     return m_geolocation.get();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesgeolocationNavigatorGeolocationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/geolocation/NavigatorGeolocation.h (248275 => 248276)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/geolocation/NavigatorGeolocation.h  2019-08-05 22:52:17 UTC (rev 248275)
+++ trunk/Source/WebCore/Modules/geolocation/NavigatorGeolocation.h     2019-08-05 23:00:26 UTC (rev 248276)
</span><span class="lines">@@ -29,12 +29,12 @@
</span><span class="cx"> class Geolocation;
</span><span class="cx"> class Navigator;
</span><span class="cx"> 
</span><del>-class NavigatorGeolocation : public Supplement<Navigator>, public DOMWindowProperty {
</del><ins>+class NavigatorGeolocation : public Supplement<Navigator> {
</ins><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><del>-    explicit NavigatorGeolocation(DOMWindow*);
</del><ins>+    explicit NavigatorGeolocation(Navigator&);
</ins><span class="cx">     virtual ~NavigatorGeolocation();
</span><del>-    static NavigatorGeolocation* from(Navigator*);
</del><ins>+    static NavigatorGeolocation* from(Navigator&);
</ins><span class="cx"> 
</span><span class="cx">     static Geolocation* geolocation(Navigator&);
</span><span class="cx">     Geolocation* geolocation() const;
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx">     static const char* supplementName();
</span><span class="cx"> 
</span><span class="cx">     mutable RefPtr<Geolocation> m_geolocation;
</span><ins>+    Navigator& m_navigator;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSNavigatorCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSNavigatorCustom.cpp (248275 => 248276)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSNavigatorCustom.cpp   2019-08-05 22:52:17 UTC (rev 248275)
+++ trunk/Source/WebCore/bindings/js/JSNavigatorCustom.cpp      2019-08-05 23:00:26 UTC (rev 248276)
</span><span class="lines">@@ -30,11 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> void JSNavigator::visitAdditionalChildren(JSC::SlotVisitor& visitor)
</span><span class="cx"> {
</span><del>-#if ENABLE(SERVICE_WORKER)
-    visitor.addOpaqueRoot(wrapped().serviceWorkerIfExists());
-#else
-    UNUSED_PARAM(visitor);
-#endif
</del><ins>+    visitor.addOpaqueRoot(static_cast<NavigatorBase*>(&wrapped()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSWorkerNavigatorCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSWorkerNavigatorCustom.cpp (248275 => 248276)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSWorkerNavigatorCustom.cpp     2019-08-05 22:52:17 UTC (rev 248275)
+++ trunk/Source/WebCore/bindings/js/JSWorkerNavigatorCustom.cpp        2019-08-05 23:00:26 UTC (rev 248276)
</span><span class="lines">@@ -30,11 +30,7 @@
</span><span class="cx"> 
</span><span class="cx"> void JSWorkerNavigator::visitAdditionalChildren(JSC::SlotVisitor& visitor)
</span><span class="cx"> {
</span><del>-#if ENABLE(SERVICE_WORKER)
-    visitor.addOpaqueRoot(wrapped().serviceWorkerIfExists());
-#else
-    UNUSED_PARAM(visitor);
-#endif
</del><ins>+    visitor.addOpaqueRoot(static_cast<NavigatorBase*>(&wrapped()));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (248275 => 248276)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm 2019-08-05 22:52:17 UTC (rev 248275)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm    2019-08-05 23:00:26 UTC (rev 248276)
</span><span class="lines">@@ -4690,18 +4690,20 @@
</span><span class="cx">                 $rootString  = "    WebGLRenderingContextBase* root = WTF::getPtr(js${interfaceName}->wrapped().context());\n";
</span><span class="cx">                 $rootString .= "    if (UNLIKELY(reason))\n";
</span><span class="cx">                 $rootString .= "        *reason = \"Reachable from ${interfaceName}\";\n";
</span><del>-            } elsif (GetGenerateIsReachable($interface) eq "ImplFrame") {
-                $rootString  = "    Frame* root = WTF::getPtr(js${interfaceName}->wrapped().frame());\n";
</del><ins>+            } elsif (GetGenerateIsReachable($interface) eq "ReachableFromDOMWindow") {
+                $rootString  = "    auto* root = WTF::getPtr(js${interfaceName}->wrapped().window());\n";
</ins><span class="cx">                 $rootString .= "    if (!root)\n";
</span><span class="cx">                 $rootString .= "        return false;\n";
</span><span class="cx">                 $rootString .= "    if (UNLIKELY(reason))\n";
</span><del>-                $rootString .= "        *reason = \"Reachable from Frame\";\n";
-            } elsif (GetGenerateIsReachable($interface) eq "ReachableFromDOMWindow") {
-                $rootString  = "    auto* root = WTF::getPtr(js${interfaceName}->wrapped().window());\n";
</del><ins>+                $rootString .= "        *reason = \"Reachable from Window\";\n";
+            } elsif (GetGenerateIsReachable($interface) eq "ReachableFromNavigator") {
+                $implIncludes{"Navigator.h"} = 1;
+                $implIncludes{"WorkerNavigator.h"} = 1;
+                $rootString  = "    NavigatorBase* root = WTF::getPtr(js${interfaceName}->wrapped().navigator());\n";
</ins><span class="cx">                 $rootString .= "    if (!root)\n";
</span><span class="cx">                 $rootString .= "        return false;\n";
</span><span class="cx">                 $rootString .= "    if (UNLIKELY(reason))\n";
</span><del>-                $rootString .= "        *reason = \"Reachable from Window\";\n";
</del><ins>+                $rootString .= "        *reason = \"Reachable from Navigator\";\n";
</ins><span class="cx">             } elsif (GetGenerateIsReachable($interface) eq "ImplDocument") {
</span><span class="cx">                 $rootString  = "    Document* root = WTF::getPtr(js${interfaceName}->wrapped().document());\n";
</span><span class="cx">                 $rootString .= "    if (!root)\n";
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsIDLAttributesjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/IDLAttributes.json (248275 => 248276)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/IDLAttributes.json 2019-08-05 22:52:17 UTC (rev 248275)
+++ trunk/Source/WebCore/bindings/scripts/IDLAttributes.json    2019-08-05 23:00:26 UTC (rev 248276)
</span><span class="lines">@@ -226,7 +226,7 @@
</span><span class="cx">         },
</span><span class="cx">         "GenerateIsReachable": {
</span><span class="cx">             "contextsAllowed": ["interface"],
</span><del>-            "values": ["", "Impl", "ImplWebGLRenderingContext", "ImplDocument", "ImplElementRoot", "ImplFrame", "ImplOwnerNodeRoot", "ImplScriptExecutionContext", "ReachableFromDOMWindow"]
</del><ins>+            "values": ["", "Impl", "ImplWebGLRenderingContext", "ImplDocument", "ImplElementRoot", "ImplOwnerNodeRoot", "ImplScriptExecutionContext", "ReachableFromDOMWindow", "ReachableFromNavigator"]
</ins><span class="cx">         },
</span><span class="cx">         "Global": {
</span><span class="cx">             "contextsAllowed": ["interface"],
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.cpp (248275 => 248276)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.cpp  2019-08-05 22:52:17 UTC (rev 248275)
+++ trunk/Source/WebCore/page/DOMWindow.cpp     2019-08-05 23:00:26 UTC (rev 248276)
</span><span class="lines">@@ -2050,7 +2050,7 @@
</span><span class="cx">     // FIXME: Can we remove the PLATFORM(IOS_FAMILY)-guard?
</span><span class="cx"> #if ENABLE(GEOLOCATION) && PLATFORM(IOS_FAMILY)
</span><span class="cx">     if (m_navigator)
</span><del>-        NavigatorGeolocation::from(m_navigator.get())->resetAllGeolocationPermission();
</del><ins>+        NavigatorGeolocation::from(*m_navigator)->resetAllGeolocationPermission();
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageNavigatorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Navigator.cpp (248275 => 248276)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Navigator.cpp  2019-08-05 22:52:17 UTC (rev 248275)
+++ trunk/Source/WebCore/page/Navigator.cpp     2019-08-05 23:00:26 UTC (rev 248276)
</span><span class="lines">@@ -153,7 +153,7 @@
</span><span class="cx">             ResourceLoadObserver::shared().logNavigatorAPIAccessed(*frame->document(), ResourceLoadStatistics::NavigatorAPI::Plugins);
</span><span class="cx">     }
</span><span class="cx">     if (!m_plugins)
</span><del>-        m_plugins = DOMPluginArray::create(window());
</del><ins>+        m_plugins = DOMPluginArray::create(*this);
</ins><span class="cx">     return *m_plugins;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -164,7 +164,7 @@
</span><span class="cx">             ResourceLoadObserver::shared().logNavigatorAPIAccessed(*frame->document(), ResourceLoadStatistics::NavigatorAPI::MimeTypes);
</span><span class="cx">     }
</span><span class="cx">     if (!m_mimeTypes)
</span><del>-        m_mimeTypes = DOMMimeTypeArray::create(window());
</del><ins>+        m_mimeTypes = DOMMimeTypeArray::create(*this);
</ins><span class="cx">     return *m_mimeTypes;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageNavigatorBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/NavigatorBase.h (248275 => 248276)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/NavigatorBase.h        2019-08-05 22:52:17 UTC (rev 248275)
+++ trunk/Source/WebCore/page/NavigatorBase.h   2019-08-05 23:00:26 UTC (rev 248276)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx"> #include <wtf/UniqueRef.h>
</span><span class="cx"> #include <wtf/Vector.h>
</span><ins>+#include <wtf/WeakPtr.h>
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -37,7 +38,7 @@
</span><span class="cx"> class ScriptExecutionContext;
</span><span class="cx"> class ServiceWorkerContainer;
</span><span class="cx"> 
</span><del>-class NavigatorBase : public RefCounted<NavigatorBase>, public ContextDestructionObserver {
</del><ins>+class NavigatorBase : public RefCounted<NavigatorBase>, public ContextDestructionObserver, public CanMakeWeakPtr<NavigatorBase> {
</ins><span class="cx"> public:
</span><span class="cx">     virtual ~NavigatorBase();
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepluginsDOMMimeTypeArraycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/plugins/DOMMimeTypeArray.cpp (248275 => 248276)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/DOMMimeTypeArray.cpp        2019-08-05 22:52:17 UTC (rev 248275)
+++ trunk/Source/WebCore/plugins/DOMMimeTypeArray.cpp   2019-08-05 23:00:26 UTC (rev 248276)
</span><span class="lines">@@ -31,8 +31,8 @@
</span><span class="cx"> 
</span><span class="cx"> WTF_MAKE_ISO_ALLOCATED_IMPL(DOMMimeTypeArray);
</span><span class="cx"> 
</span><del>-DOMMimeTypeArray::DOMMimeTypeArray(DOMWindow* window)
-    : DOMWindowProperty(window)
</del><ins>+DOMMimeTypeArray::DOMMimeTypeArray(Navigator& navigator)
+    : m_navigator(makeWeakPtr(navigator))
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepluginsDOMMimeTypeArrayh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/plugins/DOMMimeTypeArray.h (248275 => 248276)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/DOMMimeTypeArray.h  2019-08-05 22:52:17 UTC (rev 248275)
+++ trunk/Source/WebCore/plugins/DOMMimeTypeArray.h     2019-08-05 23:00:26 UTC (rev 248276)
</span><span class="lines">@@ -21,7 +21,7 @@
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><span class="cx"> #include "DOMMimeType.h"
</span><del>-#include "DOMWindowProperty.h"
</del><ins>+#include "Navigator.h"
</ins><span class="cx"> #include "ScriptWrappable.h"
</span><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx"> 
</span><span class="lines">@@ -29,10 +29,10 @@
</span><span class="cx"> 
</span><span class="cx"> class PluginData;
</span><span class="cx"> 
</span><del>-class DOMMimeTypeArray final : public ScriptWrappable, public RefCounted<DOMMimeTypeArray>, public DOMWindowProperty {
</del><ins>+class DOMMimeTypeArray final : public ScriptWrappable, public RefCounted<DOMMimeTypeArray> {
</ins><span class="cx">     WTF_MAKE_ISO_ALLOCATED(DOMMimeTypeArray);
</span><span class="cx"> public:
</span><del>-    static Ref<DOMMimeTypeArray> create(DOMWindow* window) { return adoptRef(*new DOMMimeTypeArray(window)); }
</del><ins>+    static Ref<DOMMimeTypeArray> create(Navigator& navigator) { return adoptRef(*new DOMMimeTypeArray(navigator)); }
</ins><span class="cx">     ~DOMMimeTypeArray();
</span><span class="cx"> 
</span><span class="cx">     unsigned length() const;
</span><span class="lines">@@ -39,10 +39,15 @@
</span><span class="cx">     RefPtr<DOMMimeType> item(unsigned index);
</span><span class="cx">     RefPtr<DOMMimeType> namedItem(const AtomString& propertyName);
</span><span class="cx">     Vector<AtomString> supportedPropertyNames();
</span><ins>+    
+    Navigator* navigator() { return m_navigator.get(); }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    explicit DOMMimeTypeArray(DOMWindow*);
</del><ins>+    explicit DOMMimeTypeArray(Navigator&);
</ins><span class="cx">     PluginData* getPluginData() const;
</span><ins>+    Frame* frame() const { return m_navigator ? m_navigator->frame() : nullptr; }
+    
+    WeakPtr<Navigator> m_navigator;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorepluginsDOMMimeTypeArrayidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/plugins/DOMMimeTypeArray.idl (248275 => 248276)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/DOMMimeTypeArray.idl        2019-08-05 22:52:17 UTC (rev 248275)
+++ trunk/Source/WebCore/plugins/DOMMimeTypeArray.idl   2019-08-05 23:00:26 UTC (rev 248276)
</span><span class="lines">@@ -19,7 +19,7 @@
</span><span class="cx"> */
</span><span class="cx"> 
</span><span class="cx"> [
</span><del>-    GenerateIsReachable=ReachableFromDOMWindow,
</del><ins>+    GenerateIsReachable=ReachableFromNavigator,
</ins><span class="cx">     LegacyUnenumerableNamedProperties,
</span><span class="cx">     ImplementationLacksVTable,
</span><span class="cx">     InterfaceName=MimeTypeArray,
</span></span></pre></div>
<a id="trunkSourceWebCorepluginsDOMPluginArraycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/plugins/DOMPluginArray.cpp (248275 => 248276)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/DOMPluginArray.cpp  2019-08-05 22:52:17 UTC (rev 248275)
+++ trunk/Source/WebCore/plugins/DOMPluginArray.cpp     2019-08-05 23:00:26 UTC (rev 248276)
</span><span class="lines">@@ -31,8 +31,8 @@
</span><span class="cx"> 
</span><span class="cx"> WTF_MAKE_ISO_ALLOCATED_IMPL(DOMPluginArray);
</span><span class="cx"> 
</span><del>-DOMPluginArray::DOMPluginArray(DOMWindow* window)
-    : DOMWindowProperty(window)
</del><ins>+DOMPluginArray::DOMPluginArray(Navigator& navigator)
+    : m_navigator(makeWeakPtr(navigator))
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepluginsDOMPluginArrayh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/plugins/DOMPluginArray.h (248275 => 248276)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/DOMPluginArray.h    2019-08-05 22:52:17 UTC (rev 248275)
+++ trunk/Source/WebCore/plugins/DOMPluginArray.h       2019-08-05 23:00:26 UTC (rev 248276)
</span><span class="lines">@@ -22,6 +22,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include "DOMPlugin.h"
</span><span class="cx"> #include "DOMWindowProperty.h"
</span><ins>+#include "Navigator.h"
</ins><span class="cx"> #include "ScriptWrappable.h"
</span><span class="cx"> #include <wtf/RefCounted.h>
</span><span class="cx"> 
</span><span class="lines">@@ -29,10 +30,10 @@
</span><span class="cx"> 
</span><span class="cx"> class PluginData;
</span><span class="cx"> 
</span><del>-class DOMPluginArray final : public ScriptWrappable, public RefCounted<DOMPluginArray>, public DOMWindowProperty {
</del><ins>+class DOMPluginArray final : public ScriptWrappable, public RefCounted<DOMPluginArray> {
</ins><span class="cx">     WTF_MAKE_ISO_ALLOCATED(DOMPluginArray);
</span><span class="cx"> public:
</span><del>-    static Ref<DOMPluginArray> create(DOMWindow* window) { return adoptRef(*new DOMPluginArray(window)); }
</del><ins>+    static Ref<DOMPluginArray> create(Navigator& navigator) { return adoptRef(*new DOMPluginArray(navigator)); }
</ins><span class="cx">     ~DOMPluginArray();
</span><span class="cx"> 
</span><span class="cx">     unsigned length() const;
</span><span class="lines">@@ -41,10 +42,16 @@
</span><span class="cx">     Vector<AtomString> supportedPropertyNames();
</span><span class="cx"> 
</span><span class="cx">     void refresh(bool reloadPages);
</span><ins>+    
+    Navigator* navigator() { return m_navigator.get(); }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    explicit DOMPluginArray(DOMWindow*);
</del><ins>+    explicit DOMPluginArray(Navigator&);
+
</ins><span class="cx">     PluginData* pluginData() const;
</span><ins>+    Frame* frame() const { return m_navigator ? m_navigator->frame() : nullptr; }
+    
+    WeakPtr<Navigator> m_navigator;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorepluginsDOMPluginArrayidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/plugins/DOMPluginArray.idl (248275 => 248276)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/plugins/DOMPluginArray.idl  2019-08-05 22:52:17 UTC (rev 248275)
+++ trunk/Source/WebCore/plugins/DOMPluginArray.idl     2019-08-05 23:00:26 UTC (rev 248276)
</span><span class="lines">@@ -19,7 +19,7 @@
</span><span class="cx"> */
</span><span class="cx"> 
</span><span class="cx"> [
</span><del>-    GenerateIsReachable=ReachableFromDOMWindow,
</del><ins>+    GenerateIsReachable=ReachableFromNavigator,
</ins><span class="cx">     LegacyUnenumerableNamedProperties,
</span><span class="cx">     ImplementationLacksVTable,
</span><span class="cx">     InterfaceName=PluginArray,
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersserviceServiceWorkerContainerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/service/ServiceWorkerContainer.h (248275 => 248276)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/service/ServiceWorkerContainer.h    2019-08-05 22:52:17 UTC (rev 248275)
+++ trunk/Source/WebCore/workers/service/ServiceWorkerContainer.h       2019-08-05 23:00:26 UTC (rev 248276)
</span><span class="lines">@@ -87,6 +87,8 @@
</span><span class="cx"> 
</span><span class="cx">     bool isAlwaysOnLoggingAllowed() const;
</span><span class="cx"> 
</span><ins>+    NavigatorBase* navigator() { return &m_navigator; }
+
</ins><span class="cx"> private:
</span><span class="cx">     void scheduleJob(std::unique_ptr<ServiceWorkerJob>&&);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersserviceServiceWorkerContaineridl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/service/ServiceWorkerContainer.idl (248275 => 248276)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/service/ServiceWorkerContainer.idl  2019-08-05 22:52:17 UTC (rev 248275)
+++ trunk/Source/WebCore/workers/service/ServiceWorkerContainer.idl     2019-08-05 23:00:26 UTC (rev 248276)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx">     Exposed=(Window,ServiceWorker),
</span><span class="cx">     Conditional=SERVICE_WORKER,
</span><span class="cx">     EnabledAtRuntime=ServiceWorker,
</span><del>-    GenerateIsReachable=Impl,
</del><ins>+    GenerateIsReachable=ReachableFromNavigator
</ins><span class="cx"> ] interface ServiceWorkerContainer : EventTarget {
</span><span class="cx">     readonly attribute ServiceWorker? controller;
</span><span class="cx">     readonly attribute Promise<ServiceWorkerRegistration> ready;
</span></span></pre>
</div>
</div>

</body>
</html>