src/vs/platform/userDataProfile/common/userDataProfileStorageService.ts/AbstractUserDataProfileStorageService/withProfileScopedStorageService
class AbstractUserDataProfileStorageService:	async withProfileScopedStorageService<T>(profile: IUserDataProfile, fn: (storageService: IStorageService) => Promise<T>): Promise<T> {
		if (this.storageService.hasScope(profile)) {
			return fn(this.storageService);
		}

		const storageDatabase = await this.createStorageDatabase(profile);
		const storageService = new StorageService(storageDatabase);
		try {
			await storageService.initialize();
			const result = await fn(storageService);
			await storageService.flush();
			return result;
		} finally {
			storageService.dispose();
			await this.closeAndDispose(storageDatabase);
		}
	}