/*
* Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com>
- * Copyright (C) 2009 Google Inc. All rights reserved.
+ * Copyright (C) 2009, 2010 Google Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
#define ConsoleMessage_h
#include "Console.h"
-#include "ScriptObject.h"
#include "ScriptState.h"
+#include <wtf/Forward.h>
#include <wtf/Vector.h>
namespace WebCore {
- class InspectorFrontend;
- class ScriptCallStack;
- class ScriptString;
+class InjectedScriptHost;
+class InspectorFrontend;
+class InspectorObject;
+class ScriptArguments;
+class ScriptCallFrame;
+class ScriptCallStack;
+class ScriptValue;
- class ConsoleMessage : public Noncopyable {
- public:
- ConsoleMessage(MessageSource, MessageType, MessageLevel, const String& m, unsigned li, const String& u, unsigned g);
- ConsoleMessage(MessageSource, MessageType, MessageLevel, ScriptCallStack*, unsigned g, bool storeTrace = false);
+class ConsoleMessage : public Noncopyable {
+public:
+ ConsoleMessage(MessageSource, MessageType, MessageLevel, const String& m, unsigned li, const String& u, unsigned g);
+ ConsoleMessage(MessageSource, MessageType, MessageLevel, const String& m, PassOwnPtr<ScriptArguments>, PassOwnPtr<ScriptCallStack>, unsigned g);
-#if ENABLE(INSPECTOR)
- void addToConsole(InspectorFrontend* frontend);
- void updateRepeatCountInConsole(InspectorFrontend* frontend);
-#endif
- void incrementCount() { ++m_repeatCount; };
- bool isEqual(ScriptState*, ConsoleMessage* msg) const;
+ void addToFrontend(InspectorFrontend*, InjectedScriptHost*);
+ void updateRepeatCountInConsole(InspectorFrontend* frontend);
+ void incrementCount() { ++m_repeatCount; }
+ bool isEqual(ConsoleMessage* msg) const;
- MessageSource source() const { return m_source; }
- const String& message() const { return m_message; }
+ MessageSource source() const { return m_source; }
+ const String& message() const { return m_message; }
- private:
- MessageSource m_source;
- MessageType m_type;
- MessageLevel m_level;
- String m_message;
-#if ENABLE(INSPECTOR)
- Vector<ScriptValue> m_arguments;
- ScriptState* m_scriptState;
-#endif
- Vector<ScriptString> m_frames;
- unsigned m_line;
- String m_url;
- unsigned m_groupLevel;
- unsigned m_repeatCount;
- };
+private:
+ MessageSource m_source;
+ MessageType m_type;
+ MessageLevel m_level;
+ String m_message;
+ OwnPtr<ScriptArguments> m_arguments;
+ OwnPtr<ScriptCallStack> m_callStack;
+ unsigned m_line;
+ String m_url;
+ unsigned m_groupLevel;
+ unsigned m_repeatCount;
+};
} // namespace WebCore