| 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 22 matching lines...) Expand all Loading... |
| 33 | 33 |
| 34 // V8DebuggerClient implementation. | 34 // V8DebuggerClient implementation. |
| 35 void beginUserGesture() override; | 35 void beginUserGesture() override; |
| 36 void endUserGesture() override; | 36 void endUserGesture() override; |
| 37 String16 valueSubtype(v8::Local<v8::Value>) override; | 37 String16 valueSubtype(v8::Local<v8::Value>) override; |
| 38 bool formatAccessorsAsProperties(v8::Local<v8::Value>) override; | 38 bool formatAccessorsAsProperties(v8::Local<v8::Value>) override; |
| 39 bool isExecutionAllowed() override; | 39 bool isExecutionAllowed() override; |
| 40 double currentTimeMS() override; | 40 double currentTimeMS() override; |
| 41 bool isInspectableHeapObject(v8::Local<v8::Object>) override; | 41 bool isInspectableHeapObject(v8::Local<v8::Object>) override; |
| 42 void installAdditionalCommandLineAPI(v8::Local<v8::Context>, v8::Local<v8::O
bject>) override; | 42 void installAdditionalCommandLineAPI(v8::Local<v8::Context>, v8::Local<v8::O
bject>) override; |
| 43 void reportMessageToConsole(v8::Local<v8::Context>, MessageType, MessageLeve
l, const String16& message, const v8::FunctionCallbackInfo<v8::Value>* arguments
, unsigned skipArgumentCount) final; | |
| 44 void consoleTime(const String16& title) override; | 43 void consoleTime(const String16& title) override; |
| 45 void consoleTimeEnd(const String16& title) override; | 44 void consoleTimeEnd(const String16& title) override; |
| 46 void consoleTimeStamp(const String16& title) override; | 45 void consoleTimeStamp(const String16& title) override; |
| 47 void startRepeatingTimer(double, V8DebuggerClient::TimerCallback, void* data
) override; | 46 void startRepeatingTimer(double, V8DebuggerClient::TimerCallback, void* data
) override; |
| 48 void cancelTimer(void* data) override; | 47 void cancelTimer(void* data) override; |
| 49 | 48 |
| 50 V8Debugger* debugger() const { return m_debugger.get(); } | 49 V8Debugger* debugger() const { return m_debugger.get(); } |
| 51 virtual bool isWorker() { return true; } | 50 virtual bool isWorker() { return true; } |
| 51 |
| 52 protected: | 52 protected: |
| 53 void createFunctionProperty(v8::Local<v8::Context>, v8::Local<v8::Object>, c
onst char* name, v8::FunctionCallback, const char* description); | 53 void createFunctionProperty(v8::Local<v8::Context>, v8::Local<v8::Object>, c
onst char* name, v8::FunctionCallback, const char* description); |
| 54 virtual void reportMessageToConsole(v8::Local<v8::Context>, ConsoleMessage*)
= 0; | |
| 55 void onTimer(Timer<ThreadDebugger>*); | 54 void onTimer(Timer<ThreadDebugger>*); |
| 56 | 55 |
| 57 v8::Isolate* m_isolate; | 56 v8::Isolate* m_isolate; |
| 58 std::unique_ptr<V8Debugger> m_debugger; | 57 std::unique_ptr<V8Debugger> m_debugger; |
| 59 | 58 |
| 60 private: | 59 private: |
| 61 v8::Local<v8::Function> eventLogFunction(); | 60 v8::Local<v8::Function> eventLogFunction(); |
| 62 | 61 |
| 63 static void setMonitorEventsCallback(const v8::FunctionCallbackInfo<v8::Valu
e>&, bool enabled); | 62 static void setMonitorEventsCallback(const v8::FunctionCallbackInfo<v8::Valu
e>&, bool enabled); |
| 64 static void monitorEventsCallback(const v8::FunctionCallbackInfo<v8::Value>&
); | 63 static void monitorEventsCallback(const v8::FunctionCallbackInfo<v8::Value>&
); |
| 65 static void unmonitorEventsCallback(const v8::FunctionCallbackInfo<v8::Value
>&); | 64 static void unmonitorEventsCallback(const v8::FunctionCallbackInfo<v8::Value
>&); |
| 66 static void logCallback(const v8::FunctionCallbackInfo<v8::Value>&); | 65 static void logCallback(const v8::FunctionCallbackInfo<v8::Value>&); |
| 67 | 66 |
| 68 static void getEventListenersCallback(const v8::FunctionCallbackInfo<v8::Val
ue>&); | 67 static void getEventListenersCallback(const v8::FunctionCallbackInfo<v8::Val
ue>&); |
| 69 | 68 |
| 70 Vector<OwnPtr<Timer<ThreadDebugger>>> m_timers; | 69 Vector<OwnPtr<Timer<ThreadDebugger>>> m_timers; |
| 71 Vector<V8DebuggerClient::TimerCallback> m_timerCallbacks; | 70 Vector<V8DebuggerClient::TimerCallback> m_timerCallbacks; |
| 72 Vector<void*> m_timerData; | 71 Vector<void*> m_timerData; |
| 73 OwnPtr<UserGestureIndicator> m_userGestureIndicator; | 72 OwnPtr<UserGestureIndicator> m_userGestureIndicator; |
| 74 v8::Global<v8::Function> m_eventLogFunction; | 73 v8::Global<v8::Function> m_eventLogFunction; |
| 75 }; | 74 }; |
| 76 | 75 |
| 77 } // namespace blink | 76 } // namespace blink |
| 78 | 77 |
| 79 #endif // ThreadDebugger_h | 78 #endif // ThreadDebugger_h |
| OLD | NEW |