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

Side by Side Diff: Source/core/inspector/InspectorProfilerAgent.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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Google Inc. All rights reserved. 3 * Copyright (C) 2010 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 void InspectorProfilerAgent::idleFinished() 257 void InspectorProfilerAgent::idleFinished()
258 { 258 {
259 if (!m_profileNameIdleTimeMap || !m_profileNameIdleTimeMap->size()) 259 if (!m_profileNameIdleTimeMap || !m_profileNameIdleTimeMap->size())
260 return; 260 return;
261 ScriptProfiler::setIdle(false); 261 ScriptProfiler::setIdle(false);
262 if (!m_idleStartTime) 262 if (!m_idleStartTime)
263 return; 263 return;
264 264
265 double idleTime = WTF::monotonicallyIncreasingTime() - m_idleStartTime; 265 double idleTime = WTF::monotonicallyIncreasingTime() - m_idleStartTime;
266 m_idleStartTime = 0.0; 266 m_idleStartTime = 0.0;
267 ProfileNameIdleTimeMap::iterator end = m_profileNameIdleTimeMap->end(); 267 for (auto& map : *m_profileNameIdleTimeMap)
268 for (ProfileNameIdleTimeMap::iterator it = m_profileNameIdleTimeMap->begin() ; it != end; ++it) 268 map.value += idleTime;
269 it->value += idleTime;
270 } 269 }
271 270
272 void InspectorProfilerAgent::idleStarted() 271 void InspectorProfilerAgent::idleStarted()
273 { 272 {
274 if (!m_profileNameIdleTimeMap || !m_profileNameIdleTimeMap->size()) 273 if (!m_profileNameIdleTimeMap || !m_profileNameIdleTimeMap->size())
275 return; 274 return;
276 m_idleStartTime = WTF::monotonicallyIncreasingTime(); 275 m_idleStartTime = WTF::monotonicallyIncreasingTime();
277 ScriptProfiler::setIdle(true); 276 ScriptProfiler::setIdle(true);
278 } 277 }
279 278
(...skipping 18 matching lines...) Expand all
298 } 297 }
299 298
300 void InspectorProfilerAgent::trace(Visitor* visitor) 299 void InspectorProfilerAgent::trace(Visitor* visitor)
301 { 300 {
302 visitor->trace(m_injectedScriptManager); 301 visitor->trace(m_injectedScriptManager);
303 InspectorBaseAgent::trace(visitor); 302 InspectorBaseAgent::trace(visitor);
304 } 303 }
305 304
306 } // namespace blink 305 } // namespace blink
307 306
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorPageAgent.cpp ('k') | Source/core/inspector/InspectorResourceAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698