<!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>[149720] 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/149720">149720</a></dd>
<dt>Author</dt> <dd>zandobersek@gmail.com</dd>
<dt>Date</dt> <dd>2013-05-08 01:06:00 -0700 (Wed, 08 May 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>[WK2] Make the WebNetworkInfoManager a supplement to the WebProcess
https://bugs.webkit.org/show_bug.cgi?id=115716

Reviewed by Andreas Kling.

WebNetworkInfoManager should inherit from WebProcessSupplement and should be used
as such by the WebProcess. This removes the need for the m_networkInfoManager member
variable in the WebProcess class and brings the WebNetworkInfoManager in line with
other manager classes of which instances are controlled by the WebProcess class.

* WebProcess/NetworkInfo/WebNetworkInfoManager.cpp:
(WebKit::WebNetworkInfoManager::supplementName): Specify the supplement's name.
(WebKit):
* WebProcess/NetworkInfo/WebNetworkInfoManager.h:
(WebKit): Alphabetically reorder the two forwarding declarations.
(WebNetworkInfoManager): Inherit from the WebProcessSupplement interface.
* WebProcess/WebCoreSupport/WebNetworkInfoClient.cpp:
(WebKit::WebNetworkInfoClient::bandwidth): Access the WebNetworkInfoManager as a supplement.
(WebKit::WebNetworkInfoClient::metered): Ditto.
(WebKit::WebNetworkInfoClient::startUpdating): Ditto.
(WebKit::WebNetworkInfoClient::stopUpdating): Ditto.
(WebKit::WebNetworkInfoClient::networkInfoControllerDestroyed): Ditto.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::WebProcess): Add the WebNetworkInfoManager instance as a supplement.
* WebProcess/WebProcess.h:
(WebProcess): Remove the m_networkInfoManager member variable and its getter method.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessNetworkInfoWebNetworkInfoManagercpp">trunk/Source/WebKit2/WebProcess/NetworkInfo/WebNetworkInfoManager.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessNetworkInfoWebNetworkInfoManagerh">trunk/Source/WebKit2/WebProcess/NetworkInfo/WebNetworkInfoManager.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebNetworkInfoClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebNetworkInfoClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcesscpp">trunk/Source/WebKit2/WebProcess/WebProcess.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcessh">trunk/Source/WebKit2/WebProcess/WebProcess.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (149719 => 149720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2013-05-08 08:02:28 UTC (rev 149719)
+++ trunk/Source/WebKit2/ChangeLog        2013-05-08 08:06:00 UTC (rev 149720)
</span><span class="lines">@@ -1,5 +1,34 @@
</span><span class="cx"> 2013-05-08  Zan Dobersek  &lt;zdobersek@igalia.com&gt;
</span><span class="cx"> 
</span><ins>+        [WK2] Make the WebNetworkInfoManager a supplement to the WebProcess
+        https://bugs.webkit.org/show_bug.cgi?id=115716
+
+        Reviewed by Andreas Kling.
+
+        WebNetworkInfoManager should inherit from WebProcessSupplement and should be used
+        as such by the WebProcess. This removes the need for the m_networkInfoManager member
+        variable in the WebProcess class and brings the WebNetworkInfoManager in line with
+        other manager classes of which instances are controlled by the WebProcess class.
+
+        * WebProcess/NetworkInfo/WebNetworkInfoManager.cpp:
+        (WebKit::WebNetworkInfoManager::supplementName): Specify the supplement's name.
+        (WebKit):
+        * WebProcess/NetworkInfo/WebNetworkInfoManager.h:
+        (WebKit): Alphabetically reorder the two forwarding declarations.
+        (WebNetworkInfoManager): Inherit from the WebProcessSupplement interface.
+        * WebProcess/WebCoreSupport/WebNetworkInfoClient.cpp:
+        (WebKit::WebNetworkInfoClient::bandwidth): Access the WebNetworkInfoManager as a supplement.
+        (WebKit::WebNetworkInfoClient::metered): Ditto.
+        (WebKit::WebNetworkInfoClient::startUpdating): Ditto.
+        (WebKit::WebNetworkInfoClient::stopUpdating): Ditto.
+        (WebKit::WebNetworkInfoClient::networkInfoControllerDestroyed): Ditto.
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::WebProcess): Add the WebNetworkInfoManager instance as a supplement.
+        * WebProcess/WebProcess.h:
+        (WebProcess): Remove the m_networkInfoManager member variable and its getter method.
+
+2013-05-08  Zan Dobersek  &lt;zdobersek@igalia.com&gt;
+
</ins><span class="cx">         [WK2] Make the WebBatteryManager a supplement to the WebProcess
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=115715
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessNetworkInfoWebNetworkInfoManagercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/NetworkInfo/WebNetworkInfoManager.cpp (149719 => 149720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/NetworkInfo/WebNetworkInfoManager.cpp        2013-05-08 08:02:28 UTC (rev 149719)
+++ trunk/Source/WebKit2/WebProcess/NetworkInfo/WebNetworkInfoManager.cpp        2013-05-08 08:06:00 UTC (rev 149720)
</span><span class="lines">@@ -40,6 +40,11 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><ins>+const char* WebNetworkInfoManager::supplementName()
+{
+    return &quot;WebNetworkInfoManager&quot;;
+}
+
</ins><span class="cx"> WebNetworkInfoManager::WebNetworkInfoManager(WebProcess* process)
</span><span class="cx">     : m_process(process)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessNetworkInfoWebNetworkInfoManagerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/NetworkInfo/WebNetworkInfoManager.h (149719 => 149720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/NetworkInfo/WebNetworkInfoManager.h        2013-05-08 08:02:28 UTC (rev 149719)
+++ trunk/Source/WebKit2/WebProcess/NetworkInfo/WebNetworkInfoManager.h        2013-05-08 08:06:00 UTC (rev 149720)
</span><span class="lines">@@ -31,21 +31,24 @@
</span><span class="cx"> #include &quot;MessageReceiver.h&quot;
</span><span class="cx"> #include &quot;WebCoreArgumentCoders.h&quot;
</span><span class="cx"> #include &quot;WebNetworkInfo.h&quot;
</span><ins>+#include &quot;WebProcessSupplement.h&quot;
</ins><span class="cx"> #include &lt;wtf/HashSet.h&gt;
</span><span class="cx"> #include &lt;wtf/Noncopyable.h&gt;
</span><span class="cx"> #include &lt;wtf/text/AtomicString.h&gt;
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><ins>+class WebPage;
</ins><span class="cx"> class WebProcess;
</span><del>-class WebPage;
</del><span class="cx"> 
</span><del>-class WebNetworkInfoManager : private CoreIPC::MessageReceiver {
</del><ins>+class WebNetworkInfoManager : public WebProcessSupplement, private CoreIPC::MessageReceiver {
</ins><span class="cx">     WTF_MAKE_NONCOPYABLE(WebNetworkInfoManager);
</span><span class="cx"> public:
</span><span class="cx">     explicit WebNetworkInfoManager(WebProcess*);
</span><span class="cx">     ~WebNetworkInfoManager();
</span><span class="cx"> 
</span><ins>+    static const char* supplementName();
+
</ins><span class="cx">     void registerWebPage(WebPage*);
</span><span class="cx">     void unregisterWebPage(WebPage*);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebNetworkInfoClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebNetworkInfoClient.cpp (149719 => 149720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebNetworkInfoClient.cpp        2013-05-08 08:02:28 UTC (rev 149719)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebNetworkInfoClient.cpp        2013-05-08 08:06:00 UTC (rev 149720)
</span><span class="lines">@@ -40,27 +40,27 @@
</span><span class="cx"> 
</span><span class="cx"> double WebNetworkInfoClient::bandwidth() const
</span><span class="cx"> {
</span><del>-    return WebProcess::shared().networkInfoManager().bandwidth(m_page);
</del><ins>+    return WebProcess::shared().supplement&lt;WebNetworkInfoManager&gt;()-&gt;bandwidth(m_page);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool WebNetworkInfoClient::metered() const
</span><span class="cx"> {
</span><del>-    return WebProcess::shared().networkInfoManager().metered(m_page);
</del><ins>+    return WebProcess::shared().supplement&lt;WebNetworkInfoManager&gt;()-&gt;metered(m_page);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebNetworkInfoClient::startUpdating()
</span><span class="cx"> {
</span><del>-    WebProcess::shared().networkInfoManager().registerWebPage(m_page);
</del><ins>+    WebProcess::shared().supplement&lt;WebNetworkInfoManager&gt;()-&gt;registerWebPage(m_page);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebNetworkInfoClient::stopUpdating()
</span><span class="cx"> {
</span><del>-    WebProcess::shared().networkInfoManager().unregisterWebPage(m_page);
</del><ins>+    WebProcess::shared().supplement&lt;WebNetworkInfoManager&gt;()-&gt;unregisterWebPage(m_page);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebNetworkInfoClient::networkInfoControllerDestroyed()
</span><span class="cx"> {
</span><del>-    WebProcess::shared().networkInfoManager().unregisterWebPage(m_page);
</del><ins>+    WebProcess::shared().supplement&lt;WebNetworkInfoManager&gt;()-&gt;unregisterWebPage(m_page);
</ins><span class="cx">     delete this;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (149719 => 149720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2013-05-08 08:02:28 UTC (rev 149719)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2013-05-08 08:06:00 UTC (rev 149720)
</span><span class="lines">@@ -86,6 +86,7 @@
</span><span class="cx"> #include &lt;wtf/text/StringHash.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETWORK_INFO)
</span><ins>+#include &quot;WebNetworkInfoManager.h&quot;
</ins><span class="cx"> #include &quot;WebNetworkInfoManagerMessages.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -164,9 +165,6 @@
</span><span class="cx">     , m_networkAccessManager(0)
</span><span class="cx"> #endif
</span><span class="cx">     , m_textCheckerState()
</span><del>-#if ENABLE(NETWORK_INFO)
-    , m_networkInfoManager(this)
-#endif
</del><span class="cx">     , m_iconDatabaseProxy(new WebIconDatabaseProxy(this))
</span><span class="cx"> #if ENABLE(NETWORK_PROCESS)
</span><span class="cx">     , m_usesNetworkProcess(false)
</span><span class="lines">@@ -211,6 +209,9 @@
</span><span class="cx"> #if ENABLE(BATTERY_STATUS)
</span><span class="cx">     addSupplement&lt;WebBatteryManager&gt;();
</span><span class="cx"> #endif
</span><ins>+#if ENABLE(NETWORK_INFO)
+    addSupplement&lt;WebNetworkInfoManager&gt;();
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebProcess::initializeProcess(const ChildProcessInitializationParameters&amp; parameters)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.h (149719 => 149720)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.h        2013-05-08 08:02:28 UTC (rev 149719)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.h        2013-05-08 08:06:00 UTC (rev 149720)
</span><span class="lines">@@ -57,10 +57,6 @@
</span><span class="cx"> #include &lt;dispatch/dispatch.h&gt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(NETWORK_INFO)
-#include &quot;WebNetworkInfoManager.h&quot;
-#endif
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx"> class PageGroup;
</span><span class="cx"> class ResourceRequest;
</span><span class="lines">@@ -148,9 +144,6 @@
</span><span class="cx"> #if PLATFORM(QT)
</span><span class="cx">     QNetworkAccessManager* networkAccessManager() { return m_networkAccessManager; }
</span><span class="cx"> #endif
</span><del>-#if ENABLE(NETWORK_INFO)
-    WebNetworkInfoManager&amp; networkInfoManager() { return m_networkInfoManager; }
-#endif
</del><span class="cx"> #if USE(SOUP)
</span><span class="cx">     WebSoupRequestManager&amp; soupRequestManager() { return m_soupRequestManager; }
</span><span class="cx"> #endif
</span><span class="lines">@@ -310,9 +303,6 @@
</span><span class="cx"> 
</span><span class="cx">     TextCheckerState m_textCheckerState;
</span><span class="cx"> 
</span><del>-#if ENABLE(NETWORK_INFO)
-    WebNetworkInfoManager m_networkInfoManager;
-#endif
</del><span class="cx">     WebIconDatabaseProxy* m_iconDatabaseProxy;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(NETWORK_PROCESS)
</span></span></pre>
</div>
</div>

</body>
</html>