<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&#64;apple.com" title="Chris Dumez &lt;cdumez&#64;apple.com&gt;"> <span class="fn">Chris Dumez</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=267181&amp;action=diff" name="attach_267181" title="Patch">attachment 267181</a> <a href="attachment.cgi?id=267181&amp;action=edit" title="Patch">[details]</a></span>
Patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=267181&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=267181&amp;action=review</a>

<span class="quote">&gt; Source/WebCore/page/Page.cpp:146
&gt; +bool Page::s_tabSuspensionIsEnabled = false;</span >

Shouldn't this be a setting instead?

<span class="quote">&gt; Source/WebCore/page/Page.cpp:227
&gt; +    , m_tabSuspensionTimer(*this, &amp;Page::tabSuspensionTimerFired)</span >

nit: Could be a lambda to avoid adding a new method, considering the implementation is trivial.

<span class="quote">&gt; Source/WebCore/page/Page.cpp:1297
&gt; +    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">&gt; Source/WebCore/page/Page.cpp:1301
&gt; +    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">&gt; Source/WebCore/page/Page.cpp:1850
&gt; +void Page::setTabSuspensionEnabled(bool enable)</span >

setting?

<span class="quote">&gt; Source/WebCore/page/Page.cpp:1867
&gt; +    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">&gt; Source/WebCore/page/Page.h:663
&gt; +    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>