src/vs/workbench/api/worker/extensionHostWorker.ts/create
export function create(): { onmessage: (message: any) => void } {
	performance.mark(`code/extHost/willConnectToRenderer`);
	const res = new ExtensionWorker();

	return {
		onmessage(message: any) {
			if (!isInitMessage(message)) {
				return; // silently ignore foreign messages
			}

			connectToRenderer(res.protocol).then(data => {
				performance.mark(`code/extHost/didWaitForInitData`);
				const extHostMain = new ExtensionHostMain(
					data.protocol,
					data.initData,
					hostUtil,
					null,
					message.data
				);

				patchFetching(uri => extHostMain.asBrowserUri(uri));

				onTerminate = (reason: string) => extHostMain.terminate(reason);
			});
		}
	};
}