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

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

Issue 2687943004: Abstract out ThreadDebugger from V8PerIsolateData (Closed)
Patch Set: Initialize HiddenValue and PrivateProperty in V8Initializer Created 3 years, 10 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 <v8-inspector.h>
9 #include <v8-profiler.h>
10 #include <v8.h>
11 #include <memory>
12 #include "bindings/core/v8/V8PerIsolateData.h"
8 #include "core/CoreExport.h" 13 #include "core/CoreExport.h"
9 #include "core/inspector/ConsoleTypes.h" 14 #include "core/inspector/ConsoleTypes.h"
10 #include "platform/Timer.h" 15 #include "platform/Timer.h"
11 #include "platform/UserGestureIndicator.h" 16 #include "platform/UserGestureIndicator.h"
12 #include "wtf/Forward.h" 17 #include "wtf/Forward.h"
13 #include "wtf/Vector.h" 18 #include "wtf/Vector.h"
14 #include <memory>
15 #include <v8-inspector.h>
16 #include <v8-profiler.h>
17 #include <v8.h>
18 19
19 namespace blink { 20 namespace blink {
20 21
21 class ExecutionContext; 22 class ExecutionContext;
22 class SourceLocation; 23 class SourceLocation;
23 24
24 // TODO(dgozman): rename this to ThreadInspector (and subclasses). 25 // TODO(dgozman): rename this to ThreadInspector (and subclasses).
25 class CORE_EXPORT ThreadDebugger : public v8_inspector::V8InspectorClient { 26 class CORE_EXPORT ThreadDebugger : public v8_inspector::V8InspectorClient,
27 public V8PerIsolateData::Data {
26 WTF_MAKE_NONCOPYABLE(ThreadDebugger); 28 WTF_MAKE_NONCOPYABLE(ThreadDebugger);
27 29
28 public: 30 public:
29 explicit ThreadDebugger(v8::Isolate*); 31 explicit ThreadDebugger(v8::Isolate*);
30 ~ThreadDebugger() override; 32 ~ThreadDebugger() override;
31 33
32 static ThreadDebugger* from(v8::Isolate*); 34 static ThreadDebugger* from(v8::Isolate*);
33 virtual bool isWorker() = 0; 35 virtual bool isWorker() = 0;
34 v8_inspector::V8Inspector* v8Inspector() const { return m_v8Inspector.get(); } 36 v8_inspector::V8Inspector* v8Inspector() const { return m_v8Inspector.get(); }
35 37
38 static void setThreadDebugger(v8::Isolate*, ThreadDebugger*);
39 static ThreadDebugger* getThreadDebugger(v8::Isolate*);
jbroman 2017/02/15 02:25:23 This looks equivalent to ThreadDebugger::from, abo
adithyas 2017/02/15 18:12:12 Yup, don't know why I added this.
40
36 static void willExecuteScript(v8::Isolate*, int scriptId); 41 static void willExecuteScript(v8::Isolate*, int scriptId);
37 static void didExecuteScript(v8::Isolate*); 42 static void didExecuteScript(v8::Isolate*);
38 static void idleStarted(v8::Isolate*); 43 static void idleStarted(v8::Isolate*);
39 static void idleFinished(v8::Isolate*); 44 static void idleFinished(v8::Isolate*);
40 45
41 void asyncTaskScheduled(const String& taskName, void* task, bool recurring); 46 void asyncTaskScheduled(const String& taskName, void* task, bool recurring);
42 void asyncTaskCanceled(void* task); 47 void asyncTaskCanceled(void* task);
43 void allAsyncTasksCanceled(); 48 void allAsyncTasksCanceled();
44 void asyncTaskStarted(void* task); 49 void asyncTaskStarted(void* task);
45 void asyncTaskFinished(void* task); 50 void asyncTaskFinished(void* task);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 std::unique_ptr<v8::TracingCpuProfiler> m_v8TracingCpuProfiler; 111 std::unique_ptr<v8::TracingCpuProfiler> m_v8TracingCpuProfiler;
107 Vector<std::unique_ptr<Timer<ThreadDebugger>>> m_timers; 112 Vector<std::unique_ptr<Timer<ThreadDebugger>>> m_timers;
108 Vector<v8_inspector::V8InspectorClient::TimerCallback> m_timerCallbacks; 113 Vector<v8_inspector::V8InspectorClient::TimerCallback> m_timerCallbacks;
109 Vector<void*> m_timerData; 114 Vector<void*> m_timerData;
110 std::unique_ptr<UserGestureIndicator> m_userGestureIndicator; 115 std::unique_ptr<UserGestureIndicator> m_userGestureIndicator;
111 }; 116 };
112 117
113 } // namespace blink 118 } // namespace blink
114 119
115 #endif // ThreadDebugger_h 120 #endif // ThreadDebugger_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698