зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
db80068f12
Коммит
24fa559f26
|
@ -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,
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче