Chromium Code Reviews| 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 void eventListeners(v8::Local<v8::Value>, V8EventListenerInfoList&) override ; | 37 void eventListeners(v8::Local<v8::Value>, V8EventListenerInfoList&) override ; |
| 38 String16 valueSubtype(v8::Local<v8::Value>) override; | 38 String16 valueSubtype(v8::Local<v8::Value>) override; |
| 39 bool formatAccessorsAsProperties(v8::Local<v8::Value>) override; | 39 bool formatAccessorsAsProperties(v8::Local<v8::Value>) override; |
| 40 bool isExecutionAllowed() override; | 40 bool isExecutionAllowed() override; |
| 41 double currentTimeMS() override; | 41 double currentTimeMS() override; |
| 42 bool isInspectableHeapObject(v8::Local<v8::Object>) override; | 42 bool isInspectableHeapObject(v8::Local<v8::Object>) override; |
| 43 void installAdditionalCommandLineAPI(v8::Local<v8::Context>, v8::Local<v8::O bject>) override { } | 43 static bool isCommandLineAPIMethod(const String& name); |
| 44 void installAdditionalCommandLineAPI(v8::Local<v8::Context>, v8::Local<v8::O bject>) override; | |
| 44 void reportMessageToConsole(v8::Local<v8::Context>, MessageType, MessageLeve l, const String16& message, const v8::FunctionCallbackInfo<v8::Value>* arguments , unsigned skipArgumentCount) final; | 45 void reportMessageToConsole(v8::Local<v8::Context>, MessageType, MessageLeve l, const String16& message, const v8::FunctionCallbackInfo<v8::Value>* arguments , unsigned skipArgumentCount) final; |
| 45 void consoleTime(const String16& title) override; | 46 void consoleTime(const String16& title) override; |
| 46 void consoleTimeEnd(const String16& title) override; | 47 void consoleTimeEnd(const String16& title) override; |
| 47 void consoleTimeStamp(const String16& title) override; | 48 void consoleTimeStamp(const String16& title) override; |
| 48 void startRepeatingTimer(double, V8DebuggerClient::TimerCallback, void* data ) override; | 49 void startRepeatingTimer(double, V8DebuggerClient::TimerCallback, void* data ) override; |
| 49 void cancelTimer(void* data) override; | 50 void cancelTimer(void* data) override; |
| 50 | 51 |
| 51 V8Debugger* debugger() const { return m_debugger.get(); } | 52 V8Debugger* debugger() const { return m_debugger.get(); } |
| 52 virtual bool isWorker() { return true; } | 53 virtual bool isWorker() { return true; } |
| 53 protected: | 54 protected: |
| 55 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; | 56 virtual void reportMessageToConsole(v8::Local<v8::Context>, ConsoleMessage*) = 0; |
| 55 void onTimer(Timer<ThreadDebugger>*); | 57 void onTimer(Timer<ThreadDebugger>*); |
| 56 | 58 |
| 57 v8::Isolate* m_isolate; | 59 v8::Isolate* m_isolate; |
| 58 OwnPtr<V8Debugger> m_debugger; | 60 OwnPtr<V8Debugger> m_debugger; |
| 61 | |
| 62 private: | |
| 59 Vector<OwnPtr<Timer<ThreadDebugger>>> m_timers; | 63 Vector<OwnPtr<Timer<ThreadDebugger>>> m_timers; |
| 60 Vector<V8DebuggerClient::TimerCallback> m_timerCallbacks; | 64 Vector<V8DebuggerClient::TimerCallback> m_timerCallbacks; |
| 61 Vector<void*> m_timerData; | 65 Vector<void*> m_timerData; |
| 62 OwnPtr<UserGestureIndicator> m_userGestureIndicator; | 66 OwnPtr<UserGestureIndicator> m_userGestureIndicator; |
| 67 | |
| 68 v8::Local<v8::Function> eventLogFunction(); | |
| 69 v8::Global<v8::Function> m_eventLogFunction; | |
| 70 | |
| 71 static void setMonitorEventsCallback(const v8::FunctionCallbackInfo<v8::Valu e>&, bool enabled); | |
|
dgozman
2016/05/20 22:12:04
style: all functions should be declared before all
kozy
2016/05/20 22:42:17
Done.
| |
| 72 static void monitorEventsCallback(const v8::FunctionCallbackInfo<v8::Value>& info) { setMonitorEventsCallback(info, true); } | |
|
dgozman
2016/05/20 22:12:04
style: only trivial function definitions are allow
kozy
2016/05/20 22:42:17
Done.
| |
| 73 static void unmonitorEventsCallback(const v8::FunctionCallbackInfo<v8::Value >& info) { setMonitorEventsCallback(info, false); } | |
| 74 static void logCallback(const v8::FunctionCallbackInfo<v8::Value>&); | |
| 63 }; | 75 }; |
| 64 | 76 |
| 65 } // namespace blink | 77 } // namespace blink |
| 66 | 78 |
| 67 #endif // ThreadDebugger_h | 79 #endif // ThreadDebugger_h |
| OLD | NEW |