| 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/v8_inspector/public/V8Debugger.h" | 10 #include "platform/v8_inspector/public/V8Debugger.h" |
| 11 #include "platform/v8_inspector/public/V8DebuggerClient.h" | 11 #include "platform/v8_inspector/public/V8DebuggerClient.h" |
| 12 #include "wtf/Forward.h" | 12 #include "wtf/Forward.h" |
| 13 #include "wtf/HashMap.h" | 13 #include "wtf/HashMap.h" |
| 14 | 14 |
| 15 #include <v8.h> | 15 #include <v8.h> |
| 16 | 16 |
| 17 namespace blink { | 17 namespace blink { |
| 18 | 18 |
| 19 class ConsoleMessage; | 19 class ConsoleMessage; |
| 20 class WorkerThread; | 20 class WorkerThread; |
| 21 | 21 |
| 22 class CORE_EXPORT ThreadDebugger : public V8DebuggerClient { | 22 class CORE_EXPORT ThreadDebugger : public V8DebuggerClient { |
| 23 WTF_MAKE_NONCOPYABLE(ThreadDebugger); | 23 WTF_MAKE_NONCOPYABLE(ThreadDebugger); |
| 24 public: | 24 public: |
| 25 explicit ThreadDebugger(v8::Isolate*); | 25 explicit ThreadDebugger(v8::Isolate*); |
| 26 ~ThreadDebugger() override; | 26 ~ThreadDebugger() override; |
| 27 | 27 |
| 28 static void willExecuteScript(v8::Isolate*, int scriptId); | 28 static void willExecuteScript(v8::Isolate*, int scriptId); |
| 29 static void didExecuteScript(v8::Isolate*); | 29 static void didExecuteScript(v8::Isolate*); |
| 30 static void idleStarted(v8::Isolate*); |
| 31 static void idleFinished(v8::Isolate*); |
| 30 | 32 |
| 31 // V8DebuggerClient implementation. | 33 // V8DebuggerClient implementation. |
| 32 void eventListeners(v8::Local<v8::Value>, V8EventListenerInfoList&) override
; | 34 void eventListeners(v8::Local<v8::Value>, V8EventListenerInfoList&) override
; |
| 33 String16 valueSubtype(v8::Local<v8::Value>) override; | 35 String16 valueSubtype(v8::Local<v8::Value>) override; |
| 34 bool formatAccessorsAsProperties(v8::Local<v8::Value>) override; | 36 bool formatAccessorsAsProperties(v8::Local<v8::Value>) override; |
| 35 bool isExecutionAllowed() override; | 37 bool isExecutionAllowed() override; |
| 36 double currentTimeMS() override; | 38 double currentTimeMS() override; |
| 37 bool isInspectableHeapObject(v8::Local<v8::Object>) override; | 39 bool isInspectableHeapObject(v8::Local<v8::Object>) override; |
| 38 void reportMessageToConsole(v8::Local<v8::Context>, MessageType, MessageLeve
l, const String16& message, const v8::FunctionCallbackInfo<v8::Value>* arguments
, unsigned skipArgumentCount, int maxStackSize) final; | 40 void reportMessageToConsole(v8::Local<v8::Context>, MessageType, MessageLeve
l, const String16& message, const v8::FunctionCallbackInfo<v8::Value>* arguments
, unsigned skipArgumentCount, int maxStackSize) final; |
| 39 void consoleTime(const String16& title) override; | 41 void consoleTime(const String16& title) override; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 51 v8::Isolate* m_isolate; | 53 v8::Isolate* m_isolate; |
| 52 OwnPtr<V8Debugger> m_debugger; | 54 OwnPtr<V8Debugger> m_debugger; |
| 53 HashMap<int, OwnPtr<Timer<ThreadDebugger>>> m_timers; | 55 HashMap<int, OwnPtr<Timer<ThreadDebugger>>> m_timers; |
| 54 HashMap<Timer<ThreadDebugger>*, OwnPtr<V8DebuggerClient::TimerCallback>> m_t
imerCallbacks; | 56 HashMap<Timer<ThreadDebugger>*, OwnPtr<V8DebuggerClient::TimerCallback>> m_t
imerCallbacks; |
| 55 int m_lastTimerId; | 57 int m_lastTimerId; |
| 56 }; | 58 }; |
| 57 | 59 |
| 58 } // namespace blink | 60 } // namespace blink |
| 59 | 61 |
| 60 #endif // ThreadDebugger_h | 62 #endif // ThreadDebugger_h |
| OLD | NEW |