summaryrefslogtreecommitdiffstats
path: root/WebCore/page/Console.h
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/page/Console.h')
-rw-r--r--WebCore/page/Console.h73
1 files changed, 67 insertions, 6 deletions
diff --git a/WebCore/page/Console.h b/WebCore/page/Console.h
index 81e39be..8f33e96 100644
--- a/WebCore/page/Console.h
+++ b/WebCore/page/Console.h
@@ -29,25 +29,86 @@
#ifndef Console_h
#define Console_h
-#include <wtf/RefCounted.h>
#include "PlatformString.h"
+#include <profiler/Profile.h>
+#include <wtf/RefCounted.h>
+#include <wtf/PassRefPtr.h>
+
+namespace JSC {
+ class ExecState;
+ class ArgList;
+}
namespace WebCore {
+ typedef Vector<RefPtr<JSC::Profile> > ProfilesArray;
+
class Frame;
+ class Page;
+ class String;
+
+ enum MessageSource {
+ HTMLMessageSource,
+ XMLMessageSource,
+ JSMessageSource,
+ CSSMessageSource,
+ OtherMessageSource
+ };
+
+ enum MessageLevel {
+ TipMessageLevel,
+ LogMessageLevel,
+ WarningMessageLevel,
+ ErrorMessageLevel,
+ ObjectMessageLevel,
+ NodeMessageLevel,
+ TraceMessageLevel,
+ StartGroupMessageLevel,
+ EndGroupMessageLevel
+ };
class Console : public RefCounted<Console> {
public:
- Console(Frame*);
+ static PassRefPtr<Console> create(Frame* frame) { return adoptRef(new Console(frame)); }
+
void disconnectFrame();
- void error(const String& message);
- void info(const String& message);
- void log(const String& message);
- void warn(const String& message);
+ void addMessage(MessageSource, MessageLevel, const String& message, unsigned lineNumber, const String& sourceURL);
+
+#if USE(JSC)
+ void debug(JSC::ExecState*, const JSC::ArgList&);
+ void error(JSC::ExecState*, const JSC::ArgList&);
+ void info(JSC::ExecState*, const JSC::ArgList&);
+ void log(JSC::ExecState*, const JSC::ArgList&);
+ void warn(JSC::ExecState*, const JSC::ArgList&);
+ void dir(JSC::ExecState*, const JSC::ArgList&);
+ void dirxml(JSC::ExecState*, const JSC::ArgList& arguments);
+ void trace(JSC::ExecState*);
+ void assertCondition(bool condition, JSC::ExecState*, const JSC::ArgList&);
+ void count(JSC::ExecState*, const JSC::ArgList&);
+ void profile(JSC::ExecState*, const JSC::ArgList&);
+ void profileEnd(JSC::ExecState*, const JSC::ArgList&);
+ void time(const JSC::UString& title);
+ void timeEnd(JSC::ExecState*, const JSC::ArgList&);
+ void group(JSC::ExecState*, const JSC::ArgList&);
+ void groupEnd();
+
+ void reportException(JSC::ExecState*, JSC::JSValue*);
+ void reportCurrentException(JSC::ExecState*);
+
+ static bool shouldPrintExceptions();
+ static void setShouldPrintExceptions(bool);
+
+ const ProfilesArray& profiles() const { return m_profiles; }
+#endif
private:
+ inline Page* page() const;
+
+ Console(Frame*);
+
Frame* m_frame;
+ ProfilesArray m_profiles;
};
} // namespace WebCore