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 "platform/Timer.h" | 9 #include "platform/Timer.h" |
10 #include "platform/UserGestureIndicator.h" | 10 #include "platform/UserGestureIndicator.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 void installAdditionalCommandLineAPI(v8::Local<v8::Context>, v8::Local<v8::O
bject>) override; | 53 void installAdditionalCommandLineAPI(v8::Local<v8::Context>, v8::Local<v8::O
bject>) override; |
54 void consoleTime(const String16& title) override; | 54 void consoleTime(const String16& title) override; |
55 void consoleTimeEnd(const String16& title) override; | 55 void consoleTimeEnd(const String16& title) override; |
56 void consoleTimeStamp(const String16& title) override; | 56 void consoleTimeStamp(const String16& title) override; |
57 void startRepeatingTimer(double, V8DebuggerClient::TimerCallback, void* data
) override; | 57 void startRepeatingTimer(double, V8DebuggerClient::TimerCallback, void* data
) override; |
58 void cancelTimer(void* data) override; | 58 void cancelTimer(void* data) override; |
59 | 59 |
60 V8Debugger* debugger() const { return m_debugger.get(); } | 60 V8Debugger* debugger() const { return m_debugger.get(); } |
61 virtual bool isWorker() { return true; } | 61 virtual bool isWorker() { return true; } |
62 virtual void reportConsoleMessage(ExecutionContext*, ConsoleMessage*) = 0; | 62 virtual void reportConsoleMessage(ExecutionContext*, ConsoleMessage*) = 0; |
| 63 virtual int contextGroupId(ExecutionContext*) = 0; |
63 | 64 |
64 protected: | 65 protected: |
65 void createFunctionProperty(v8::Local<v8::Context>, v8::Local<v8::Object>, c
onst char* name, v8::FunctionCallback, const char* description); | 66 void createFunctionProperty(v8::Local<v8::Context>, v8::Local<v8::Object>, c
onst char* name, v8::FunctionCallback, const char* description); |
66 void onTimer(Timer<ThreadDebugger>*); | 67 void onTimer(Timer<ThreadDebugger>*); |
67 | 68 |
68 v8::Isolate* m_isolate; | 69 v8::Isolate* m_isolate; |
69 std::unique_ptr<V8Debugger> m_debugger; | 70 std::unique_ptr<V8Debugger> m_debugger; |
70 | 71 |
71 private: | 72 private: |
72 v8::Local<v8::Function> eventLogFunction(); | 73 v8::Local<v8::Function> eventLogFunction(); |
73 | 74 |
74 static void setMonitorEventsCallback(const v8::FunctionCallbackInfo<v8::Valu
e>&, bool enabled); | 75 static void setMonitorEventsCallback(const v8::FunctionCallbackInfo<v8::Valu
e>&, bool enabled); |
75 static void monitorEventsCallback(const v8::FunctionCallbackInfo<v8::Value>&
); | 76 static void monitorEventsCallback(const v8::FunctionCallbackInfo<v8::Value>&
); |
76 static void unmonitorEventsCallback(const v8::FunctionCallbackInfo<v8::Value
>&); | 77 static void unmonitorEventsCallback(const v8::FunctionCallbackInfo<v8::Value
>&); |
77 static void logCallback(const v8::FunctionCallbackInfo<v8::Value>&); | 78 static void logCallback(const v8::FunctionCallbackInfo<v8::Value>&); |
78 | 79 |
79 static void getEventListenersCallback(const v8::FunctionCallbackInfo<v8::Val
ue>&); | 80 static void getEventListenersCallback(const v8::FunctionCallbackInfo<v8::Val
ue>&); |
80 | 81 |
81 bool m_asyncInstrumentationEnabled; | 82 bool m_asyncInstrumentationEnabled; |
82 Vector<std::unique_ptr<Timer<ThreadDebugger>>> m_timers; | 83 Vector<std::unique_ptr<Timer<ThreadDebugger>>> m_timers; |
83 Vector<V8DebuggerClient::TimerCallback> m_timerCallbacks; | 84 Vector<V8DebuggerClient::TimerCallback> m_timerCallbacks; |
84 Vector<void*> m_timerData; | 85 Vector<void*> m_timerData; |
85 std::unique_ptr<UserGestureIndicator> m_userGestureIndicator; | 86 std::unique_ptr<UserGestureIndicator> m_userGestureIndicator; |
86 v8::Global<v8::Function> m_eventLogFunction; | 87 v8::Global<v8::Function> m_eventLogFunction; |
87 }; | 88 }; |
88 | 89 |
89 } // namespace blink | 90 } // namespace blink |
90 | 91 |
91 #endif // ThreadDebugger_h | 92 #endif // ThreadDebugger_h |
OLD | NEW |