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

Side by Side Diff: Source/core/inspector/InspectorConsoleAgent.h

Issue 24027002: DevTools: implement console.timeline/timelineEnd. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 27 matching lines...) Expand all
38 #include "wtf/text/StringHash.h" 38 #include "wtf/text/StringHash.h"
39 39
40 namespace WebCore { 40 namespace WebCore {
41 41
42 class ConsoleMessage; 42 class ConsoleMessage;
43 class DocumentLoader; 43 class DocumentLoader;
44 class DOMWindow; 44 class DOMWindow;
45 class Frame; 45 class Frame;
46 class InspectorFrontend; 46 class InspectorFrontend;
47 class InjectedScriptManager; 47 class InjectedScriptManager;
48 class InspectorTimelineAgent;
48 class InstrumentingAgents; 49 class InstrumentingAgents;
49 class ResourceError; 50 class ResourceError;
50 class ResourceLoader; 51 class ResourceLoader;
51 class ResourceResponse; 52 class ResourceResponse;
52 class ScriptArguments; 53 class ScriptArguments;
53 class ScriptCallStack; 54 class ScriptCallStack;
54 class ScriptProfile; 55 class ScriptProfile;
55 class ThreadableLoaderClient; 56 class ThreadableLoaderClient;
56 57
57 typedef String ErrorString; 58 typedef String ErrorString;
58 59
59 class InspectorConsoleAgent : public InspectorBaseAgent<InspectorConsoleAgent>, public InspectorBackendDispatcher::ConsoleCommandHandler { 60 class InspectorConsoleAgent : public InspectorBaseAgent<InspectorConsoleAgent>, public InspectorBackendDispatcher::ConsoleCommandHandler {
60 WTF_MAKE_NONCOPYABLE(InspectorConsoleAgent); 61 WTF_MAKE_NONCOPYABLE(InspectorConsoleAgent);
61 public: 62 public:
62 InspectorConsoleAgent(InstrumentingAgents*, InspectorCompositeState*, Inject edScriptManager*); 63 InspectorConsoleAgent(InstrumentingAgents*, InspectorTimelineAgent*, Inspect orCompositeState*, InjectedScriptManager*);
63 virtual ~InspectorConsoleAgent(); 64 virtual ~InspectorConsoleAgent();
64 65
65 virtual void enable(ErrorString*); 66 virtual void enable(ErrorString*);
66 virtual void disable(ErrorString*); 67 virtual void disable(ErrorString*);
67 virtual void clearMessages(ErrorString*); 68 virtual void clearMessages(ErrorString*);
68 bool enabled() { return m_enabled; } 69 bool enabled() { return m_enabled; }
69 void reset(); 70 void reset();
70 71
71 virtual void setFrontend(InspectorFrontend*); 72 virtual void setFrontend(InspectorFrontend*);
72 virtual void clearFrontend(); 73 virtual void clearFrontend();
73 virtual void restore(); 74 virtual void restore();
74 75
75 void addMessageToConsole(MessageSource, MessageType, MessageLevel, const Str ing& message, ScriptState*, PassRefPtr<ScriptArguments>, unsigned long requestId entifier = 0); 76 void addMessageToConsole(MessageSource, MessageType, MessageLevel, const Str ing& message, ScriptState*, PassRefPtr<ScriptArguments>, unsigned long requestId entifier = 0);
76 void addMessageToConsole(MessageSource, MessageType, MessageLevel, const Str ing& message, const String& scriptId, unsigned lineNumber, unsigned columnNumber = 0, ScriptState* = 0, unsigned long requestIdentifier = 0); 77 void addMessageToConsole(MessageSource, MessageType, MessageLevel, const Str ing& message, const String& scriptId, unsigned lineNumber, unsigned columnNumber = 0, ScriptState* = 0, unsigned long requestIdentifier = 0);
77 78
78 // FIXME: Remove once we no longer generate stacks outside of Inspector. 79 // FIXME: Remove once we no longer generate stacks outside of Inspector.
79 void addMessageToConsole(MessageSource, MessageType, MessageLevel, const Str ing& message, PassRefPtr<ScriptCallStack>, unsigned long requestIdentifier = 0); 80 void addMessageToConsole(MessageSource, MessageType, MessageLevel, const Str ing& message, PassRefPtr<ScriptCallStack>, unsigned long requestIdentifier = 0);
80 81
81 Vector<unsigned> consoleMessageArgumentCounts(); 82 Vector<unsigned> consoleMessageArgumentCounts();
82 83
83 void startConsoleTiming(ScriptExecutionContext*, const String& title); 84 void consoleTime(ScriptExecutionContext*, const String& title);
yurys 2013/09/06 07:56:45 Can you land this part separately?
pfeldman 2013/09/06 16:10:30 This is a simple rename in attempt to streamline c
84 void stopConsoleTiming(ScriptExecutionContext*, const String& title, PassRef Ptr<ScriptCallStack>); 85 void consoleTimeEnd(ScriptExecutionContext*, const String& title, ScriptStat e*);
caseq 2013/09/06 09:25:46 Do we need both ScriptState and ScriptExecutionCon
pfeldman 2013/09/06 16:10:30 Yes, those are different.
86 void consoleTimeline(ScriptExecutionContext*, const String& title, ScriptSta te*);
87 void consoleTimelineEnd(ScriptExecutionContext*, const String& title, Script State*);
88
85 void consoleCount(ScriptState*, PassRefPtr<ScriptArguments>); 89 void consoleCount(ScriptState*, PassRefPtr<ScriptArguments>);
86 90
87 void frameWindowDiscarded(DOMWindow*); 91 void frameWindowDiscarded(DOMWindow*);
88 void didCommitLoad(Frame*, DocumentLoader*); 92 void didCommitLoad(Frame*, DocumentLoader*);
89 93
90 void didFinishXHRLoading(ThreadableLoaderClient*, unsigned long requestIdent ifier, ScriptString, const String& url, const String& sendURL, unsigned sendLine Number); 94 void didFinishXHRLoading(ThreadableLoaderClient*, unsigned long requestIdent ifier, ScriptString, const String& url, const String& sendURL, unsigned sendLine Number);
91 void didReceiveResourceResponse(unsigned long requestIdentifier, DocumentLoa der*, const ResourceResponse& response, ResourceLoader*); 95 void didReceiveResourceResponse(unsigned long requestIdentifier, DocumentLoa der*, const ResourceResponse& response, ResourceLoader*);
92 void didFailLoading(unsigned long requestIdentifier, DocumentLoader*, const ResourceError&); 96 void didFailLoading(unsigned long requestIdentifier, DocumentLoader*, const ResourceError&);
93 void addProfileFinishedMessageToConsole(PassRefPtr<ScriptProfile>, unsigned lineNumber, const String& sourceURL); 97 void addProfileFinishedMessageToConsole(PassRefPtr<ScriptProfile>, unsigned lineNumber, const String& sourceURL);
94 void addStartProfilingMessageToConsole(const String& title, unsigned lineNum ber, const String& sourceURL); 98 void addStartProfilingMessageToConsole(const String& title, unsigned lineNum ber, const String& sourceURL);
95 virtual void setMonitoringXHREnabled(ErrorString*, bool enabled); 99 virtual void setMonitoringXHREnabled(ErrorString*, bool enabled);
96 virtual void addInspectedNode(ErrorString*, int nodeId) = 0; 100 virtual void addInspectedNode(ErrorString*, int nodeId) = 0;
97 virtual void addInspectedHeapObject(ErrorString*, int inspectedHeapObjectId) ; 101 virtual void addInspectedHeapObject(ErrorString*, int inspectedHeapObjectId) ;
98 102
99 virtual bool isWorkerAgent() = 0; 103 virtual bool isWorkerAgent() = 0;
100 104
101 protected: 105 protected:
102 void addConsoleMessage(PassOwnPtr<ConsoleMessage>); 106 void addConsoleMessage(PassOwnPtr<ConsoleMessage>);
103 107
108 InspectorTimelineAgent* m_timelineAgent;
104 InjectedScriptManager* m_injectedScriptManager; 109 InjectedScriptManager* m_injectedScriptManager;
105 InspectorFrontend::Console* m_frontend; 110 InspectorFrontend::Console* m_frontend;
106 ConsoleMessage* m_previousMessage; 111 ConsoleMessage* m_previousMessage;
107 Vector<OwnPtr<ConsoleMessage> > m_consoleMessages; 112 Vector<OwnPtr<ConsoleMessage> > m_consoleMessages;
108 int m_expiredConsoleMessageCount; 113 int m_expiredConsoleMessageCount;
109 HashMap<String, unsigned> m_counts; 114 HashMap<String, unsigned> m_counts;
110 HashMap<String, double> m_times; 115 HashMap<String, double> m_times;
111 bool m_enabled; 116 bool m_enabled;
112 private: 117 private:
113 static int s_enabledAgentCount; 118 static int s_enabledAgentCount;
114 }; 119 };
115 120
116 } // namespace WebCore 121 } // namespace WebCore
117 122
118 123
119 #endif // !defined(InspectorConsoleAgent_h) 124 #endif // !defined(InspectorConsoleAgent_h)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698