| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef ConsoleMessage_h | 5 #ifndef ConsoleMessage_h |
| 6 #define ConsoleMessage_h | 6 #define ConsoleMessage_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptState.h" | 8 #include "bindings/core/v8/ScriptState.h" |
| 9 #include "core/frame/ConsoleTypes.h" | 9 #include "core/frame/ConsoleTypes.h" |
| 10 #include "core/inspector/ConsoleAPITypes.h" |
| 10 #include "core/inspector/ScriptCallStack.h" | 11 #include "core/inspector/ScriptCallStack.h" |
| 11 #include "platform/heap/Handle.h" | 12 #include "platform/heap/Handle.h" |
| 12 #include "wtf/Forward.h" | 13 #include "wtf/Forward.h" |
| 14 #include "wtf/OwnPtr.h" |
| 13 #include "wtf/PassRefPtr.h" | 15 #include "wtf/PassRefPtr.h" |
| 14 #include "wtf/RefCounted.h" | 16 #include "wtf/RefCounted.h" |
| 15 #include "wtf/text/WTFString.h" | 17 #include "wtf/text/WTFString.h" |
| 16 | 18 |
| 17 namespace blink { | 19 namespace blink { |
| 18 | 20 |
| 21 class InjectedScriptManager; |
| 22 class ScriptArguments; |
| 19 class ScriptCallStack; | 23 class ScriptCallStack; |
| 20 class ScriptState; | 24 class ScriptState; |
| 21 class WorkerGlobalScopeProxy; | 25 class WorkerGlobalScopeProxy; |
| 22 | 26 |
| 23 class ConsoleMessage FINAL: public RefCountedWillBeGarbageCollectedFinalized<Con
soleMessage> { | 27 class ConsoleMessage FINAL: public RefCountedWillBeGarbageCollectedFinalized<Con
soleMessage> { |
| 24 public: | 28 public: |
| 25 static PassRefPtrWillBeRawPtr<ConsoleMessage> create(MessageSource source, M
essageLevel level, const String& message, const String& url = String(), unsigned
lineNumber = 0, unsigned columnNumber = 0) | 29 static PassRefPtrWillBeRawPtr<ConsoleMessage> create(MessageSource source, M
essageLevel level, const String& message, const String& url = String(), unsigned
lineNumber = 0, unsigned columnNumber = 0) |
| 26 { | 30 { |
| 27 return adoptRefWillBeNoop(new ConsoleMessage(source, level, message, url
, lineNumber, columnNumber)); | 31 return adoptRefWillBeNoop(new ConsoleMessage(source, level, message, url
, lineNumber, columnNumber)); |
| 28 } | 32 } |
| 29 | 33 |
| 30 ~ConsoleMessage(); | 34 ~ConsoleMessage(); |
| 31 | 35 |
| 32 PassRefPtrWillBeRawPtr<ScriptCallStack> callStack() const; | 36 PassRefPtrWillBeRawPtr<ScriptCallStack> callStack() const; |
| 33 void setCallStack(PassRefPtrWillBeRawPtr<ScriptCallStack>); | 37 void setCallStack(PassRefPtrWillBeRawPtr<ScriptCallStack>); |
| 34 ScriptState* scriptState() const; | 38 ScriptState* scriptState() const; |
| 35 void setScriptState(ScriptState*); | 39 void setScriptState(ScriptState*); |
| 36 unsigned long requestIdentifier() const; | 40 unsigned long requestIdentifier() const; |
| 37 void setRequestIdentifier(unsigned long); | 41 void setRequestIdentifier(unsigned long); |
| 38 const String& url() const; | 42 const String& url() const; |
| 39 void setURL(const String&); | 43 void setURL(const String&); |
| 40 unsigned lineNumber() const; | 44 unsigned lineNumber() const; |
| 41 void setLineNumber(unsigned); | 45 void setLineNumber(unsigned); |
| 46 PassRefPtr<ScriptArguments> scriptArguments() const; |
| 47 void setScriptArguments(PassRefPtr<ScriptArguments>); |
| 48 MessageType type() const; |
| 49 void setType(MessageType); |
| 50 double timestamp() const; |
| 51 void setTimestamp(double); |
| 52 WorkerGlobalScopeProxy* workerId() { return m_workerProxy; } |
| 53 void setWorkerId(WorkerGlobalScopeProxy* proxy) { m_workerProxy = proxy; } |
| 42 | 54 |
| 43 MessageSource source() const; | 55 MessageSource source() const; |
| 44 MessageLevel level() const; | 56 MessageLevel level() const; |
| 45 const String& message() const; | 57 const String& message() const; |
| 46 unsigned columnNumber() const; | 58 unsigned columnNumber() const; |
| 47 void setWorkerId(WorkerGlobalScopeProxy* proxy) { m_workerProxy = proxy; } | 59 |
| 48 WorkerGlobalScopeProxy* workerId() { return m_workerProxy; } | 60 void windowCleared(LocalDOMWindow*); |
| 61 unsigned argumentCount(); |
| 62 |
| 63 void autogenerateMetadata(); |
| 49 | 64 |
| 50 void trace(Visitor*); | 65 void trace(Visitor*); |
| 51 | 66 |
| 52 private: | 67 private: |
| 53 ConsoleMessage(); | 68 ConsoleMessage(); |
| 54 ConsoleMessage(MessageSource, MessageLevel, const String& message, const Str
ing& url = String(), unsigned lineNumber = 0, unsigned columnNumber = 0); | 69 ConsoleMessage(MessageSource, MessageLevel, const String& message, const Str
ing& url = String(), unsigned lineNumber = 0, unsigned columnNumber = 0); |
| 55 | 70 |
| 56 MessageSource m_source; | 71 MessageSource m_source; |
| 72 MessageType m_type; |
| 57 MessageLevel m_level; | 73 MessageLevel m_level; |
| 58 String m_message; | 74 String m_message; |
| 59 String m_url; | 75 String m_url; |
| 60 unsigned m_lineNumber; | 76 unsigned m_lineNumber; |
| 61 unsigned m_columnNumber; | 77 unsigned m_columnNumber; |
| 78 RefPtr<ScriptArguments> m_arguments; |
| 62 RefPtrWillBeMember<ScriptCallStack> m_callStack; | 79 RefPtrWillBeMember<ScriptCallStack> m_callStack; |
| 63 ScriptState* m_scriptState; | 80 OwnPtr<ScriptStateProtectingContext> m_scriptState; |
| 64 unsigned long m_requestIdentifier; | 81 unsigned long m_requestIdentifier; |
| 65 WorkerGlobalScopeProxy* m_workerProxy; | 82 WorkerGlobalScopeProxy* m_workerProxy; |
| 83 double m_timestamp; |
| 66 }; | 84 }; |
| 67 | 85 |
| 68 } // namespace WebCore | 86 } // namespace WebCore |
| 69 | 87 |
| 70 #endif // ConsoleMessage_h | 88 #endif // ConsoleMessage_h |
| OLD | NEW |