diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2013-09-17 11:01:33 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-19 20:50:05 +0200 |
commit | 2925efd2fcef1f8b9fd48979144877c1a5ec214b (patch) | |
tree | 5e0720412202468499c2bd41d4ec8d5952618f8a /Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp | |
parent | 4ff1d0e1e73e6467aeed9313afe09ec6ece4884d (diff) | |
download | qtwebkit-2925efd2fcef1f8b9fd48979144877c1a5ec214b.tar.gz |
Remove C++11 requirement in WebKit2
Removes all use of C++11 specific features in WebKit2. This consists of
template<S<T>> syntax, a few uses of auto, and a single use of std::move.
Change-Id: I1bbd356c430802caf5f7440cd0d3bb2ba49ed098
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp')
-rw-r--r-- | Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp b/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp index 9e462af9b..5bb3db5f7 100644 --- a/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp +++ b/Source/WebKit2/UIProcess/Notifications/WebNotificationManagerProxy.cpp @@ -118,7 +118,7 @@ void WebNotificationManagerProxy::cancel(WebPageProxy* webPage, uint64_t pageNot void WebNotificationManagerProxy::didDestroyNotification(WebPageProxy* webPage, uint64_t pageNotificationID) { - auto globalIDNotificationPair = m_notifications.take(make_pair(webPage->pageID(), pageNotificationID)); + pair<uint64_t, RefPtr<WebNotification> > globalIDNotificationPair = m_notifications.take(make_pair(webPage->pageID(), pageNotificationID)); if (uint64_t globalNotificationID = globalIDNotificationPair.first) { WebNotification* notification = globalIDNotificationPair.second.get(); m_globalNotificationMap.remove(globalNotificationID); @@ -153,19 +153,28 @@ void WebNotificationManagerProxy::clearNotifications(WebPageProxy* webPage, cons Vector<uint64_t> globalNotificationIDs; globalNotificationIDs.reserveCapacity(m_globalNotificationMap.size()); - for (auto it = m_notifications.begin(), end = m_notifications.end(); it != end; ++it) { - uint64_t webPageID = it->key.first; - uint64_t pageNotificationID = it->key.second; - if (!filterFunction(webPageID, pageNotificationID, targetPageID, pageNotificationIDs)) - continue; - - uint64_t globalNotificationID = it->value.first; - globalNotificationIDs.append(globalNotificationID); + { + HashMap<pair<uint64_t, uint64_t>, pair<uint64_t, RefPtr<WebNotification> > >::iterator it = m_notifications.begin(); + HashMap<pair<uint64_t, uint64_t>, pair<uint64_t, RefPtr<WebNotification> > >::iterator end = m_notifications.end(); + for (; it != end; ++it) { + uint64_t webPageID = it->key.first; + uint64_t pageNotificationID = it->key.second; + if (!filterFunction(webPageID, pageNotificationID, targetPageID, pageNotificationIDs)) + continue; + + uint64_t globalNotificationID = it->value.first; + globalNotificationIDs.append(globalNotificationID); + } } - for (auto it = globalNotificationIDs.begin(), end = globalNotificationIDs.end(); it != end; ++it) { - auto pageNotification = m_globalNotificationMap.take(*it); - m_notifications.remove(pageNotification); + + { + Vector<uint64_t>::iterator it = globalNotificationIDs.begin(); + Vector<uint64_t>::iterator end = globalNotificationIDs.end(); + for (; it != end; ++it) { + pair<uint64_t, uint64_t> pageNotification = m_globalNotificationMap.take(*it); + m_notifications.remove(pageNotification); + } } m_provider.clearNotifications(globalNotificationIDs); @@ -173,7 +182,7 @@ void WebNotificationManagerProxy::clearNotifications(WebPageProxy* webPage, cons void WebNotificationManagerProxy::providerDidShowNotification(uint64_t globalNotificationID) { - auto it = m_globalNotificationMap.find(globalNotificationID); + HashMap<uint64_t, pair<uint64_t, uint64_t> >::iterator it = m_globalNotificationMap.find(globalNotificationID); if (it == m_globalNotificationMap.end()) return; @@ -188,7 +197,7 @@ void WebNotificationManagerProxy::providerDidShowNotification(uint64_t globalNot void WebNotificationManagerProxy::providerDidClickNotification(uint64_t globalNotificationID) { - auto it = m_globalNotificationMap.find(globalNotificationID); + HashMap<uint64_t, pair<uint64_t, uint64_t> >::iterator it = m_globalNotificationMap.find(globalNotificationID); if (it == m_globalNotificationMap.end()) return; @@ -204,16 +213,16 @@ void WebNotificationManagerProxy::providerDidClickNotification(uint64_t globalNo void WebNotificationManagerProxy::providerDidCloseNotifications(ImmutableArray* globalNotificationIDs) { - HashMap<WebPageProxy*, Vector<uint64_t>> pageNotificationIDs; + HashMap<WebPageProxy*, Vector<uint64_t> > pageNotificationIDs; size_t size = globalNotificationIDs->size(); for (size_t i = 0; i < size; ++i) { - auto it = m_globalNotificationMap.find(globalNotificationIDs->at<WebUInt64>(i)->value()); + HashMap<uint64_t, pair<uint64_t, uint64_t> >::iterator it = m_globalNotificationMap.find(globalNotificationIDs->at<WebUInt64>(i)->value()); if (it == m_globalNotificationMap.end()) continue; if (WebPageProxy* webPage = WebProcessProxy::webPage(it->value.first)) { - auto pageIt = pageNotificationIDs.find(webPage); + HashMap<WebPageProxy*, Vector<uint64_t> >::iterator pageIt = pageNotificationIDs.find(webPage); if (pageIt == pageNotificationIDs.end()) { Vector<uint64_t> newVector; newVector.reserveInitialCapacity(size); @@ -228,7 +237,7 @@ void WebNotificationManagerProxy::providerDidCloseNotifications(ImmutableArray* m_globalNotificationMap.remove(it); } - for (auto it = pageNotificationIDs.begin(), end = pageNotificationIDs.end(); it != end; ++it) + for (HashMap<WebPageProxy*, Vector<uint64_t> >::iterator it = pageNotificationIDs.begin(), end = pageNotificationIDs.end(); it != end; ++it) it->key->process()->send(Messages::WebNotificationManager::DidCloseNotifications(it->value), 0); } |