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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 *newCallFrames = currentCallFrame(); | 244 *newCallFrames = currentCallFrame(); |
245 return true; | 245 return true; |
246 } | 246 } |
247 | 247 |
248 ScriptValue ScriptDebugServer::currentCallFrame() | 248 ScriptValue ScriptDebugServer::currentCallFrame() |
249 { | 249 { |
250 ASSERT(isPaused()); | 250 ASSERT(isPaused()); |
251 v8::Handle<v8::Function> currentCallFrameFunction = v8::Local<v8::Function>:
:Cast(m_debuggerScript.get()->Get(v8::String::New("currentCallFrame"))); | 251 v8::Handle<v8::Function> currentCallFrameFunction = v8::Local<v8::Function>:
:Cast(m_debuggerScript.get()->Get(v8::String::New("currentCallFrame"))); |
252 v8::Handle<v8::Value> argv[] = { m_executionState.get() }; | 252 v8::Handle<v8::Value> argv[] = { m_executionState.get() }; |
253 v8::Handle<v8::Value> currentCallFrameV8 = currentCallFrameFunction->Call(m_
debuggerScript.get(), 1, argv); | 253 v8::Handle<v8::Value> currentCallFrameV8 = currentCallFrameFunction->Call(m_
debuggerScript.get(), 1, argv); |
| 254 |
| 255 ASSERT(!currentCallFrameV8.IsEmpty()); |
254 if (!currentCallFrameV8->IsObject()) | 256 if (!currentCallFrameV8->IsObject()) |
255 return ScriptValue(v8::Null()); | 257 return ScriptValue(v8::Null()); |
| 258 |
256 RefPtr<JavaScriptCallFrame> currentCallFrame = JavaScriptCallFrame::create(v
8::Debug::GetDebugContext(), v8::Handle<v8::Object>::Cast(currentCallFrameV8)); | 259 RefPtr<JavaScriptCallFrame> currentCallFrame = JavaScriptCallFrame::create(v
8::Debug::GetDebugContext(), v8::Handle<v8::Object>::Cast(currentCallFrameV8)); |
257 v8::Context::Scope contextScope(m_pausedContext); | 260 v8::Context::Scope contextScope(m_pausedContext); |
258 return ScriptValue(toV8(currentCallFrame.release())); | 261 return ScriptValue(toV8(currentCallFrame.release())); |
259 } | 262 } |
260 | 263 |
261 void ScriptDebugServer::interruptAndRun(PassOwnPtr<Task> task) | 264 void ScriptDebugServer::interruptAndRun(PassOwnPtr<Task> task) |
262 { | 265 { |
263 v8::Debug::DebugBreakForCommand(new ClientDataImpl(task)); | 266 v8::Debug::DebugBreakForCommand(new ClientDataImpl(task)); |
264 } | 267 } |
265 | 268 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 } | 387 } |
385 | 388 |
386 bool ScriptDebugServer::isPaused() | 389 bool ScriptDebugServer::isPaused() |
387 { | 390 { |
388 return !m_executionState.get().IsEmpty(); | 391 return !m_executionState.get().IsEmpty(); |
389 } | 392 } |
390 | 393 |
391 } // namespace WebCore | 394 } // namespace WebCore |
392 | 395 |
393 #endif // ENABLE(JAVASCRIPT_DEBUGGER) | 396 #endif // ENABLE(JAVASCRIPT_DEBUGGER) |
OLD | NEW |