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

Unified Diff: Source/core/inspector/InspectorDebuggerAgent.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/InspectorDOMDebuggerAgent.cpp ('k') | Source/core/inspector/InspectorInputAgent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/InspectorDebuggerAgent.cpp
diff --git a/Source/core/inspector/InspectorDebuggerAgent.cpp b/Source/core/inspector/InspectorDebuggerAgent.cpp
index 110f6c63a7aa19d987c8573f9855789b0239d042..ab3e5f4927bee4d1f7e9621092e41627a27004d7 100644
--- a/Source/core/inspector/InspectorDebuggerAgent.cpp
+++ b/Source/core/inspector/InspectorDebuggerAgent.cpp
@@ -380,10 +380,10 @@ void InspectorDebuggerAgent::setBreakpointByUrl(ErrorString* errorString, int li
m_state->setObject(DebuggerAgentState::javaScriptBreakpoints, breakpointsCookie);
ScriptBreakpoint breakpoint(lineNumber, columnNumber, condition);
- for (ScriptsMap::iterator it = m_scripts.begin(); it != m_scripts.end(); ++it) {
- if (!matches(it->value.sourceURL(), url, isRegex))
+ for (auto& script : m_scripts) {
+ if (!matches(script.value.sourceURL(), url, isRegex))
continue;
- RefPtr<TypeBuilder::Debugger::Location> location = resolveBreakpoint(breakpointId, it->key, breakpoint, UserBreakpointSource);
+ RefPtr<TypeBuilder::Debugger::Location> location = resolveBreakpoint(breakpointId, script.key, breakpoint, UserBreakpointSource);
if (location)
locations->addItem(location);
}
@@ -1383,8 +1383,8 @@ void InspectorDebuggerAgent::didParseSource(const String& scriptId, const Script
return;
RefPtr<JSONObject> breakpointsCookie = m_state->getObject(DebuggerAgentState::javaScriptBreakpoints);
- for (JSONObject::iterator it = breakpointsCookie->begin(); it != breakpointsCookie->end(); ++it) {
- RefPtr<JSONObject> breakpointObject = it->value->asObject();
+ for (auto& cookie : *breakpointsCookie) {
+ RefPtr<JSONObject> breakpointObject = cookie.value->asObject();
bool isRegex;
breakpointObject->getBoolean(DebuggerAgentState::isRegex, &isRegex);
String url;
@@ -1395,9 +1395,9 @@ void InspectorDebuggerAgent::didParseSource(const String& scriptId, const Script
breakpointObject->getNumber(DebuggerAgentState::lineNumber, &breakpoint.lineNumber);
breakpointObject->getNumber(DebuggerAgentState::columnNumber, &breakpoint.columnNumber);
breakpointObject->getString(DebuggerAgentState::condition, &breakpoint.condition);
- RefPtr<TypeBuilder::Debugger::Location> location = resolveBreakpoint(it->key, scriptId, breakpoint, UserBreakpointSource);
+ RefPtr<TypeBuilder::Debugger::Location> location = resolveBreakpoint(cookie.key, scriptId, breakpoint, UserBreakpointSource);
if (location)
- m_frontend->breakpointResolved(it->key, location);
+ m_frontend->breakpointResolved(cookie.key, location);
}
}
@@ -1437,8 +1437,8 @@ ScriptDebugListener::SkipPauseRequest InspectorDebuggerAgent::didPause(ScriptSta
RefPtr<Array<String> > hitBreakpointIds = Array<String>::create();
- for (Vector<String>::const_iterator i = hitBreakpoints.begin(); i != hitBreakpoints.end(); ++i) {
- DebugServerBreakpointToBreakpointIdAndSourceMap::iterator breakpointIterator = m_serverBreakpoints.find(*i);
+ for (const auto& point : hitBreakpoints) {
+ DebugServerBreakpointToBreakpointIdAndSourceMap::iterator breakpointIterator = m_serverBreakpoints.find(point);
if (breakpointIterator != m_serverBreakpoints.end()) {
const String& localId = breakpointIterator->value.first;
hitBreakpointIds->addItem(localId);
« no previous file with comments | « Source/core/inspector/InspectorDOMDebuggerAgent.cpp ('k') | Source/core/inspector/InspectorInputAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698