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/v8_inspector/public/V8Debugger.h" | 9 #include "platform/v8_inspector/public/V8Debugger.h" |
| 10 #include "platform/v8_inspector/public/V8DebuggerClient.h" | 10 #include "platform/v8_inspector/public/V8DebuggerClient.h" |
| 11 #include "wtf/Forward.h" | 11 #include "wtf/Forward.h" |
| 12 | 12 |
| 13 #include <v8.h> | 13 #include <v8.h> |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 class ConsoleMessage; | |
|
dgozman
2016/04/08 18:18:46
Remove.
kozy
2016/04/08 23:56:50
It is used by reportMessageToConsole method.
| |
| 17 class WorkerThread; | 18 class WorkerThread; |
| 18 | 19 |
| 19 class CORE_EXPORT ThreadDebugger : public V8DebuggerClient { | 20 class CORE_EXPORT ThreadDebugger : public V8DebuggerClient { |
| 20 WTF_MAKE_NONCOPYABLE(ThreadDebugger); | 21 WTF_MAKE_NONCOPYABLE(ThreadDebugger); |
| 21 public: | 22 public: |
| 22 explicit ThreadDebugger(v8::Isolate*); | 23 explicit ThreadDebugger(v8::Isolate*); |
| 23 ~ThreadDebugger() override; | 24 ~ThreadDebugger() override; |
| 24 | 25 |
| 25 // V8DebuggerClient implementation. | 26 // V8DebuggerClient implementation. |
| 26 void eventListeners(v8::Local<v8::Value>, V8EventListenerInfoList&) override ; | 27 void eventListeners(v8::Local<v8::Value>, V8EventListenerInfoList&) override ; |
| 27 String16 valueSubtype(v8::Local<v8::Value>) override; | 28 String16 valueSubtype(v8::Local<v8::Value>) override; |
| 28 bool formatAccessorsAsProperties(v8::Local<v8::Value>) override; | 29 bool formatAccessorsAsProperties(v8::Local<v8::Value>) override; |
| 29 bool isExecutionAllowed() override; | 30 bool isExecutionAllowed() override; |
| 30 double currentTimeMS() override; | 31 double currentTimeMS() override; |
| 31 | 32 |
| 32 V8Debugger* debugger() const { return m_debugger.get(); } | 33 V8Debugger* debugger() const { return m_debugger.get(); } |
| 33 virtual bool isWorker() { return true; } | 34 virtual bool isWorker() { return true; } |
| 34 | 35 |
| 36 void reportMessageToConsole(v8::Local<v8::Context>, MessageType, MessageLeve l, const v8::FunctionCallbackInfo<v8::Value>& arguments, unsigned skipArgumentCo unt) final; | |
| 37 void reportMessageToConsole(v8::Local<v8::Context>, MessageType, MessageLeve l, const String16& text) final; | |
| 38 | |
| 39 void time(v8::Isolate*, const String16& title) override; | |
|
dgozman
2016/04/08 18:18:46
consoleTime
kozy
2016/04/08 23:56:51
Done.
| |
| 40 void timeEnd(v8::Isolate*, const String16& title) override; | |
|
dgozman
2016/04/08 18:18:46
consoleTimeEnd
kozy
2016/04/08 23:56:51
Done.
| |
| 41 void timeStamp(v8::Isolate*, const String16& title) override; | |
|
dgozman
2016/04/08 18:18:46
consoleTimeStamp
kozy
2016/04/08 23:56:50
Done.
| |
| 42 | |
| 43 void profile(v8::Local<v8::Context>, const String16& title) override; | |
| 44 void profileEnd(v8::Local<v8::Context>, const String16& title) override; | |
| 35 protected: | 45 protected: |
| 46 virtual void reportMessageToConsole(v8::Local<v8::Context>, ConsoleMessage*) = 0; | |
| 47 | |
| 36 v8::Isolate* m_isolate; | 48 v8::Isolate* m_isolate; |
| 37 OwnPtr<V8Debugger> m_debugger; | 49 OwnPtr<V8Debugger> m_debugger; |
| 38 }; | 50 }; |
| 39 | 51 |
| 40 } // namespace blink | 52 } // namespace blink |
| 41 | 53 |
| 42 #endif // ThreadDebugger_h | 54 #endif // ThreadDebugger_h |
| OLD | NEW |