OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010-2011 Google Inc. All rights reserved. | 2 * Copyright (c) 2010-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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 v8::Handle<v8::Value> result = callDebuggerMethod("pauseOnExceptionsState",
0, argv); | 154 v8::Handle<v8::Value> result = callDebuggerMethod("pauseOnExceptionsState",
0, argv); |
155 return static_cast<ScriptDebugServer::PauseOnExceptionsState>(result->Int32V
alue()); | 155 return static_cast<ScriptDebugServer::PauseOnExceptionsState>(result->Int32V
alue()); |
156 } | 156 } |
157 | 157 |
158 void ScriptDebugServer::setPauseOnExceptionsState(PauseOnExceptionsState pauseOn
ExceptionsState) | 158 void ScriptDebugServer::setPauseOnExceptionsState(PauseOnExceptionsState pauseOn
ExceptionsState) |
159 { | 159 { |
160 ensureDebuggerScriptCompiled(); | 160 ensureDebuggerScriptCompiled(); |
161 v8::HandleScope scope(m_isolate); | 161 v8::HandleScope scope(m_isolate); |
162 v8::Context::Scope contextScope(v8::Debug::GetDebugContext()); | 162 v8::Context::Scope contextScope(v8::Debug::GetDebugContext()); |
163 | 163 |
164 v8::Handle<v8::Value> argv[] = { v8::Int32::New(pauseOnExceptionsState) }; | 164 v8::Handle<v8::Value> argv[] = { v8::Int32::New(pauseOnExceptionsState, m_is
olate) }; |
165 callDebuggerMethod("setPauseOnExceptionsState", 1, argv); | 165 callDebuggerMethod("setPauseOnExceptionsState", 1, argv); |
166 } | 166 } |
167 | 167 |
168 void ScriptDebugServer::setPauseOnNextStatement(bool pause) | 168 void ScriptDebugServer::setPauseOnNextStatement(bool pause) |
169 { | 169 { |
170 if (isPaused()) | 170 if (isPaused()) |
171 return; | 171 return; |
172 if (pause) | 172 if (pause) |
173 v8::Debug::DebugBreak(m_isolate); | 173 v8::Debug::DebugBreak(m_isolate); |
174 else | 174 else |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 | 308 |
309 | 309 |
310 void ScriptDebugServer::updateCallStack(ScriptValue* callFrame) | 310 void ScriptDebugServer::updateCallStack(ScriptValue* callFrame) |
311 { | 311 { |
312 if (isPaused()) | 312 if (isPaused()) |
313 *callFrame = currentCallFrame(); | 313 *callFrame = currentCallFrame(); |
314 } | 314 } |
315 | 315 |
316 PassRefPtr<JavaScriptCallFrame> ScriptDebugServer::wrapCallFrames(v8::Handle<v8:
:Object> executionState, int maximumLimit) | 316 PassRefPtr<JavaScriptCallFrame> ScriptDebugServer::wrapCallFrames(v8::Handle<v8:
:Object> executionState, int maximumLimit) |
317 { | 317 { |
318 v8::Handle<v8::Value> argv[] = { executionState, v8::Integer::New(maximumLim
it) }; | 318 v8::Handle<v8::Value> argv[] = { executionState, v8::Integer::New(maximumLim
it, m_isolate) }; |
319 v8::Handle<v8::Value> currentCallFrameV8 = callDebuggerMethod("currentCallFr
ame", 2, argv); | 319 v8::Handle<v8::Value> currentCallFrameV8 = callDebuggerMethod("currentCallFr
ame", 2, argv); |
320 | 320 |
321 ASSERT(!currentCallFrameV8.IsEmpty()); | 321 ASSERT(!currentCallFrameV8.IsEmpty()); |
322 if (!currentCallFrameV8->IsObject()) | 322 if (!currentCallFrameV8->IsObject()) |
323 return PassRefPtr<JavaScriptCallFrame>(); | 323 return PassRefPtr<JavaScriptCallFrame>(); |
324 return JavaScriptCallFrame::create(v8::Debug::GetDebugContext(), v8::Handle<
v8::Object>::Cast(currentCallFrameV8)); | 324 return JavaScriptCallFrame::create(v8::Debug::GetDebugContext(), v8::Handle<
v8::Object>::Cast(currentCallFrameV8)); |
325 } | 325 } |
326 | 326 |
327 ScriptValue ScriptDebugServer::currentCallFrame() | 327 ScriptValue ScriptDebugServer::currentCallFrame() |
328 { | 328 { |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 } | 533 } |
534 | 534 |
535 v8::Handle<v8::Value> ScriptDebugServer::setFunctionVariableValue(v8::Handle<v8:
:Value> functionValue, int scopeNumber, const String& variableName, v8::Handle<v
8::Value> newValue) | 535 v8::Handle<v8::Value> ScriptDebugServer::setFunctionVariableValue(v8::Handle<v8:
:Value> functionValue, int scopeNumber, const String& variableName, v8::Handle<v
8::Value> newValue) |
536 { | 536 { |
537 v8::Local<v8::Context> debuggerContext = v8::Debug::GetDebugContext(); | 537 v8::Local<v8::Context> debuggerContext = v8::Debug::GetDebugContext(); |
538 if (m_debuggerScript.isEmpty()) | 538 if (m_debuggerScript.isEmpty()) |
539 return v8::ThrowException(v8::String::New("Debugging is not enabled.")); | 539 return v8::ThrowException(v8::String::New("Debugging is not enabled.")); |
540 | 540 |
541 v8::Handle<v8::Value> argv[] = { | 541 v8::Handle<v8::Value> argv[] = { |
542 functionValue, | 542 functionValue, |
543 v8::Handle<v8::Value>(v8::Integer::New(scopeNumber)), | 543 v8::Handle<v8::Value>(v8::Integer::New(scopeNumber, debuggerContext->Get
Isolate())), |
544 v8String(variableName, debuggerContext->GetIsolate()), | 544 v8String(variableName, debuggerContext->GetIsolate()), |
545 newValue | 545 newValue |
546 }; | 546 }; |
547 return callDebuggerMethod("setFunctionVariableValue", 4, argv); | 547 return callDebuggerMethod("setFunctionVariableValue", 4, argv); |
548 } | 548 } |
549 | 549 |
550 | 550 |
551 bool ScriptDebugServer::isPaused() | 551 bool ScriptDebugServer::isPaused() |
552 { | 552 { |
553 return !m_executionState.isEmpty(); | 553 return !m_executionState.isEmpty(); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 { | 614 { |
615 return PassOwnPtr<ScriptSourceCode>(); | 615 return PassOwnPtr<ScriptSourceCode>(); |
616 } | 616 } |
617 | 617 |
618 String ScriptDebugServer::preprocessEventListener(Frame*, const String& source,
const String& url, const String& functionName) | 618 String ScriptDebugServer::preprocessEventListener(Frame*, const String& source,
const String& url, const String& functionName) |
619 { | 619 { |
620 return source; | 620 return source; |
621 } | 621 } |
622 | 622 |
623 } // namespace WebCore | 623 } // namespace WebCore |
OLD | NEW |