| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |