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 "core/inspector/ConsoleTypes.h" |
10 #include "platform/heap/Handle.h" | 10 #include "platform/heap/Handle.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 public: | 22 public: |
23 // 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. |
24 static ConsoleMessage* create(MessageSource, MessageLevel, const String& mes
sage, std::unique_ptr<SourceLocation>); | 24 static ConsoleMessage* create(MessageSource, MessageLevel, const String& mes
sage, std::unique_ptr<SourceLocation>); |
25 | 25 |
26 // Shortcut when location is unknown. Captures current location. | 26 // Shortcut when location is unknown. Captures current location. |
27 static ConsoleMessage* create(MessageSource, MessageLevel, const String& mes
sage); | 27 static ConsoleMessage* create(MessageSource, MessageLevel, const String& mes
sage); |
28 | 28 |
29 // This method captures current location. | 29 // This method captures current location. |
30 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); |
31 | 31 |
| 32 // This creates message from WorkerMessageSource. |
| 33 static ConsoleMessage* createFromWorker(MessageLevel, const String& message,
std::unique_ptr<SourceLocation>, const String& workerId); |
| 34 |
32 ~ConsoleMessage(); | 35 ~ConsoleMessage(); |
33 | 36 |
34 SourceLocation* location() const; | 37 SourceLocation* location() const; |
35 unsigned long requestIdentifier() const; | 38 unsigned long requestIdentifier() const; |
36 double timestamp() const; | 39 double timestamp() const; |
37 MessageSource source() const; | 40 MessageSource source() const; |
38 MessageLevel level() const; | 41 MessageLevel level() const; |
39 const String& message() const; | 42 const String& message() const; |
| 43 const String& workerId() const; |
40 | 44 |
41 DECLARE_TRACE(); | 45 DECLARE_TRACE(); |
42 | 46 |
43 private: | 47 private: |
44 ConsoleMessage(MessageSource, MessageLevel, const String& message, std::uniq
ue_ptr<SourceLocation>); | 48 ConsoleMessage(MessageSource, MessageLevel, const String& message, std::uniq
ue_ptr<SourceLocation>); |
45 | 49 |
46 MessageSource m_source; | 50 MessageSource m_source; |
47 MessageLevel m_level; | 51 MessageLevel m_level; |
48 String m_message; | 52 String m_message; |
49 std::unique_ptr<SourceLocation> m_location; | 53 std::unique_ptr<SourceLocation> m_location; |
50 unsigned long m_requestIdentifier; | 54 unsigned long m_requestIdentifier; |
51 double m_timestamp; | 55 double m_timestamp; |
| 56 String m_workerId; |
52 }; | 57 }; |
53 | 58 |
54 } // namespace blink | 59 } // namespace blink |
55 | 60 |
56 #endif // ConsoleMessage_h | 61 #endif // ConsoleMessage_h |
OLD | NEW |