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

Side by Side Diff: Source/core/inspector/v8/V8DebuggerImpl.cpp

Issue 1249013002: DevTools: simplify setScriptSource and restartFrame return values (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 5 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
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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 void V8DebuggerImpl::clearStepping() 291 void V8DebuggerImpl::clearStepping()
292 { 292 {
293 ASSERT(enabled()); 293 ASSERT(enabled());
294 v8::HandleScope scope(m_isolate); 294 v8::HandleScope scope(m_isolate);
295 v8::Context::Scope contextScope(debuggerContext()); 295 v8::Context::Scope contextScope(debuggerContext());
296 296
297 v8::Local<v8::Value> argv[] = { v8Undefined() }; 297 v8::Local<v8::Value> argv[] = { v8Undefined() };
298 callDebuggerMethod("clearStepping", 0, argv); 298 callDebuggerMethod("clearStepping", 0, argv);
299 } 299 }
300 300
301 bool V8DebuggerImpl::setScriptSource(const String& sourceID, const String& newCo ntent, bool preview, String* error, RefPtr<TypeBuilder::Debugger::SetScriptSourc eError>& errorData, v8::Global<v8::Object>* newCallFrames, RefPtr<JSONObject>* r esult) 301 bool V8DebuggerImpl::setScriptSource(const String& sourceID, const String& newCo ntent, bool preview, String* error, RefPtr<TypeBuilder::Debugger::SetScriptSourc eError>& errorData, v8::Global<v8::Object>* newCallFrames, TypeBuilder::OptOutpu t<bool>* stackChanged)
302 { 302 {
303 class EnableLiveEditScope { 303 class EnableLiveEditScope {
304 public: 304 public:
305 explicit EnableLiveEditScope(v8::Isolate* isolate) : m_isolate(isolate) { v8::Debug::SetLiveEditEnabled(m_isolate, true); } 305 explicit EnableLiveEditScope(v8::Isolate* isolate) : m_isolate(isolate) { v8::Debug::SetLiveEditEnabled(m_isolate, true); }
306 ~EnableLiveEditScope() { v8::Debug::SetLiveEditEnabled(m_isolate, false) ; } 306 ~EnableLiveEditScope() { v8::Debug::SetLiveEditEnabled(m_isolate, false) ; }
307 private: 307 private:
308 v8::Isolate* m_isolate; 308 v8::Isolate* m_isolate;
309 }; 309 };
310 310
311 ASSERT(enabled()); 311 ASSERT(enabled());
(...skipping 20 matching lines...) Expand all
332 return false; 332 return false;
333 } 333 }
334 v8result = maybeResult.ToLocalChecked(); 334 v8result = maybeResult.ToLocalChecked();
335 } 335 }
336 ASSERT(!v8result.IsEmpty()); 336 ASSERT(!v8result.IsEmpty());
337 v8::Local<v8::Object> resultTuple = v8result->ToObject(m_isolate); 337 v8::Local<v8::Object> resultTuple = v8result->ToObject(m_isolate);
338 int code = static_cast<int>(resultTuple->Get(0)->ToInteger(m_isolate)->Value ()); 338 int code = static_cast<int>(resultTuple->Get(0)->ToInteger(m_isolate)->Value ());
339 switch (code) { 339 switch (code) {
340 case 0: 340 case 0:
341 { 341 {
342 v8::Local<v8::Value> normalResult = resultTuple->Get(1); 342 *stackChanged = resultTuple->Get(1)->BooleanValue();
343 RefPtr<JSONValue> jsonResult = toJSONValue(m_isolate, normalResult);
344 if (jsonResult)
345 *result = jsonResult->asObject();
346 // Call stack may have changed after if the edited function was on t he stack. 343 // Call stack may have changed after if the edited function was on t he stack.
347 if (!preview && isPaused()) 344 if (!preview && isPaused())
348 newCallFrames->Reset(m_isolate, currentCallFrames()); 345 newCallFrames->Reset(m_isolate, currentCallFrames());
349 return true; 346 return true;
350 } 347 }
351 // Compile error. 348 // Compile error.
352 case 1: 349 case 1:
353 { 350 {
354 RefPtr<TypeBuilder::Debugger::SetScriptSourceError::CompileError> co mpileError = 351 RefPtr<TypeBuilder::Debugger::SetScriptSourceError::CompileError> co mpileError =
355 TypeBuilder::Debugger::SetScriptSourceError::CompileError::creat e() 352 TypeBuilder::Debugger::SetScriptSourceError::CompileError::creat e()
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 return callDebuggerMethod("setFunctionVariableValue", 4, argv); 684 return callDebuggerMethod("setFunctionVariableValue", 4, argv);
688 } 685 }
689 686
690 687
691 bool V8DebuggerImpl::isPaused() 688 bool V8DebuggerImpl::isPaused()
692 { 689 {
693 return !m_pausedContext.IsEmpty(); 690 return !m_pausedContext.IsEmpty();
694 } 691 }
695 692
696 } // namespace blink 693 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698