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" |
13 #include "wtf/PassRefPtr.h" | 14 #include "wtf/PassRefPtr.h" |
14 #include "wtf/RefCounted.h" | 15 #include "wtf/RefCounted.h" |
15 #include "wtf/text/WTFString.h" | 16 #include "wtf/text/WTFString.h" |
16 | 17 |
17 namespace blink { | 18 namespace blink { |
18 | 19 |
| 20 class ScriptArguments; |
19 class ScriptCallStack; | 21 class ScriptCallStack; |
20 class ScriptState; | 22 class ScriptState; |
21 class WorkerGlobalScopeProxy; | 23 class WorkerGlobalScopeProxy; |
22 | 24 |
23 class ConsoleMessage FINAL: public RefCountedWillBeGarbageCollectedFinalized<Con
soleMessage> { | 25 class ConsoleMessage FINAL: public RefCountedWillBeGarbageCollectedFinalized<Con
soleMessage> { |
24 public: | 26 public: |
25 static PassRefPtrWillBeRawPtr<ConsoleMessage> create(MessageSource source, M
essageLevel level, const String& message, const String& url = String(), unsigned
lineNumber = 0, unsigned columnNumber = 0) | 27 static PassRefPtrWillBeRawPtr<ConsoleMessage> create(MessageSource source, M
essageLevel level, const String& message, const String& url = String(), unsigned
lineNumber = 0, unsigned columnNumber = 0) |
26 { | 28 { |
27 return adoptRefWillBeNoop(new ConsoleMessage(source, level, message, url
, lineNumber, columnNumber)); | 29 return adoptRefWillBeNoop(new ConsoleMessage(source, level, message, url
, lineNumber, columnNumber)); |
28 } | 30 } |
29 | |
30 ~ConsoleMessage(); | 31 ~ConsoleMessage(); |
31 | 32 |
| 33 MessageType type() const; |
| 34 void setType(MessageType); |
| 35 const String& url() const; |
| 36 void setURL(const String&); |
| 37 unsigned lineNumber() const; |
| 38 void setLineNumber(unsigned); |
32 PassRefPtrWillBeRawPtr<ScriptCallStack> callStack() const; | 39 PassRefPtrWillBeRawPtr<ScriptCallStack> callStack() const; |
33 void setCallStack(PassRefPtrWillBeRawPtr<ScriptCallStack>); | 40 void setCallStack(PassRefPtrWillBeRawPtr<ScriptCallStack>); |
34 ScriptState* scriptState() const; | 41 ScriptState* scriptState() const; |
35 void setScriptState(ScriptState*); | 42 void setScriptState(ScriptState*); |
| 43 PassRefPtr<ScriptArguments> scriptArguments() const; |
| 44 void setScriptArguments(PassRefPtr<ScriptArguments>); |
36 unsigned long requestIdentifier() const; | 45 unsigned long requestIdentifier() const; |
37 void setRequestIdentifier(unsigned long); | 46 void setRequestIdentifier(unsigned long); |
38 const String& url() const; | 47 WorkerGlobalScopeProxy* workerId() { return m_workerProxy; } |
39 void setURL(const String&); | 48 void setWorkerId(WorkerGlobalScopeProxy* proxy) { m_workerProxy = proxy; } |
40 unsigned lineNumber() const; | |
41 void setLineNumber(unsigned); | |
42 | 49 |
43 MessageSource source() const; | 50 MessageSource source() const; |
44 MessageLevel level() const; | 51 MessageLevel level() const; |
45 const String& message() const; | 52 const String& message() const; |
46 unsigned columnNumber() const; | 53 unsigned columnNumber() const; |
47 void setWorkerId(WorkerGlobalScopeProxy* proxy) { m_workerProxy = proxy; } | |
48 WorkerGlobalScopeProxy* workerId() { return m_workerProxy; } | |
49 | 54 |
50 void trace(Visitor*); | 55 void trace(Visitor*); |
51 | 56 |
52 private: | 57 private: |
53 ConsoleMessage(); | |
54 ConsoleMessage(MessageSource, MessageLevel, const String& message, const Str
ing& url = String(), unsigned lineNumber = 0, unsigned columnNumber = 0); | 58 ConsoleMessage(MessageSource, MessageLevel, const String& message, const Str
ing& url = String(), unsigned lineNumber = 0, unsigned columnNumber = 0); |
55 | 59 |
56 MessageSource m_source; | 60 MessageSource m_source; |
57 MessageLevel m_level; | 61 MessageLevel m_level; |
| 62 MessageType m_type; |
58 String m_message; | 63 String m_message; |
59 String m_url; | 64 String m_url; |
60 unsigned m_lineNumber; | 65 unsigned m_lineNumber; |
61 unsigned m_columnNumber; | 66 unsigned m_columnNumber; |
62 RefPtrWillBeMember<ScriptCallStack> m_callStack; | 67 RefPtrWillBeMember<ScriptCallStack> m_callStack; |
63 ScriptState* m_scriptState; | 68 OwnPtr<ScriptStateProtectingContext> m_scriptState; |
| 69 RefPtr<ScriptArguments> m_scriptArguments; |
64 unsigned long m_requestIdentifier; | 70 unsigned long m_requestIdentifier; |
65 WorkerGlobalScopeProxy* m_workerProxy; | 71 WorkerGlobalScopeProxy* m_workerProxy; |
66 }; | 72 }; |
67 | 73 |
68 } // namespace blink | 74 } // namespace blink |
69 | 75 |
70 #endif // ConsoleMessage_h | 76 #endif // ConsoleMessage_h |
OLD | NEW |