| 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 23 matching lines...) Expand all Loading... |
| 34 #include "wtf/Forward.h" | 34 #include "wtf/Forward.h" |
| 35 #include "wtf/HashCountedSet.h" | 35 #include "wtf/HashCountedSet.h" |
| 36 #include "wtf/HashMap.h" | 36 #include "wtf/HashMap.h" |
| 37 #include "wtf/Noncopyable.h" | 37 #include "wtf/Noncopyable.h" |
| 38 #include "wtf/Vector.h" | 38 #include "wtf/Vector.h" |
| 39 #include "wtf/text/StringHash.h" | 39 #include "wtf/text/StringHash.h" |
| 40 | 40 |
| 41 namespace blink { | 41 namespace blink { |
| 42 | 42 |
| 43 class ConsoleMessage; | 43 class ConsoleMessage; |
| 44 class ConsoleMessageStorage; |
| 44 class DocumentLoader; | 45 class DocumentLoader; |
| 45 class LocalDOMWindow; | 46 class LocalDOMWindow; |
| 46 class LocalFrame; | 47 class LocalFrame; |
| 47 class InspectorConsoleMessage; | |
| 48 class InspectorFrontend; | 48 class InspectorFrontend; |
| 49 class InjectedScriptManager; | 49 class InjectedScriptManager; |
| 50 class InspectorTimelineAgent; | 50 class InspectorTimelineAgent; |
| 51 class InspectorTracingAgent; | 51 class InspectorTracingAgent; |
| 52 class InstrumentingAgents; | 52 class InstrumentingAgents; |
| 53 class ResourceError; | 53 class ResourceError; |
| 54 class ResourceLoader; | 54 class ResourceLoader; |
| 55 class ResourceResponse; | 55 class ResourceResponse; |
| 56 class ScriptArguments; | 56 class ScriptArguments; |
| 57 class ScriptCallStack; | 57 class ScriptCallStack; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 74 virtual void disable(ErrorString*) OVERRIDE FINAL; | 74 virtual void disable(ErrorString*) OVERRIDE FINAL; |
| 75 virtual void clearMessages(ErrorString*) OVERRIDE; | 75 virtual void clearMessages(ErrorString*) OVERRIDE; |
| 76 bool enabled() { return m_enabled; } | 76 bool enabled() { return m_enabled; } |
| 77 void reset(); | 77 void reset(); |
| 78 | 78 |
| 79 virtual void setFrontend(InspectorFrontend*) OVERRIDE FINAL; | 79 virtual void setFrontend(InspectorFrontend*) OVERRIDE FINAL; |
| 80 virtual void clearFrontend() OVERRIDE FINAL; | 80 virtual void clearFrontend() OVERRIDE FINAL; |
| 81 virtual void restore() OVERRIDE FINAL; | 81 virtual void restore() OVERRIDE FINAL; |
| 82 | 82 |
| 83 void addConsoleAPIMessageToConsole(MessageType, MessageLevel, const String&
message, ScriptState*, PassRefPtrWillBeRawPtr<ScriptArguments>, unsigned long re
questIdentifier = 0); | 83 void addConsoleAPIMessageToConsole(MessageType, MessageLevel, const String&
message, ScriptState*, PassRefPtrWillBeRawPtr<ScriptArguments>, unsigned long re
questIdentifier = 0); |
| 84 void addMessageToConsole(ConsoleMessage*); | 84 void addMessageToConsole(PassRefPtr<ConsoleMessage>); |
| 85 void adoptWorkerConsoleMessages(WorkerGlobalScopeProxy*); | 85 void adoptWorkerConsoleMessages(WorkerGlobalScopeProxy*); |
| 86 |
| 86 Vector<unsigned> consoleMessageArgumentCounts(); | 87 Vector<unsigned> consoleMessageArgumentCounts(); |
| 87 | 88 |
| 88 void consoleTime(ExecutionContext*, const String& title); | 89 void consoleTime(ExecutionContext*, const String& title); |
| 89 void consoleTimeEnd(ExecutionContext*, const String& title, ScriptState*); | 90 void consoleTimeEnd(ExecutionContext*, const String& title, ScriptState*); |
| 90 void setTracingBasedTimeline(ErrorString*, bool enabled); | 91 void setTracingBasedTimeline(ErrorString*, bool enabled); |
| 91 void consoleTimeline(ExecutionContext*, const String& title, ScriptState*); | 92 void consoleTimeline(ExecutionContext*, const String& title, ScriptState*); |
| 92 void consoleTimelineEnd(ExecutionContext*, const String& title, ScriptState*
); | 93 void consoleTimelineEnd(ExecutionContext*, const String& title, ScriptState*
); |
| 93 | 94 |
| 94 void consoleCount(ScriptState*, PassRefPtrWillBeRawPtr<ScriptArguments>); | 95 void consoleCount(ScriptState*, PassRefPtrWillBeRawPtr<ScriptArguments>); |
| 95 | 96 |
| 96 void frameWindowDiscarded(LocalDOMWindow*); | 97 void frameWindowDiscarded(LocalDOMWindow*); |
| 97 void didCommitLoad(LocalFrame*, DocumentLoader*); | 98 void didCommitLoad(LocalFrame*, DocumentLoader*); |
| 98 | 99 |
| 99 void didFinishXHRLoading(XMLHttpRequest*, ThreadableLoaderClient*, unsigned
long requestIdentifier, ScriptString, const AtomicString& method, const String&
url, const String& sendURL, unsigned sendLineNumber); | 100 void didFinishXHRLoading(XMLHttpRequest*, ThreadableLoaderClient*, unsigned
long requestIdentifier, ScriptString, const AtomicString& method, const String&
url, const String& sendURL, unsigned sendLineNumber); |
| 100 void didReceiveResourceResponse(LocalFrame*, unsigned long requestIdentifier
, DocumentLoader*, const ResourceResponse&, ResourceLoader*); | 101 void didReceiveResourceResponse(LocalFrame*, unsigned long requestIdentifier
, DocumentLoader*, const ResourceResponse&, ResourceLoader*); |
| 101 void didFailLoading(unsigned long requestIdentifier, const ResourceError&); | 102 void didFailLoading(unsigned long requestIdentifier, const ResourceError&); |
| 102 void addProfileFinishedMessageToConsole(PassRefPtrWillBeRawPtr<ScriptProfile
>, unsigned lineNumber, const String& sourceURL); | 103 void addProfileFinishedMessageToConsole(PassRefPtrWillBeRawPtr<ScriptProfile
>, unsigned lineNumber, const String& sourceURL); |
| 103 void addStartProfilingMessageToConsole(const String& title, unsigned lineNum
ber, const String& sourceURL); | 104 void addStartProfilingMessageToConsole(const String& title, unsigned lineNum
ber, const String& sourceURL); |
| 104 virtual void setMonitoringXHREnabled(ErrorString*, bool enabled) OVERRIDE; | 105 virtual void setMonitoringXHREnabled(ErrorString*, bool enabled) OVERRIDE; |
| 105 virtual void addInspectedNode(ErrorString*, int nodeId) = 0; | 106 virtual void addInspectedNode(ErrorString*, int nodeId) = 0; |
| 106 virtual void addInspectedHeapObject(ErrorString*, int inspectedHeapObjectId)
OVERRIDE; | 107 virtual void addInspectedHeapObject(ErrorString*, int inspectedHeapObjectId)
OVERRIDE; |
| 107 | 108 |
| 108 virtual bool isWorkerAgent() = 0; | 109 virtual bool isWorkerAgent() = 0; |
| 109 | 110 |
| 110 protected: | 111 protected: |
| 111 void addConsoleMessage(PassOwnPtr<InspectorConsoleMessage>); | 112 void storeConsoleMessage(PassRefPtr<ConsoleMessage>); |
| 113 void sendConsoleMessageToFrontend(PassRefPtr<ConsoleMessage>, bool generateP
review); |
| 114 virtual ConsoleMessageStorage* messageStorage() = 0; |
| 112 | 115 |
| 113 RawPtrWillBeMember<InspectorTimelineAgent> m_timelineAgent; | 116 RawPtrWillBeMember<InspectorTimelineAgent> m_timelineAgent; |
| 114 RawPtrWillBeMember<InspectorTracingAgent> m_tracingAgent; | 117 RawPtrWillBeMember<InspectorTracingAgent> m_tracingAgent; |
| 115 RawPtrWillBeMember<InjectedScriptManager> m_injectedScriptManager; | 118 RawPtrWillBeMember<InjectedScriptManager> m_injectedScriptManager; |
| 116 InspectorFrontend::Console* m_frontend; | 119 InspectorFrontend::Console* m_frontend; |
| 117 Vector<OwnPtr<InspectorConsoleMessage> > m_consoleMessages; | |
| 118 int m_expiredConsoleMessageCount; | |
| 119 HashCountedSet<String> m_counts; | 120 HashCountedSet<String> m_counts; |
| 120 HashMap<String, double> m_times; | 121 HashMap<String, double> m_times; |
| 121 bool m_enabled; | 122 bool m_enabled; |
| 122 private: | 123 private: |
| 123 static int s_enabledAgentCount; | 124 static int s_enabledAgentCount; |
| 124 }; | 125 }; |
| 125 | 126 |
| 126 } // namespace blink | 127 } // namespace blink |
| 127 | 128 |
| 128 | 129 |
| 129 #endif // !defined(InspectorConsoleAgent_h) | 130 #endif // !defined(InspectorConsoleAgent_h) |
| OLD | NEW |