| 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 26 matching lines...) Expand all Loading... |
| 37 #include "wtf/Forward.h" | 37 #include "wtf/Forward.h" |
| 38 #include "wtf/RefCounted.h" | 38 #include "wtf/RefCounted.h" |
| 39 | 39 |
| 40 namespace WebCore { | 40 namespace WebCore { |
| 41 | 41 |
| 42 class Page; | 42 class Page; |
| 43 class ScriptController; | 43 class ScriptController; |
| 44 class ScriptPreprocessor; | 44 class ScriptPreprocessor; |
| 45 class ScriptSourceCode; | 45 class ScriptSourceCode; |
| 46 | 46 |
| 47 class PageScriptDebugServer : public ScriptDebugServer { | 47 class PageScriptDebugServer FINAL : public ScriptDebugServer { |
| 48 WTF_MAKE_NONCOPYABLE(PageScriptDebugServer); | 48 WTF_MAKE_NONCOPYABLE(PageScriptDebugServer); |
| 49 public: | 49 public: |
| 50 static PageScriptDebugServer& shared(); | 50 static PageScriptDebugServer& shared(); |
| 51 | 51 |
| 52 void addListener(ScriptDebugListener*, Page*); | 52 void addListener(ScriptDebugListener*, Page*); |
| 53 void removeListener(ScriptDebugListener*, Page*); | 53 void removeListener(ScriptDebugListener*, Page*); |
| 54 | 54 |
| 55 class ClientMessageLoop { | 55 class ClientMessageLoop { |
| 56 public: | 56 public: |
| 57 virtual ~ClientMessageLoop() { } | 57 virtual ~ClientMessageLoop() { } |
| 58 virtual void run(Page*) = 0; | 58 virtual void run(Page*) = 0; |
| 59 virtual void quitNow() = 0; | 59 virtual void quitNow() = 0; |
| 60 }; | 60 }; |
| 61 void setClientMessageLoop(PassOwnPtr<ClientMessageLoop>); | 61 void setClientMessageLoop(PassOwnPtr<ClientMessageLoop>); |
| 62 | 62 |
| 63 virtual void compileScript(ScriptState*, const String& expression, const Str
ing& sourceURL, String* scriptId, String* exceptionMessage); | 63 virtual void compileScript(ScriptState*, const String& expression, const Str
ing& sourceURL, String* scriptId, String* exceptionMessage) OVERRIDE; |
| 64 virtual void clearCompiledScripts(); | 64 virtual void clearCompiledScripts() OVERRIDE; |
| 65 virtual void runScript(ScriptState*, const String& scriptId, ScriptValue* re
sult, bool* wasThrown, String* exceptionMessage); | 65 virtual void runScript(ScriptState*, const String& scriptId, ScriptValue* re
sult, bool* wasThrown, String* exceptionMessage) OVERRIDE; |
| 66 virtual void setPreprocessorSource(const String&); | 66 virtual void setPreprocessorSource(const String&) OVERRIDE; |
| 67 virtual void preprocessBeforeCompile(const v8::Debug::EventDetails&); | 67 virtual void preprocessBeforeCompile(const v8::Debug::EventDetails&) OVERRID
E; |
| 68 virtual PassOwnPtr<ScriptSourceCode> preprocess(Frame*, const ScriptSourceCo
de&); | 68 virtual PassOwnPtr<ScriptSourceCode> preprocess(Frame*, const ScriptSourceCo
de&) OVERRIDE; |
| 69 virtual String preprocessEventListener(Frame*, const String& source, const S
tring& url, const String& functionName); | 69 virtual String preprocessEventListener(Frame*, const String& source, const S
tring& url, const String& functionName) OVERRIDE; |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 PageScriptDebugServer(); | 72 PageScriptDebugServer(); |
| 73 virtual ~PageScriptDebugServer() { } | 73 virtual ~PageScriptDebugServer() { } |
| 74 | 74 |
| 75 virtual ScriptDebugListener* getDebugListenerForContext(v8::Handle<v8::Conte
xt>); | 75 virtual ScriptDebugListener* getDebugListenerForContext(v8::Handle<v8::Conte
xt>) OVERRIDE; |
| 76 virtual void runMessageLoopOnPause(v8::Handle<v8::Context>); | 76 virtual void runMessageLoopOnPause(v8::Handle<v8::Context>) OVERRIDE; |
| 77 virtual void quitMessageLoopOnPause(); | 77 virtual void quitMessageLoopOnPause() OVERRIDE; |
| 78 | 78 |
| 79 typedef HashMap<Page*, ScriptDebugListener*> ListenersMap; | 79 typedef HashMap<Page*, ScriptDebugListener*> ListenersMap; |
| 80 ListenersMap m_listenersMap; | 80 ListenersMap m_listenersMap; |
| 81 OwnPtr<ClientMessageLoop> m_clientMessageLoop; | 81 OwnPtr<ClientMessageLoop> m_clientMessageLoop; |
| 82 Page* m_pausedPage; | 82 Page* m_pausedPage; |
| 83 HashMap<String, String> m_compiledScriptURLs; | 83 HashMap<String, String> m_compiledScriptURLs; |
| 84 | 84 |
| 85 OwnPtr<ScriptSourceCode> m_preprocessorSourceCode; | 85 OwnPtr<ScriptSourceCode> m_preprocessorSourceCode; |
| 86 OwnPtr<ScriptPreprocessor> m_scriptPreprocessor; | 86 OwnPtr<ScriptPreprocessor> m_scriptPreprocessor; |
| 87 bool canPreprocess(Frame*); | 87 bool canPreprocess(Frame*); |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 } // namespace WebCore | 90 } // namespace WebCore |
| 91 | 91 |
| 92 | 92 |
| 93 #endif // PageScriptDebugServer_h | 93 #endif // PageScriptDebugServer_h |
| OLD | NEW |