Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(283)

Side by Side Diff: third_party/WebKit/Source/core/inspector/ThreadDebugger.h

Issue 2035653006: [DevTools] Move Console to v8 inspector. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: improved api a bit Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 void beginUserGesture() override; 42 void beginUserGesture() override;
43 void endUserGesture() override; 43 void endUserGesture() override;
44 String16 valueSubtype(v8::Local<v8::Value>) override; 44 String16 valueSubtype(v8::Local<v8::Value>) override;
45 bool formatAccessorsAsProperties(v8::Local<v8::Value>) override; 45 bool formatAccessorsAsProperties(v8::Local<v8::Value>) override;
46 bool isExecutionAllowed() override; 46 bool isExecutionAllowed() override;
47 double currentTimeMS() override; 47 double currentTimeMS() override;
48 bool isInspectableHeapObject(v8::Local<v8::Object>) override; 48 bool isInspectableHeapObject(v8::Local<v8::Object>) override;
49 void enableAsyncInstrumentation() override; 49 void enableAsyncInstrumentation() override;
50 void disableAsyncInstrumentation() override; 50 void disableAsyncInstrumentation() override;
51 void installAdditionalCommandLineAPI(v8::Local<v8::Context>, v8::Local<v8::O bject>) override; 51 void installAdditionalCommandLineAPI(v8::Local<v8::Context>, v8::Local<v8::O bject>) override;
52 void reportMessageToConsole(v8::Local<v8::Context>, MessageType, MessageLeve l, const String16& message, const v8::FunctionCallbackInfo<v8::Value>* arguments , unsigned skipArgumentCount) final;
53 void consoleTime(const String16& title) override; 52 void consoleTime(const String16& title) override;
54 void consoleTimeEnd(const String16& title) override; 53 void consoleTimeEnd(const String16& title) override;
55 void consoleTimeStamp(const String16& title) override; 54 void consoleTimeStamp(const String16& title) override;
56 void startRepeatingTimer(double, V8DebuggerClient::TimerCallback, void* data ) override; 55 void startRepeatingTimer(double, V8DebuggerClient::TimerCallback, void* data ) override;
57 void cancelTimer(void* data) override; 56 void cancelTimer(void* data) override;
58 57
59 V8Debugger* debugger() const { return m_debugger.get(); } 58 V8Debugger* debugger() const { return m_debugger.get(); }
60 virtual bool isWorker() { return true; } 59 virtual bool isWorker() { return true; }
60
61 protected: 61 protected:
62 void createFunctionProperty(v8::Local<v8::Context>, v8::Local<v8::Object>, c onst char* name, v8::FunctionCallback, const char* description); 62 void createFunctionProperty(v8::Local<v8::Context>, v8::Local<v8::Object>, c onst char* name, v8::FunctionCallback, const char* description);
63 virtual void reportMessageToConsole(v8::Local<v8::Context>, ConsoleMessage*) = 0;
64 void onTimer(Timer<ThreadDebugger>*); 63 void onTimer(Timer<ThreadDebugger>*);
65 64
66 v8::Isolate* m_isolate; 65 v8::Isolate* m_isolate;
67 std::unique_ptr<V8Debugger> m_debugger; 66 std::unique_ptr<V8Debugger> m_debugger;
68 67
69 private: 68 private:
70 v8::Local<v8::Function> eventLogFunction(); 69 v8::Local<v8::Function> eventLogFunction();
71 70
72 static void setMonitorEventsCallback(const v8::FunctionCallbackInfo<v8::Valu e>&, bool enabled); 71 static void setMonitorEventsCallback(const v8::FunctionCallbackInfo<v8::Valu e>&, bool enabled);
73 static void monitorEventsCallback(const v8::FunctionCallbackInfo<v8::Value>& ); 72 static void monitorEventsCallback(const v8::FunctionCallbackInfo<v8::Value>& );
74 static void unmonitorEventsCallback(const v8::FunctionCallbackInfo<v8::Value >&); 73 static void unmonitorEventsCallback(const v8::FunctionCallbackInfo<v8::Value >&);
75 static void logCallback(const v8::FunctionCallbackInfo<v8::Value>&); 74 static void logCallback(const v8::FunctionCallbackInfo<v8::Value>&);
76 75
77 static void getEventListenersCallback(const v8::FunctionCallbackInfo<v8::Val ue>&); 76 static void getEventListenersCallback(const v8::FunctionCallbackInfo<v8::Val ue>&);
78 77
79 bool m_asyncInstrumentationEnabled; 78 bool m_asyncInstrumentationEnabled;
80 Vector<std::unique_ptr<Timer<ThreadDebugger>>> m_timers; 79 Vector<std::unique_ptr<Timer<ThreadDebugger>>> m_timers;
81 Vector<V8DebuggerClient::TimerCallback> m_timerCallbacks; 80 Vector<V8DebuggerClient::TimerCallback> m_timerCallbacks;
82 Vector<void*> m_timerData; 81 Vector<void*> m_timerData;
83 std::unique_ptr<UserGestureIndicator> m_userGestureIndicator; 82 std::unique_ptr<UserGestureIndicator> m_userGestureIndicator;
84 v8::Global<v8::Function> m_eventLogFunction; 83 v8::Global<v8::Function> m_eventLogFunction;
85 }; 84 };
86 85
87 } // namespace blink 86 } // namespace blink
88 87
89 #endif // ThreadDebugger_h 88 #endif // ThreadDebugger_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698