Title: [137804] trunk/Source/WebKit2
- Revision
- 137804
- Author
- [email protected]
- Date
- 2012-12-15 12:35:53 -0800 (Sat, 15 Dec 2012)
Log Message
Get rid of DownloadProxyMap::downloads()
https://bugs.webkit.org/show_bug.cgi?id=105100
Reviewed by Sam Weinig.
Add the needed member functions to DownloadProxyMap and remove the downloads() member function.
* UIProcess/Downloads/DownloadProxyMap.cpp:
(WebKit::DownloadProxyMap::downloadFinished):
(WebKit::DownloadProxyMap::processDidClose):
(WebKit):
* UIProcess/Downloads/DownloadProxyMap.h:
(WebKit::DownloadProxyMap::isEmpty):
(DownloadProxyMap):
* UIProcess/WebContext.cpp:
(WebKit::WebContext::shouldTerminate):
(WebKit::WebContext::disconnectProcess):
(WebKit::WebContext::downloadFinished):
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (137803 => 137804)
--- trunk/Source/WebKit2/ChangeLog 2012-12-15 20:26:40 UTC (rev 137803)
+++ trunk/Source/WebKit2/ChangeLog 2012-12-15 20:35:53 UTC (rev 137804)
@@ -1,3 +1,24 @@
+2012-12-15 Anders Carlsson <[email protected]>
+
+ Get rid of DownloadProxyMap::downloads()
+ https://bugs.webkit.org/show_bug.cgi?id=105100
+
+ Reviewed by Sam Weinig.
+
+ Add the needed member functions to DownloadProxyMap and remove the downloads() member function.
+
+ * UIProcess/Downloads/DownloadProxyMap.cpp:
+ (WebKit::DownloadProxyMap::downloadFinished):
+ (WebKit::DownloadProxyMap::processDidClose):
+ (WebKit):
+ * UIProcess/Downloads/DownloadProxyMap.h:
+ (WebKit::DownloadProxyMap::isEmpty):
+ (DownloadProxyMap):
+ * UIProcess/WebContext.cpp:
+ (WebKit::WebContext::shouldTerminate):
+ (WebKit::WebContext::disconnectProcess):
+ (WebKit::WebContext::downloadFinished):
+
2012-12-15 Sam Weinig <[email protected]>
Move calculation of caches sizes based on the cache model to CacheModel.h/cpp
Modified: trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxyMap.cpp (137803 => 137804)
--- trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxyMap.cpp 2012-12-15 20:26:40 UTC (rev 137803)
+++ trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxyMap.cpp 2012-12-15 20:35:53 UTC (rev 137804)
@@ -52,7 +52,20 @@
{
ASSERT(m_downloads.contains(downloadProxy->downloadID()));
+ downloadProxy->invalidate();
+
m_downloads.remove(downloadProxy->downloadID());
}
+void DownloadProxyMap::processDidClose()
+{
+ // Invalidate all outstanding downloads.
+ for (HashMap<uint64_t, RefPtr<DownloadProxy> >::iterator::Values it = m_downloads.begin().values(), end = m_downloads.end().values(); it != end; ++it) {
+ (*it)->processDidClose();
+ (*it)->invalidate();
+ }
+
+ m_downloads.clear();
+}
+
} // namespace WebKit
Modified: trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxyMap.h (137803 => 137804)
--- trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxyMap.h 2012-12-15 20:26:40 UTC (rev 137803)
+++ trunk/Source/WebKit2/UIProcess/Downloads/DownloadProxyMap.h 2012-12-15 20:35:53 UTC (rev 137804)
@@ -45,9 +45,10 @@
DownloadProxy* createDownloadProxy(WebContext*);
void downloadFinished(DownloadProxy*);
- // FIXME: Don't fully expose the downloads map like this.
- HashMap<uint64_t, RefPtr<DownloadProxy> >& downloads() { return m_downloads; }
+ bool isEmpty() const { return m_downloads.isEmpty(); }
+ void processDidClose();
+
private:
HashMap<uint64_t, RefPtr<DownloadProxy> > m_downloads;
};
Modified: trunk/Source/WebKit2/UIProcess/WebContext.cpp (137803 => 137804)
--- trunk/Source/WebKit2/UIProcess/WebContext.cpp 2012-12-15 20:26:40 UTC (rev 137803)
+++ trunk/Source/WebKit2/UIProcess/WebContext.cpp 2012-12-15 20:35:53 UTC (rev 137804)
@@ -537,7 +537,7 @@
if (!m_processTerminationEnabled)
return false;
- if (!m_downloads.downloads().isEmpty())
+ if (!m_downloads.isEmpty())
return false;
if (!m_applicationCacheManagerProxy->shouldTerminate(process))
@@ -599,14 +599,8 @@
return;
}
- // Invalidate all outstanding downloads.
- for (HashMap<uint64_t, RefPtr<DownloadProxy> >::iterator::Values it = m_downloads.downloads().begin().values(), end = m_downloads.downloads().end().values(); it != end; ++it) {
- (*it)->processDidClose();
- (*it)->invalidate();
- }
+ m_downloads.processDidClose();
- m_downloads.downloads().clear();
-
m_applicationCacheManagerProxy->invalidate();
#if ENABLE(BATTERY_STATUS)
m_batteryManagerProxy->invalidate();
@@ -842,9 +836,9 @@
void WebContext::downloadFinished(DownloadProxy* downloadProxy)
{
- downloadProxy->invalidate();
+ m_downloads.downloadFinished(downloadProxy);
+
removeMessageReceiver(Messages::DownloadProxy::messageReceiverName(), downloadProxy->downloadID());
- m_downloads.downloads().remove(downloadProxy->downloadID());
}
// FIXME: This is not the ideal place for this function.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes