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

Side by Side Diff: Source/core/inspector/InspectorProfilerAgent.cpp

Issue 436873002: DevTools: count the number of consoleProfile and consoleTimeline calls. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: comments addressed Created 6 years, 4 months 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/inspector/InspectorProfilerAgent.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 14 matching lines...) Expand all
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/frame/ConsoleTypes.h"
36 #include "core/frame/UseCounter.h"
35 #include "core/inspector/InjectedScript.h" 37 #include "core/inspector/InjectedScript.h"
36 #include "core/inspector/InjectedScriptHost.h" 38 #include "core/inspector/InjectedScriptHost.h"
37 #include "core/inspector/InspectorOverlay.h" 39 #include "core/inspector/InspectorOverlay.h"
38 #include "core/inspector/InspectorState.h" 40 #include "core/inspector/InspectorState.h"
39 #include "core/inspector/InstrumentingAgents.h" 41 #include "core/inspector/InstrumentingAgents.h"
40 #include "core/inspector/ScriptCallStack.h" 42 #include "core/inspector/ScriptCallStack.h"
41 #include "core/inspector/ScriptProfile.h" 43 #include "core/inspector/ScriptProfile.h"
42 #include "core/frame/ConsoleTypes.h"
43 #include "wtf/CurrentTime.h" 44 #include "wtf/CurrentTime.h"
44 #include "wtf/text/StringConcatenate.h" 45 #include "wtf/text/StringConcatenate.h"
45 46
46 namespace blink { 47 namespace blink {
47 48
48 namespace ProfilerAgentState { 49 namespace ProfilerAgentState {
49 static const char samplingInterval[] = "samplingInterval"; 50 static const char samplingInterval[] = "samplingInterval";
50 static const char userInitiatedProfiling[] = "userInitiatedProfiling"; 51 static const char userInitiatedProfiling[] = "userInitiatedProfiling";
51 static const char profilerEnabled[] = "profilerEnabled"; 52 static const char profilerEnabled[] = "profilerEnabled";
52 static const char nextProfileId[] = "nextProfileId"; 53 static const char nextProfileId[] = "nextProfileId";
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 , m_profileNameIdleTimeMap(ScriptProfiler::currentProfileNameIdleTimeMap()) 97 , m_profileNameIdleTimeMap(ScriptProfiler::currentProfileNameIdleTimeMap())
97 , m_idleStartTime(0.0) 98 , m_idleStartTime(0.0)
98 , m_overlay(overlay) 99 , m_overlay(overlay)
99 { 100 {
100 } 101 }
101 102
102 InspectorProfilerAgent::~InspectorProfilerAgent() 103 InspectorProfilerAgent::~InspectorProfilerAgent()
103 { 104 {
104 } 105 }
105 106
106 void InspectorProfilerAgent::consoleProfile(const String& title, ScriptState* sc riptState) 107 void InspectorProfilerAgent::consoleProfile(ExecutionContext* context, const Str ing& title, ScriptState* scriptState)
107 { 108 {
109 UseCounter::count(context, UseCounter::DevToolsConsoleProfile);
108 ASSERT(m_frontend && enabled()); 110 ASSERT(m_frontend && enabled());
109 String id = nextProfileId(); 111 String id = nextProfileId();
110 m_startedProfiles.append(ProfileDescriptor(id, title)); 112 m_startedProfiles.append(ProfileDescriptor(id, title));
111 ScriptProfiler::start(id); 113 ScriptProfiler::start(id);
112 m_frontend->consoleProfileStarted(id, currentDebugLocation(scriptState), tit le.isNull() ? 0 : &title); 114 m_frontend->consoleProfileStarted(id, currentDebugLocation(scriptState), tit le.isNull() ? 0 : &title);
113 } 115 }
114 116
115 void InspectorProfilerAgent::consoleProfileEnd(const String& title, ScriptState* scriptState) 117 void InspectorProfilerAgent::consoleProfileEnd(const String& title, ScriptState* scriptState)
116 { 118 {
117 ASSERT(m_frontend && enabled()); 119 ASSERT(m_frontend && enabled());
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 } 298 }
297 299
298 void InspectorProfilerAgent::trace(Visitor* visitor) 300 void InspectorProfilerAgent::trace(Visitor* visitor)
299 { 301 {
300 visitor->trace(m_injectedScriptManager); 302 visitor->trace(m_injectedScriptManager);
301 InspectorBaseAgent::trace(visitor); 303 InspectorBaseAgent::trace(visitor);
302 } 304 }
303 305
304 } // namespace blink 306 } // namespace blink
305 307
OLDNEW
« no previous file with comments | « Source/core/inspector/InspectorProfilerAgent.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698