Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: Source/bindings/v8/ScriptDebugServer.cpp

Issue 333153003: DevTools: Revert stepping over/out on a call frame backend code. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/bindings/v8/ScriptDebugServer.h ('k') | Source/core/inspector/InjectedScript.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 void ScriptDebugServer::stepIntoStatement() 210 void ScriptDebugServer::stepIntoStatement()
211 { 211 {
212 ASSERT(isPaused()); 212 ASSERT(isPaused());
213 ASSERT(!m_executionState.IsEmpty()); 213 ASSERT(!m_executionState.IsEmpty());
214 v8::HandleScope handleScope(m_isolate); 214 v8::HandleScope handleScope(m_isolate);
215 v8::Handle<v8::Value> argv[] = { m_executionState }; 215 v8::Handle<v8::Value> argv[] = { m_executionState };
216 callDebuggerMethod(stepIntoV8MethodName, 1, argv); 216 callDebuggerMethod(stepIntoV8MethodName, 1, argv);
217 continueProgram(); 217 continueProgram();
218 } 218 }
219 219
220 void ScriptDebugServer::stepCommandWithFrame(const char* functionName, const Scr iptValue& frame) 220 void ScriptDebugServer::stepOverStatement()
221 { 221 {
222 ASSERT(isPaused()); 222 ASSERT(isPaused());
223 ASSERT(!m_executionState.IsEmpty()); 223 ASSERT(!m_executionState.IsEmpty());
224 v8::HandleScope handleScope(m_isolate); 224 v8::HandleScope handleScope(m_isolate);
225 v8::Handle<v8::Value> callFrame; 225 v8::Handle<v8::Value> argv[] = { m_executionState };
226 if (frame.isEmpty()) { 226 callDebuggerMethod("stepOverStatement", 1, argv);
227 callFrame = v8::Undefined(m_isolate);
228 } else {
229 JavaScriptCallFrame* impl = V8JavaScriptCallFrame::toNative(v8::Handle<v 8::Object>::Cast(frame.v8Value()));
230 callFrame = impl->innerCallFrame();
231 }
232
233 v8::Handle<v8::Value> argv[] = { m_executionState, callFrame };
234 callDebuggerMethod(functionName, 2, argv);
235 continueProgram(); 227 continueProgram();
236 } 228 }
237 229
238 void ScriptDebugServer::stepOverStatement(const ScriptValue& frame) 230 void ScriptDebugServer::stepOutOfFunction()
239 { 231 {
240 stepCommandWithFrame("stepOverStatement", frame); 232 ASSERT(isPaused());
241 } 233 ASSERT(!m_executionState.IsEmpty());
242 234 v8::HandleScope handleScope(m_isolate);
243 void ScriptDebugServer::stepOutOfFunction(const ScriptValue& frame) 235 v8::Handle<v8::Value> argv[] = { m_executionState };
244 { 236 callDebuggerMethod(stepOutV8MethodName, 1, argv);
245 stepCommandWithFrame(stepOutV8MethodName, frame); 237 continueProgram();
246 } 238 }
247 239
248 bool ScriptDebugServer::setScriptSource(const String& sourceID, const String& ne wContent, bool preview, String* error, RefPtr<TypeBuilder::Debugger::SetScriptSo urceError>& errorData, ScriptValue* newCallFrames, RefPtr<JSONObject>* result) 240 bool ScriptDebugServer::setScriptSource(const String& sourceID, const String& ne wContent, bool preview, String* error, RefPtr<TypeBuilder::Debugger::SetScriptSo urceError>& errorData, ScriptValue* newCallFrames, RefPtr<JSONObject>* result)
249 { 241 {
250 class EnableLiveEditScope { 242 class EnableLiveEditScope {
251 public: 243 public:
252 explicit EnableLiveEditScope(v8::Isolate* isolate) : m_isolate(isolate) { v8::Debug::SetLiveEditEnabled(m_isolate, true); } 244 explicit EnableLiveEditScope(v8::Isolate* isolate) : m_isolate(isolate) { v8::Debug::SetLiveEditEnabled(m_isolate, true); }
253 ~EnableLiveEditScope() { v8::Debug::SetLiveEditEnabled(m_isolate, false) ; } 245 ~EnableLiveEditScope() { v8::Debug::SetLiveEditEnabled(m_isolate, false) ; }
254 private: 246 private:
255 v8::Isolate* m_isolate; 247 v8::Isolate* m_isolate;
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 { 628 {
637 return PassOwnPtr<ScriptSourceCode>(); 629 return PassOwnPtr<ScriptSourceCode>();
638 } 630 }
639 631
640 String ScriptDebugServer::preprocessEventListener(LocalFrame*, const String& sou rce, const String& url, const String& functionName) 632 String ScriptDebugServer::preprocessEventListener(LocalFrame*, const String& sou rce, const String& url, const String& functionName)
641 { 633 {
642 return source; 634 return source;
643 } 635 }
644 636
645 } // namespace WebCore 637 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/v8/ScriptDebugServer.h ('k') | Source/core/inspector/InjectedScript.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698