| 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 23 matching lines...) Expand all Loading... |
| 34 #include "bindings/core/v8/ScriptDebugServer.h" | 34 #include "bindings/core/v8/ScriptDebugServer.h" |
| 35 #include "bindings/core/v8/ScriptPreprocessor.h" | 35 #include "bindings/core/v8/ScriptPreprocessor.h" |
| 36 #include <v8.h> | 36 #include <v8.h> |
| 37 | 37 |
| 38 namespace blink { | 38 namespace blink { |
| 39 | 39 |
| 40 class Page; | 40 class Page; |
| 41 class ScriptPreprocessor; | 41 class ScriptPreprocessor; |
| 42 class ScriptSourceCode; | 42 class ScriptSourceCode; |
| 43 | 43 |
| 44 class PageScriptDebugServer FINAL : public ScriptDebugServer { | 44 class PageScriptDebugServer final : public ScriptDebugServer { |
| 45 WTF_MAKE_NONCOPYABLE(PageScriptDebugServer); | 45 WTF_MAKE_NONCOPYABLE(PageScriptDebugServer); |
| 46 public: | 46 public: |
| 47 static PageScriptDebugServer& shared(); | 47 static PageScriptDebugServer& shared(); |
| 48 | 48 |
| 49 static void setMainThreadIsolate(v8::Isolate*); | 49 static void setMainThreadIsolate(v8::Isolate*); |
| 50 | 50 |
| 51 void addListener(ScriptDebugListener*, Page*); | 51 void addListener(ScriptDebugListener*, Page*); |
| 52 void removeListener(ScriptDebugListener*, Page*); | 52 void removeListener(ScriptDebugListener*, Page*); |
| 53 | 53 |
| 54 static void interruptAndRun(PassOwnPtr<Task>); | 54 static void interruptAndRun(PassOwnPtr<Task>); |
| 55 | 55 |
| 56 class ClientMessageLoop { | 56 class ClientMessageLoop { |
| 57 public: | 57 public: |
| 58 virtual ~ClientMessageLoop() { } | 58 virtual ~ClientMessageLoop() { } |
| 59 virtual void run(Page*) = 0; | 59 virtual void run(Page*) = 0; |
| 60 virtual void quitNow() = 0; | 60 virtual void quitNow() = 0; |
| 61 }; | 61 }; |
| 62 void setClientMessageLoop(PassOwnPtr<ClientMessageLoop>); | 62 void setClientMessageLoop(PassOwnPtr<ClientMessageLoop>); |
| 63 | 63 |
| 64 virtual void compileScript(ScriptState*, const String& expression, const Str
ing& sourceURL, String* scriptId, String* exceptionDetailsText, int* lineNumber,
int* columnNumber, RefPtrWillBeRawPtr<ScriptCallStack>* stackTrace) OVERRIDE; | 64 virtual void compileScript(ScriptState*, const String& expression, const Str
ing& sourceURL, String* scriptId, String* exceptionDetailsText, int* lineNumber,
int* columnNumber, RefPtrWillBeRawPtr<ScriptCallStack>* stackTrace) override; |
| 65 virtual void clearCompiledScripts() OVERRIDE; | 65 virtual void clearCompiledScripts() override; |
| 66 virtual void runScript(ScriptState*, const String& scriptId, ScriptValue* re
sult, bool* wasThrown, String* exceptionDetailsText, int* lineNumber, int* colum
nNumber, RefPtrWillBeRawPtr<ScriptCallStack>* stackTrace) OVERRIDE; | 66 virtual void runScript(ScriptState*, const String& scriptId, ScriptValue* re
sult, bool* wasThrown, String* exceptionDetailsText, int* lineNumber, int* colum
nNumber, RefPtrWillBeRawPtr<ScriptCallStack>* stackTrace) override; |
| 67 virtual void setPreprocessorSource(const String&) OVERRIDE; | 67 virtual void setPreprocessorSource(const String&) override; |
| 68 virtual void preprocessBeforeCompile(const v8::Debug::EventDetails&) OVERRID
E; | 68 virtual void preprocessBeforeCompile(const v8::Debug::EventDetails&) overrid
e; |
| 69 virtual PassOwnPtr<ScriptSourceCode> preprocess(LocalFrame*, const ScriptSou
rceCode&) OVERRIDE; | 69 virtual PassOwnPtr<ScriptSourceCode> preprocess(LocalFrame*, const ScriptSou
rceCode&) override; |
| 70 virtual String preprocessEventListener(LocalFrame*, const String& source, co
nst String& url, const String& functionName) OVERRIDE; | 70 virtual String preprocessEventListener(LocalFrame*, const String& source, co
nst String& url, const String& functionName) override; |
| 71 virtual void clearPreprocessor() OVERRIDE; | 71 virtual void clearPreprocessor() override; |
| 72 | 72 |
| 73 virtual void muteWarningsAndDeprecations() OVERRIDE; | 73 virtual void muteWarningsAndDeprecations() override; |
| 74 virtual void unmuteWarningsAndDeprecations() OVERRIDE; | 74 virtual void unmuteWarningsAndDeprecations() override; |
| 75 | 75 |
| 76 private: | 76 private: |
| 77 PageScriptDebugServer(); | 77 PageScriptDebugServer(); |
| 78 virtual ~PageScriptDebugServer(); | 78 virtual ~PageScriptDebugServer(); |
| 79 | 79 |
| 80 virtual ScriptDebugListener* getDebugListenerForContext(v8::Handle<v8::Conte
xt>) OVERRIDE; | 80 virtual ScriptDebugListener* getDebugListenerForContext(v8::Handle<v8::Conte
xt>) override; |
| 81 virtual void runMessageLoopOnPause(v8::Handle<v8::Context>) OVERRIDE; | 81 virtual void runMessageLoopOnPause(v8::Handle<v8::Context>) override; |
| 82 virtual void quitMessageLoopOnPause() OVERRIDE; | 82 virtual void quitMessageLoopOnPause() override; |
| 83 | 83 |
| 84 typedef HashMap<Page*, ScriptDebugListener*> ListenersMap; | 84 typedef HashMap<Page*, ScriptDebugListener*> ListenersMap; |
| 85 ListenersMap m_listenersMap; | 85 ListenersMap m_listenersMap; |
| 86 OwnPtr<ClientMessageLoop> m_clientMessageLoop; | 86 OwnPtr<ClientMessageLoop> m_clientMessageLoop; |
| 87 Page* m_pausedPage; | 87 Page* m_pausedPage; |
| 88 HashMap<String, String> m_compiledScriptURLs; | 88 HashMap<String, String> m_compiledScriptURLs; |
| 89 | 89 |
| 90 OwnPtr<ScriptSourceCode> m_preprocessorSourceCode; | 90 OwnPtr<ScriptSourceCode> m_preprocessorSourceCode; |
| 91 OwnPtr<ScriptPreprocessor> m_scriptPreprocessor; | 91 OwnPtr<ScriptPreprocessor> m_scriptPreprocessor; |
| 92 bool canPreprocess(LocalFrame*); | 92 bool canPreprocess(LocalFrame*); |
| 93 static v8::Isolate* s_mainThreadIsolate; | 93 static v8::Isolate* s_mainThreadIsolate; |
| 94 }; | 94 }; |
| 95 | 95 |
| 96 } // namespace blink | 96 } // namespace blink |
| 97 | 97 |
| 98 | 98 |
| 99 #endif // PageScriptDebugServer_h | 99 #endif // PageScriptDebugServer_h |
| OLD | NEW |