| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 class PageScriptDebugServer final : public ScriptDebugServer { | 43 class PageScriptDebugServer final : public ScriptDebugServer { |
| 44 WTF_MAKE_NONCOPYABLE(PageScriptDebugServer); | 44 WTF_MAKE_NONCOPYABLE(PageScriptDebugServer); |
| 45 public: | 45 public: |
| 46 static PageScriptDebugServer& shared(); | 46 static PageScriptDebugServer& shared(); |
| 47 | 47 |
| 48 ~PageScriptDebugServer() override; | 48 ~PageScriptDebugServer() override; |
| 49 void trace(Visitor*) override; | 49 void trace(Visitor*) override; |
| 50 | 50 |
| 51 static void setMainThreadIsolate(v8::Isolate*); | 51 static void setMainThreadIsolate(v8::Isolate*); |
| 52 | 52 |
| 53 void addListener(ScriptDebugListener*, LocalFrame*); | 53 void addListener(ScriptDebugListener*, Page*); |
| 54 void removeListener(ScriptDebugListener*, LocalFrame*); | 54 void removeListener(ScriptDebugListener*, Page*); |
| 55 | 55 |
| 56 static void interruptAndRun(PassOwnPtr<Task>); | 56 static void interruptAndRun(PassOwnPtr<Task>); |
| 57 | 57 |
| 58 class ClientMessageLoop { | 58 class ClientMessageLoop { |
| 59 public: | 59 public: |
| 60 virtual ~ClientMessageLoop() { } | 60 virtual ~ClientMessageLoop() { } |
| 61 virtual void run(LocalFrame*) = 0; | 61 virtual void run(Page*) = 0; |
| 62 virtual void quitNow() = 0; | 62 virtual void quitNow() = 0; |
| 63 }; | 63 }; |
| 64 void setClientMessageLoop(PassOwnPtr<ClientMessageLoop>); | 64 void setClientMessageLoop(PassOwnPtr<ClientMessageLoop>); |
| 65 | 65 |
| 66 void compileScript(ScriptState*, const String& expression, const String& sou
rceURL, String* scriptId, String* exceptionDetailsText, int* lineNumber, int* co
lumnNumber, RefPtrWillBeRawPtr<ScriptCallStack>* stackTrace) override; | 66 void compileScript(ScriptState*, const String& expression, const String& sou
rceURL, String* scriptId, String* exceptionDetailsText, int* lineNumber, int* co
lumnNumber, RefPtrWillBeRawPtr<ScriptCallStack>* stackTrace) override; |
| 67 void clearCompiledScripts() override; | 67 void clearCompiledScripts() override; |
| 68 void runScript(ScriptState*, const String& scriptId, ScriptValue* result, bo
ol* wasThrown, String* exceptionDetailsText, int* lineNumber, int* columnNumber,
RefPtrWillBeRawPtr<ScriptCallStack>* stackTrace) override; | 68 void runScript(ScriptState*, const String& scriptId, ScriptValue* result, bo
ol* wasThrown, String* exceptionDetailsText, int* lineNumber, int* columnNumber,
RefPtrWillBeRawPtr<ScriptCallStack>* stackTrace) override; |
| 69 void setPreprocessorSource(const String&) override; | 69 void setPreprocessorSource(const String&) override; |
| 70 void preprocessBeforeCompile(const v8::Debug::EventDetails&) override; | 70 void preprocessBeforeCompile(const v8::Debug::EventDetails&) override; |
| 71 ScriptSourceCode preprocess(LocalFrame*, const ScriptSourceCode&) override; | 71 ScriptSourceCode preprocess(LocalFrame*, const ScriptSourceCode&) override; |
| 72 String preprocessEventListener(LocalFrame*, const String& source, const Stri
ng& url, const String& functionName) override; | 72 String preprocessEventListener(LocalFrame*, const String& source, const Stri
ng& url, const String& functionName) override; |
| 73 void clearPreprocessor() override; | 73 void clearPreprocessor() override; |
| 74 | 74 |
| 75 void muteWarningsAndDeprecations() override; | 75 void muteWarningsAndDeprecations() override; |
| 76 void unmuteWarningsAndDeprecations() override; | 76 void unmuteWarningsAndDeprecations() override; |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 PageScriptDebugServer(); | 79 PageScriptDebugServer(); |
| 80 | 80 |
| 81 ScriptDebugListener* getDebugListenerForContext(v8::Handle<v8::Context>) ove
rride; | 81 ScriptDebugListener* getDebugListenerForContext(v8::Handle<v8::Context>) ove
rride; |
| 82 void runMessageLoopOnPause(v8::Handle<v8::Context>) override; | 82 void runMessageLoopOnPause(v8::Handle<v8::Context>) override; |
| 83 void quitMessageLoopOnPause() override; | 83 void quitMessageLoopOnPause() override; |
| 84 | 84 |
| 85 using ListenersMap = WillBeHeapHashMap<RawPtrWillBeMember<LocalFrame>, Scrip
tDebugListener*>; | 85 using ListenersMap = WillBeHeapHashMap<RawPtrWillBeMember<Page>, ScriptDebug
Listener*>; |
| 86 ListenersMap m_listenersMap; | 86 ListenersMap m_listenersMap; |
| 87 OwnPtr<ClientMessageLoop> m_clientMessageLoop; | 87 OwnPtr<ClientMessageLoop> m_clientMessageLoop; |
| 88 RawPtrWillBeMember<LocalFrame> m_pausedFrame; | 88 RawPtrWillBeMember<Page> m_pausedPage; |
| 89 HashMap<String, String> m_compiledScriptURLs; | 89 HashMap<String, String> m_compiledScriptURLs; |
| 90 | 90 |
| 91 ScriptSourceCode m_preprocessorSourceCode; | 91 ScriptSourceCode m_preprocessorSourceCode; |
| 92 OwnPtr<ScriptPreprocessor> m_scriptPreprocessor; | 92 OwnPtr<ScriptPreprocessor> m_scriptPreprocessor; |
| 93 bool canPreprocess(LocalFrame*); | 93 bool canPreprocess(LocalFrame*); |
| 94 static v8::Isolate* s_mainThreadIsolate; | 94 static v8::Isolate* s_mainThreadIsolate; |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 } // namespace blink | 97 } // namespace blink |
| 98 | 98 |
| 99 | 99 |
| 100 #endif // PageScriptDebugServer_h | 100 #endif // PageScriptDebugServer_h |
| OLD | NEW |