Bug 1620280 - [devtools] Wait for source actor when fetching frames. r=jdescottes

Differential Revision: https://phabricator.services.mozilla.com/D90429
This commit is contained in:
Alexandre Poirot 2020-10-01 14:22:38 +00:00
Родитель db80068f12
Коммит 24fa559f26
2 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -9,6 +9,7 @@ import {
addThreadEventListeners,
clientEvents,
removeThreadEventListeners,
ensureSourceActor,
} from "./events";
import { makePendingLocationId } from "../../utils/breakpoint";
@ -316,6 +317,13 @@ function getProperties(thread: string, grip: Grip): Promise<*> {
async function getFrames(thread: string) {
const threadFront = lookupThreadFront(thread);
const response = await threadFront.getFrames(0, CALL_STACK_PAGE_SIZE);
// Ensure that each frame has its source already available.
// Because of throttling, the source may be available a bit late.
await Promise.all(
response.frames.map(frame => ensureSourceActor(frame.where.actor))
);
return response.frames.map<?Frame>((frame, i) =>
createFrame(thread, frame, i)
);

Просмотреть файл

@ -141,4 +141,5 @@ export {
addThreadEventListeners,
removeThreadEventListeners,
attachAllTargets,
ensureSourceActor,
};