Chromium Code Reviews| 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" | |
| 11 #include "core/inspector/ScriptArguments.h" | |
| 10 #include "core/inspector/ScriptCallStack.h" | 12 #include "core/inspector/ScriptCallStack.h" |
| 11 #include "platform/heap/Handle.h" | 13 #include "platform/heap/Handle.h" |
| 12 #include "wtf/Forward.h" | 14 #include "wtf/Forward.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 |
| 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 | 31 |
| 30 ~ConsoleMessage(); | 32 MessageType type() const; |
| 31 | 33 void setType(MessageType); |
| 34 const String& url() const; | |
| 35 void setURL(const String&); | |
| 36 unsigned lineNumber() const; | |
| 37 void setLineNumber(unsigned); | |
| 32 PassRefPtrWillBeRawPtr<ScriptCallStack> callStack() const; | 38 PassRefPtrWillBeRawPtr<ScriptCallStack> callStack() const; |
| 33 void setCallStack(PassRefPtrWillBeRawPtr<ScriptCallStack>); | 39 void setCallStack(PassRefPtrWillBeRawPtr<ScriptCallStack>); |
| 34 ScriptState* scriptState() const; | 40 ScriptState* scriptState() const; |
| 35 void setScriptState(ScriptState*); | 41 void setScriptState(ScriptState*); |
| 42 PassRefPtr<ScriptArguments> scriptArguments() const; | |
| 43 void setScriptArguments(PassRefPtr<ScriptArguments>); | |
| 36 unsigned long requestIdentifier() const; | 44 unsigned long requestIdentifier() const; |
| 37 void setRequestIdentifier(unsigned long); | 45 void setRequestIdentifier(unsigned long); |
| 38 const String& url() const; | 46 WorkerGlobalScopeProxy* workerId() { return m_workerProxy; } |
| 39 void setURL(const String&); | 47 void setWorkerId(WorkerGlobalScopeProxy* proxy) { m_workerProxy = proxy; } |
| 40 unsigned lineNumber() const; | |
| 41 void setLineNumber(unsigned); | |
| 42 | 48 |
| 43 MessageSource source() const; | 49 MessageSource source() const; |
| 44 MessageLevel level() const; | 50 MessageLevel level() const; |
| 45 const String& message() const; | 51 const String& message() const; |
| 46 unsigned columnNumber() const; | 52 unsigned columnNumber() const; |
| 47 void setWorkerId(WorkerGlobalScopeProxy* proxy) { m_workerProxy = proxy; } | |
| 48 WorkerGlobalScopeProxy* workerId() { return m_workerProxy; } | |
| 49 | 53 |
| 50 void trace(Visitor*); | 54 void trace(Visitor*); |
| 51 | 55 |
| 52 private: | 56 private: |
| 53 ConsoleMessage(); | |
| 54 ConsoleMessage(MessageSource, MessageLevel, const String& message, const Str ing& url = String(), unsigned lineNumber = 0, unsigned columnNumber = 0); | 57 ConsoleMessage(MessageSource, MessageLevel, const String& message, const Str ing& url = String(), unsigned lineNumber = 0, unsigned columnNumber = 0); |
| 55 | 58 |
| 56 MessageSource m_source; | 59 MessageSource m_source; |
| 57 MessageLevel m_level; | 60 MessageLevel m_level; |
| 61 MessageType m_type; | |
| 58 String m_message; | 62 String m_message; |
| 59 String m_url; | 63 String m_url; |
| 60 unsigned m_lineNumber; | 64 unsigned m_lineNumber; |
| 61 unsigned m_columnNumber; | 65 unsigned m_columnNumber; |
| 62 RefPtrWillBeMember<ScriptCallStack> m_callStack; | 66 RefPtrWillBeMember<ScriptCallStack> m_callStack; |
| 63 ScriptState* m_scriptState; | 67 OwnPtr<ScriptStateProtectingContext> m_scriptState; |
|
vsevik
2014/08/18 18:41:06
You don't need OwnPtr here, ScriptStateProtectingC
kozyatinskiy1
2014/08/19 07:31:06
I can't support setScriptState without OwnPtr. Scr
| |
| 68 RefPtr<ScriptArguments> m_scriptArguments; | |
| 64 unsigned long m_requestIdentifier; | 69 unsigned long m_requestIdentifier; |
| 65 WorkerGlobalScopeProxy* m_workerProxy; | 70 WorkerGlobalScopeProxy* m_workerProxy; |
| 66 }; | 71 }; |
| 67 | 72 |
| 68 } // namespace blink | 73 } // namespace blink |
| 69 | 74 |
| 70 #endif // ConsoleMessage_h | 75 #endif // ConsoleMessage_h |
| OLD | NEW |