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

Side by Side Diff: Source/core/inspector/ConsoleMessage.h

Issue 466753002: DevTools: Do not push to frontend messages from worker while it is alive (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address vsevik's comments Created 6 years, 4 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 | Annotate | Revision Log
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 #ifndef ConsoleMessage_h 5 #ifndef ConsoleMessage_h
6 #define ConsoleMessage_h 6 #define ConsoleMessage_h
7 7
8 #include "bindings/core/v8/ScriptState.h" 8 #include "bindings/core/v8/ScriptState.h"
9 #include "core/frame/ConsoleTypes.h" 9 #include "core/frame/ConsoleTypes.h"
10 #include "core/inspector/ScriptCallStack.h" 10 #include "core/inspector/ScriptCallStack.h"
11 #include "platform/heap/Handle.h" 11 #include "platform/heap/Handle.h"
12 #include "wtf/Forward.h" 12 #include "wtf/Forward.h"
13 #include "wtf/PassRefPtr.h" 13 #include "wtf/PassRefPtr.h"
14 #include "wtf/RefCounted.h" 14 #include "wtf/RefCounted.h"
15 #include "wtf/text/WTFString.h" 15 #include "wtf/text/WTFString.h"
16 16
17 namespace blink { 17 namespace blink {
18 18
19 class ScriptCallStack; 19 class ScriptCallStack;
20 class ScriptState; 20 class ScriptState;
21 class WorkerGlobalScopeProxy;
21 22
22 class ConsoleMessage FINAL: public RefCountedWillBeGarbageCollectedFinalized<Con soleMessage> { 23 class ConsoleMessage FINAL: public RefCountedWillBeGarbageCollectedFinalized<Con soleMessage> {
23 public: 24 public:
24 static PassRefPtrWillBeRawPtr<ConsoleMessage> create(MessageSource source, M essageLevel level, const String& message, const String& url = String(), unsigned lineNumber = 0, unsigned columnNumber = 0) 25 static PassRefPtrWillBeRawPtr<ConsoleMessage> create(MessageSource source, M essageLevel level, const String& message, const String& url = String(), unsigned lineNumber = 0, unsigned columnNumber = 0)
25 { 26 {
26 return adoptRefWillBeNoop(new ConsoleMessage(source, level, message, url , lineNumber, columnNumber)); 27 return adoptRefWillBeNoop(new ConsoleMessage(source, level, message, url , lineNumber, columnNumber));
27 } 28 }
28 29
29 ~ConsoleMessage(); 30 ~ConsoleMessage();
30 31
31 PassRefPtrWillBeRawPtr<ScriptCallStack> callStack() const; 32 PassRefPtrWillBeRawPtr<ScriptCallStack> callStack() const;
32 void setCallStack(PassRefPtrWillBeRawPtr<ScriptCallStack>); 33 void setCallStack(PassRefPtrWillBeRawPtr<ScriptCallStack>);
33 ScriptState* scriptState() const; 34 ScriptState* scriptState() const;
34 void setScriptState(ScriptState*); 35 void setScriptState(ScriptState*);
35 unsigned long requestIdentifier() const; 36 unsigned long requestIdentifier() const;
36 void setRequestIdentifier(unsigned long); 37 void setRequestIdentifier(unsigned long);
37 const String& url() const; 38 const String& url() const;
38 void setURL(const String&); 39 void setURL(const String&);
39 unsigned lineNumber() const; 40 unsigned lineNumber() const;
40 void setLineNumber(unsigned); 41 void setLineNumber(unsigned);
41 42
42 MessageSource source() const; 43 MessageSource source() const;
43 MessageLevel level() const; 44 MessageLevel level() const;
44 const String& message() const; 45 const String& message() const;
45 unsigned columnNumber() const; 46 unsigned columnNumber() const;
47 void setWorkerId(WorkerGlobalScopeProxy* proxy) { m_workerProxy = proxy; }
48 WorkerGlobalScopeProxy* getWorkerId() { return m_workerProxy; }
vsevik 2014/08/12 15:46:07 workerId()
sergeyv 2014/08/12 16:00:58 Done.
46 49
47 void trace(Visitor*); 50 void trace(Visitor*);
48 51
49 private: 52 private:
50 ConsoleMessage(); 53 ConsoleMessage();
51 ConsoleMessage(MessageSource, MessageLevel, const String& message, const Str ing& url = String(), unsigned lineNumber = 0, unsigned columnNumber = 0); 54 ConsoleMessage(MessageSource, MessageLevel, const String& message, const Str ing& url = String(), unsigned lineNumber = 0, unsigned columnNumber = 0);
52 55
53 MessageSource m_source; 56 MessageSource m_source;
54 MessageLevel m_level; 57 MessageLevel m_level;
55 String m_message; 58 String m_message;
56 String m_url; 59 String m_url;
57 unsigned m_lineNumber; 60 unsigned m_lineNumber;
58 unsigned m_columnNumber; 61 unsigned m_columnNumber;
59 RefPtrWillBeMember<ScriptCallStack> m_callStack; 62 RefPtrWillBeMember<ScriptCallStack> m_callStack;
60 ScriptState* m_scriptState; 63 ScriptState* m_scriptState;
61 unsigned long m_requestIdentifier; 64 unsigned long m_requestIdentifier;
65 WorkerGlobalScopeProxy* m_workerProxy;
62 }; 66 };
63 67
64 } // namespace WebCore 68 } // namespace WebCore
65 69
66 #endif // ConsoleMessage_h 70 #endif // ConsoleMessage_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698