@@ -11,8 +11,9 @@ import { FileDeleteOptions, FileOverwriteOptions, FileSystemProviderCapabilities
11
11
import { IStorageService , StorageScope } from 'vs/platform/storage/common/storage' ;
12
12
import { IWorkbenchContribution } from 'vs/workbench/common/contributions' ;
13
13
import { 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' ;
15
15
import { IProductService } from 'vs/platform/product/common/productService' ;
16
+ import { IStorageKeysSyncRegistryService } from 'vs/platform/userDataSync/common/storageKeys' ;
16
17
17
18
const TRUSTED_DOMAINS_SCHEMA = 'trustedDomains' ;
18
19
@@ -76,9 +77,13 @@ export class TrustedDomainsFileSystemProvider implements IFileSystemProviderWith
76
77
constructor (
77
78
@IFileService private readonly fileService : IFileService ,
78
79
@IStorageService private readonly storageService : IStorageService ,
79
- @IProductService private readonly productService : IProductService
80
+ @IProductService private readonly productService : IProductService ,
81
+ @IStorageKeysSyncRegistryService private readonly storageKeysSyncRegistryService : IStorageKeysSyncRegistryService
80
82
) {
81
83
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 } ) ;
82
87
}
83
88
84
89
stat ( resource : URI ) : Promise < IStat > {
@@ -87,7 +92,7 @@ export class TrustedDomainsFileSystemProvider implements IFileSystemProviderWith
87
92
88
93
readFile ( resource : URI ) : Promise < Uint8Array > {
89
94
let trustedDomainsContent = this . storageService . get (
90
- 'http.linkProtectionTrustedDomainsContent' ,
95
+ TRUSTED_DOMAINS_CONTENT_STORAGE_KEY ,
91
96
StorageScope . GLOBAL
92
97
) ;
93
98
@@ -110,9 +115,9 @@ export class TrustedDomainsFileSystemProvider implements IFileSystemProviderWith
110
115
const trustedDomainsContent = VSBuffer . wrap ( content ) . toString ( ) ;
111
116
const trustedDomains = parse ( trustedDomainsContent ) ;
112
117
113
- this . storageService . store ( 'http.linkProtectionTrustedDomainsContent' , trustedDomainsContent , StorageScope . GLOBAL ) ;
118
+ this . storageService . store ( TRUSTED_DOMAINS_CONTENT_STORAGE_KEY , trustedDomainsContent , StorageScope . GLOBAL ) ;
114
119
this . storageService . store (
115
- 'http.linkProtectionTrustedDomains' ,
120
+ TRUSTED_DOMAINS_STORAGE_KEY ,
116
121
JSON . stringify ( trustedDomains ) || '' ,
117
122
StorageScope . GLOBAL
118
123
) ;
0 commit comments