mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-13 01:54:52 +08:00
DevTools: ensure all auto-start modules are loaded before starting the app.
Change-Id: I9dcdabed9e8e255bfb9911234b5c2c2a37d57fd1 Reviewed-on: https://chromium-review.googlesource.com/c/1349501 Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Commit-Queue: Pavel Feldman <pfeldman@chromium.org> Cr-Original-Commit-Position: refs/heads/master@{#610722} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 89caaba1c8fadd39eb064b5dc2f9314436acbdea
This commit is contained in:
committed by
Commit Bot
parent
edea727370
commit
63e89eb94a
@@ -66,8 +66,6 @@ var Runtime = class { // eslint-disable-line
|
||||
|
||||
for (let i = 0; i < descriptors.length; ++i)
|
||||
this._registerModule(descriptors[i]);
|
||||
|
||||
Runtime._runtimeReadyPromiseCallback();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -237,8 +235,8 @@ var Runtime = class { // eslint-disable-line
|
||||
/**
|
||||
* @return {!Promise}
|
||||
*/
|
||||
static async runtimeReady() {
|
||||
return Runtime._runtimeReadyPromise;
|
||||
static async appStarted() {
|
||||
return Runtime._appStartedPromise;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -289,7 +287,8 @@ var Runtime = class { // eslint-disable-line
|
||||
}
|
||||
self.runtime = new Runtime(moduleDescriptors);
|
||||
if (coreModuleNames)
|
||||
return /** @type {!Promise<undefined>} */ (self.runtime._loadAutoStartModules(coreModuleNames));
|
||||
await self.runtime._loadAutoStartModules(coreModuleNames);
|
||||
Runtime._appStartedPromiseCallback();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1069,8 +1068,8 @@ Runtime.Experiment = class {
|
||||
Runtime.experiments = new Runtime.ExperimentsSupport();
|
||||
|
||||
/** @type {Function} */
|
||||
Runtime._runtimeReadyPromiseCallback;
|
||||
Runtime._runtimeReadyPromise = new Promise(fulfil => Runtime._runtimeReadyPromiseCallback = fulfil);
|
||||
Runtime._appStartedPromiseCallback;
|
||||
Runtime._appStartedPromise = new Promise(fulfil => Runtime._appStartedPromiseCallback = fulfil);
|
||||
/**
|
||||
* @type {?string}
|
||||
*/
|
||||
|
||||
@@ -60,7 +60,7 @@ Main.Main = class {
|
||||
|
||||
async _loaded() {
|
||||
console.timeStamp('Main._loaded');
|
||||
await Runtime.runtimeReady();
|
||||
await Runtime.appStarted();
|
||||
Runtime.setPlatform(Host.platform());
|
||||
InspectorFrontendHost.getPreferences(this._gotPreferences.bind(this));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user