| 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 #include "ScriptArguments.h" | 35 #include "ScriptArguments.h" |
| 36 #include "ScriptCallStack.h" | 36 #include "ScriptCallStack.h" |
| 37 #include "ScriptProfile.h" | 37 #include "ScriptProfile.h" |
| 38 #include <wtf/PassRefPtr.h> | 38 #include <wtf/PassRefPtr.h> |
| 39 #include <wtf/UnusedParam.h> | 39 #include <wtf/UnusedParam.h> |
| 40 | 40 |
| 41 namespace WebCore { | 41 namespace WebCore { |
| 42 | 42 |
| 43 inline void InspectorInstrumentation::addMessageToConsole(Page* page, MessageSou
rce source, MessageType type, MessageLevel level, const String& message, PassRef
Ptr<ScriptCallStack> callStack, unsigned long requestIdentifier) | 43 inline void InspectorInstrumentation::addMessageToConsole(Page* page, MessageSou
rce source, MessageType type, MessageLevel level, const String& message, PassRef
Ptr<ScriptCallStack> callStack, unsigned long requestIdentifier) |
| 44 { | 44 { |
| 45 #if ENABLE(INSPECTOR) | |
| 46 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(pa
ge)) | 45 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(pa
ge)) |
| 47 addMessageToConsoleImpl(instrumentingAgents, source, type, level, messag
e, callStack, requestIdentifier); | 46 addMessageToConsoleImpl(instrumentingAgents, source, type, level, messag
e, callStack, requestIdentifier); |
| 48 #else | |
| 49 UNUSED_PARAM(page); | |
| 50 UNUSED_PARAM(source); | |
| 51 UNUSED_PARAM(type); | |
| 52 UNUSED_PARAM(level); | |
| 53 UNUSED_PARAM(message); | |
| 54 UNUSED_PARAM(callStack); | |
| 55 UNUSED_PARAM(requestIdentifier); | |
| 56 #endif | |
| 57 } | 47 } |
| 58 | 48 |
| 59 inline void InspectorInstrumentation::addMessageToConsole(Page* page, MessageSou
rce source, MessageType type, MessageLevel level, const String& message, ScriptS
tate* state, PassRefPtr<ScriptArguments> arguments, unsigned long requestIdentif
ier) | 49 inline void InspectorInstrumentation::addMessageToConsole(Page* page, MessageSou
rce source, MessageType type, MessageLevel level, const String& message, ScriptS
tate* state, PassRefPtr<ScriptArguments> arguments, unsigned long requestIdentif
ier) |
| 60 { | 50 { |
| 61 #if ENABLE(INSPECTOR) | |
| 62 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(pa
ge)) | 51 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(pa
ge)) |
| 63 addMessageToConsoleImpl(instrumentingAgents, source, type, level, messag
e, state, arguments, requestIdentifier); | 52 addMessageToConsoleImpl(instrumentingAgents, source, type, level, messag
e, state, arguments, requestIdentifier); |
| 64 #else | |
| 65 UNUSED_PARAM(page); | |
| 66 UNUSED_PARAM(source); | |
| 67 UNUSED_PARAM(type); | |
| 68 UNUSED_PARAM(level); | |
| 69 UNUSED_PARAM(message); | |
| 70 UNUSED_PARAM(state); | |
| 71 UNUSED_PARAM(arguments); | |
| 72 UNUSED_PARAM(requestIdentifier); | |
| 73 #endif | |
| 74 } | 53 } |
| 75 | 54 |
| 76 inline void InspectorInstrumentation::addMessageToConsole(Page* page, MessageSou
rce source, MessageType type, MessageLevel level, const String& message, const S
tring& scriptId, unsigned lineNumber, ScriptState* state, unsigned long requestI
dentifier) | 55 inline void InspectorInstrumentation::addMessageToConsole(Page* page, MessageSou
rce source, MessageType type, MessageLevel level, const String& message, const S
tring& scriptId, unsigned lineNumber, ScriptState* state, unsigned long requestI
dentifier) |
| 77 { | 56 { |
| 78 #if ENABLE(INSPECTOR) | |
| 79 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(pa
ge)) | 57 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(pa
ge)) |
| 80 addMessageToConsoleImpl(instrumentingAgents, source, type, level, messag
e, scriptId, lineNumber, state, requestIdentifier); | 58 addMessageToConsoleImpl(instrumentingAgents, source, type, level, messag
e, scriptId, lineNumber, state, requestIdentifier); |
| 81 #else | |
| 82 UNUSED_PARAM(page); | |
| 83 UNUSED_PARAM(source); | |
| 84 UNUSED_PARAM(type); | |
| 85 UNUSED_PARAM(level); | |
| 86 UNUSED_PARAM(message); | |
| 87 UNUSED_PARAM(scriptId); | |
| 88 UNUSED_PARAM(lineNumber); | |
| 89 UNUSED_PARAM(state); | |
| 90 UNUSED_PARAM(requestIdentifier); | |
| 91 #endif | |
| 92 } | 59 } |
| 93 | 60 |
| 94 #if ENABLE(WORKERS) | 61 #if ENABLE(WORKERS) |
| 95 inline void InspectorInstrumentation::addMessageToConsole(WorkerContext* workerC
ontext, MessageSource source, MessageType type, MessageLevel level, const String
& message, PassRefPtr<ScriptCallStack> callStack, unsigned long requestIdentifie
r) | 62 inline void InspectorInstrumentation::addMessageToConsole(WorkerContext* workerC
ontext, MessageSource source, MessageType type, MessageLevel level, const String
& message, PassRefPtr<ScriptCallStack> callStack, unsigned long requestIdentifie
r) |
| 96 { | 63 { |
| 97 #if ENABLE(INSPECTOR) | |
| 98 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForWorkerC
ontext(workerContext)) | 64 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForWorkerC
ontext(workerContext)) |
| 99 addMessageToConsoleImpl(instrumentingAgents, source, type, level, messag
e, callStack, requestIdentifier); | 65 addMessageToConsoleImpl(instrumentingAgents, source, type, level, messag
e, callStack, requestIdentifier); |
| 100 #else | |
| 101 UNUSED_PARAM(workerContext); | |
| 102 UNUSED_PARAM(source); | |
| 103 UNUSED_PARAM(type); | |
| 104 UNUSED_PARAM(level); | |
| 105 UNUSED_PARAM(message); | |
| 106 UNUSED_PARAM(callStack); | |
| 107 UNUSED_PARAM(requestIdentifier); | |
| 108 #endif | |
| 109 } | 66 } |
| 110 | 67 |
| 111 inline void InspectorInstrumentation::addMessageToConsole(WorkerContext* workerC
ontext, MessageSource source, MessageType type, MessageLevel level, const String
& message, const String& scriptId, unsigned lineNumber, ScriptState* state, unsi
gned long requestIdentifier) | 68 inline void InspectorInstrumentation::addMessageToConsole(WorkerContext* workerC
ontext, MessageSource source, MessageType type, MessageLevel level, const String
& message, const String& scriptId, unsigned lineNumber, ScriptState* state, unsi
gned long requestIdentifier) |
| 112 { | 69 { |
| 113 #if ENABLE(INSPECTOR) | |
| 114 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForWorkerC
ontext(workerContext)) | 70 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForWorkerC
ontext(workerContext)) |
| 115 addMessageToConsoleImpl(instrumentingAgents, source, type, level, messag
e, scriptId, lineNumber, state, requestIdentifier); | 71 addMessageToConsoleImpl(instrumentingAgents, source, type, level, messag
e, scriptId, lineNumber, state, requestIdentifier); |
| 116 #else | |
| 117 UNUSED_PARAM(workerContext); | |
| 118 UNUSED_PARAM(source); | |
| 119 UNUSED_PARAM(type); | |
| 120 UNUSED_PARAM(level); | |
| 121 UNUSED_PARAM(message); | |
| 122 UNUSED_PARAM(scriptId); | |
| 123 UNUSED_PARAM(lineNumber); | |
| 124 UNUSED_PARAM(state); | |
| 125 UNUSED_PARAM(requestIdentifier); | |
| 126 #endif | |
| 127 } | 72 } |
| 128 #endif | 73 #endif |
| 129 | 74 |
| 130 inline void InspectorInstrumentation::consoleCount(Page* page, ScriptState* stat
e, PassRefPtr<ScriptArguments> arguments) | 75 inline void InspectorInstrumentation::consoleCount(Page* page, ScriptState* stat
e, PassRefPtr<ScriptArguments> arguments) |
| 131 { | 76 { |
| 132 #if ENABLE(INSPECTOR) | |
| 133 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(pa
ge)) | 77 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(pa
ge)) |
| 134 consoleCountImpl(instrumentingAgents, state, arguments); | 78 consoleCountImpl(instrumentingAgents, state, arguments); |
| 135 #else | |
| 136 UNUSED_PARAM(page); | |
| 137 UNUSED_PARAM(state); | |
| 138 UNUSED_PARAM(arguments); | |
| 139 #endif | |
| 140 } | 79 } |
| 141 | 80 |
| 142 inline void InspectorInstrumentation::startConsoleTiming(Frame* frame, const Str
ing& title) | 81 inline void InspectorInstrumentation::startConsoleTiming(Frame* frame, const Str
ing& title) |
| 143 { | 82 { |
| 144 #if ENABLE(INSPECTOR) | |
| 145 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(f
rame)) | 83 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(f
rame)) |
| 146 startConsoleTimingImpl(instrumentingAgents, frame, title); | 84 startConsoleTimingImpl(instrumentingAgents, frame, title); |
| 147 #else | |
| 148 UNUSED_PARAM(frame); | |
| 149 UNUSED_PARAM(title); | |
| 150 #endif | |
| 151 } | 85 } |
| 152 | 86 |
| 153 inline void InspectorInstrumentation::stopConsoleTiming(Frame* frame, const Stri
ng& title, PassRefPtr<ScriptCallStack> stack) | 87 inline void InspectorInstrumentation::stopConsoleTiming(Frame* frame, const Stri
ng& title, PassRefPtr<ScriptCallStack> stack) |
| 154 { | 88 { |
| 155 #if ENABLE(INSPECTOR) | |
| 156 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(f
rame)) | 89 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(f
rame)) |
| 157 stopConsoleTimingImpl(instrumentingAgents, frame, title, stack); | 90 stopConsoleTimingImpl(instrumentingAgents, frame, title, stack); |
| 158 #else | |
| 159 UNUSED_PARAM(frame); | |
| 160 UNUSED_PARAM(title); | |
| 161 UNUSED_PARAM(stack); | |
| 162 #endif | |
| 163 } | 91 } |
| 164 | 92 |
| 165 inline void InspectorInstrumentation::consoleTimeStamp(Frame* frame, PassRefPtr<
ScriptArguments> arguments) | 93 inline void InspectorInstrumentation::consoleTimeStamp(Frame* frame, PassRefPtr<
ScriptArguments> arguments) |
| 166 { | 94 { |
| 167 #if ENABLE(INSPECTOR) | |
| 168 FAST_RETURN_IF_NO_FRONTENDS(void()); | 95 FAST_RETURN_IF_NO_FRONTENDS(void()); |
| 169 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(f
rame)) | 96 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(f
rame)) |
| 170 consoleTimeStampImpl(instrumentingAgents, frame, arguments); | 97 consoleTimeStampImpl(instrumentingAgents, frame, arguments); |
| 171 #else | |
| 172 UNUSED_PARAM(frame); | |
| 173 UNUSED_PARAM(arguments); | |
| 174 #endif | |
| 175 } | 98 } |
| 176 | 99 |
| 177 #if ENABLE(JAVASCRIPT_DEBUGGER) | |
| 178 inline void InspectorInstrumentation::addStartProfilingMessageToConsole(Page* pa
ge, const String& title, unsigned lineNumber, const String& sourceURL) | 100 inline void InspectorInstrumentation::addStartProfilingMessageToConsole(Page* pa
ge, const String& title, unsigned lineNumber, const String& sourceURL) |
| 179 { | 101 { |
| 180 #if ENABLE(INSPECTOR) | |
| 181 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(pa
ge)) | 102 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(pa
ge)) |
| 182 addStartProfilingMessageToConsoleImpl(instrumentingAgents, title, lineNu
mber, sourceURL); | 103 addStartProfilingMessageToConsoleImpl(instrumentingAgents, title, lineNu
mber, sourceURL); |
| 183 #else | |
| 184 UNUSED_PARAM(page); | |
| 185 UNUSED_PARAM(title); | |
| 186 UNUSED_PARAM(lineNumber); | |
| 187 UNUSED_PARAM(sourceURL); | |
| 188 #endif | |
| 189 } | 104 } |
| 190 | 105 |
| 191 inline void InspectorInstrumentation::addProfile(Page* page, RefPtr<ScriptProfil
e> profile, PassRefPtr<ScriptCallStack> callStack) | 106 inline void InspectorInstrumentation::addProfile(Page* page, RefPtr<ScriptProfil
e> profile, PassRefPtr<ScriptCallStack> callStack) |
| 192 { | 107 { |
| 193 #if ENABLE(INSPECTOR) | |
| 194 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(pa
ge)) | 108 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(pa
ge)) |
| 195 addProfileImpl(instrumentingAgents, profile, callStack); | 109 addProfileImpl(instrumentingAgents, profile, callStack); |
| 196 #else | |
| 197 UNUSED_PARAM(page); | |
| 198 UNUSED_PARAM(profile); | |
| 199 UNUSED_PARAM(callStack); | |
| 200 #endif | |
| 201 } | 110 } |
| 202 | 111 |
| 203 inline bool InspectorInstrumentation::profilerEnabled(Page* page) | 112 inline bool InspectorInstrumentation::profilerEnabled(Page* page) |
| 204 { | 113 { |
| 205 #if ENABLE(INSPECTOR) | |
| 206 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(pa
ge)) | 114 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(pa
ge)) |
| 207 return profilerEnabledImpl(instrumentingAgents); | 115 return profilerEnabledImpl(instrumentingAgents); |
| 208 #else | |
| 209 UNUSED_PARAM(page); | |
| 210 #endif | |
| 211 return false; | 116 return false; |
| 212 } | 117 } |
| 213 | 118 |
| 214 inline String InspectorInstrumentation::getCurrentUserInitiatedProfileName(Page*
page, bool incrementProfileNumber) | 119 inline String InspectorInstrumentation::getCurrentUserInitiatedProfileName(Page*
page, bool incrementProfileNumber) |
| 215 { | 120 { |
| 216 #if ENABLE(INSPECTOR) | |
| 217 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(pa
ge)) | 121 if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(pa
ge)) |
| 218 return InspectorInstrumentation::getCurrentUserInitiatedProfileNameImpl(
instrumentingAgents, incrementProfileNumber); | 122 return InspectorInstrumentation::getCurrentUserInitiatedProfileNameImpl(
instrumentingAgents, incrementProfileNumber); |
| 219 #else | |
| 220 UNUSED_PARAM(page); | |
| 221 UNUSED_PARAM(incrementProfileNumber); | |
| 222 #endif | |
| 223 return ""; | 123 return ""; |
| 224 } | 124 } |
| 225 #endif | |
| 226 | 125 |
| 227 } // namespace WebCore | 126 } // namespace WebCore |
| 228 | 127 |
| 229 #endif // !defined(InspectorConsoleInstrumentation_h) | 128 #endif // !defined(InspectorConsoleInstrumentation_h) |
| OLD | NEW |