OLD | NEW |
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 typedef String ErrorString; | 60 typedef String ErrorString; |
61 | 61 |
62 class InspectorConsoleAgent : public InspectorBaseAgent<InspectorConsoleAgent>,
public InspectorBackendDispatcher::ConsoleCommandHandler { | 62 class InspectorConsoleAgent : public InspectorBaseAgent<InspectorConsoleAgent>,
public InspectorBackendDispatcher::ConsoleCommandHandler { |
63 WTF_MAKE_NONCOPYABLE(InspectorConsoleAgent); | 63 WTF_MAKE_NONCOPYABLE(InspectorConsoleAgent); |
64 public: | 64 public: |
65 InspectorConsoleAgent(InstrumentingAgents*, InspectorTimelineAgent*, Inspect
orCompositeState*, InjectedScriptManager*); | 65 InspectorConsoleAgent(InstrumentingAgents*, InspectorTimelineAgent*, Inspect
orCompositeState*, InjectedScriptManager*); |
66 virtual ~InspectorConsoleAgent(); | 66 virtual ~InspectorConsoleAgent(); |
67 | 67 |
68 virtual void enable(ErrorString*) OVERRIDE FINAL; | 68 virtual void enable(ErrorString*) OVERRIDE FINAL; |
69 virtual void disable(ErrorString*) OVERRIDE FINAL; | 69 virtual void disable(ErrorString*) OVERRIDE FINAL; |
70 virtual void clearMessages(ErrorString*); | 70 virtual void clearMessages(ErrorString*) OVERRIDE; |
71 bool enabled() { return m_enabled; } | 71 bool enabled() { return m_enabled; } |
72 void reset(); | 72 void reset(); |
73 | 73 |
74 virtual void setFrontend(InspectorFrontend*) OVERRIDE FINAL; | 74 virtual void setFrontend(InspectorFrontend*) OVERRIDE FINAL; |
75 virtual void clearFrontend() OVERRIDE FINAL; | 75 virtual void clearFrontend() OVERRIDE FINAL; |
76 virtual void restore() OVERRIDE FINAL; | 76 virtual void restore() OVERRIDE FINAL; |
77 | 77 |
78 void addMessageToConsole(MessageSource, MessageType, MessageLevel, const Str
ing& message, ScriptState*, PassRefPtr<ScriptArguments>, unsigned long requestId
entifier = 0); | 78 void addMessageToConsole(MessageSource, MessageType, MessageLevel, const Str
ing& message, ScriptState*, PassRefPtr<ScriptArguments>, unsigned long requestId
entifier = 0); |
79 void addMessageToConsole(MessageSource, MessageType, MessageLevel, const Str
ing& message, const String& scriptId, unsigned lineNumber, unsigned columnNumber
= 0, ScriptState* = 0, unsigned long requestIdentifier = 0); | 79 void addMessageToConsole(MessageSource, MessageType, MessageLevel, const Str
ing& message, const String& scriptId, unsigned lineNumber, unsigned columnNumber
= 0, ScriptState* = 0, unsigned long requestIdentifier = 0); |
80 | 80 |
(...skipping 10 matching lines...) Expand all Loading... |
91 void consoleCount(ScriptState*, PassRefPtr<ScriptArguments>); | 91 void consoleCount(ScriptState*, PassRefPtr<ScriptArguments>); |
92 | 92 |
93 void frameWindowDiscarded(DOMWindow*); | 93 void frameWindowDiscarded(DOMWindow*); |
94 void didCommitLoad(Frame*, DocumentLoader*); | 94 void didCommitLoad(Frame*, DocumentLoader*); |
95 | 95 |
96 void didFinishXHRLoading(XMLHttpRequest*, ThreadableLoaderClient*, unsigned
long requestIdentifier, ScriptString, const String& url, const String& sendURL,
unsigned sendLineNumber); | 96 void didFinishXHRLoading(XMLHttpRequest*, ThreadableLoaderClient*, unsigned
long requestIdentifier, ScriptString, const String& url, const String& sendURL,
unsigned sendLineNumber); |
97 void didReceiveResourceResponse(Frame*, unsigned long requestIdentifier, Doc
umentLoader*, const ResourceResponse&, ResourceLoader*); | 97 void didReceiveResourceResponse(Frame*, unsigned long requestIdentifier, Doc
umentLoader*, const ResourceResponse&, ResourceLoader*); |
98 void didFailLoading(unsigned long requestIdentifier, DocumentLoader*, const
ResourceError&); | 98 void didFailLoading(unsigned long requestIdentifier, DocumentLoader*, const
ResourceError&); |
99 void addProfileFinishedMessageToConsole(PassRefPtr<ScriptProfile>, unsigned
lineNumber, const String& sourceURL); | 99 void addProfileFinishedMessageToConsole(PassRefPtr<ScriptProfile>, unsigned
lineNumber, const String& sourceURL); |
100 void addStartProfilingMessageToConsole(const String& title, unsigned lineNum
ber, const String& sourceURL); | 100 void addStartProfilingMessageToConsole(const String& title, unsigned lineNum
ber, const String& sourceURL); |
101 virtual void setMonitoringXHREnabled(ErrorString*, bool enabled); | 101 virtual void setMonitoringXHREnabled(ErrorString*, bool enabled) OVERRIDE; |
102 virtual void addInspectedNode(ErrorString*, int nodeId) = 0; | 102 virtual void addInspectedNode(ErrorString*, int nodeId) = 0; |
103 virtual void addInspectedHeapObject(ErrorString*, int inspectedHeapObjectId)
; | 103 virtual void addInspectedHeapObject(ErrorString*, int inspectedHeapObjectId)
OVERRIDE; |
104 | 104 |
105 virtual bool isWorkerAgent() = 0; | 105 virtual bool isWorkerAgent() = 0; |
106 | 106 |
107 protected: | 107 protected: |
108 void addConsoleMessage(PassOwnPtr<ConsoleMessage>); | 108 void addConsoleMessage(PassOwnPtr<ConsoleMessage>); |
109 | 109 |
110 InspectorTimelineAgent* m_timelineAgent; | 110 InspectorTimelineAgent* m_timelineAgent; |
111 InjectedScriptManager* m_injectedScriptManager; | 111 InjectedScriptManager* m_injectedScriptManager; |
112 InspectorFrontend::Console* m_frontend; | 112 InspectorFrontend::Console* m_frontend; |
113 ConsoleMessage* m_previousMessage; | 113 ConsoleMessage* m_previousMessage; |
114 Vector<OwnPtr<ConsoleMessage> > m_consoleMessages; | 114 Vector<OwnPtr<ConsoleMessage> > m_consoleMessages; |
115 int m_expiredConsoleMessageCount; | 115 int m_expiredConsoleMessageCount; |
116 HashCountedSet<String> m_counts; | 116 HashCountedSet<String> m_counts; |
117 HashMap<String, double> m_times; | 117 HashMap<String, double> m_times; |
118 bool m_enabled; | 118 bool m_enabled; |
119 private: | 119 private: |
120 static int s_enabledAgentCount; | 120 static int s_enabledAgentCount; |
121 }; | 121 }; |
122 | 122 |
123 } // namespace WebCore | 123 } // namespace WebCore |
124 | 124 |
125 | 125 |
126 #endif // !defined(InspectorConsoleAgent_h) | 126 #endif // !defined(InspectorConsoleAgent_h) |
OLD | NEW |