| 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 "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/inspector/ConsoleTypes.h" |
| 9 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
| 10 #include "platform/v8_inspector/public/ConsoleAPITypes.h" | |
| 11 #include "platform/v8_inspector/public/ConsoleTypes.h" | |
| 12 #include "wtf/Forward.h" | 11 #include "wtf/Forward.h" |
| 13 #include "wtf/PassRefPtr.h" | 12 #include "wtf/PassRefPtr.h" |
| 14 #include "wtf/RefCounted.h" | 13 #include "wtf/RefCounted.h" |
| 15 #include "wtf/text/WTFString.h" | 14 #include "wtf/text/WTFString.h" |
| 16 #include <memory> | 15 #include <memory> |
| 17 | 16 |
| 18 namespace blink { | 17 namespace blink { |
| 19 | 18 |
| 20 class LocalDOMWindow; | |
| 21 class ScriptArguments; | |
| 22 class SourceLocation; | 19 class SourceLocation; |
| 23 class V8StackTrace; | |
| 24 | 20 |
| 25 class CORE_EXPORT ConsoleMessage final: public GarbageCollectedFinalized<Console
Message> { | 21 class CORE_EXPORT ConsoleMessage final: public GarbageCollectedFinalized<Console
Message> { |
| 26 public: | 22 public: |
| 27 // Location should not be null. Zero lineNumber or columnNumber means unknow
n. | 23 // Location should not be null. Zero lineNumber or columnNumber means unknow
n. |
| 28 static ConsoleMessage* create(MessageSource, MessageLevel, const String& mes
sage, std::unique_ptr<SourceLocation>, ScriptArguments* = nullptr); | 24 static ConsoleMessage* create(MessageSource, MessageLevel, const String& mes
sage, std::unique_ptr<SourceLocation>); |
| 29 | 25 |
| 30 // Shortcut when location is unknown. Captures current location. | 26 // Shortcut when location is unknown. Captures current location. |
| 31 static ConsoleMessage* create(MessageSource, MessageLevel, const String& mes
sage); | 27 static ConsoleMessage* create(MessageSource, MessageLevel, const String& mes
sage); |
| 32 | 28 |
| 33 // This method captures current location. | 29 // This method captures current location. |
| 34 static ConsoleMessage* createForRequest(MessageSource, MessageLevel, const S
tring& message, const String& url, unsigned long requestIdentifier); | 30 static ConsoleMessage* createForRequest(MessageSource, MessageLevel, const S
tring& message, const String& url, unsigned long requestIdentifier); |
| 35 | 31 |
| 36 // This method captures current location. | |
| 37 static ConsoleMessage* createForConsoleAPI(MessageLevel, MessageType, const
String& message, ScriptArguments*); | |
| 38 | |
| 39 ~ConsoleMessage(); | 32 ~ConsoleMessage(); |
| 40 | 33 |
| 41 MessageType type() const; | |
| 42 SourceLocation* location() const; | 34 SourceLocation* location() const; |
| 43 ScriptArguments* scriptArguments() const; | |
| 44 unsigned long requestIdentifier() const; | 35 unsigned long requestIdentifier() const; |
| 45 double timestamp() const; | 36 double timestamp() const; |
| 46 unsigned assignMessageId(); | |
| 47 unsigned messageId() const { return m_messageId; } | |
| 48 unsigned relatedMessageId() const { return m_relatedMessageId; } | |
| 49 void setRelatedMessageId(unsigned relatedMessageId) { m_relatedMessageId = r
elatedMessageId; } | |
| 50 MessageSource source() const; | 37 MessageSource source() const; |
| 51 MessageLevel level() const; | 38 MessageLevel level() const; |
| 52 const String& message() const; | 39 const String& message() const; |
| 53 | 40 |
| 54 void frameWindowDiscarded(LocalDOMWindow*); | |
| 55 unsigned argumentCount(); | |
| 56 | |
| 57 DECLARE_TRACE(); | 41 DECLARE_TRACE(); |
| 58 | 42 |
| 59 private: | 43 private: |
| 60 ConsoleMessage(MessageSource, MessageLevel, const String& message, std::uniq
ue_ptr<SourceLocation>, ScriptArguments*); | 44 ConsoleMessage(MessageSource, MessageLevel, const String& message, std::uniq
ue_ptr<SourceLocation>); |
| 61 | 45 |
| 62 MessageSource m_source; | 46 MessageSource m_source; |
| 63 MessageLevel m_level; | 47 MessageLevel m_level; |
| 64 MessageType m_type; | |
| 65 String m_message; | 48 String m_message; |
| 66 std::unique_ptr<SourceLocation> m_location; | 49 std::unique_ptr<SourceLocation> m_location; |
| 67 Member<ScriptArguments> m_scriptArguments; | |
| 68 unsigned long m_requestIdentifier; | 50 unsigned long m_requestIdentifier; |
| 69 double m_timestamp; | 51 double m_timestamp; |
| 70 unsigned m_messageId; | |
| 71 unsigned m_relatedMessageId; | |
| 72 }; | 52 }; |
| 73 | 53 |
| 74 } // namespace blink | 54 } // namespace blink |
| 75 | 55 |
| 76 #endif // ConsoleMessage_h | 56 #endif // ConsoleMessage_h |
| OLD | NEW |