| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2010, Google Inc. All rights reserved. | 2 * Copyright (c) 2010, 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 v8::Handle<v8::Value> setFunctionVariableValue(v8::Handle<v8::Value> functio
nValue, int scopeNumber, const String& variableName, v8::Handle<v8::Value> newVa
lue); | 96 v8::Handle<v8::Value> setFunctionVariableValue(v8::Handle<v8::Value> functio
nValue, int scopeNumber, const String& variableName, v8::Handle<v8::Value> newVa
lue); |
| 97 | 97 |
| 98 | 98 |
| 99 virtual void compileScript(ScriptState*, const String& expression, const Str
ing& sourceURL, String* scriptId, String* exceptionMessage); | 99 virtual void compileScript(ScriptState*, const String& expression, const Str
ing& sourceURL, String* scriptId, String* exceptionMessage); |
| 100 virtual void clearCompiledScripts(); | 100 virtual void clearCompiledScripts(); |
| 101 virtual void runScript(ScriptState*, const String& scriptId, ScriptValue* re
sult, bool* wasThrown, String* exceptionMessage); | 101 virtual void runScript(ScriptState*, const String& scriptId, ScriptValue* re
sult, bool* wasThrown, String* exceptionMessage); |
| 102 | 102 |
| 103 protected: | 103 protected: |
| 104 explicit ScriptDebugServer(v8::Isolate*); | 104 explicit ScriptDebugServer(v8::Isolate*); |
| 105 virtual ~ScriptDebugServer(); | 105 virtual ~ScriptDebugServer(); |
| 106 | 106 |
| 107 ScriptValue currentCallFrame(); | 107 ScriptValue currentCallFrame(); |
| 108 | 108 |
| 109 virtual ScriptDebugListener* getDebugListenerForContext(v8::Handle<v8::Conte
xt>) = 0; | 109 virtual ScriptDebugListener* getDebugListenerForContext(v8::Handle<v8::Conte
xt>) = 0; |
| 110 virtual void runMessageLoopOnPause(v8::Handle<v8::Context>) = 0; | 110 virtual void runMessageLoopOnPause(v8::Handle<v8::Context>) = 0; |
| 111 virtual void quitMessageLoopOnPause() = 0; | 111 virtual void quitMessageLoopOnPause() = 0; |
| 112 | 112 |
| 113 static void breakProgramCallback(const v8::FunctionCallbackInfo<v8::Value>&
args); | 113 static void breakProgramCallback(const v8::FunctionCallbackInfo<v8::Value>&
args); |
| 114 void handleProgramBreak(v8::Handle<v8::Object> executionState, v8::Handle<v8
::Value> exception, v8::Handle<v8::Array> hitBreakpoints); | 114 void handleProgramBreak(v8::Handle<v8::Object> executionState, v8::Handle<v8
::Value> exception, v8::Handle<v8::Array> hitBreakpoints); |
| 115 void handleProgramBreak(const v8::Debug::EventDetails&, v8::Handle<v8::Value
> exception, v8::Handle<v8::Array> hitBreakpointNumbers); | 115 void handleProgramBreak(const v8::Debug::EventDetails&, v8::Handle<v8::Value
> exception, v8::Handle<v8::Array> hitBreakpointNumbers); |
| 116 | 116 |
| 117 static void v8DebugEventCallback(const v8::Debug::EventDetails& eventDetails
); | 117 static void v8DebugEventCallback(const v8::Debug::EventDetails& eventDetails
); |
| 118 void handleV8DebugEvent(const v8::Debug::EventDetails& eventDetails); | 118 void handleV8DebugEvent(const v8::Debug::EventDetails& eventDetails); |
| 119 | 119 |
| 120 void dispatchDidParseSource(ScriptDebugListener* listener, v8::Handle<v8::Ob
ject> sourceObject); | 120 void dispatchDidParseSource(ScriptDebugListener* listener, v8::Handle<v8::Ob
ject> sourceObject); |
| 121 | 121 |
| 122 void ensureDebuggerScriptCompiled(); | 122 void ensureDebuggerScriptCompiled(); |
| 123 | 123 |
| 124 v8::Local<v8::Value> callDebuggerMethod(const char* functionName, int argc,
v8::Handle<v8::Value> argv[]); | 124 v8::Local<v8::Value> callDebuggerMethod(const char* functionName, int argc,
v8::Handle<v8::Value> argv[]); |
| 125 | 125 |
| 126 String preprocessSourceCode(const String& sourceCode); | 126 String preprocessSourceCode(const String& sourceCode); |
| 127 | 127 |
| 128 PauseOnExceptionsState m_pauseOnExceptionsState; | 128 PauseOnExceptionsState m_pauseOnExceptionsState; |
| 129 ScopedPersistent<v8::Object> m_debuggerScript; | 129 ScopedPersistent<v8::Object> m_debuggerScript; |
| 130 ScopedPersistent<v8::Object> m_executionState; | 130 ScopedPersistent<v8::Object> m_executionState; |
| 131 v8::Handle<v8::Context> m_pausedContext; | 131 v8::Handle<v8::Context> m_pausedContext; |
| 132 bool m_breakpointsActivated; | 132 bool m_breakpointsActivated; |
| 133 ScopedPersistent<v8::FunctionTemplate> m_breakProgramCallbackTemplate; | 133 ScopedPersistent<v8::FunctionTemplate> m_breakProgramCallbackTemplate; |
| 134 HashMap<String, OwnPtr<ScopedPersistent<v8::Script> > > m_compiledScripts; | 134 HashMap<String, OwnPtr<ScopedPersistent<v8::Script> > > m_compiledScripts; |
| 135 v8::Isolate* m_isolate; | 135 v8::Isolate* m_isolate; |
| 136 | 136 |
| 137 private: | 137 private: |
| 138 PassRefPtr<JavaScriptCallFrame> wrapCallFrames(v8::Handle<v8::Object> execut
ionState, int maximumLimit); | 138 PassRefPtr<JavaScriptCallFrame> wrapCallFrames(v8::Handle<v8::Object> execut
ionState, int maximumLimit); |
| 139 | 139 |
| 140 class ScriptPreprocessor; | 140 class ScriptPreprocessor; |
| 141 OwnPtr<ScriptPreprocessor> m_scriptPreprocessor; | 141 OwnPtr<ScriptPreprocessor> m_scriptPreprocessor; |
| 142 bool m_runningNestedMessageLoop; | 142 bool m_runningNestedMessageLoop; |
| 143 }; | 143 }; |
| 144 | 144 |
| 145 } // namespace WebCore | 145 } // namespace WebCore |
| 146 | 146 |
| 147 | 147 |
| 148 #endif // ScriptDebugServer_h | 148 #endif // ScriptDebugServer_h |
| OLD | NEW |