Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Unified Diff: Source/core/inspector/ConsoleMessage.cpp

Issue 1095943002: DevTools: [console] Logged promise rejections do not change state once handled (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: for landing Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/inspector/ConsoleMessage.h ('k') | Source/core/inspector/InspectorConsoleAgent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « Source/core/inspector/ConsoleMessage.h ('k') | Source/core/inspector/InspectorConsoleAgent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698