<!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>[184223] trunk/Source/WebKit2</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/184223">184223</a></dd>
<dt>Author</dt> <dd>dbates@webkit.org</dd>
<dt>Date</dt> <dd>2015-05-12 15:06:44 -0700 (Tue, 12 May 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Make {Network, Web}ProcessProxy inherit from ProcessThrottleClient privately
https://bugs.webkit.org/show_bug.cgi?id=144886

Reviewed by Darin Adler.

{Network, Web}ProcessProxy are implemented in terms of ProcessThrottleClient, an
interface that defines the callbacks that ProcessThrottler makes to a client. We
do not want to allow arbitrary callers to make use of the interface ProcessThrottleClient.
So, we should use private inheritance to represent the relationship between
{Network, Web}ProcessProxy and ProcessThrottleClient instead of public inheritance.

Additionally make ProcessThrottler a instance variable of {Network, Web}ProcessProxy instead
of holding a smart pointer to a ProcessThrottler instance because we always want to
have a ProcessThrottler for each instance of {Network, Web}ProcessProxy.

* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::NetworkProcessProxy): Update code to work now that m_throttler
is an instance of ProcessThrottler instead of a smart pointer to a ProcessThrottler instance.
(WebKit::NetworkProcessProxy::didFinishLaunching): Update code to access functions of
m_throttler by reference instead of by pointer.
(WebKit::NetworkProcessProxy::didCancelProcessSuspension): Ditto.
(WebKit::NetworkProcessProxy::processReadyToSuspend): Ditto.
(WebKit::NetworkProcessProxy::setIsHoldingLockedFiles): Ditto.
* UIProcess/Network/NetworkProcessProxy.h: Inherit from ProcessThrottleClient privately.
(WebKit::NetworkProcessProxy::throttler): Update code to work now that m_throttler is an
instance of ProcessThrottler instead of a smart pointer to a ProcessThrottler instance.
* UIProcess/ProcessThrottler.cpp:
(WebKit::ProcessThrottler::ProcessThrottler): Update code to work now that m_process is
a lvalue reference instead of a pointer.
(WebKit::ProcessThrottler::updateAssertion): Ditto.
(WebKit::ProcessThrottler::assertionWillExpireImminently): Ditto.
* UIProcess/ProcessThrottler.h: Ditto.
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::WebProcessProxy): Update code to work now that m_throttler is an
instance of ProcessThrottler instead of a smart pointer to a ProcessThrottler instance.
(WebKit::WebProcessProxy::didFinishLaunching): Update code to access functions of
m_throttler by reference instead of by pointer.
(WebKit::WebProcessProxy::processReadyToSuspend): Ditto.
(WebKit::WebProcessProxy::didCancelProcessSuspension): Ditto.
(WebKit::WebProcessProxy::setIsHoldingLockedFiles): Ditto.
* UIProcess/WebProcessProxy.h: Inherit from ProcessThrottleClient privately.
(WebKit::WebProcessProxy::throttler): Update code to work now that m_throttler is an
instance of ProcessThrottler instead of a smart pointer to a ProcessThrottler instance.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessNetworkNetworkProcessProxycpp">trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessNetworkNetworkProcessProxyh">trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessProcessThrottlercpp">trunk/Source/WebKit2/UIProcess/ProcessThrottler.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessProcessThrottlerh">trunk/Source/WebKit2/UIProcess/ProcessThrottler.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebProcessProxycpp">trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebProcessProxyh">trunk/Source/WebKit2/UIProcess/WebProcessProxy.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (184222 => 184223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-05-12 21:50:16 UTC (rev 184222)
+++ trunk/Source/WebKit2/ChangeLog        2015-05-12 22:06:44 UTC (rev 184223)
</span><span class="lines">@@ -1,3 +1,49 @@
</span><ins>+2015-05-12  Daniel Bates  &lt;dabates@apple.com&gt;
+
+        Make {Network, Web}ProcessProxy inherit from ProcessThrottleClient privately
+        https://bugs.webkit.org/show_bug.cgi?id=144886
+
+        Reviewed by Darin Adler.
+
+        {Network, Web}ProcessProxy are implemented in terms of ProcessThrottleClient, an
+        interface that defines the callbacks that ProcessThrottler makes to a client. We
+        do not want to allow arbitrary callers to make use of the interface ProcessThrottleClient.
+        So, we should use private inheritance to represent the relationship between
+        {Network, Web}ProcessProxy and ProcessThrottleClient instead of public inheritance.
+
+        Additionally make ProcessThrottler a instance variable of {Network, Web}ProcessProxy instead
+        of holding a smart pointer to a ProcessThrottler instance because we always want to
+        have a ProcessThrottler for each instance of {Network, Web}ProcessProxy.
+
+        * UIProcess/Network/NetworkProcessProxy.cpp:
+        (WebKit::NetworkProcessProxy::NetworkProcessProxy): Update code to work now that m_throttler
+        is an instance of ProcessThrottler instead of a smart pointer to a ProcessThrottler instance.
+        (WebKit::NetworkProcessProxy::didFinishLaunching): Update code to access functions of
+        m_throttler by reference instead of by pointer.
+        (WebKit::NetworkProcessProxy::didCancelProcessSuspension): Ditto.
+        (WebKit::NetworkProcessProxy::processReadyToSuspend): Ditto.
+        (WebKit::NetworkProcessProxy::setIsHoldingLockedFiles): Ditto.
+        * UIProcess/Network/NetworkProcessProxy.h: Inherit from ProcessThrottleClient privately.
+        (WebKit::NetworkProcessProxy::throttler): Update code to work now that m_throttler is an
+        instance of ProcessThrottler instead of a smart pointer to a ProcessThrottler instance.
+        * UIProcess/ProcessThrottler.cpp:
+        (WebKit::ProcessThrottler::ProcessThrottler): Update code to work now that m_process is
+        a lvalue reference instead of a pointer.
+        (WebKit::ProcessThrottler::updateAssertion): Ditto.
+        (WebKit::ProcessThrottler::assertionWillExpireImminently): Ditto.
+        * UIProcess/ProcessThrottler.h: Ditto.
+        * UIProcess/WebProcessProxy.cpp:
+        (WebKit::WebProcessProxy::WebProcessProxy): Update code to work now that m_throttler is an
+        instance of ProcessThrottler instead of a smart pointer to a ProcessThrottler instance. 
+        (WebKit::WebProcessProxy::didFinishLaunching): Update code to access functions of
+        m_throttler by reference instead of by pointer.
+        (WebKit::WebProcessProxy::processReadyToSuspend): Ditto.
+        (WebKit::WebProcessProxy::didCancelProcessSuspension): Ditto.
+        (WebKit::WebProcessProxy::setIsHoldingLockedFiles): Ditto.
+        * UIProcess/WebProcessProxy.h: Inherit from ProcessThrottleClient privately.
+        (WebKit::WebProcessProxy::throttler): Update code to work now that m_throttler is an
+        instance of ProcessThrottler instead of a smart pointer to a ProcessThrottler instance.
+
</ins><span class="cx"> 2015-05-12  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Production builds should link against the shims directly
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessNetworkNetworkProcessProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp (184222 => 184223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp        2015-05-12 21:50:16 UTC (rev 184222)
+++ trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.cpp        2015-05-12 22:06:44 UTC (rev 184223)
</span><span class="lines">@@ -68,7 +68,7 @@
</span><span class="cx">     : m_processPool(processPool)
</span><span class="cx">     , m_numPendingConnectionRequests(0)
</span><span class="cx">     , m_customProtocolManagerProxy(this, processPool)
</span><del>-    , m_throttler(std::make_unique&lt;ProcessThrottler&gt;(this))
</del><ins>+    , m_throttler(*this)
</ins><span class="cx"> {
</span><span class="cx">     connect();
</span><span class="cx"> }
</span><span class="lines">@@ -276,7 +276,7 @@
</span><span class="cx">     
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     if (xpc_connection_t connection = this-&gt;connection()-&gt;xpcConnection())
</span><del>-        m_throttler-&gt;didConnectToProcess(xpc_connection_get_pid(connection));
</del><ins>+        m_throttler.didConnectToProcess(xpc_connection_get_pid(connection));
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -337,7 +337,7 @@
</span><span class="cx"> 
</span><span class="cx"> void NetworkProcessProxy::didCancelProcessSuspension()
</span><span class="cx"> {
</span><del>-    m_throttler-&gt;didCancelProcessSuspension();
</del><ins>+    m_throttler.didCancelProcessSuspension();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkProcessProxy::sendProcessDidResume()
</span><span class="lines">@@ -348,7 +348,7 @@
</span><span class="cx"> 
</span><span class="cx"> void NetworkProcessProxy::processReadyToSuspend()
</span><span class="cx"> {
</span><del>-    m_throttler-&gt;processReadyToSuspend();
</del><ins>+    m_throttler.processReadyToSuspend();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkProcessProxy::setIsHoldingLockedFiles(bool isHoldingLockedFiles)
</span><span class="lines">@@ -358,7 +358,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     if (!m_tokenForHoldingLockedFiles)
</span><del>-        m_tokenForHoldingLockedFiles = m_throttler-&gt;backgroundActivityToken();
</del><ins>+        m_tokenForHoldingLockedFiles = m_throttler.backgroundActivityToken();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessNetworkNetworkProcessProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h (184222 => 184223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h        2015-05-12 21:50:16 UTC (rev 184222)
+++ trunk/Source/WebKit2/UIProcess/Network/NetworkProcessProxy.h        2015-05-12 22:06:44 UTC (rev 184223)
</span><span class="lines">@@ -52,7 +52,7 @@
</span><span class="cx"> class WebProcessPool;
</span><span class="cx"> struct NetworkProcessCreationParameters;
</span><span class="cx"> 
</span><del>-class NetworkProcessProxy : public ChildProcessProxy, public ProcessThrottlerClient {
</del><ins>+class NetworkProcessProxy : public ChildProcessProxy, private ProcessThrottlerClient {
</ins><span class="cx"> public:
</span><span class="cx">     static PassRefPtr&lt;NetworkProcessProxy&gt; create(WebProcessPool&amp;);
</span><span class="cx">     ~NetworkProcessProxy();
</span><span class="lines">@@ -69,15 +69,12 @@
</span><span class="cx">     void setProcessSuppressionEnabled(bool);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    void sendProcessWillSuspendImminently() override;
-    void sendProcessWillSuspend() override;
-    void sendCancelProcessWillSuspend() override;
</del><span class="cx">     void didCancelProcessSuspension();
</span><span class="cx">     void processReadyToSuspend();
</span><del>-    void sendProcessDidResume() override;
</del><ins>+
</ins><span class="cx">     void setIsHoldingLockedFiles(bool);
</span><span class="cx"> 
</span><del>-    ProcessThrottler&amp; throttler() { return *m_throttler; }
</del><ins>+    ProcessThrottler&amp; throttler() { return m_throttler; }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     NetworkProcessProxy(WebProcessPool&amp;);
</span><span class="lines">@@ -89,6 +86,12 @@
</span><span class="cx">     void platformGetLaunchOptions(ProcessLauncher::LaunchOptions&amp;);
</span><span class="cx">     void networkProcessCrashedOrFailedToLaunch();
</span><span class="cx"> 
</span><ins>+    // ProcessThrottlerClient
+    void sendProcessWillSuspendImminently() override;
+    void sendProcessWillSuspend() override;
+    void sendCancelProcessWillSuspend() override;
+    void sendProcessDidResume() override;
+
</ins><span class="cx">     // IPC::Connection::Client
</span><span class="cx">     virtual void didReceiveMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;) override;
</span><span class="cx">     virtual void didReceiveSyncMessage(IPC::Connection&amp;, IPC::MessageDecoder&amp;, std::unique_ptr&lt;IPC::MessageEncoder&gt;&amp;) override;
</span><span class="lines">@@ -122,7 +125,7 @@
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;DownloadProxyMap&gt; m_downloadProxyMap;
</span><span class="cx">     CustomProtocolManagerProxy m_customProtocolManagerProxy;
</span><del>-    std::unique_ptr&lt;ProcessThrottler&gt; m_throttler;
</del><ins>+    ProcessThrottler m_throttler;
</ins><span class="cx">     ProcessThrottler::BackgroundActivityToken m_tokenForHoldingLockedFiles;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessProcessThrottlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ProcessThrottler.cpp (184222 => 184223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ProcessThrottler.cpp        2015-05-12 21:50:16 UTC (rev 184222)
+++ trunk/Source/WebKit2/UIProcess/ProcessThrottler.cpp        2015-05-12 22:06:44 UTC (rev 184223)
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx">     
</span><span class="cx"> static const unsigned processSuspensionTimeout = 30;
</span><span class="cx">     
</span><del>-ProcessThrottler::ProcessThrottler(ProcessThrottlerClient* process)
</del><ins>+ProcessThrottler::ProcessThrottler(ProcessThrottlerClient&amp; process)
</ins><span class="cx">     : m_process(process)
</span><span class="cx">     , m_suspendTimer(RunLoop::main(), this, &amp;ProcessThrottler::suspendTimerFired)
</span><span class="cx">     , m_foregroundCounter([this](bool) { updateAssertion(); })
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx">     // in the background for too long.
</span><span class="cx">     if (m_assertion &amp;&amp; m_assertion-&gt;state() != AssertionState::Suspended &amp;&amp; !m_foregroundCounter.value() &amp;&amp; !m_backgroundCounter.value()) {
</span><span class="cx">         ++m_suspendMessageCount;
</span><del>-        m_process-&gt;sendProcessWillSuspend();
</del><ins>+        m_process.sendProcessWillSuspend();
</ins><span class="cx">         m_suspendTimer.startOneShot(processSuspensionTimeout);
</span><span class="cx">         m_assertion-&gt;setState(AssertionState::Background);
</span><span class="cx">         return;
</span><span class="lines">@@ -76,10 +76,10 @@
</span><span class="cx"> 
</span><span class="cx">     // If we're currently waiting for the Web process to do suspension cleanup, but no longer need to be suspended, tell the Web process to cancel the cleanup.
</span><span class="cx">     if (m_suspendTimer.isActive() &amp;&amp; shouldBeRunnable)
</span><del>-        m_process-&gt;sendCancelProcessWillSuspend();
</del><ins>+        m_process.sendCancelProcessWillSuspend();
</ins><span class="cx">     
</span><span class="cx">     if (m_assertion &amp;&amp; m_assertion-&gt;state() == AssertionState::Suspended &amp;&amp; shouldBeRunnable)
</span><del>-        m_process-&gt;sendProcessDidResume();
</del><ins>+        m_process.sendProcessDidResume();
</ins><span class="cx"> 
</span><span class="cx">     updateAssertionNow();
</span><span class="cx"> }
</span><span class="lines">@@ -112,7 +112,7 @@
</span><span class="cx"> 
</span><span class="cx"> void ProcessThrottler::assertionWillExpireImminently()
</span><span class="cx"> {
</span><del>-    m_process-&gt;sendProcessWillSuspendImminently();
</del><ins>+    m_process.sendProcessWillSuspendImminently();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessProcessThrottlerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ProcessThrottler.h (184222 => 184223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ProcessThrottler.h        2015-05-12 21:50:16 UTC (rev 184222)
+++ trunk/Source/WebKit2/UIProcess/ProcessThrottler.h        2015-05-12 22:06:44 UTC (rev 184223)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx">     enum BackgroundActivityTokenType { };
</span><span class="cx">     typedef RefCounter::Token&lt;BackgroundActivityTokenType&gt; BackgroundActivityToken;
</span><span class="cx"> 
</span><del>-    ProcessThrottler(ProcessThrottlerClient*);
</del><ins>+    ProcessThrottler(ProcessThrottlerClient&amp;);
</ins><span class="cx"> 
</span><span class="cx">     inline ForegroundActivityToken foregroundActivityToken() const;
</span><span class="cx">     inline BackgroundActivityToken backgroundActivityToken() const;
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx">     // ProcessAssertionClient
</span><span class="cx">     void assertionWillExpireImminently() override;
</span><span class="cx"> 
</span><del>-    ProcessThrottlerClient* m_process;
</del><ins>+    ProcessThrottlerClient&amp; m_process;
</ins><span class="cx">     std::unique_ptr&lt;ProcessAndUIAssertion&gt; m_assertion;
</span><span class="cx">     RunLoop::Timer&lt;ProcessThrottler&gt; m_suspendTimer;
</span><span class="cx">     RefCounter m_foregroundCounter;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp (184222 => 184223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp        2015-05-12 21:50:16 UTC (rev 184222)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.cpp        2015-05-12 22:06:44 UTC (rev 184223)
</span><span class="lines">@@ -106,7 +106,7 @@
</span><span class="cx">     , m_mayHaveUniversalFileReadSandboxExtension(false)
</span><span class="cx">     , m_customProtocolManagerProxy(this, processPool)
</span><span class="cx">     , m_numberOfTimesSuddenTerminationWasDisabled(0)
</span><del>-    , m_throttler(std::make_unique&lt;ProcessThrottler&gt;(this))
</del><ins>+    , m_throttler(*this)
</ins><span class="cx"> {
</span><span class="cx">     WebPasteboardProxy::singleton().addWebProcessProxy(*this);
</span><span class="cx"> 
</span><span class="lines">@@ -588,7 +588,7 @@
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     xpc_connection_t xpcConnection = connection()-&gt;xpcConnection();
</span><span class="cx">     ASSERT(xpcConnection);
</span><del>-    m_throttler-&gt;didConnectToProcess(xpc_connection_get_pid(xpcConnection));
</del><ins>+    m_throttler.didConnectToProcess(xpc_connection_get_pid(xpcConnection));
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     initializeNetworkProcessActivityToken();
</span><span class="lines">@@ -929,7 +929,7 @@
</span><span class="cx">     
</span><span class="cx"> void WebProcessProxy::processReadyToSuspend()
</span><span class="cx"> {
</span><del>-    m_throttler-&gt;processReadyToSuspend();
</del><ins>+    m_throttler.processReadyToSuspend();
</ins><span class="cx"> #if PLATFORM(IOS) &amp;&amp; ENABLE(NETWORK_PROCESS)
</span><span class="cx">     m_tokenForNetworkProcess = nullptr;
</span><span class="cx"> #endif
</span><span class="lines">@@ -937,7 +937,7 @@
</span><span class="cx"> 
</span><span class="cx"> void WebProcessProxy::didCancelProcessSuspension()
</span><span class="cx"> {
</span><del>-    m_throttler-&gt;didCancelProcessSuspension();
</del><ins>+    m_throttler.didCancelProcessSuspension();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebProcessProxy::setIsHoldingLockedFiles(bool isHoldingLockedFiles)
</span><span class="lines">@@ -947,7 +947,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     if (!m_tokenForHoldingLockedFiles)
</span><del>-        m_tokenForHoldingLockedFiles = m_throttler-&gt;backgroundActivityToken();
</del><ins>+        m_tokenForHoldingLockedFiles = m_throttler.backgroundActivityToken();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebProcessProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebProcessProxy.h (184222 => 184223)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebProcessProxy.h        2015-05-12 21:50:16 UTC (rev 184222)
+++ trunk/Source/WebKit2/UIProcess/WebProcessProxy.h        2015-05-12 22:06:44 UTC (rev 184223)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx"> class WebProcessPool;
</span><span class="cx"> struct WebNavigationDataStore;
</span><span class="cx">     
</span><del>-class WebProcessProxy : public ChildProcessProxy, ResponsivenessTimer::Client, public ProcessThrottlerClient {
</del><ins>+class WebProcessProxy : public ChildProcessProxy, ResponsivenessTimer::Client, private ProcessThrottlerClient {
</ins><span class="cx"> public:
</span><span class="cx">     typedef HashMap&lt;uint64_t, RefPtr&lt;WebBackForwardListItem&gt;&gt; WebBackForwardListItemMap;
</span><span class="cx">     typedef HashMap&lt;uint64_t, RefPtr&lt;WebFrameProxy&gt;&gt; WebFrameProxyMap;
</span><span class="lines">@@ -143,16 +143,12 @@
</span><span class="cx"> 
</span><span class="cx">     void windowServerConnectionStateChanged();
</span><span class="cx"> 
</span><del>-    void sendProcessWillSuspendImminently() override;
-    void sendProcessWillSuspend() override;
</del><span class="cx">     void processReadyToSuspend();
</span><del>-    void sendCancelProcessWillSuspend() override;
</del><span class="cx">     void didCancelProcessSuspension();
</span><del>-    void sendProcessDidResume() override;
</del><span class="cx"> 
</span><span class="cx">     void setIsHoldingLockedFiles(bool);
</span><span class="cx"> 
</span><del>-    ProcessThrottler&amp; throttler() { return *m_throttler; }
</del><ins>+    ProcessThrottler&amp; throttler() { return m_throttler; }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     explicit WebProcessProxy(WebProcessPool&amp;);
</span><span class="lines">@@ -209,6 +205,12 @@
</span><span class="cx">     void interactionOccurredWhileUnresponsive(ResponsivenessTimer*) override;
</span><span class="cx">     void didBecomeResponsive(ResponsivenessTimer*) override;
</span><span class="cx"> 
</span><ins>+    // ProcessThrottlerClient
+    void sendProcessWillSuspendImminently() override;
+    void sendProcessWillSuspend() override;
+    void sendCancelProcessWillSuspend() override;
+    void sendProcessDidResume() override;
+
</ins><span class="cx">     // ProcessLauncher::Client
</span><span class="cx">     virtual void didFinishLaunching(ProcessLauncher*, IPC::Connection::Identifier) override;
</span><span class="cx"> 
</span><span class="lines">@@ -243,7 +245,7 @@
</span><span class="cx">     HashMap&lt;uint64_t, std::function&lt;void ()&gt;&gt; m_pendingDeleteWebsiteDataForOriginsCallbacks;
</span><span class="cx"> 
</span><span class="cx">     int m_numberOfTimesSuddenTerminationWasDisabled;
</span><del>-    std::unique_ptr&lt;ProcessThrottler&gt; m_throttler;
</del><ins>+    ProcessThrottler m_throttler;
</ins><span class="cx">     ProcessThrottler::BackgroundActivityToken m_tokenForHoldingLockedFiles;
</span><span class="cx"> #if PLATFORM(IOS) &amp;&amp; ENABLE(NETWORK_PROCESS)
</span><span class="cx">     ProcessThrottler::ForegroundActivityToken m_tokenForNetworkProcess;
</span></span></pre>
</div>
</div>

</body>
</html>