2
* Copyright (C) 2011 Google Inc. All rights reserved.
4
* Redistribution and use in source and binary forms, with or without
5
* modification, are permitted provided that the following conditions are
8
* * Redistributions of source code must retain the above copyright
9
* notice, this list of conditions and the following disclaimer.
10
* * Redistributions in binary form must reproduce the above
11
* copyright notice, this list of conditions and the following disclaimer
12
* in the documentation and/or other materials provided with the
14
* * Neither the name of Google Inc. nor the names of its
15
* contributors may be used to endorse or promote products derived from
16
* this software without specific prior written permission.
18
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
#ifndef InspectorConsoleInstrumentation_h
32
#define InspectorConsoleInstrumentation_h
34
#include "InspectorInstrumentation.h"
35
#include "ScriptArguments.h"
36
#include "ScriptCallStack.h"
37
#include "ScriptProfile.h"
38
#include <wtf/PassRefPtr.h>
42
inline void InspectorInstrumentation::addMessageToConsole(Page* page, MessageSource source, MessageType type, MessageLevel level, const String& message, PassRefPtr<ScriptCallStack> callStack, unsigned long requestIdentifier)
45
if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
46
addMessageToConsoleImpl(instrumentingAgents, source, type, level, message, callStack, requestIdentifier);
50
inline void InspectorInstrumentation::addMessageToConsole(Page* page, MessageSource source, MessageType type, MessageLevel level, const String& message, ScriptState* state, PassRefPtr<ScriptArguments> arguments, unsigned long requestIdentifier)
53
if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
54
addMessageToConsoleImpl(instrumentingAgents, source, type, level, message, state, arguments, requestIdentifier);
58
inline void InspectorInstrumentation::addMessageToConsole(Page* page, MessageSource source, MessageType type, MessageLevel level, const String& message, const String& scriptId, unsigned lineNumber, unsigned long requestIdentifier)
61
if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
62
addMessageToConsoleImpl(instrumentingAgents, source, type, level, message, scriptId, lineNumber, requestIdentifier);
67
inline void InspectorInstrumentation::addMessageToConsole(WorkerContext* workerContext, MessageSource source, MessageType type, MessageLevel level, const String& message, PassRefPtr<ScriptCallStack> callStack, unsigned long requestIdentifier)
70
if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForWorkerContext(workerContext))
71
addMessageToConsoleImpl(instrumentingAgents, source, type, level, message, callStack, requestIdentifier);
75
inline void InspectorInstrumentation::addMessageToConsole(WorkerContext* workerContext, MessageSource source, MessageType type, MessageLevel level, const String& message, const String& scriptId, unsigned lineNumber, unsigned long requestIdentifier)
78
if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForWorkerContext(workerContext))
79
addMessageToConsoleImpl(instrumentingAgents, source, type, level, message, scriptId, lineNumber, requestIdentifier);
84
inline void InspectorInstrumentation::consoleCount(Page* page, ScriptState* state, PassRefPtr<ScriptArguments> arguments)
87
if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
88
consoleCountImpl(instrumentingAgents, state, arguments);
92
inline void InspectorInstrumentation::startConsoleTiming(Frame* frame, const String& title)
95
if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
96
startConsoleTimingImpl(instrumentingAgents, frame, title);
100
inline void InspectorInstrumentation::stopConsoleTiming(Frame* frame, const String& title, PassRefPtr<ScriptCallStack> stack)
102
#if ENABLE(INSPECTOR)
103
if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
104
stopConsoleTimingImpl(instrumentingAgents, frame, title, stack);
108
inline void InspectorInstrumentation::consoleTimeStamp(Frame* frame, PassRefPtr<ScriptArguments> arguments)
110
#if ENABLE(INSPECTOR)
111
FAST_RETURN_IF_NO_FRONTENDS(void());
112
if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForFrame(frame))
113
consoleTimeStampImpl(instrumentingAgents, frame, arguments);
117
#if ENABLE(JAVASCRIPT_DEBUGGER)
118
inline void InspectorInstrumentation::addStartProfilingMessageToConsole(Page* page, const String& title, unsigned lineNumber, const String& sourceURL)
120
#if ENABLE(INSPECTOR)
121
if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
122
addStartProfilingMessageToConsoleImpl(instrumentingAgents, title, lineNumber, sourceURL);
126
inline void InspectorInstrumentation::addProfile(Page* page, RefPtr<ScriptProfile> profile, PassRefPtr<ScriptCallStack> callStack)
128
#if ENABLE(INSPECTOR)
129
if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
130
addProfileImpl(instrumentingAgents, profile, callStack);
134
inline bool InspectorInstrumentation::profilerEnabled(Page* page)
136
#if ENABLE(INSPECTOR)
137
if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
138
return profilerEnabledImpl(instrumentingAgents);
143
inline String InspectorInstrumentation::getCurrentUserInitiatedProfileName(Page* page, bool incrementProfileNumber)
145
#if ENABLE(INSPECTOR)
146
if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForPage(page))
147
return InspectorInstrumentation::getCurrentUserInitiatedProfileNameImpl(instrumentingAgents, incrementProfileNumber);
153
} // namespace WebCore
155
#endif // !defined(InspectorConsoleInstrumentation_h)