| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "platform/v8_inspector/V8DebuggerAgentImpl.h" | 5 #include "platform/v8_inspector/V8DebuggerAgentImpl.h" |
| 6 | 6 |
| 7 #include "platform/inspector_protocol/String16.h" | 7 #include "platform/inspector_protocol/String16.h" |
| 8 #include "platform/inspector_protocol/Values.h" | 8 #include "platform/inspector_protocol/Values.h" |
| 9 #include "platform/v8_inspector/IgnoreExceptionsScope.h" | 9 #include "platform/v8_inspector/IgnoreExceptionsScope.h" |
| 10 #include "platform/v8_inspector/InjectedScript.h" | 10 #include "platform/v8_inspector/InjectedScript.h" |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 return; | 625 return; |
| 626 it->second->setSource(newContent); | 626 it->second->setSource(newContent); |
| 627 } | 627 } |
| 628 | 628 |
| 629 void V8DebuggerAgentImpl::restartFrame(ErrorString* errorString, | 629 void V8DebuggerAgentImpl::restartFrame(ErrorString* errorString, |
| 630 const String16& callFrameId, | 630 const String16& callFrameId, |
| 631 OwnPtr<Array<CallFrame>>* newCallFrames, | 631 OwnPtr<Array<CallFrame>>* newCallFrames, |
| 632 Maybe<StackTrace>* asyncStackTrace) | 632 Maybe<StackTrace>* asyncStackTrace) |
| 633 { | 633 { |
| 634 if (!isPaused() || m_currentCallStack.IsEmpty()) { | 634 if (!isPaused() || m_currentCallStack.IsEmpty()) { |
| 635 *errorString = "Attempt to access callframe when debugger is not on paus
e"; | 635 *errorString = "Attempt to access call frame when debugger is not on pau
se"; |
| 636 return; | 636 return; |
| 637 } | 637 } |
| 638 OwnPtr<RemoteCallFrameId> remoteId = RemoteCallFrameId::parse(errorString, c
allFrameId); | 638 OwnPtr<RemoteCallFrameId> remoteId = RemoteCallFrameId::parse(errorString, c
allFrameId); |
| 639 if (!remoteId) | 639 if (!remoteId) |
| 640 return; | 640 return; |
| 641 InjectedScript* injectedScript = m_injectedScriptManager->findInjectedScript
(errorString, remoteId.get()); | 641 InjectedScript* injectedScript = m_injectedScriptManager->findInjectedScript
(errorString, remoteId.get()); |
| 642 if (!injectedScript) | 642 if (!injectedScript) |
| 643 return; | 643 return; |
| 644 | 644 |
| 645 v8::HandleScope scope(m_isolate); | 645 v8::HandleScope scope(m_isolate); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 return; | 699 return; |
| 700 InjectedScript* injectedScript = m_injectedScriptManager->findInjectedScript
(errorString, remoteId.get()); | 700 InjectedScript* injectedScript = m_injectedScriptManager->findInjectedScript
(errorString, remoteId.get()); |
| 701 if (!injectedScript) | 701 if (!injectedScript) |
| 702 return; | 702 return; |
| 703 | 703 |
| 704 v8::HandleScope scope(m_isolate); | 704 v8::HandleScope scope(m_isolate); |
| 705 v8::Local<v8::Context> context = injectedScript->context(); | 705 v8::Local<v8::Context> context = injectedScript->context(); |
| 706 v8::Context::Scope contextScope(context); | 706 v8::Context::Scope contextScope(context); |
| 707 | 707 |
| 708 v8::Local<v8::Object> object; | 708 v8::Local<v8::Object> object; |
| 709 v8::Local<v8::Value> value = injectedScript->findObject(*remoteId); | 709 v8::Local<v8::Value> value; |
| 710 if (value.IsEmpty() || !value->IsObject() || !value->ToObject(context).ToLoc
al(&object)) { | 710 if (!injectedScript->findObject(errorString, *remoteId, &value)) |
| 711 *errorString = "Could not find object with given id"; | 711 return; |
| 712 if (!value->IsObject() || !value->ToObject(context).ToLocal(&object)) { |
| 713 *errorString = "Value with given id is not an Object"; |
| 712 return; | 714 return; |
| 713 } | 715 } |
| 714 | 716 |
| 715 v8::Local<v8::Object> detailsObject; | 717 v8::Local<v8::Object> detailsObject; |
| 716 v8::Local<v8::Value> detailsValue = debugger().generatorObjectDetails(object
); | 718 v8::Local<v8::Value> detailsValue = debugger().generatorObjectDetails(object
); |
| 717 if (!detailsValue->IsObject() || !detailsValue->ToObject(context).ToLocal(&d
etailsObject)) { | 719 if (!detailsValue->IsObject() || !detailsValue->ToObject(context).ToLocal(&d
etailsObject)) { |
| 718 *errorString = "Internal error"; | 720 *errorString = "Internal error"; |
| 719 return; | 721 return; |
| 720 } | 722 } |
| 721 | 723 |
| (...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1572 m_scripts.clear(); | 1574 m_scripts.clear(); |
| 1573 m_blackboxedPositions.clear(); | 1575 m_blackboxedPositions.clear(); |
| 1574 m_breakpointIdToDebuggerBreakpointIds.clear(); | 1576 m_breakpointIdToDebuggerBreakpointIds.clear(); |
| 1575 resetAsyncCallTracker(); | 1577 resetAsyncCallTracker(); |
| 1576 m_promiseTracker->clear(); | 1578 m_promiseTracker->clear(); |
| 1577 if (m_frontend) | 1579 if (m_frontend) |
| 1578 m_frontend->globalObjectCleared(); | 1580 m_frontend->globalObjectCleared(); |
| 1579 } | 1581 } |
| 1580 | 1582 |
| 1581 } // namespace blink | 1583 } // namespace blink |
| OLD | NEW |