<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Safari background tabs should be fully suspended where possible."
href="https://bugs.webkit.org/show_bug.cgi?id=150515#c24">Comment # 24</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Safari background tabs should be fully suspended where possible."
href="https://bugs.webkit.org/show_bug.cgi?id=150515">bug 150515</a>
from <span class="vcard"><a class="email" href="mailto:cdumez@apple.com" title="Chris Dumez <cdumez@apple.com>"> <span class="fn">Chris Dumez</span></a>
</span></b>
<pre>Comment on <span class=""><a href="attachment.cgi?id=267181&action=diff" name="attach_267181" title="Patch">attachment 267181</a> <a href="attachment.cgi?id=267181&action=edit" title="Patch">[details]</a></span>
Patch
View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=267181&action=review">https://bugs.webkit.org/attachment.cgi?id=267181&action=review</a>
<span class="quote">> Source/WebCore/page/Page.cpp:146
> +bool Page::s_tabSuspensionIsEnabled = false;</span >
Shouldn't this be a setting instead?
<span class="quote">> Source/WebCore/page/Page.cpp:227
> + , m_tabSuspensionTimer(*this, &Page::tabSuspensionTimerFired)</span >
nit: Could be a lambda to avoid adding a new method, considering the implementation is trivial.
<span class="quote">> Source/WebCore/page/Page.cpp:1297
> + if (m_pageActivityState == activityState)</span >
How can this happen? I see one call site in PageThrottler::setActivityFlag() and it already does this check.
<span class="quote">> Source/WebCore/page/Page.cpp:1301
> + m_pageActivityState = activityState;</span >
Seems to me we could ask m_pageThrottler for the current pageActivityState when needed and avoid adding a data member to Page for this.
<span class="quote">> Source/WebCore/page/Page.cpp:1850
> +void Page::setTabSuspensionEnabled(bool enable)</span >
setting?
<span class="quote">> Source/WebCore/page/Page.cpp:1867
> + m_isTabSuspensionScheduled = shouldSuspend;</span >
This seems confusing. If canTabSuspend() returns false, this may be true even though we did not schedule anything.
I think the problem is the naming, how about m_shouldSuspendTab?
<span class="quote">> Source/WebCore/page/Page.h:663
> + bool canTabSuspend();</span >
We normally try to avoid mixing methods and members. The methods should probably be declared higher in the class.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>