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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 void V8DebuggerImpl::clearStepping() | 360 void V8DebuggerImpl::clearStepping() |
361 { | 361 { |
362 DCHECK(enabled()); | 362 DCHECK(enabled()); |
363 v8::HandleScope scope(m_isolate); | 363 v8::HandleScope scope(m_isolate); |
364 v8::Context::Scope contextScope(debuggerContext()); | 364 v8::Context::Scope contextScope(debuggerContext()); |
365 | 365 |
366 v8::Local<v8::Value> argv[] = { v8::Undefined(m_isolate) }; | 366 v8::Local<v8::Value> argv[] = { v8::Undefined(m_isolate) }; |
367 callDebuggerMethod("clearStepping", 0, argv); | 367 callDebuggerMethod("clearStepping", 0, argv); |
368 } | 368 } |
369 | 369 |
370 bool V8DebuggerImpl::setScriptSource(const String16& sourceID, v8::Local<v8::Str
ing> newSource, bool preview, ErrorString* error, Maybe<protocol::Debugger::SetS
criptSourceError>* errorData, JavaScriptCallFrames* newCallFrames, Maybe<bool>*
stackChanged) | 370 bool V8DebuggerImpl::setScriptSource(const String16& sourceID, v8::Local<v8::Str
ing> newSource, bool preview, ErrorString* error, Maybe<protocol::Runtime::Excep
tionDetails>* exceptionDetails, JavaScriptCallFrames* newCallFrames, Maybe<bool>
* stackChanged) |
371 { | 371 { |
372 class EnableLiveEditScope { | 372 class EnableLiveEditScope { |
373 public: | 373 public: |
374 explicit EnableLiveEditScope(v8::Isolate* isolate) : m_isolate(isolate) | 374 explicit EnableLiveEditScope(v8::Isolate* isolate) : m_isolate(isolate) |
375 { | 375 { |
376 v8::Debug::SetLiveEditEnabled(m_isolate, true); | 376 v8::Debug::SetLiveEditEnabled(m_isolate, true); |
377 inLiveEditScope = true; | 377 inLiveEditScope = true; |
378 } | 378 } |
379 ~EnableLiveEditScope() | 379 ~EnableLiveEditScope() |
380 { | 380 { |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 // Call stack may have changed after if the edited function was on t
he stack. | 420 // Call stack may have changed after if the edited function was on t
he stack. |
421 if (!preview && isPaused()) { | 421 if (!preview && isPaused()) { |
422 JavaScriptCallFrames frames = currentCallFrames(); | 422 JavaScriptCallFrames frames = currentCallFrames(); |
423 newCallFrames->swap(frames); | 423 newCallFrames->swap(frames); |
424 } | 424 } |
425 return true; | 425 return true; |
426 } | 426 } |
427 // Compile error. | 427 // Compile error. |
428 case 1: | 428 case 1: |
429 { | 429 { |
430 *errorData = protocol::Debugger::SetScriptSourceError::create() | 430 *exceptionDetails = protocol::Runtime::ExceptionDetails::create() |
431 .setMessage(toProtocolStringWithTypeCheck(resultTuple->Get(2))) | 431 .setText(toProtocolStringWithTypeCheck(resultTuple->Get(2))) |
432 .setLineNumber(resultTuple->Get(3)->ToInteger(m_isolate)->Value(
)) | 432 .setScriptId(String16("0")) |
433 .setColumnNumber(resultTuple->Get(4)->ToInteger(m_isolate)->Valu
e()).build(); | 433 .setLineNumber(resultTuple->Get(3)->ToInteger(m_isolate)->Value(
) - 1) |
| 434 .setColumnNumber(resultTuple->Get(4)->ToInteger(m_isolate)->Valu
e() - 1).build(); |
434 return false; | 435 return false; |
435 } | 436 } |
436 } | 437 } |
437 *error = "Unknown error."; | 438 *error = "Unknown error."; |
438 return false; | 439 return false; |
439 } | 440 } |
440 | 441 |
441 JavaScriptCallFrames V8DebuggerImpl::currentCallFrames(int limit) | 442 JavaScriptCallFrames V8DebuggerImpl::currentCallFrames(int limit) |
442 { | 443 { |
443 if (!m_isolate->InContext()) | 444 if (!m_isolate->InContext()) |
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1144 | 1145 |
1145 V8InspectorSessionImpl* V8DebuggerImpl::sessionForContextGroup(int contextGroupI
d) | 1146 V8InspectorSessionImpl* V8DebuggerImpl::sessionForContextGroup(int contextGroupI
d) |
1146 { | 1147 { |
1147 if (!contextGroupId) | 1148 if (!contextGroupId) |
1148 return nullptr; | 1149 return nullptr; |
1149 SessionMap::iterator iter = m_sessions.find(contextGroupId); | 1150 SessionMap::iterator iter = m_sessions.find(contextGroupId); |
1150 return iter == m_sessions.end() ? nullptr : iter->second; | 1151 return iter == m_sessions.end() ? nullptr : iter->second; |
1151 } | 1152 } |
1152 | 1153 |
1153 } // namespace blink | 1154 } // namespace blink |
OLD | NEW |