#ifndef InspectorConsoleAgent_h
#define InspectorConsoleAgent_h
-#include "InspectorFrontend.h"
-#include "bindings/v8/ScriptState.h"
-#include "bindings/v8/ScriptString.h"
+#include "bindings/core/v8/ScriptState.h"
+#include "bindings/core/v8/ScriptString.h"
+#include "core/InspectorFrontend.h"
#include "core/inspector/ConsoleAPITypes.h"
#include "core/inspector/InspectorBaseAgent.h"
#include "core/frame/ConsoleTypes.h"
#include "wtf/Vector.h"
#include "wtf/text/StringHash.h"
-namespace WebCore {
+namespace blink {
class ConsoleMessage;
class DocumentLoader;
-class DOMWindow;
-class Frame;
+class LocalDOMWindow;
+class LocalFrame;
+class InspectorConsoleMessage;
class InspectorFrontend;
class InjectedScriptManager;
class InspectorTimelineAgent;
+class InspectorTracingAgent;
class InstrumentingAgents;
class ResourceError;
class ResourceLoader;
class ScriptCallStack;
class ScriptProfile;
class ThreadableLoaderClient;
+class WorkerGlobalScopeProxy;
class XMLHttpRequest;
typedef String ErrorString;
class InspectorConsoleAgent : public InspectorBaseAgent<InspectorConsoleAgent>, public InspectorBackendDispatcher::ConsoleCommandHandler {
WTF_MAKE_NONCOPYABLE(InspectorConsoleAgent);
public:
- InspectorConsoleAgent(InspectorTimelineAgent*, InjectedScriptManager*);
+ InspectorConsoleAgent(InspectorTimelineAgent*, InspectorTracingAgent*, InjectedScriptManager*);
virtual ~InspectorConsoleAgent();
+ virtual void trace(Visitor*) OVERRIDE;
virtual void init() OVERRIDE;
virtual void enable(ErrorString*) OVERRIDE FINAL;
virtual void clearFrontend() OVERRIDE FINAL;
virtual void restore() OVERRIDE FINAL;
- void addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message, ScriptState*, PassRefPtr<ScriptArguments>, unsigned long requestIdentifier = 0);
- void addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message, const String& scriptId, unsigned lineNumber, unsigned columnNumber = 0, ScriptState* = 0, unsigned long requestIdentifier = 0);
-
- // FIXME: Remove once we no longer generate stacks outside of Inspector.
- void addMessageToConsole(MessageSource, MessageType, MessageLevel, const String& message, PassRefPtr<ScriptCallStack>, unsigned long requestIdentifier = 0);
-
+ void addConsoleAPIMessageToConsole(MessageType, MessageLevel, const String& message, ScriptState*, PassRefPtrWillBeRawPtr<ScriptArguments>, unsigned long requestIdentifier = 0);
+ void addMessageToConsole(ConsoleMessage*);
+ void adoptWorkerConsoleMessages(WorkerGlobalScopeProxy*);
Vector<unsigned> consoleMessageArgumentCounts();
void consoleTime(ExecutionContext*, const String& title);
void consoleTimeEnd(ExecutionContext*, const String& title, ScriptState*);
+ void setTracingBasedTimeline(ErrorString*, bool enabled);
void consoleTimeline(ExecutionContext*, const String& title, ScriptState*);
void consoleTimelineEnd(ExecutionContext*, const String& title, ScriptState*);
- void consoleCount(ScriptState*, PassRefPtr<ScriptArguments>);
+ void consoleCount(ScriptState*, PassRefPtrWillBeRawPtr<ScriptArguments>);
- void frameWindowDiscarded(DOMWindow*);
- void didCommitLoad(Frame*, DocumentLoader*);
+ void frameWindowDiscarded(LocalDOMWindow*);
+ void didCommitLoad(LocalFrame*, DocumentLoader*);
void didFinishXHRLoading(XMLHttpRequest*, ThreadableLoaderClient*, unsigned long requestIdentifier, ScriptString, const AtomicString& method, const String& url, const String& sendURL, unsigned sendLineNumber);
- void didReceiveResourceResponse(Frame*, unsigned long requestIdentifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
- void didFailLoading(unsigned long requestIdentifier, DocumentLoader*, const ResourceError&);
- void addProfileFinishedMessageToConsole(PassRefPtr<ScriptProfile>, unsigned lineNumber, const String& sourceURL);
+ void didReceiveResourceResponse(LocalFrame*, unsigned long requestIdentifier, DocumentLoader*, const ResourceResponse&, ResourceLoader*);
+ void didFailLoading(unsigned long requestIdentifier, const ResourceError&);
+ void addProfileFinishedMessageToConsole(PassRefPtrWillBeRawPtr<ScriptProfile>, unsigned lineNumber, const String& sourceURL);
void addStartProfilingMessageToConsole(const String& title, unsigned lineNumber, const String& sourceURL);
virtual void setMonitoringXHREnabled(ErrorString*, bool enabled) OVERRIDE;
virtual void addInspectedNode(ErrorString*, int nodeId) = 0;
virtual bool isWorkerAgent() = 0;
protected:
- void addConsoleMessage(PassOwnPtr<ConsoleMessage>);
+ void addConsoleMessage(PassOwnPtr<InspectorConsoleMessage>);
- InspectorTimelineAgent* m_timelineAgent;
- InjectedScriptManager* m_injectedScriptManager;
+ RawPtrWillBeMember<InspectorTimelineAgent> m_timelineAgent;
+ RawPtrWillBeMember<InspectorTracingAgent> m_tracingAgent;
+ RawPtrWillBeMember<InjectedScriptManager> m_injectedScriptManager;
InspectorFrontend::Console* m_frontend;
- ConsoleMessage* m_previousMessage;
- Vector<OwnPtr<ConsoleMessage> > m_consoleMessages;
+ Vector<OwnPtr<InspectorConsoleMessage> > m_consoleMessages;
int m_expiredConsoleMessageCount;
HashCountedSet<String> m_counts;
HashMap<String, double> m_times;
static int s_enabledAgentCount;
};
-} // namespace WebCore
+} // namespace blink
#endif // !defined(InspectorConsoleAgent_h)