Chromium Code Reviews| 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 14 matching lines...) Expand all Loading... | |
| 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 */ | 28 */ |
| 29 | 29 |
| 30 #include "config.h" | 30 #include "config.h" |
| 31 #include "core/inspector/InspectorProfilerAgent.h" | 31 #include "core/inspector/InspectorProfilerAgent.h" |
| 32 | 32 |
| 33 #include "bindings/core/v8/ScriptCallStackFactory.h" | 33 #include "bindings/core/v8/ScriptCallStackFactory.h" |
| 34 #include "bindings/core/v8/ScriptProfiler.h" | 34 #include "bindings/core/v8/ScriptProfiler.h" |
| 35 #include "core/dom/ExecutionContext.h" | |
|
yurys
2014/08/01 13:06:40
You don't seem to need this include, forward decla
loislo
2014/08/01 13:32:32
Done.
| |
| 36 #include "core/frame/ConsoleTypes.h" | |
| 37 #include "core/frame/UseCounter.h" | |
| 35 #include "core/inspector/InjectedScript.h" | 38 #include "core/inspector/InjectedScript.h" |
| 36 #include "core/inspector/InjectedScriptHost.h" | 39 #include "core/inspector/InjectedScriptHost.h" |
| 37 #include "core/inspector/InspectorOverlay.h" | 40 #include "core/inspector/InspectorOverlay.h" |
| 38 #include "core/inspector/InspectorState.h" | 41 #include "core/inspector/InspectorState.h" |
| 39 #include "core/inspector/InstrumentingAgents.h" | 42 #include "core/inspector/InstrumentingAgents.h" |
| 40 #include "core/inspector/ScriptCallStack.h" | 43 #include "core/inspector/ScriptCallStack.h" |
| 41 #include "core/inspector/ScriptProfile.h" | 44 #include "core/inspector/ScriptProfile.h" |
| 42 #include "core/frame/ConsoleTypes.h" | |
| 43 #include "wtf/CurrentTime.h" | 45 #include "wtf/CurrentTime.h" |
| 44 #include "wtf/text/StringConcatenate.h" | 46 #include "wtf/text/StringConcatenate.h" |
| 45 | 47 |
| 46 namespace blink { | 48 namespace blink { |
| 47 | 49 |
| 48 namespace ProfilerAgentState { | 50 namespace ProfilerAgentState { |
| 49 static const char samplingInterval[] = "samplingInterval"; | 51 static const char samplingInterval[] = "samplingInterval"; |
| 50 static const char userInitiatedProfiling[] = "userInitiatedProfiling"; | 52 static const char userInitiatedProfiling[] = "userInitiatedProfiling"; |
| 51 static const char profilerEnabled[] = "profilerEnabled"; | 53 static const char profilerEnabled[] = "profilerEnabled"; |
| 52 static const char nextProfileId[] = "nextProfileId"; | 54 static const char nextProfileId[] = "nextProfileId"; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 96 , m_profileNameIdleTimeMap(ScriptProfiler::currentProfileNameIdleTimeMap()) | 98 , m_profileNameIdleTimeMap(ScriptProfiler::currentProfileNameIdleTimeMap()) |
| 97 , m_idleStartTime(0.0) | 99 , m_idleStartTime(0.0) |
| 98 , m_overlay(overlay) | 100 , m_overlay(overlay) |
| 99 { | 101 { |
| 100 } | 102 } |
| 101 | 103 |
| 102 InspectorProfilerAgent::~InspectorProfilerAgent() | 104 InspectorProfilerAgent::~InspectorProfilerAgent() |
| 103 { | 105 { |
| 104 } | 106 } |
| 105 | 107 |
| 106 void InspectorProfilerAgent::consoleProfile(const String& title, ScriptState* sc riptState) | 108 void InspectorProfilerAgent::consoleProfile(ExecutionContext* context, const Str ing& title, ScriptState* scriptState) |
| 107 { | 109 { |
| 110 UseCounter::count(context, UseCounter::DevToolsConsoleProfile); | |
| 108 ASSERT(m_frontend && enabled()); | 111 ASSERT(m_frontend && enabled()); |
| 109 String id = nextProfileId(); | 112 String id = nextProfileId(); |
| 110 m_startedProfiles.append(ProfileDescriptor(id, title)); | 113 m_startedProfiles.append(ProfileDescriptor(id, title)); |
| 111 ScriptProfiler::start(id); | 114 ScriptProfiler::start(id); |
| 112 m_frontend->consoleProfileStarted(id, currentDebugLocation(scriptState), tit le.isNull() ? 0 : &title); | 115 m_frontend->consoleProfileStarted(id, currentDebugLocation(scriptState), tit le.isNull() ? 0 : &title); |
| 113 } | 116 } |
| 114 | 117 |
| 115 void InspectorProfilerAgent::consoleProfileEnd(const String& title, ScriptState* scriptState) | 118 void InspectorProfilerAgent::consoleProfileEnd(const String& title, ScriptState* scriptState) |
| 116 { | 119 { |
| 117 ASSERT(m_frontend && enabled()); | 120 ASSERT(m_frontend && enabled()); |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 296 } | 299 } |
| 297 | 300 |
| 298 void InspectorProfilerAgent::trace(Visitor* visitor) | 301 void InspectorProfilerAgent::trace(Visitor* visitor) |
| 299 { | 302 { |
| 300 visitor->trace(m_injectedScriptManager); | 303 visitor->trace(m_injectedScriptManager); |
| 301 InspectorBaseAgent::trace(visitor); | 304 InspectorBaseAgent::trace(visitor); |
| 302 } | 305 } |
| 303 | 306 |
| 304 } // namespace blink | 307 } // namespace blink |
| 305 | 308 |
| OLD | NEW |