@@ -11,8 +11,9 @@ import { FileDeleteOptions, FileOverwriteOptions, FileSystemProviderCapabilities
1111import { IStorageService , StorageScope } from 'vs/platform/storage/common/storage' ;
1212import { IWorkbenchContribution } from 'vs/workbench/common/contributions' ;
1313import { VSBuffer } from 'vs/base/common/buffer' ;
14- import { readTrustedDomains } from 'vs/workbench/contrib/url/common/trustedDomains' ;
14+ import { readTrustedDomains , TRUSTED_DOMAINS_CONTENT_STORAGE_KEY , TRUSTED_DOMAINS_STORAGE_KEY } from 'vs/workbench/contrib/url/common/trustedDomains' ;
1515import { IProductService } from 'vs/platform/product/common/productService' ;
16+ import { IStorageKeysSyncRegistryService } from 'vs/platform/userDataSync/common/storageKeys' ;
1617
1718const TRUSTED_DOMAINS_SCHEMA = 'trustedDomains' ;
1819
@@ -76,9 +77,13 @@ export class TrustedDomainsFileSystemProvider implements IFileSystemProviderWith
7677 constructor (
7778 @IFileService private readonly fileService : IFileService ,
7879 @IStorageService private readonly storageService : IStorageService ,
79- @IProductService private readonly productService : IProductService
80+ @IProductService private readonly productService : IProductService ,
81+ @IStorageKeysSyncRegistryService private readonly storageKeysSyncRegistryService : IStorageKeysSyncRegistryService
8082 ) {
8183 this . fileService . registerProvider ( TRUSTED_DOMAINS_SCHEMA , this ) ;
84+
85+ this . storageKeysSyncRegistryService . registerStorageKey ( { key : TRUSTED_DOMAINS_STORAGE_KEY , version : 1 } ) ;
86+ this . storageKeysSyncRegistryService . registerStorageKey ( { key : TRUSTED_DOMAINS_CONTENT_STORAGE_KEY , version : 1 } ) ;
8287 }
8388
8489 stat ( resource : URI ) : Promise < IStat > {
@@ -87,7 +92,7 @@ export class TrustedDomainsFileSystemProvider implements IFileSystemProviderWith
8792
8893 readFile ( resource : URI ) : Promise < Uint8Array > {
8994 let trustedDomainsContent = this . storageService . get (
90- 'http.linkProtectionTrustedDomainsContent' ,
95+ TRUSTED_DOMAINS_CONTENT_STORAGE_KEY ,
9196 StorageScope . GLOBAL
9297 ) ;
9398
@@ -110,9 +115,9 @@ export class TrustedDomainsFileSystemProvider implements IFileSystemProviderWith
110115 const trustedDomainsContent = VSBuffer . wrap ( content ) . toString ( ) ;
111116 const trustedDomains = parse ( trustedDomainsContent ) ;
112117
113- this . storageService . store ( 'http.linkProtectionTrustedDomainsContent' , trustedDomainsContent , StorageScope . GLOBAL ) ;
118+ this . storageService . store ( TRUSTED_DOMAINS_CONTENT_STORAGE_KEY , trustedDomainsContent , StorageScope . GLOBAL ) ;
114119 this . storageService . store (
115- 'http.linkProtectionTrustedDomains' ,
120+ TRUSTED_DOMAINS_STORAGE_KEY ,
116121 JSON . stringify ( trustedDomains ) || '' ,
117122 StorageScope . GLOBAL
118123 ) ;
0 commit comments