OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 the V8 project 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 "src/inspector/v8-debugger.h" | 5 #include "src/inspector/v8-debugger.h" |
6 | 6 |
7 #include "src/inspector/debugger-script.h" | 7 #include "src/inspector/debugger-script.h" |
8 #include "src/inspector/inspected-context.h" | 8 #include "src/inspector/inspected-context.h" |
9 #include "src/inspector/protocol/Protocol.h" | 9 #include "src/inspector/protocol/Protocol.h" |
10 #include "src/inspector/script-breakpoint.h" | 10 #include "src/inspector/script-breakpoint.h" |
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 // is migrated to pure C++ API. | 603 // is migrated to pure C++ API. |
604 v8::debug::PromiseDebugActionType type = | 604 v8::debug::PromiseDebugActionType type = |
605 static_cast<v8::debug::PromiseDebugActionType>( | 605 static_cast<v8::debug::PromiseDebugActionType>( |
606 eventData | 606 eventData |
607 ->Get(m_isolate->GetCurrentContext(), | 607 ->Get(m_isolate->GetCurrentContext(), |
608 toV8StringInternalized(m_isolate, "type_")) | 608 toV8StringInternalized(m_isolate, "type_")) |
609 .ToLocalChecked() | 609 .ToLocalChecked() |
610 ->ToInteger(m_isolate->GetCurrentContext()) | 610 ->ToInteger(m_isolate->GetCurrentContext()) |
611 .ToLocalChecked() | 611 .ToLocalChecked() |
612 ->Value()); | 612 ->Value()); |
613 String16 name = toProtocolStringWithTypeCheck( | |
614 eventData | |
615 ->Get(m_isolate->GetCurrentContext(), | |
616 toV8StringInternalized(m_isolate, "name_")) | |
617 .ToLocalChecked()); | |
618 int id = static_cast<int>(eventData | 613 int id = static_cast<int>(eventData |
619 ->Get(m_isolate->GetCurrentContext(), | 614 ->Get(m_isolate->GetCurrentContext(), |
620 toV8StringInternalized(m_isolate, "id_")) | 615 toV8StringInternalized(m_isolate, "id_")) |
621 .ToLocalChecked() | 616 .ToLocalChecked() |
622 ->ToInteger(m_isolate->GetCurrentContext()) | 617 ->ToInteger(m_isolate->GetCurrentContext()) |
623 .ToLocalChecked() | 618 .ToLocalChecked() |
624 ->Value()); | 619 ->Value()); |
625 // Async task events from Promises are given misaligned pointers to prevent | 620 // Async task events from Promises are given misaligned pointers to prevent |
626 // from overlapping with other Blink task identifiers. There is a single | 621 // from overlapping with other Blink task identifiers. There is a single |
627 // namespace of such ids, managed by src/js/promise.js. | 622 // namespace of such ids, managed by src/js/promise.js. |
628 void* ptr = reinterpret_cast<void*>(id * 2 + 1); | 623 void* ptr = reinterpret_cast<void*>(id * 2 + 1); |
629 switch (type) { | 624 switch (type) { |
630 case v8::debug::kDebugEnqueueRecurring: | 625 case v8::debug::kDebugEnqueueAsyncFunction: |
631 asyncTaskScheduled(name, ptr, true); | 626 asyncTaskScheduled("async function", ptr, true); |
632 break; | 627 break; |
633 case v8::debug::kDebugCancel: | 628 case v8::debug::kDebugEnqueuePromiseResolve: |
| 629 asyncTaskScheduled("Promise.resolve", ptr, true); |
| 630 break; |
| 631 case v8::debug::kDebugEnqueuePromiseReject: |
| 632 asyncTaskScheduled("Promise.reject", ptr, true); |
| 633 break; |
| 634 case v8::debug::kDebugEnqueuePromiseResolveThenableJob: |
| 635 asyncTaskScheduled("PromiseResolveThenableJob", ptr, true); |
| 636 break; |
| 637 case v8::debug::kDebugPromiseCollected: |
634 asyncTaskCanceled(ptr); | 638 asyncTaskCanceled(ptr); |
635 break; | 639 break; |
636 case v8::debug::kDebugWillHandle: | 640 case v8::debug::kDebugWillHandle: |
637 asyncTaskStarted(ptr); | 641 asyncTaskStarted(ptr); |
638 break; | 642 break; |
639 case v8::debug::kDebugDidHandle: | 643 case v8::debug::kDebugDidHandle: |
640 asyncTaskFinished(ptr); | 644 asyncTaskFinished(ptr); |
641 break; | 645 break; |
642 } | 646 } |
643 } | 647 } |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1010 | 1014 |
1011 size_t stackSize = | 1015 size_t stackSize = |
1012 fullStack ? V8StackTraceImpl::maxCallStackSizeToCapture : 1; | 1016 fullStack ? V8StackTraceImpl::maxCallStackSizeToCapture : 1; |
1013 if (m_inspector->enabledRuntimeAgentForGroup(contextGroupId)) | 1017 if (m_inspector->enabledRuntimeAgentForGroup(contextGroupId)) |
1014 stackSize = V8StackTraceImpl::maxCallStackSizeToCapture; | 1018 stackSize = V8StackTraceImpl::maxCallStackSizeToCapture; |
1015 | 1019 |
1016 return V8StackTraceImpl::capture(this, contextGroupId, stackSize); | 1020 return V8StackTraceImpl::capture(this, contextGroupId, stackSize); |
1017 } | 1021 } |
1018 | 1022 |
1019 } // namespace v8_inspector | 1023 } // namespace v8_inspector |
OLD | NEW |