Index: Source/core/inspector/ConsoleMessage.cpp |
diff --git a/Source/core/inspector/ConsoleMessage.cpp b/Source/core/inspector/ConsoleMessage.cpp |
index f2800f4dfa09685441db2b3b00876934b1dc6b70..0bbbc3dce4aaa5ffef4884b0c7f33a8f36130d44 100644 |
--- a/Source/core/inspector/ConsoleMessage.cpp |
+++ b/Source/core/inspector/ConsoleMessage.cpp |
@@ -13,6 +13,17 @@ |
namespace blink { |
+unsigned nextMessageId() |
+{ |
+ struct MessageId { |
+ MessageId() : value(0) { } |
+ unsigned value; |
+ }; |
+ |
+ AtomicallyInitializedStaticReference(WTF::ThreadSpecific<MessageId>, messageId, new WTF::ThreadSpecific<MessageId>); |
+ return ++messageId->value; |
+} |
+ |
ConsoleMessage::ConsoleMessage(MessageSource source, |
MessageLevel level, |
const String& message, |
@@ -30,6 +41,8 @@ ConsoleMessage::ConsoleMessage(MessageSource source, |
, m_requestIdentifier(0) |
, m_timestamp(WTF::currentTime()) |
, m_workerProxy(nullptr) |
+ , m_messageId(0) |
+ , m_relatedMessageId(0) |
{ |
} |
@@ -135,6 +148,13 @@ void ConsoleMessage::setTimestamp(double timestamp) |
m_timestamp = timestamp; |
} |
+unsigned ConsoleMessage::assignMessageId() |
+{ |
+ if (!m_messageId) |
+ m_messageId = nextMessageId(); |
+ return m_messageId; |
+} |
+ |
MessageSource ConsoleMessage::source() const |
{ |
return m_source; |