OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 Google Inc. All rights reserved. | 2 * Copyright (c) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 ~MainThreadDebugger() override; | 61 ~MainThreadDebugger() override; |
62 | 62 |
63 static MainThreadDebugger* instance(); | 63 static MainThreadDebugger* instance(); |
64 static void interruptMainThreadAndRun(std::unique_ptr<InspectorTaskRunner::T
ask>); | 64 static void interruptMainThreadAndRun(std::unique_ptr<InspectorTaskRunner::T
ask>); |
65 | 65 |
66 InspectorTaskRunner* taskRunner() const { return m_taskRunner.get(); } | 66 InspectorTaskRunner* taskRunner() const { return m_taskRunner.get(); } |
67 bool isWorker() override { return false; } | 67 bool isWorker() override { return false; } |
68 bool isPaused() const { return m_paused; } | 68 bool isPaused() const { return m_paused; } |
69 void setClientMessageLoop(std::unique_ptr<ClientMessageLoop>); | 69 void setClientMessageLoop(std::unique_ptr<ClientMessageLoop>); |
70 void reportConsoleMessage(ExecutionContext*, ConsoleMessage*) override; | 70 void reportConsoleMessage(ExecutionContext*, ConsoleMessage*) override; |
| 71 int contextGroupId(ExecutionContext*) override; |
71 | 72 |
72 // TODO(dgozman): by making this method virtual, we can move many methods to
ThreadDebugger and avoid some duplication. Should be careful about performance. | 73 // TODO(dgozman): by making this method virtual, we can move many methods to
ThreadDebugger and avoid some duplication. Should be careful about performance. |
73 int contextGroupId(LocalFrame*); | 74 int contextGroupId(LocalFrame*); |
74 void didClearContextsForFrame(LocalFrame*); | 75 void didClearContextsForFrame(LocalFrame*); |
75 void contextCreated(ScriptState*, LocalFrame*, SecurityOrigin*); | 76 void contextCreated(ScriptState*, LocalFrame*, SecurityOrigin*); |
76 void contextWillBeDestroyed(ScriptState*); | 77 void contextWillBeDestroyed(ScriptState*); |
77 void exceptionThrown(LocalFrame*, const String& errorMessage, std::unique_pt
r<SourceLocation>); | 78 void exceptionThrown(LocalFrame*, const String& errorMessage, std::unique_pt
r<SourceLocation>); |
78 bool addConsoleMessage(LocalFrame*, ConsoleMessage*); | |
79 | 79 |
80 void installAdditionalCommandLineAPI(v8::Local<v8::Context>, v8::Local<v8::O
bject>) override; | 80 void installAdditionalCommandLineAPI(v8::Local<v8::Context>, v8::Local<v8::O
bject>) override; |
81 | 81 |
82 v8::MaybeLocal<v8::Value> memoryInfo(v8::Isolate*, v8::Local<v8::Context>) o
verride; | 82 v8::MaybeLocal<v8::Value> memoryInfo(v8::Isolate*, v8::Local<v8::Context>) o
verride; |
83 | 83 |
84 private: | 84 private: |
85 // V8DebuggerClient implementation. | 85 // V8DebuggerClient implementation. |
86 void runMessageLoopOnPause(int contextGroupId) override; | 86 void runMessageLoopOnPause(int contextGroupId) override; |
87 void quitMessageLoopOnPause() override; | 87 void quitMessageLoopOnPause() override; |
88 void muteWarningsAndDeprecations() override; | 88 void muteWarningsAndDeprecations(int contextGroupId) override; |
89 void unmuteWarningsAndDeprecations() override; | 89 void unmuteWarningsAndDeprecations(int contextGroupId) override; |
90 bool callingContextCanAccessContext(v8::Local<v8::Context> calling, v8::Loca
l<v8::Context> target) override; | 90 bool callingContextCanAccessContext(v8::Local<v8::Context> calling, v8::Loca
l<v8::Context> target) override; |
91 v8::Local<v8::Context> ensureDefaultContextInGroup(int contextGroupId) overr
ide; | 91 v8::Local<v8::Context> ensureDefaultContextInGroup(int contextGroupId) overr
ide; |
92 void consoleAPIMessage(int contextGroupId, MessageLevel, const String16& mes
sage, const String16& url, unsigned lineNumber, unsigned columnNumber, V8StackTr
ace*) override; | 92 void consoleAPIMessage(int contextGroupId, MessageLevel, const String16& mes
sage, const String16& url, unsigned lineNumber, unsigned columnNumber, V8StackTr
ace*) override; |
93 | 93 |
94 std::unique_ptr<ClientMessageLoop> m_clientMessageLoop; | 94 std::unique_ptr<ClientMessageLoop> m_clientMessageLoop; |
95 std::unique_ptr<InspectorTaskRunner> m_taskRunner; | 95 std::unique_ptr<InspectorTaskRunner> m_taskRunner; |
96 bool m_paused; | 96 bool m_paused; |
97 int m_muteConsoleCount; | |
98 | 97 |
99 static MainThreadDebugger* s_instance; | 98 static MainThreadDebugger* s_instance; |
100 | 99 |
101 static void querySelectorCallback(const v8::FunctionCallbackInfo<v8::Value>&
); | 100 static void querySelectorCallback(const v8::FunctionCallbackInfo<v8::Value>&
); |
102 static void querySelectorAllCallback(const v8::FunctionCallbackInfo<v8::Valu
e>&); | 101 static void querySelectorAllCallback(const v8::FunctionCallbackInfo<v8::Valu
e>&); |
103 static void xpathSelectorCallback(const v8::FunctionCallbackInfo<v8::Value>&
); | 102 static void xpathSelectorCallback(const v8::FunctionCallbackInfo<v8::Value>&
); |
104 }; | 103 }; |
105 | 104 |
106 } // namespace blink | 105 } // namespace blink |
107 | 106 |
108 | 107 |
109 #endif // MainThreadDebugger_h | 108 #endif // MainThreadDebugger_h |
OLD | NEW |