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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « Source/core/inspector/ConsoleMessage.h ('k') | Source/core/inspector/InspectorConsoleAgent.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "config.h" 5 #include "config.h"
6 #include "core/inspector/ConsoleMessage.h" 6 #include "core/inspector/ConsoleMessage.h"
7 7
8 #include "bindings/core/v8/ScriptCallStackFactory.h" 8 #include "bindings/core/v8/ScriptCallStackFactory.h"
9 #include "bindings/core/v8/ScriptValue.h" 9 #include "bindings/core/v8/ScriptValue.h"
10 #include "core/inspector/ScriptArguments.h" 10 #include "core/inspector/ScriptArguments.h"
11 #include "wtf/CurrentTime.h" 11 #include "wtf/CurrentTime.h"
12 #include "wtf/PassOwnPtr.h" 12 #include "wtf/PassOwnPtr.h"
13 13
14 namespace blink { 14 namespace blink {
15 15
16 unsigned nextMessageId()
17 {
18 struct MessageId {
19 MessageId() : value(0) { }
20 unsigned value;
21 };
22
23 AtomicallyInitializedStaticReference(WTF::ThreadSpecific<MessageId>, message Id, new WTF::ThreadSpecific<MessageId>);
24 return ++messageId->value;
25 }
26
16 ConsoleMessage::ConsoleMessage(MessageSource source, 27 ConsoleMessage::ConsoleMessage(MessageSource source,
17 MessageLevel level, 28 MessageLevel level,
18 const String& message, 29 const String& message,
19 const String& url, 30 const String& url,
20 unsigned lineNumber, 31 unsigned lineNumber,
21 unsigned columnNumber) 32 unsigned columnNumber)
22 : m_source(source) 33 : m_source(source)
23 , m_level(level) 34 , m_level(level)
24 , m_type(LogMessageType) 35 , m_type(LogMessageType)
25 , m_message(message) 36 , m_message(message)
26 , m_scriptId(0) 37 , m_scriptId(0)
27 , m_url(url) 38 , m_url(url)
28 , m_lineNumber(lineNumber) 39 , m_lineNumber(lineNumber)
29 , m_columnNumber(columnNumber) 40 , m_columnNumber(columnNumber)
30 , m_requestIdentifier(0) 41 , m_requestIdentifier(0)
31 , m_timestamp(WTF::currentTime()) 42 , m_timestamp(WTF::currentTime())
32 , m_workerProxy(nullptr) 43 , m_workerProxy(nullptr)
44 , m_messageId(0)
45 , m_relatedMessageId(0)
33 { 46 {
34 } 47 }
35 48
36 ConsoleMessage::~ConsoleMessage() 49 ConsoleMessage::~ConsoleMessage()
37 { 50 {
38 } 51 }
39 52
40 MessageType ConsoleMessage::type() const 53 MessageType ConsoleMessage::type() const
41 { 54 {
42 return m_type; 55 return m_type;
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 double ConsoleMessage::timestamp() const 141 double ConsoleMessage::timestamp() const
129 { 142 {
130 return m_timestamp; 143 return m_timestamp;
131 } 144 }
132 145
133 void ConsoleMessage::setTimestamp(double timestamp) 146 void ConsoleMessage::setTimestamp(double timestamp)
134 { 147 {
135 m_timestamp = timestamp; 148 m_timestamp = timestamp;
136 } 149 }
137 150
151 unsigned ConsoleMessage::assignMessageId()
152 {
153 if (!m_messageId)
154 m_messageId = nextMessageId();
155 return m_messageId;
156 }
157
138 MessageSource ConsoleMessage::source() const 158 MessageSource ConsoleMessage::source() const
139 { 159 {
140 return m_source; 160 return m_source;
141 } 161 }
142 162
143 MessageLevel ConsoleMessage::level() const 163 MessageLevel ConsoleMessage::level() const
144 { 164 {
145 return m_level; 165 return m_level;
146 } 166 }
147 167
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 m_callStack.clear(); 216 m_callStack.clear();
197 } 217 }
198 218
199 DEFINE_TRACE(ConsoleMessage) 219 DEFINE_TRACE(ConsoleMessage)
200 { 220 {
201 visitor->trace(m_callStack); 221 visitor->trace(m_callStack);
202 visitor->trace(m_scriptArguments); 222 visitor->trace(m_scriptArguments);
203 } 223 }
204 224
205 } // namespace blink 225 } // namespace blink
OLDNEW
« 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