Chromium Code Reviews

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

Issue 1913283003: [DevTools] Rework idle{Started,Finished} instrumentation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@1907663005
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
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/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; 17 class ConsoleMessage;
18 class WorkerThread; 18 class WorkerThread;
19 19
20 class CORE_EXPORT ThreadDebugger : public V8DebuggerClient { 20 class CORE_EXPORT ThreadDebugger : public V8DebuggerClient {
21 WTF_MAKE_NONCOPYABLE(ThreadDebugger); 21 WTF_MAKE_NONCOPYABLE(ThreadDebugger);
22 public: 22 public:
23 explicit ThreadDebugger(v8::Isolate*); 23 explicit ThreadDebugger(v8::Isolate*);
24 ~ThreadDebugger() override; 24 ~ThreadDebugger() override;
25 25
26 static void willExecuteScript(v8::Isolate*, int scriptId); 26 static void willExecuteScript(v8::Isolate*, int scriptId);
27 static void didExecuteScript(v8::Isolate*); 27 static void didExecuteScript(v8::Isolate*);
28 static void idleStarted(v8::Isolate*);
29 static void idleFinished(v8::Isolate*);
28 30
29 // V8DebuggerClient implementation. 31 // V8DebuggerClient implementation.
30 void eventListeners(v8::Local<v8::Value>, V8EventListenerInfoList&) override ; 32 void eventListeners(v8::Local<v8::Value>, V8EventListenerInfoList&) override ;
31 String16 valueSubtype(v8::Local<v8::Value>) override; 33 String16 valueSubtype(v8::Local<v8::Value>) override;
32 bool formatAccessorsAsProperties(v8::Local<v8::Value>) override; 34 bool formatAccessorsAsProperties(v8::Local<v8::Value>) override;
33 bool isExecutionAllowed() override; 35 bool isExecutionAllowed() override;
34 double currentTimeMS() override; 36 double currentTimeMS() override;
35 void reportMessageToConsole(v8::Local<v8::Context>, MessageType, MessageLeve l, const String16& message, const v8::FunctionCallbackInfo<v8::Value>* arguments , unsigned skipArgumentCount, int maxStackSize) final; 37 void reportMessageToConsole(v8::Local<v8::Context>, MessageType, MessageLeve l, const String16& message, const v8::FunctionCallbackInfo<v8::Value>* arguments , unsigned skipArgumentCount, int maxStackSize) final;
36 void consoleTime(const String16& title) override; 38 void consoleTime(const String16& title) override;
37 void consoleTimeEnd(const String16& title) override; 39 void consoleTimeEnd(const String16& title) override;
38 void consoleTimeStamp(const String16& title) override; 40 void consoleTimeStamp(const String16& title) override;
39 41
40 V8Debugger* debugger() const { return m_debugger.get(); } 42 V8Debugger* debugger() const { return m_debugger.get(); }
41 virtual bool isWorker() { return true; } 43 virtual bool isWorker() { return true; }
42 protected: 44 protected:
43 virtual void reportMessageToConsole(v8::Local<v8::Context>, ConsoleMessage*) = 0; 45 virtual void reportMessageToConsole(v8::Local<v8::Context>, ConsoleMessage*) = 0;
44 46
45 v8::Isolate* m_isolate; 47 v8::Isolate* m_isolate;
46 OwnPtr<V8Debugger> m_debugger; 48 OwnPtr<V8Debugger> m_debugger;
47 }; 49 };
48 50
49 } // namespace blink 51 } // namespace blink
50 52
51 #endif // ThreadDebugger_h 53 #endif // ThreadDebugger_h
OLDNEW

Powered by Google App Engine