Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(609)

Unified Diff: Source/core/inspector/NetworkResourcesData.cpp

Issue 800113002: Use C++11 range-based for loop in Source/core/inspector (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase again and again! Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/inspector/InspectorWorkerAgent.cpp ('k') | Source/core/inspector/PromiseTracker.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/NetworkResourcesData.cpp
diff --git a/Source/core/inspector/NetworkResourcesData.cpp b/Source/core/inspector/NetworkResourcesData.cpp
index 6efa2976305010f32371470086f73f024bed23a6..17ad7df62ec8b9cdb2932cce39aa6055586132ee 100644
--- a/Source/core/inspector/NetworkResourcesData.cpp
+++ b/Source/core/inspector/NetworkResourcesData.cpp
@@ -280,11 +280,9 @@ void NetworkResourcesData::setXHRReplayData(const String& requestId, XHRReplayDa
ResourceData* resourceData = resourceDataForRequestId(requestId);
if (!resourceData) {
Vector<String> result;
- ReusedRequestIds::iterator it;
- ReusedRequestIds::iterator end = m_reusedXHRReplayDataRequestIds.end();
- for (it = m_reusedXHRReplayDataRequestIds.begin(); it != end; ++it) {
- if (it->value == requestId)
- setXHRReplayData(it->key, xhrReplayData);
+ for (auto& request : m_reusedXHRReplayDataRequestIds) {
+ if (request.value == requestId)
+ setXHRReplayData(request.key, xhrReplayData);
}
return;
}
@@ -295,21 +293,19 @@ void NetworkResourcesData::setXHRReplayData(const String& requestId, XHRReplayDa
Vector<NetworkResourcesData::ResourceData*> NetworkResourcesData::resources()
{
Vector<ResourceData*> result;
- for (ResourceDataMap::iterator it = m_requestIdToResourceDataMap.begin(); it != m_requestIdToResourceDataMap.end(); ++it)
- result.append(it->value);
+ for (auto& request : m_requestIdToResourceDataMap)
+ result.append(request.value);
return result;
}
Vector<String> NetworkResourcesData::removeResource(Resource* cachedResource)
{
Vector<String> result;
- ResourceDataMap::iterator it;
- ResourceDataMap::iterator end = m_requestIdToResourceDataMap.end();
- for (it = m_requestIdToResourceDataMap.begin(); it != end; ++it) {
- ResourceData* resourceData = it->value;
+ for (auto& request : m_requestIdToResourceDataMap) {
+ ResourceData* resourceData = request.value;
if (resourceData->cachedResource() == cachedResource) {
resourceData->setResource(0);
- result.append(it->key);
+ result.append(request.key);
}
}
@@ -323,12 +319,10 @@ void NetworkResourcesData::clear(const String& preservedLoaderId)
ResourceDataMap preservedMap;
- ResourceDataMap::iterator it;
- ResourceDataMap::iterator end = m_requestIdToResourceDataMap.end();
- for (it = m_requestIdToResourceDataMap.begin(); it != end; ++it) {
- ResourceData* resourceData = it->value;
+ for (auto& resource : m_requestIdToResourceDataMap) {
+ ResourceData* resourceData = resource.value;
if (!preservedLoaderId.isNull() && resourceData->loaderId() == preservedLoaderId)
- preservedMap.set(it->key, it->value);
+ preservedMap.set(resource.key, resource.value);
else
delete resourceData;
}
« no previous file with comments | « Source/core/inspector/InspectorWorkerAgent.cpp ('k') | Source/core/inspector/PromiseTracker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698