| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/v8_inspector/V8ProfilerAgentImpl.h" | 5 #include "platform/v8_inspector/V8ProfilerAgentImpl.h" |
| 6 | 6 |
| 7 #include "platform/v8_inspector/Atomics.h" | 7 #include "platform/v8_inspector/Atomics.h" |
| 8 #include "platform/v8_inspector/V8DebuggerImpl.h" | 8 #include "platform/v8_inspector/V8DebuggerImpl.h" |
| 9 #include "platform/v8_inspector/V8StackTraceImpl.h" | 9 #include "platform/v8_inspector/V8StackTraceImpl.h" |
| 10 #include "platform/v8_inspector/V8StringUtil.h" | 10 #include "platform/v8_inspector/V8StringUtil.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 startProfiling(id); | 146 startProfiling(id); |
| 147 m_frontend->consoleProfileStarted(id, currentDebugLocation(m_debugger), titl
e); | 147 m_frontend->consoleProfileStarted(id, currentDebugLocation(m_debugger), titl
e); |
| 148 } | 148 } |
| 149 | 149 |
| 150 void V8ProfilerAgentImpl::consoleProfileEnd(const String16& title) | 150 void V8ProfilerAgentImpl::consoleProfileEnd(const String16& title) |
| 151 { | 151 { |
| 152 ASSERT(m_frontend && m_enabled); | 152 ASSERT(m_frontend && m_enabled); |
| 153 String16 id; | 153 String16 id; |
| 154 String16 resolvedTitle; | 154 String16 resolvedTitle; |
| 155 // Take last started profile if no title was passed. | 155 // Take last started profile if no title was passed. |
| 156 if (title.isNull()) { | 156 if (title.isEmpty()) { |
| 157 if (m_startedProfiles.isEmpty()) | 157 if (m_startedProfiles.isEmpty()) |
| 158 return; | 158 return; |
| 159 id = m_startedProfiles.last().m_id; | 159 id = m_startedProfiles.last().m_id; |
| 160 resolvedTitle = m_startedProfiles.last().m_title; | 160 resolvedTitle = m_startedProfiles.last().m_title; |
| 161 m_startedProfiles.removeLast(); | 161 m_startedProfiles.removeLast(); |
| 162 } else { | 162 } else { |
| 163 for (size_t i = 0; i < m_startedProfiles.size(); i++) { | 163 for (size_t i = 0; i < m_startedProfiles.size(); i++) { |
| 164 if (m_startedProfiles[i].m_title == title) { | 164 if (m_startedProfiles[i].m_title == title) { |
| 165 resolvedTitle = title; | 165 resolvedTitle = title; |
| 166 id = m_startedProfiles[i].m_id; | 166 id = m_startedProfiles[i].m_id; |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 } | 292 } |
| 293 | 293 |
| 294 void V8ProfilerAgentImpl::idleStarted() | 294 void V8ProfilerAgentImpl::idleStarted() |
| 295 { | 295 { |
| 296 if (!isRecording()) | 296 if (!isRecording()) |
| 297 return; | 297 return; |
| 298 m_isolate->GetCpuProfiler()->SetIdle(true); | 298 m_isolate->GetCpuProfiler()->SetIdle(true); |
| 299 } | 299 } |
| 300 | 300 |
| 301 } // namespace blink | 301 } // namespace blink |
| OLD | NEW |