<!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>[161697] trunk/Source/WebCore</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/161697">161697</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2014-01-10 16:38:16 -0800 (Fri, 10 Jan 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>CTTE in NavigationScheduler
https://bugs.webkit.org/show_bug.cgi?id=126788
Reviewed by Tim Horton.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::frameScheduledNavigationImpl):
(WebCore::InspectorInstrumentation::frameClearedScheduledNavigationImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::frameScheduledNavigation):
(WebCore::InspectorInstrumentation::frameClearedScheduledNavigation):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::frameScheduledNavigation):
(WebCore::InspectorPageAgent::frameClearedScheduledNavigation):
* inspector/InspectorPageAgent.h:
* loader/NavigationScheduler.cpp:
(WebCore::ScheduledNavigation::shouldStartTimer):
(WebCore::ScheduledNavigation::didStartTimer):
(WebCore::ScheduledNavigation::didStopTimer):
(WebCore::NavigationScheduler::NavigationScheduler):
(WebCore::NavigationScheduler::clear):
(WebCore::NavigationScheduler::shouldScheduleNavigation):
(WebCore::NavigationScheduler::scheduleRedirect):
(WebCore::NavigationScheduler::mustLockBackForwardList):
(WebCore::NavigationScheduler::scheduleLocationChange):
(WebCore::NavigationScheduler::scheduleFormSubmission):
(WebCore::NavigationScheduler::scheduleRefresh):
(WebCore::NavigationScheduler::scheduleHistoryNavigation):
(WebCore::NavigationScheduler::timerFired):
(WebCore::NavigationScheduler::schedule):
(WebCore::NavigationScheduler::startTimer):
(WebCore::NavigationScheduler::cancel):
* loader/NavigationScheduler.h:
* page/Frame.cpp:
(WebCore::Frame::Frame):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorInstrumentationcpp">trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorInstrumentationh">trunk/Source/WebCore/inspector/InspectorInstrumentation.h</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorPageAgentcpp">trunk/Source/WebCore/inspector/InspectorPageAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorPageAgenth">trunk/Source/WebCore/inspector/InspectorPageAgent.h</a></li>
<li><a href="#trunkSourceWebCoreloaderNavigationSchedulercpp">trunk/Source/WebCore/loader/NavigationScheduler.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderNavigationSchedulerh">trunk/Source/WebCore/loader/NavigationScheduler.h</a></li>
<li><a href="#trunkSourceWebCorepageFramecpp">trunk/Source/WebCore/page/Frame.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (161696 => 161697)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-01-11 00:31:19 UTC (rev 161696)
+++ trunk/Source/WebCore/ChangeLog        2014-01-11 00:38:16 UTC (rev 161697)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2014-01-10 Anders Carlsson <andersca@apple.com>
+
+ CTTE in NavigationScheduler
+ https://bugs.webkit.org/show_bug.cgi?id=126788
+
+ Reviewed by Tim Horton.
+
+ * inspector/InspectorInstrumentation.cpp:
+ (WebCore::InspectorInstrumentation::frameScheduledNavigationImpl):
+ (WebCore::InspectorInstrumentation::frameClearedScheduledNavigationImpl):
+ * inspector/InspectorInstrumentation.h:
+ (WebCore::InspectorInstrumentation::frameScheduledNavigation):
+ (WebCore::InspectorInstrumentation::frameClearedScheduledNavigation):
+ * inspector/InspectorPageAgent.cpp:
+ (WebCore::InspectorPageAgent::frameScheduledNavigation):
+ (WebCore::InspectorPageAgent::frameClearedScheduledNavigation):
+ * inspector/InspectorPageAgent.h:
+ * loader/NavigationScheduler.cpp:
+ (WebCore::ScheduledNavigation::shouldStartTimer):
+ (WebCore::ScheduledNavigation::didStartTimer):
+ (WebCore::ScheduledNavigation::didStopTimer):
+ (WebCore::NavigationScheduler::NavigationScheduler):
+ (WebCore::NavigationScheduler::clear):
+ (WebCore::NavigationScheduler::shouldScheduleNavigation):
+ (WebCore::NavigationScheduler::scheduleRedirect):
+ (WebCore::NavigationScheduler::mustLockBackForwardList):
+ (WebCore::NavigationScheduler::scheduleLocationChange):
+ (WebCore::NavigationScheduler::scheduleFormSubmission):
+ (WebCore::NavigationScheduler::scheduleRefresh):
+ (WebCore::NavigationScheduler::scheduleHistoryNavigation):
+ (WebCore::NavigationScheduler::timerFired):
+ (WebCore::NavigationScheduler::schedule):
+ (WebCore::NavigationScheduler::startTimer):
+ (WebCore::NavigationScheduler::cancel):
+ * loader/NavigationScheduler.h:
+ * page/Frame.cpp:
+ (WebCore::Frame::Frame):
+
</ins><span class="cx"> 2014-01-10 Myles C. Maxfield <mmaxfield@apple.com>
</span><span class="cx">
</span><span class="cx"> CSS word-spacing property does not obey percentages
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorInstrumentationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp (161696 => 161697)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp        2014-01-11 00:31:19 UTC (rev 161696)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp        2014-01-11 00:38:16 UTC (rev 161697)
</span><span class="lines">@@ -868,15 +868,15 @@
</span><span class="cx"> inspectorPageAgent->frameStoppedLoading(frame);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void InspectorInstrumentation::frameScheduledNavigationImpl(InstrumentingAgents* instrumentingAgents, Frame* frame, double delay)
</del><ins>+void InspectorInstrumentation::frameScheduledNavigationImpl(InstrumentingAgents& instrumentingAgents, Frame& frame, double delay)
</ins><span class="cx"> {
</span><del>- if (InspectorPageAgent* inspectorPageAgent = instrumentingAgents->inspectorPageAgent())
</del><ins>+ if (InspectorPageAgent* inspectorPageAgent = instrumentingAgents.inspectorPageAgent())
</ins><span class="cx"> inspectorPageAgent->frameScheduledNavigation(frame, delay);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void InspectorInstrumentation::frameClearedScheduledNavigationImpl(InstrumentingAgents* instrumentingAgents, Frame* frame)
</del><ins>+void InspectorInstrumentation::frameClearedScheduledNavigationImpl(InstrumentingAgents& instrumentingAgents, Frame& frame)
</ins><span class="cx"> {
</span><del>- if (InspectorPageAgent* inspectorPageAgent = instrumentingAgents->inspectorPageAgent())
</del><ins>+ if (InspectorPageAgent* inspectorPageAgent = instrumentingAgents.inspectorPageAgent())
</ins><span class="cx"> inspectorPageAgent->frameClearedScheduledNavigation(frame);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorInstrumentationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.h (161696 => 161697)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorInstrumentation.h        2014-01-11 00:31:19 UTC (rev 161696)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.h        2014-01-11 00:38:16 UTC (rev 161697)
</span><span class="lines">@@ -197,8 +197,8 @@
</span><span class="cx"> static void loaderDetachedFromFrame(Frame*, DocumentLoader*);
</span><span class="cx"> static void frameStartedLoading(Frame&);
</span><span class="cx"> static void frameStoppedLoading(Frame&);
</span><del>- static void frameScheduledNavigation(Frame*, double delay);
- static void frameClearedScheduledNavigation(Frame*);
</del><ins>+ static void frameScheduledNavigation(Frame&, double delay);
+ static void frameClearedScheduledNavigation(Frame&);
</ins><span class="cx"> static InspectorInstrumentationCookie willRunJavaScriptDialog(Page*, const String& message);
</span><span class="cx"> static void didRunJavaScriptDialog(const InspectorInstrumentationCookie&);
</span><span class="cx"> static void willDestroyCachedResource(CachedResource*);
</span><span class="lines">@@ -388,8 +388,8 @@
</span><span class="cx"> static void loaderDetachedFromFrameImpl(InstrumentingAgents*, DocumentLoader*);
</span><span class="cx"> static void frameStartedLoadingImpl(InstrumentingAgents&, Frame&);
</span><span class="cx"> static void frameStoppedLoadingImpl(InstrumentingAgents&, Frame&);
</span><del>- static void frameScheduledNavigationImpl(InstrumentingAgents*, Frame*, double delay);
- static void frameClearedScheduledNavigationImpl(InstrumentingAgents*, Frame*);
</del><ins>+ static void frameScheduledNavigationImpl(InstrumentingAgents&, Frame&, double delay);
+ static void frameClearedScheduledNavigationImpl(InstrumentingAgents&, Frame&);
</ins><span class="cx"> static InspectorInstrumentationCookie willRunJavaScriptDialogImpl(InstrumentingAgents*, const String& message);
</span><span class="cx"> static void didRunJavaScriptDialogImpl(const InspectorInstrumentationCookie&);
</span><span class="cx"> static void willDestroyCachedResourceImpl(CachedResource*);
</span><span class="lines">@@ -1626,22 +1626,22 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void InspectorInstrumentation::frameScheduledNavigation(Frame* frame, double delay)
</del><ins>+inline void InspectorInstrumentation::frameScheduledNavigation(Frame& frame, double delay)
</ins><span class="cx"> {
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><del>- if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
- frameScheduledNavigationImpl(instrumentingAgents, frame, delay);
</del><ins>+ if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(&frame))
+ frameScheduledNavigationImpl(*instrumentingAgents, frame, delay);
</ins><span class="cx"> #else
</span><span class="cx"> UNUSED_PARAM(frame);
</span><span class="cx"> UNUSED_PARAM(delay);
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><del>-inline void InspectorInstrumentation::frameClearedScheduledNavigation(Frame* frame)
</del><ins>+inline void InspectorInstrumentation::frameClearedScheduledNavigation(Frame& frame)
</ins><span class="cx"> {
</span><span class="cx"> #if ENABLE(INSPECTOR)
</span><del>- if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
- frameClearedScheduledNavigationImpl(instrumentingAgents, frame);
</del><ins>+ if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(&frame))
+ frameClearedScheduledNavigationImpl(*instrumentingAgents, frame);
</ins><span class="cx"> #else
</span><span class="cx"> UNUSED_PARAM(frame);
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorPageAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.cpp (161696 => 161697)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorPageAgent.cpp        2014-01-11 00:31:19 UTC (rev 161696)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.cpp        2014-01-11 00:38:16 UTC (rev 161697)
</span><span class="lines">@@ -884,14 +884,14 @@
</span><span class="cx"> m_frontendDispatcher->frameStoppedLoading(frameId(&frame));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void InspectorPageAgent::frameScheduledNavigation(Frame* frame, double delay)
</del><ins>+void InspectorPageAgent::frameScheduledNavigation(Frame& frame, double delay)
</ins><span class="cx"> {
</span><del>- m_frontendDispatcher->frameScheduledNavigation(frameId(frame), delay);
</del><ins>+ m_frontendDispatcher->frameScheduledNavigation(frameId(&frame), delay);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-void InspectorPageAgent::frameClearedScheduledNavigation(Frame* frame)
</del><ins>+void InspectorPageAgent::frameClearedScheduledNavigation(Frame& frame)
</ins><span class="cx"> {
</span><del>- m_frontendDispatcher->frameClearedScheduledNavigation(frameId(frame));
</del><ins>+ m_frontendDispatcher->frameClearedScheduledNavigation(frameId(&frame));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InspectorPageAgent::willRunJavaScriptDialog(const String& message)
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorPageAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.h (161696 => 161697)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorPageAgent.h        2014-01-11 00:31:19 UTC (rev 161696)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.h        2014-01-11 00:38:16 UTC (rev 161697)
</span><span class="lines">@@ -135,8 +135,8 @@
</span><span class="cx"> void loaderDetachedFromFrame(DocumentLoader*);
</span><span class="cx"> void frameStartedLoading(Frame&);
</span><span class="cx"> void frameStoppedLoading(Frame&);
</span><del>- void frameScheduledNavigation(Frame*, double delay);
- void frameClearedScheduledNavigation(Frame*);
</del><ins>+ void frameScheduledNavigation(Frame&, double delay);
+ void frameClearedScheduledNavigation(Frame&);
</ins><span class="cx"> void willRunJavaScriptDialog(const String& message);
</span><span class="cx"> void didRunJavaScriptDialog();
</span><span class="cx"> void applyEmulatedMedia(String*);
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderNavigationSchedulercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/NavigationScheduler.cpp (161696 => 161697)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/NavigationScheduler.cpp        2014-01-11 00:31:19 UTC (rev 161696)
+++ trunk/Source/WebCore/loader/NavigationScheduler.cpp        2014-01-11 00:38:16 UTC (rev 161697)
</span><span class="lines">@@ -70,11 +70,11 @@
</span><span class="cx"> }
</span><span class="cx"> virtual ~ScheduledNavigation() { }
</span><span class="cx">
</span><del>- virtual void fire(Frame*) = 0;
</del><ins>+ virtual void fire(Frame&) = 0;
</ins><span class="cx">
</span><del>- virtual bool shouldStartTimer(Frame*) { return true; }
- virtual void didStartTimer(Frame*, Timer<NavigationScheduler>*) { }
- virtual void didStopTimer(Frame*, bool /* newLoadInProgress */) { }
</del><ins>+ virtual bool shouldStartTimer(Frame&) { return true; }
+ virtual void didStartTimer(Frame&, Timer<NavigationScheduler>&) { }
+ virtual void didStopTimer(Frame&, bool /* newLoadInProgress */) { }
</ins><span class="cx">
</span><span class="cx"> double delay() const { return m_delay; }
</span><span class="cx"> bool lockHistory() const { return m_lockHistory; }
</span><span class="lines">@@ -106,23 +106,23 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>- virtual void fire(Frame* frame)
</del><ins>+ virtual void fire(Frame& frame) OVERRIDE
</ins><span class="cx"> {
</span><span class="cx"> UserGestureIndicator gestureIndicator(wasUserGesture() ? DefinitelyProcessingUserGesture : DefinitelyNotProcessingUserGesture);
</span><del>- frame->loader().changeLocation(m_securityOrigin.get(), URL(ParsedURLString, m_url), m_referrer, lockHistory(), lockBackForwardList(), false);
</del><ins>+ frame.loader().changeLocation(m_securityOrigin.get(), URL(ParsedURLString, m_url), m_referrer, lockHistory(), lockBackForwardList(), false);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- virtual void didStartTimer(Frame* frame, Timer<NavigationScheduler>* timer)
</del><ins>+ virtual void didStartTimer(Frame& frame, Timer<NavigationScheduler>& timer) OVERRIDE
</ins><span class="cx"> {
</span><span class="cx"> if (m_haveToldClient)
</span><span class="cx"> return;
</span><span class="cx"> m_haveToldClient = true;
</span><span class="cx">
</span><span class="cx"> UserGestureIndicator gestureIndicator(wasUserGesture() ? DefinitelyProcessingUserGesture : DefinitelyNotProcessingUserGesture);
</span><del>- frame->loader().clientRedirected(URL(ParsedURLString, m_url), delay(), currentTime() + timer->nextFireInterval(), lockBackForwardList());
</del><ins>+ frame.loader().clientRedirected(URL(ParsedURLString, m_url), delay(), currentTime() + timer.nextFireInterval(), lockBackForwardList());
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- virtual void didStopTimer(Frame* frame, bool newLoadInProgress)
</del><ins>+ virtual void didStopTimer(Frame& frame, bool newLoadInProgress) OVERRIDE
</ins><span class="cx"> {
</span><span class="cx"> if (!m_haveToldClient)
</span><span class="cx"> return;
</span><span class="lines">@@ -133,7 +133,7 @@
</span><span class="cx"> // fact unavailable. We need to be consistent with them, otherwise the
</span><span class="cx"> // gesture state will sometimes be set and sometimes not within
</span><span class="cx"> // dispatchDidCancelClientRedirect().
</span><del>- frame->loader().clientRedirectCancelledOrFinished(newLoadInProgress);
</del><ins>+ frame.loader().clientRedirectCancelledOrFinished(newLoadInProgress);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> SecurityOrigin* securityOrigin() const { return m_securityOrigin.get(); }
</span><span class="lines">@@ -155,13 +155,16 @@
</span><span class="cx"> clearUserGesture();
</span><span class="cx"> }
</span><span class="cx">
</span><del>- virtual bool shouldStartTimer(Frame* frame) { return frame->loader().allAncestorsAreComplete(); }
</del><ins>+ virtual bool shouldStartTimer(Frame& frame) OVERRIDE
+ {
+ return frame.loader().allAncestorsAreComplete();
+ }
</ins><span class="cx">
</span><del>- virtual void fire(Frame* frame)
</del><ins>+ virtual void fire(Frame& frame) OVERRIDE
</ins><span class="cx"> {
</span><span class="cx"> UserGestureIndicator gestureIndicator(wasUserGesture() ? DefinitelyProcessingUserGesture : DefinitelyNotProcessingUserGesture);
</span><del>- bool refresh = equalIgnoringFragmentIdentifier(frame->document()->url(), URL(ParsedURLString, url()));
- frame->loader().changeLocation(securityOrigin(), URL(ParsedURLString, url()), referrer(), lockHistory(), lockBackForwardList(), refresh);
</del><ins>+ bool refresh = equalIgnoringFragmentIdentifier(frame.document()->url(), URL(ParsedURLString, url()));
+ frame.loader().changeLocation(securityOrigin(), URL(ParsedURLString, url()), referrer(), lockHistory(), lockBackForwardList(), refresh);
</ins><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><span class="lines">@@ -178,10 +181,10 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>- virtual void fire(Frame* frame)
</del><ins>+ virtual void fire(Frame& frame) OVERRIDE
</ins><span class="cx"> {
</span><span class="cx"> UserGestureIndicator gestureIndicator(wasUserGesture() ? DefinitelyProcessingUserGesture : DefinitelyNotProcessingUserGesture);
</span><del>- frame->loader().changeLocation(securityOrigin(), URL(ParsedURLString, url()), referrer(), lockHistory(), lockBackForwardList(), true);
</del><ins>+ frame.loader().changeLocation(securityOrigin(), URL(ParsedURLString, url()), referrer(), lockHistory(), lockBackForwardList(), true);
</ins><span class="cx"> }
</span><span class="cx"> };
</span><span class="cx">
</span><span class="lines">@@ -193,19 +196,20 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>- virtual void fire(Frame* frame)
</del><ins>+ virtual void fire(Frame& frame) OVERRIDE
</ins><span class="cx"> {
</span><span class="cx"> UserGestureIndicator gestureIndicator(wasUserGesture() ? DefinitelyProcessingUserGesture : DefinitelyNotProcessingUserGesture);
</span><span class="cx">
</span><span class="cx"> if (!m_historySteps) {
</span><span class="cx"> // Special case for go(0) from a frame -> reload only the frame
</span><span class="cx"> // To follow Firefox and IE's behavior, history reload can only navigate the self frame.
</span><del>- frame->loader().urlSelected(frame->document()->url(), "_self", 0, lockHistory(), lockBackForwardList(), MaybeSendReferrer);
</del><ins>+ frame.loader().urlSelected(frame.document()->url(), "_self", 0, lockHistory(), lockBackForwardList(), MaybeSendReferrer);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> // go(i!=0) from a frame navigates into the history of the frame only,
</span><span class="cx"> // in both IE and NS (but not in Mozilla). We can't easily do that.
</span><del>- frame->page()->backForward().goBackOrForward(m_historySteps);
</del><ins>+ frame.page()->backForward().goBackOrForward(m_historySteps);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="lines">@@ -222,7 +226,7 @@
</span><span class="cx"> ASSERT(m_submission->state());
</span><span class="cx"> }
</span><span class="cx">
</span><del>- virtual void fire(Frame* frame)
</del><ins>+ virtual void fire(Frame& frame) OVERRIDE
</ins><span class="cx"> {
</span><span class="cx"> UserGestureIndicator gestureIndicator(wasUserGesture() ? DefinitelyProcessingUserGesture : DefinitelyNotProcessingUserGesture);
</span><span class="cx">
</span><span class="lines">@@ -231,24 +235,24 @@
</span><span class="cx"> // selecting a target, in case conditions have changed. Other code paths avoid this by targeting
</span><span class="cx"> // without leaving a time window. If we fail the check just silently drop the form submission.
</span><span class="cx"> Document* requestingDocument = m_submission->state()->sourceDocument();
</span><del>- if (!requestingDocument->canNavigate(frame))
</del><ins>+ if (!requestingDocument->canNavigate(&frame))
</ins><span class="cx"> return;
</span><span class="cx"> FrameLoadRequest frameRequest(requestingDocument->securityOrigin());
</span><span class="cx"> m_submission->populateFrameLoadRequest(frameRequest);
</span><del>- frame->loader().loadFrameRequest(frameRequest, lockHistory(), lockBackForwardList(), m_submission->event(), m_submission->state(), MaybeSendReferrer);
</del><ins>+ frame.loader().loadFrameRequest(frameRequest, lockHistory(), lockBackForwardList(), m_submission->event(), m_submission->state(), MaybeSendReferrer);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- virtual void didStartTimer(Frame* frame, Timer<NavigationScheduler>* timer)
</del><ins>+ virtual void didStartTimer(Frame& frame, Timer<NavigationScheduler>& timer) OVERRIDE
</ins><span class="cx"> {
</span><span class="cx"> if (m_haveToldClient)
</span><span class="cx"> return;
</span><span class="cx"> m_haveToldClient = true;
</span><span class="cx">
</span><span class="cx"> UserGestureIndicator gestureIndicator(wasUserGesture() ? DefinitelyProcessingUserGesture : DefinitelyNotProcessingUserGesture);
</span><del>- frame->loader().clientRedirected(m_submission->requestURL(), delay(), currentTime() + timer->nextFireInterval(), lockBackForwardList());
</del><ins>+ frame.loader().clientRedirected(m_submission->requestURL(), delay(), currentTime() + timer.nextFireInterval(), lockBackForwardList());
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- virtual void didStopTimer(Frame* frame, bool newLoadInProgress)
</del><ins>+ virtual void didStopTimer(Frame& frame, bool newLoadInProgress) OVERRIDE
</ins><span class="cx"> {
</span><span class="cx"> if (!m_haveToldClient)
</span><span class="cx"> return;
</span><span class="lines">@@ -259,7 +263,7 @@
</span><span class="cx"> // fact unavailable. We need to be consistent with them, otherwise the
</span><span class="cx"> // gesture state will sometimes be set and sometimes not within
</span><span class="cx"> // dispatchDidCancelClientRedirect().
</span><del>- frame->loader().clientRedirectCancelledOrFinished(newLoadInProgress);
</del><ins>+ frame.loader().clientRedirectCancelledOrFinished(newLoadInProgress);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="lines">@@ -267,7 +271,7 @@
</span><span class="cx"> bool m_haveToldClient;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-NavigationScheduler::NavigationScheduler(Frame* frame)
</del><ins>+NavigationScheduler::NavigationScheduler(Frame& frame)
</ins><span class="cx"> : m_frame(frame)
</span><span class="cx"> , m_timer(this, &NavigationScheduler::timerFired)
</span><span class="cx"> {
</span><span class="lines">@@ -292,12 +296,12 @@
</span><span class="cx"> if (m_timer.isActive())
</span><span class="cx"> InspectorInstrumentation::frameClearedScheduledNavigation(m_frame);
</span><span class="cx"> m_timer.stop();
</span><del>- m_redirect.clear();
</del><ins>+ m_redirect = nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline bool NavigationScheduler::shouldScheduleNavigation() const
</span><span class="cx"> {
</span><del>- return m_frame->page();
</del><ins>+ return m_frame.page();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> inline bool NavigationScheduler::shouldScheduleNavigation(const String& url) const
</span><span class="lines">@@ -316,20 +320,20 @@
</span><span class="cx">
</span><span class="cx"> // We want a new back/forward list item if the refresh timeout is > 1 second.
</span><span class="cx"> if (!m_redirect || delay <= m_redirect->delay())
</span><del>- schedule(adoptPtr(new ScheduledRedirect(delay, m_frame->document()->securityOrigin(), url, true, delay <= 1)));
</del><ins>+ schedule(std::make_unique<ScheduledRedirect>(delay, m_frame.document()->securityOrigin(), url, true, delay <= 1));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-bool NavigationScheduler::mustLockBackForwardList(Frame* targetFrame)
</del><ins>+bool NavigationScheduler::mustLockBackForwardList(Frame& targetFrame)
</ins><span class="cx"> {
</span><span class="cx"> // Non-user navigation before the page has finished firing onload should not create a new back/forward item.
</span><span class="cx"> // See https://webkit.org/b/42861 for the original motivation for this.
</span><del>- if (!ScriptController::processingUserGesture() && targetFrame->loader().documentLoader() && !targetFrame->loader().documentLoader()->wasOnloadHandled())
</del><ins>+ if (!ScriptController::processingUserGesture() && targetFrame.loader().documentLoader() && !targetFrame.loader().documentLoader()->wasOnloadHandled())
</ins><span class="cx"> return true;
</span><span class="cx">
</span><span class="cx"> // Navigation of a subframe during loading of an ancestor frame does not create a new back/forward item.
</span><span class="cx"> // The definition of "during load" is any time before all handlers for the load event have been run.
</span><span class="cx"> // See https://bugs.webkit.org/show_bug.cgi?id=14957 for the original motivation for this.
</span><del>- for (Frame* ancestor = targetFrame->tree().parent(); ancestor; ancestor = ancestor->tree().parent()) {
</del><ins>+ for (Frame* ancestor = targetFrame.tree().parent(); ancestor; ancestor = ancestor->tree().parent()) {
</ins><span class="cx"> Document* document = ancestor->document();
</span><span class="cx"> if (!ancestor->loader().isComplete() || (document && document->processingLoadEvent()))
</span><span class="cx"> return true;
</span><span class="lines">@@ -346,13 +350,13 @@
</span><span class="cx">
</span><span class="cx"> lockBackForwardList = lockBackForwardList || mustLockBackForwardList(m_frame);
</span><span class="cx">
</span><del>- FrameLoader& loader = m_frame->loader();
</del><ins>+ FrameLoader& loader = m_frame.loader();
</ins><span class="cx">
</span><span class="cx"> // If the URL we're going to navigate to is the same as the current one, except for the
</span><span class="cx"> // fragment part, we don't need to schedule the location change.
</span><span class="cx"> URL parsedURL(ParsedURLString, url);
</span><del>- if (parsedURL.hasFragmentIdentifier() && equalIgnoringFragmentIdentifier(m_frame->document()->url(), parsedURL)) {
- loader.changeLocation(securityOrigin, m_frame->document()->completeURL(url), referrer, lockHistory, lockBackForwardList);
</del><ins>+ if (parsedURL.hasFragmentIdentifier() && equalIgnoringFragmentIdentifier(m_frame.document()->url(), parsedURL)) {
+ loader.changeLocation(securityOrigin, m_frame.document()->completeURL(url), referrer, lockHistory, lockBackForwardList);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -360,39 +364,39 @@
</span><span class="cx"> // This may happen when a frame changes the location of another frame.
</span><span class="cx"> bool duringLoad = !loader.stateMachine()->committedFirstRealDocumentLoad();
</span><span class="cx">
</span><del>- schedule(adoptPtr(new ScheduledLocationChange(securityOrigin, url, referrer, lockHistory, lockBackForwardList, duringLoad)));
</del><ins>+ schedule(std::make_unique<ScheduledLocationChange>(securityOrigin, url, referrer, lockHistory, lockBackForwardList, duringLoad));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void NavigationScheduler::scheduleFormSubmission(PassRefPtr<FormSubmission> submission)
</span><span class="cx"> {
</span><del>- ASSERT(m_frame->page());
</del><ins>+ ASSERT(m_frame.page());
</ins><span class="cx">
</span><span class="cx"> // FIXME: Do we need special handling for form submissions where the URL is the same
</span><span class="cx"> // as the current one except for the fragment part? See scheduleLocationChange above.
</span><span class="cx">
</span><span class="cx"> // Handle a location change of a page with no document as a special case.
</span><span class="cx"> // This may happen when a frame changes the location of another frame.
</span><del>- bool duringLoad = !m_frame->loader().stateMachine()->committedFirstRealDocumentLoad();
</del><ins>+ bool duringLoad = !m_frame.loader().stateMachine()->committedFirstRealDocumentLoad();
</ins><span class="cx">
</span><span class="cx"> // If this is a child frame and the form submission was triggered by a script, lock the back/forward list
</span><span class="cx"> // to match IE and Opera.
</span><span class="cx"> // See https://bugs.webkit.org/show_bug.cgi?id=32383 for the original motivation for this.
</span><span class="cx"> bool lockBackForwardList = mustLockBackForwardList(m_frame)
</span><span class="cx"> || (submission->state()->formSubmissionTrigger() == SubmittedByJavaScript
</span><del>- && m_frame->tree().parent() && !ScriptController::processingUserGesture());
</del><ins>+ && m_frame.tree().parent() && !ScriptController::processingUserGesture());
</ins><span class="cx">
</span><del>- schedule(adoptPtr(new ScheduledFormSubmission(submission, lockBackForwardList, duringLoad)));
</del><ins>+ schedule(std::make_unique<ScheduledFormSubmission>(submission, lockBackForwardList, duringLoad));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void NavigationScheduler::scheduleRefresh()
</span><span class="cx"> {
</span><span class="cx"> if (!shouldScheduleNavigation())
</span><span class="cx"> return;
</span><del>- const URL& url = m_frame->document()->url();
</del><ins>+ const URL& url = m_frame.document()->url();
</ins><span class="cx"> if (url.isEmpty())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- schedule(adoptPtr(new ScheduledRefresh(m_frame->document()->securityOrigin(), url.string(), m_frame->loader().outgoingReferrer())));
</del><ins>+ schedule(std::make_unique<ScheduledRefresh>(m_frame.document()->securityOrigin(), url.string(), m_frame.loader().outgoingReferrer()));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void NavigationScheduler::scheduleHistoryNavigation(int steps)
</span><span class="lines">@@ -402,54 +406,54 @@
</span><span class="cx">
</span><span class="cx"> // Invalid history navigations (such as history.forward() during a new load) have the side effect of cancelling any scheduled
</span><span class="cx"> // redirects. We also avoid the possibility of cancelling the current load by avoiding the scheduled redirection altogether.
</span><del>- BackForwardController& backForward = m_frame->page()->backForward();
</del><ins>+ BackForwardController& backForward = m_frame.page()->backForward();
</ins><span class="cx"> if (steps > backForward.forwardCount() || -steps > backForward.backCount()) {
</span><span class="cx"> cancel();
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // In all other cases, schedule the history traversal to occur asynchronously.
</span><del>- schedule(adoptPtr(new ScheduledHistoryNavigation(steps)));
</del><ins>+ schedule(std::make_unique<ScheduledHistoryNavigation>(steps));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void NavigationScheduler::timerFired(Timer<NavigationScheduler>*)
</span><span class="cx"> {
</span><del>- if (!m_frame->page())
</del><ins>+ if (!m_frame.page())
</ins><span class="cx"> return;
</span><del>- if (m_frame->page()->defersLoading()) {
</del><ins>+ if (m_frame.page()->defersLoading()) {
</ins><span class="cx"> InspectorInstrumentation::frameClearedScheduledNavigation(m_frame);
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- Ref<Frame> protect(*m_frame);
</del><ins>+ Ref<Frame> protect(m_frame);
</ins><span class="cx">
</span><del>- OwnPtr<ScheduledNavigation> redirect(m_redirect.release());
</del><ins>+ std::unique_ptr<ScheduledNavigation> redirect = std::move(m_redirect);
</ins><span class="cx"> redirect->fire(m_frame);
</span><span class="cx"> InspectorInstrumentation::frameClearedScheduledNavigation(m_frame);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void NavigationScheduler::schedule(PassOwnPtr<ScheduledNavigation> redirect)
</del><ins>+void NavigationScheduler::schedule(std::unique_ptr<ScheduledNavigation> redirect)
</ins><span class="cx"> {
</span><del>- ASSERT(m_frame->page());
</del><ins>+ ASSERT(m_frame.page());
</ins><span class="cx">
</span><del>- Ref<Frame> protect(*m_frame);
</del><ins>+ Ref<Frame> protect(m_frame);
</ins><span class="cx">
</span><span class="cx"> // If a redirect was scheduled during a load, then stop the current load.
</span><span class="cx"> // Otherwise when the current load transitions from a provisional to a
</span><span class="cx"> // committed state, pending redirects may be cancelled.
</span><span class="cx"> if (redirect->wasDuringLoad()) {
</span><del>- if (DocumentLoader* provisionalDocumentLoader = m_frame->loader().provisionalDocumentLoader())
</del><ins>+ if (DocumentLoader* provisionalDocumentLoader = m_frame.loader().provisionalDocumentLoader())
</ins><span class="cx"> provisionalDocumentLoader->stopLoading();
</span><del>- m_frame->loader().stopLoading(UnloadEventPolicyUnloadAndPageHide);
</del><ins>+ m_frame.loader().stopLoading(UnloadEventPolicyUnloadAndPageHide);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> cancel();
</span><del>- m_redirect = redirect;
</del><ins>+ m_redirect = std::move(redirect);
</ins><span class="cx">
</span><del>- if (!m_frame->loader().isComplete() && m_redirect->isLocationChange())
- m_frame->loader().completed();
</del><ins>+ if (!m_frame.loader().isComplete() && m_redirect->isLocationChange())
+ m_frame.loader().completed();
</ins><span class="cx">
</span><del>- if (!m_frame->page())
</del><ins>+ if (!m_frame.page())
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> startTimer();
</span><span class="lines">@@ -460,7 +464,7 @@
</span><span class="cx"> if (!m_redirect)
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- ASSERT(m_frame->page());
</del><ins>+ ASSERT(m_frame.page());
</ins><span class="cx"> if (m_timer.isActive())
</span><span class="cx"> return;
</span><span class="cx"> if (!m_redirect->shouldStartTimer(m_frame))
</span><span class="lines">@@ -469,7 +473,7 @@
</span><span class="cx"> double delay = m_redirect->delay();
</span><span class="cx"> m_timer.startOneShot(delay);
</span><span class="cx"> InspectorInstrumentation::frameScheduledNavigation(m_frame, delay);
</span><del>- m_redirect->didStartTimer(m_frame, &m_timer); // m_redirect may be null on return (e.g. the client canceled the load)
</del><ins>+ m_redirect->didStartTimer(m_frame, m_timer); // m_redirect may be null on return (e.g. the client canceled the load)
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void NavigationScheduler::cancel(bool newLoadInProgress)
</span><span class="lines">@@ -478,8 +482,7 @@
</span><span class="cx"> InspectorInstrumentation::frameClearedScheduledNavigation(m_frame);
</span><span class="cx"> m_timer.stop();
</span><span class="cx">
</span><del>- OwnPtr<ScheduledNavigation> redirect(m_redirect.release());
- if (redirect)
</del><ins>+ if (std::unique_ptr<ScheduledNavigation> redirect = std::move(m_redirect))
</ins><span class="cx"> redirect->didStopTimer(m_frame, newLoadInProgress);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderNavigationSchedulerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/NavigationScheduler.h (161696 => 161697)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/NavigationScheduler.h        2014-01-11 00:31:19 UTC (rev 161696)
+++ trunk/Source/WebCore/loader/NavigationScheduler.h        2014-01-11 00:38:16 UTC (rev 161697)
</span><span class="lines">@@ -34,8 +34,6 @@
</span><span class="cx"> #include "Timer.h"
</span><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx"> #include <wtf/Noncopyable.h>
</span><del>-#include <wtf/OwnPtr.h>
-#include <wtf/PassOwnPtr.h>
</del><span class="cx"> #include <wtf/PassRefPtr.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -68,7 +66,7 @@
</span><span class="cx"> WTF_MAKE_NONCOPYABLE(NavigationScheduler);
</span><span class="cx">
</span><span class="cx"> public:
</span><del>- explicit NavigationScheduler(Frame*);
</del><ins>+ explicit NavigationScheduler(Frame&);
</ins><span class="cx"> ~NavigationScheduler();
</span><span class="cx">
</span><span class="cx"> bool redirectScheduledDuringLoad();
</span><span class="lines">@@ -90,13 +88,13 @@
</span><span class="cx"> bool shouldScheduleNavigation(const String& url) const;
</span><span class="cx">
</span><span class="cx"> void timerFired(Timer<NavigationScheduler>*);
</span><del>- void schedule(PassOwnPtr<ScheduledNavigation>);
</del><ins>+ void schedule(std::unique_ptr<ScheduledNavigation>);
</ins><span class="cx">
</span><del>- static bool mustLockBackForwardList(Frame* targetFrame);
</del><ins>+ static bool mustLockBackForwardList(Frame& targetFrame);
</ins><span class="cx">
</span><del>- Frame* m_frame;
</del><ins>+ Frame& m_frame;
</ins><span class="cx"> Timer<NavigationScheduler> m_timer;
</span><del>- OwnPtr<ScheduledNavigation> m_redirect;
</del><ins>+ std::unique_ptr<ScheduledNavigation> m_redirect;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorepageFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Frame.cpp (161696 => 161697)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Frame.cpp        2014-01-11 00:31:19 UTC (rev 161696)
+++ trunk/Source/WebCore/page/Frame.cpp        2014-01-11 00:38:16 UTC (rev 161697)
</span><span class="lines">@@ -164,7 +164,7 @@
</span><span class="cx"> , m_settings(&page.settings())
</span><span class="cx"> , m_treeNode(this, parentFromOwnerElement(ownerElement))
</span><span class="cx"> , m_loader(*this, frameLoaderClient)
</span><del>- , m_navigationScheduler(this)
</del><ins>+ , m_navigationScheduler(*this)
</ins><span class="cx"> , m_ownerElement(ownerElement)
</span><span class="cx"> , m_script(std::make_unique<ScriptController>(*this))
</span><span class="cx"> , m_editor(Editor::create(*this))
</span></span></pre>
</div>
</div>
</body>
</html>