OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 ThreadDebugger_h | 5 #ifndef ThreadDebugger_h |
6 #define ThreadDebugger_h | 6 #define ThreadDebugger_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/inspector/ConsoleTypes.h" |
9 #include "platform/Timer.h" | 10 #include "platform/Timer.h" |
10 #include "platform/UserGestureIndicator.h" | 11 #include "platform/UserGestureIndicator.h" |
11 #include "platform/v8_inspector/public/V8Debugger.h" | 12 #include "platform/v8_inspector/public/V8Debugger.h" |
12 #include "platform/v8_inspector/public/V8DebuggerClient.h" | 13 #include "platform/v8_inspector/public/V8DebuggerClient.h" |
13 #include "wtf/Forward.h" | 14 #include "wtf/Forward.h" |
14 #include "wtf/Vector.h" | 15 #include "wtf/Vector.h" |
15 #include <memory> | 16 #include <memory> |
16 #include <v8.h> | 17 #include <v8.h> |
17 | 18 |
18 namespace blink { | 19 namespace blink { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 void cancelTimer(void* data) override; | 59 void cancelTimer(void* data) override; |
59 | 60 |
60 V8Debugger* debugger() const { return m_debugger.get(); } | 61 V8Debugger* debugger() const { return m_debugger.get(); } |
61 virtual bool isWorker() { return true; } | 62 virtual bool isWorker() { return true; } |
62 virtual void reportConsoleMessage(ExecutionContext*, ConsoleMessage*) = 0; | 63 virtual void reportConsoleMessage(ExecutionContext*, ConsoleMessage*) = 0; |
63 virtual int contextGroupId(ExecutionContext*) = 0; | 64 virtual int contextGroupId(ExecutionContext*) = 0; |
64 | 65 |
65 protected: | 66 protected: |
66 void createFunctionProperty(v8::Local<v8::Context>, v8::Local<v8::Object>, c
onst char* name, v8::FunctionCallback, const char* description); | 67 void createFunctionProperty(v8::Local<v8::Context>, v8::Local<v8::Object>, c
onst char* name, v8::FunctionCallback, const char* description); |
67 void onTimer(TimerBase*); | 68 void onTimer(TimerBase*); |
| 69 static MessageLevel consoleAPITypeToMessageLevel(V8ConsoleAPIType); |
68 | 70 |
69 v8::Isolate* m_isolate; | 71 v8::Isolate* m_isolate; |
70 std::unique_ptr<V8Debugger> m_debugger; | 72 std::unique_ptr<V8Debugger> m_debugger; |
71 | 73 |
72 private: | 74 private: |
73 static void setMonitorEventsCallback(const v8::FunctionCallbackInfo<v8::Valu
e>&, bool enabled); | 75 static void setMonitorEventsCallback(const v8::FunctionCallbackInfo<v8::Valu
e>&, bool enabled); |
74 static void monitorEventsCallback(const v8::FunctionCallbackInfo<v8::Value>&
); | 76 static void monitorEventsCallback(const v8::FunctionCallbackInfo<v8::Value>&
); |
75 static void unmonitorEventsCallback(const v8::FunctionCallbackInfo<v8::Value
>&); | 77 static void unmonitorEventsCallback(const v8::FunctionCallbackInfo<v8::Value
>&); |
76 | 78 |
77 static void getEventListenersCallback(const v8::FunctionCallbackInfo<v8::Val
ue>&); | 79 static void getEventListenersCallback(const v8::FunctionCallbackInfo<v8::Val
ue>&); |
78 | 80 |
79 bool m_asyncInstrumentationEnabled; | 81 bool m_asyncInstrumentationEnabled; |
80 Vector<std::unique_ptr<Timer<ThreadDebugger>>> m_timers; | 82 Vector<std::unique_ptr<Timer<ThreadDebugger>>> m_timers; |
81 Vector<V8DebuggerClient::TimerCallback> m_timerCallbacks; | 83 Vector<V8DebuggerClient::TimerCallback> m_timerCallbacks; |
82 Vector<void*> m_timerData; | 84 Vector<void*> m_timerData; |
83 std::unique_ptr<UserGestureIndicator> m_userGestureIndicator; | 85 std::unique_ptr<UserGestureIndicator> m_userGestureIndicator; |
84 }; | 86 }; |
85 | 87 |
86 } // namespace blink | 88 } // namespace blink |
87 | 89 |
88 #endif // ThreadDebugger_h | 90 #endif // ThreadDebugger_h |
OLD | NEW |