| 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 14 matching lines...) Expand all Loading... |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef SKY_ENGINE_V8_INSPECTOR_PAGESCRIPTDEBUGSERVER_H_ | 31 #ifndef SKY_ENGINE_V8_INSPECTOR_PAGESCRIPTDEBUGSERVER_H_ |
| 32 #define SKY_ENGINE_V8_INSPECTOR_PAGESCRIPTDEBUGSERVER_H_ | 32 #define SKY_ENGINE_V8_INSPECTOR_PAGESCRIPTDEBUGSERVER_H_ |
| 33 | 33 |
| 34 #include "sky/engine/v8_inspector/ScriptDebugServer.h" | 34 #include "sky/engine/v8_inspector/ScriptDebugServer.h" |
| 35 #include "sky/engine/v8_inspector/ScriptPreprocessor.h" | |
| 36 #include "sky/engine/wtf/Forward.h" | 35 #include "sky/engine/wtf/Forward.h" |
| 37 #include "sky/engine/wtf/RefCounted.h" | 36 #include "sky/engine/wtf/RefCounted.h" |
| 38 #include "v8/include/v8.h" | 37 #include "v8/include/v8.h" |
| 39 | 38 |
| 40 // This whole file will move to namespace inspector. | 39 // This whole file will move to namespace inspector. |
| 41 namespace inspector { | 40 namespace inspector { |
| 42 class InspectorHost; | 41 class InspectorHost; |
| 43 } | 42 } |
| 44 | 43 |
| 45 namespace blink { | 44 namespace blink { |
| 46 | 45 |
| 47 class ScriptController; | 46 class ScriptController; |
| 48 class ScriptPreprocessor; | |
| 49 class ScriptSourceCode; | 47 class ScriptSourceCode; |
| 50 | 48 |
| 51 class PageScriptDebugServer final : public ScriptDebugServer { | 49 class PageScriptDebugServer final : public ScriptDebugServer { |
| 52 WTF_MAKE_NONCOPYABLE(PageScriptDebugServer); | 50 WTF_MAKE_NONCOPYABLE(PageScriptDebugServer); |
| 53 public: | 51 public: |
| 54 static PageScriptDebugServer& shared(); | 52 static PageScriptDebugServer& shared(); |
| 55 | 53 |
| 56 static void setMainThreadIsolate(v8::Isolate*); | 54 static void setMainThreadIsolate(v8::Isolate*); |
| 57 | 55 |
| 58 void addListener(ScriptDebugListener*, inspector::InspectorHost*); | 56 void addListener(ScriptDebugListener*, inspector::InspectorHost*); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 71 class InspectorHostResolver { | 69 class InspectorHostResolver { |
| 72 public: | 70 public: |
| 73 virtual ~InspectorHostResolver() { } | 71 virtual ~InspectorHostResolver() { } |
| 74 virtual inspector::InspectorHost* inspectorHostFor(v8::Handle<v8::Contex
t>) = 0; | 72 virtual inspector::InspectorHost* inspectorHostFor(v8::Handle<v8::Contex
t>) = 0; |
| 75 }; | 73 }; |
| 76 void setInspectorHostResolver(PassOwnPtr<InspectorHostResolver>); | 74 void setInspectorHostResolver(PassOwnPtr<InspectorHostResolver>); |
| 77 | 75 |
| 78 virtual void compileScript(ScriptState*, const String& expression, const Str
ing& sourceURL, String* scriptId, String* exceptionDetailsText, int* lineNumber,
int* columnNumber, RefPtr<ScriptCallStack>* stackTrace) override; | 76 virtual void compileScript(ScriptState*, const String& expression, const Str
ing& sourceURL, String* scriptId, String* exceptionDetailsText, int* lineNumber,
int* columnNumber, RefPtr<ScriptCallStack>* stackTrace) override; |
| 79 virtual void clearCompiledScripts() override; | 77 virtual void clearCompiledScripts() override; |
| 80 virtual void runScript(ScriptState*, const String& scriptId, ScriptValue* re
sult, bool* wasThrown, String* exceptionDetailsText, int* lineNumber, int* colum
nNumber, RefPtr<ScriptCallStack>* stackTrace) override; | 78 virtual void runScript(ScriptState*, const String& scriptId, ScriptValue* re
sult, bool* wasThrown, String* exceptionDetailsText, int* lineNumber, int* colum
nNumber, RefPtr<ScriptCallStack>* stackTrace) override; |
| 81 virtual void setPreprocessorSource(const String&) override; | |
| 82 virtual void preprocessBeforeCompile(const v8::Debug::EventDetails&) overrid
e; | |
| 83 virtual PassOwnPtr<ScriptSourceCode> preprocess(LocalFrame*, const ScriptSou
rceCode&) override; | |
| 84 virtual String preprocessEventListener(LocalFrame*, const String& source, co
nst String& url, const String& functionName) override; | |
| 85 virtual void clearPreprocessor() override; | |
| 86 | 79 |
| 87 private: | 80 private: |
| 88 PageScriptDebugServer(); | 81 PageScriptDebugServer(); |
| 89 virtual ~PageScriptDebugServer(); | 82 virtual ~PageScriptDebugServer(); |
| 90 | 83 |
| 91 virtual ScriptDebugListener* getDebugListenerForContext(v8::Handle<v8::Conte
xt>) override; | 84 virtual ScriptDebugListener* getDebugListenerForContext(v8::Handle<v8::Conte
xt>) override; |
| 92 virtual void runMessageLoopOnPause(v8::Handle<v8::Context>) override; | 85 virtual void runMessageLoopOnPause(v8::Handle<v8::Context>) override; |
| 93 virtual void quitMessageLoopOnPause() override; | 86 virtual void quitMessageLoopOnPause() override; |
| 94 | 87 |
| 95 typedef HashMap<inspector::InspectorHost*, ScriptDebugListener*> ListenersMa
p; | 88 typedef HashMap<inspector::InspectorHost*, ScriptDebugListener*> ListenersMa
p; |
| 96 ListenersMap m_listenersMap; | 89 ListenersMap m_listenersMap; |
| 97 OwnPtr<ClientMessageLoop> m_clientMessageLoop; | 90 OwnPtr<ClientMessageLoop> m_clientMessageLoop; |
| 98 OwnPtr<InspectorHostResolver> m_inspectorHostResolver; | 91 OwnPtr<InspectorHostResolver> m_inspectorHostResolver; |
| 99 inspector::InspectorHost* m_pausedHost; | 92 inspector::InspectorHost* m_pausedHost; |
| 100 HashMap<String, String> m_compiledScriptURLs; | 93 HashMap<String, String> m_compiledScriptURLs; |
| 101 | 94 |
| 102 OwnPtr<ScriptSourceCode> m_preprocessorSourceCode; | |
| 103 OwnPtr<ScriptPreprocessor> m_scriptPreprocessor; | |
| 104 bool canPreprocess(LocalFrame*); | |
| 105 static v8::Isolate* s_mainThreadIsolate; | 95 static v8::Isolate* s_mainThreadIsolate; |
| 106 }; | 96 }; |
| 107 | 97 |
| 108 } // namespace blink | 98 } // namespace blink |
| 109 | 99 |
| 110 | 100 |
| 111 #endif // SKY_ENGINE_V8_INSPECTOR_PAGESCRIPTDEBUGSERVER_H_ | 101 #endif // SKY_ENGINE_V8_INSPECTOR_PAGESCRIPTDEBUGSERVER_H_ |
| OLD | NEW |