| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 explicit MainThreadDebugger(v8::Isolate*); | 62 explicit MainThreadDebugger(v8::Isolate*); |
| 63 ~MainThreadDebugger() override; | 63 ~MainThreadDebugger() override; |
| 64 | 64 |
| 65 static MainThreadDebugger* instance(); | 65 static MainThreadDebugger* instance(); |
| 66 static void interruptMainThreadAndRun(std::unique_ptr<InspectorTaskRunner::T
ask>); | 66 static void interruptMainThreadAndRun(std::unique_ptr<InspectorTaskRunner::T
ask>); |
| 67 | 67 |
| 68 InspectorTaskRunner* taskRunner() const { return m_taskRunner.get(); } | 68 InspectorTaskRunner* taskRunner() const { return m_taskRunner.get(); } |
| 69 bool isWorker() override { return false; } | 69 bool isWorker() override { return false; } |
| 70 bool isPaused() const { return m_paused; } | 70 bool isPaused() const { return m_paused; } |
| 71 void setClientMessageLoop(std::unique_ptr<ClientMessageLoop>); | 71 void setClientMessageLoop(std::unique_ptr<ClientMessageLoop>); |
| 72 void reportConsoleMessage(ExecutionContext*, MessageSource, MessageLevel, co
nst String& message, SourceLocation*) override; | |
| 73 int contextGroupId(ExecutionContext*) override; | |
| 74 | 72 |
| 75 // 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. |
| 76 int contextGroupId(LocalFrame*); | 74 int contextGroupId(LocalFrame*); |
| 77 void didClearContextsForFrame(LocalFrame*); | 75 void didClearContextsForFrame(LocalFrame*); |
| 78 void contextCreated(ScriptState*, LocalFrame*, SecurityOrigin*); | 76 void contextCreated(ScriptState*, LocalFrame*, SecurityOrigin*); |
| 79 void contextWillBeDestroyed(ScriptState*); | 77 void contextWillBeDestroyed(ScriptState*); |
| 80 void exceptionThrown(ExecutionContext*, ErrorEvent*); | 78 void exceptionThrown(ExecutionContext*, ErrorEvent*); |
| 81 | 79 |
| 82 void installAdditionalCommandLineAPI(v8::Local<v8::Context>, v8::Local<v8::O
bject>) override; | 80 private: |
| 81 void reportConsoleMessage(ExecutionContext*, MessageSource, MessageLevel, co
nst String& message, SourceLocation*) override; |
| 82 int contextGroupId(ExecutionContext*) override; |
| 83 | 83 |
| 84 v8::MaybeLocal<v8::Value> memoryInfo(v8::Isolate*, v8::Local<v8::Context>) o
verride; | |
| 85 | |
| 86 private: | |
| 87 // V8InspectorClient implementation. | 84 // V8InspectorClient implementation. |
| 88 void runMessageLoopOnPause(int contextGroupId) override; | 85 void runMessageLoopOnPause(int contextGroupId) override; |
| 89 void quitMessageLoopOnPause() override; | 86 void quitMessageLoopOnPause() override; |
| 90 void muteMetrics(int contextGroupId) override; | 87 void muteMetrics(int contextGroupId) override; |
| 91 void unmuteMetrics(int contextGroupId) override; | 88 void unmuteMetrics(int contextGroupId) override; |
| 92 v8::Local<v8::Context> ensureDefaultContextInGroup(int contextGroupId) overr
ide; | 89 v8::Local<v8::Context> ensureDefaultContextInGroup(int contextGroupId) overr
ide; |
| 93 void beginEnsureAllContextsInGroup(int contextGroupId) override; | 90 void beginEnsureAllContextsInGroup(int contextGroupId) override; |
| 94 void endEnsureAllContextsInGroup(int contextGroupId) override; | 91 void endEnsureAllContextsInGroup(int contextGroupId) override; |
| 95 bool canExecuteScripts(int contextGroupId) override; | 92 bool canExecuteScripts(int contextGroupId) override; |
| 96 void resumeStartup(int contextGroupId) override; | 93 void resumeStartup(int contextGroupId) override; |
| 97 void consoleAPIMessage(int contextGroupId, V8ConsoleAPIType, const String16&
message, const String16& url, unsigned lineNumber, unsigned columnNumber, V8Sta
ckTrace*) override; | 94 void consoleAPIMessage(int contextGroupId, V8ConsoleAPIType, const String16&
message, const String16& url, unsigned lineNumber, unsigned columnNumber, V8Sta
ckTrace*) override; |
| 95 void installAdditionalCommandLineAPI(v8::Local<v8::Context>, v8::Local<v8::O
bject>) override; |
| 96 v8::MaybeLocal<v8::Value> memoryInfo(v8::Isolate*, v8::Local<v8::Context>) o
verride; |
| 97 |
| 98 static void querySelectorCallback(const v8::FunctionCallbackInfo<v8::Value>&
); |
| 99 static void querySelectorAllCallback(const v8::FunctionCallbackInfo<v8::Valu
e>&); |
| 100 static void xpathSelectorCallback(const v8::FunctionCallbackInfo<v8::Value>&
); |
| 98 | 101 |
| 99 std::unique_ptr<ClientMessageLoop> m_clientMessageLoop; | 102 std::unique_ptr<ClientMessageLoop> m_clientMessageLoop; |
| 100 std::unique_ptr<InspectorTaskRunner> m_taskRunner; | 103 std::unique_ptr<InspectorTaskRunner> m_taskRunner; |
| 101 bool m_paused; | 104 bool m_paused; |
| 102 | |
| 103 static MainThreadDebugger* s_instance; | 105 static MainThreadDebugger* s_instance; |
| 104 | |
| 105 static void querySelectorCallback(const v8::FunctionCallbackInfo<v8::Value>&
); | |
| 106 static void querySelectorAllCallback(const v8::FunctionCallbackInfo<v8::Valu
e>&); | |
| 107 static void xpathSelectorCallback(const v8::FunctionCallbackInfo<v8::Value>&
); | |
| 108 }; | 106 }; |
| 109 | 107 |
| 110 } // namespace blink | 108 } // namespace blink |
| 111 | 109 |
| 112 | 110 |
| 113 #endif // MainThreadDebugger_h | 111 #endif // MainThreadDebugger_h |
| OLD | NEW |