@@ -45,12 +45,6 @@ import { Query } from './query';
45
45
import { Transaction } from './transaction' ;
46
46
import { OnlineState } from './types' ;
47
47
import { ViewSnapshot } from './view_snapshot' ;
48
- import {
49
- LocalStorageNotificationChannel ,
50
- TabNotificationChannel
51
- } from '../local/tab_notification_channel' ;
52
- import { AutoId } from '../util/misc' ;
53
- import { WindowEventListener } from '../platform_browser/window_event_listener' ;
54
48
55
49
const LOG_TAG = 'FirestoreClient' ;
56
50
@@ -71,9 +65,8 @@ export class FirestoreClient {
71
65
private persistence : Persistence ;
72
66
private localStore : LocalStore ;
73
67
private remoteStore : RemoteStore ;
74
- private notificationChannel ?: TabNotificationChannel ;
75
- private windowEventListener ?: WindowEventListener ;
76
68
private syncEngine : SyncEngine ;
69
+
77
70
constructor (
78
71
private platform : Platform ,
79
72
private databaseInfo : DatabaseInfo ,
@@ -238,8 +231,6 @@ export class FirestoreClient {
238
231
* @returns A promise indicating success or failure.
239
232
*/
240
233
private startIndexedDbPersistence ( ) : Promise < void > {
241
- const ownerId = AutoId . newId ( ) ;
242
-
243
234
// TODO(http://b/33384523): For now we just disable garbage collection
244
235
// when persistence is enabled.
245
236
this . garbageCollector = new NoOpGarbageCollector ( ) ;
@@ -250,26 +241,8 @@ export class FirestoreClient {
250
241
const serializer = new JsonProtoSerializer ( this . databaseInfo . databaseId , {
251
242
useProto3Json : true
252
243
} ) ;
253
-
254
- this . persistence = new IndexedDbPersistence (
255
- storagePrefix ,
256
- ownerId ,
257
- serializer
258
- ) ;
259
-
260
- return this . persistence . start ( ) . then ( ( ) => {
261
- this . notificationChannel = new LocalStorageNotificationChannel (
262
- storagePrefix ,
263
- ownerId ,
264
- this . asyncQueue
265
- ) ;
266
- this . notificationChannel . start ( ) ;
267
- this . windowEventListener = new WindowEventListener (
268
- this . asyncQueue ,
269
- this . notificationChannel
270
- ) ;
271
- this . windowEventListener . start ( ) ;
272
- } ) ;
244
+ this . persistence = new IndexedDbPersistence ( storagePrefix , serializer ) ;
245
+ return this . persistence . start ( ) ;
273
246
}
274
247
275
248
/**
@@ -363,11 +336,6 @@ export class FirestoreClient {
363
336
. then ( ( ) => {
364
337
// PORTING NOTE: LocalStore does not need an explicit shutdown on web.
365
338
return this . persistence . shutdown ( ) ;
366
- } )
367
- . then ( ( ) => {
368
- if ( this . notificationChannel ) {
369
- this . notificationChannel . shutdown ( ) ;
370
- }
371
339
} ) ;
372
340
}
373
341
0 commit comments