diff options
author | Michael Lehenbauer <mikelehen@gmail.com> | 2017-12-19 16:05:20 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-19 16:05:20 -0800 |
commit | faca4ea11be26953b0a031e104e7dfcbd6ed9024 (patch) | |
tree | 5a248613aeef8e88c7358985f696bec619032805 /Firestore/Source | |
parent | 9ddf3637ac984abfe16d4ebef6ff3947b4e946c1 (diff) |
Rename all the onlineStateChanged methods to applyChangedOnlineState. (#574)
Diffstat (limited to 'Firestore/Source')
-rw-r--r-- | Firestore/Source/Core/FSTEventManager.h | 2 | ||||
-rw-r--r-- | Firestore/Source/Core/FSTEventManager.m | 8 | ||||
-rw-r--r-- | Firestore/Source/Core/FSTFirestoreClient.m | 6 | ||||
-rw-r--r-- | Firestore/Source/Core/FSTSyncEngine.h | 2 | ||||
-rw-r--r-- | Firestore/Source/Core/FSTSyncEngine.m | 4 | ||||
-rw-r--r-- | Firestore/Source/Core/FSTView.h | 2 | ||||
-rw-r--r-- | Firestore/Source/Core/FSTView.m | 2 | ||||
-rw-r--r-- | Firestore/Source/Remote/FSTRemoteStore.h | 2 | ||||
-rw-r--r-- | Firestore/Source/Remote/FSTRemoteStore.m | 2 |
9 files changed, 15 insertions, 15 deletions
diff --git a/Firestore/Source/Core/FSTEventManager.h b/Firestore/Source/Core/FSTEventManager.h index edd2a96..8eafd4b 100644 --- a/Firestore/Source/Core/FSTEventManager.h +++ b/Firestore/Source/Core/FSTEventManager.h @@ -62,7 +62,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)queryDidChangeViewSnapshot:(FSTViewSnapshot *)snapshot; - (void)queryDidError:(NSError *)error; -- (void)clientDidChangeOnlineState:(FSTOnlineState)onlineState; +- (void)applyChangedOnlineState:(FSTOnlineState)onlineState; @property(nonatomic, strong, readonly) FSTQuery *query; diff --git a/Firestore/Source/Core/FSTEventManager.m b/Firestore/Source/Core/FSTEventManager.m index 3e1b99b..bc204a0 100644 --- a/Firestore/Source/Core/FSTEventManager.m +++ b/Firestore/Source/Core/FSTEventManager.m @@ -151,7 +151,7 @@ NS_ASSUME_NONNULL_BEGIN self.viewSnapshotHandler(nil, error); } -- (void)clientDidChangeOnlineState:(FSTOnlineState)onlineState { +- (void)applyChangedOnlineState:(FSTOnlineState)onlineState { self.onlineState = onlineState; if (self.snapshot && !self.raisedInitialEvent && [self shouldRaiseInitialEventForSnapshot:self.snapshot onlineState:onlineState]) { @@ -268,7 +268,7 @@ NS_ASSUME_NONNULL_BEGIN } [queryInfo.listeners addObject:listener]; - [listener clientDidChangeOnlineState:self.onlineState]; + [listener applyChangedOnlineState:self.onlineState]; if (queryInfo.viewSnapshot) { [listener queryDidChangeViewSnapshot:queryInfo.viewSnapshot]; @@ -321,11 +321,11 @@ NS_ASSUME_NONNULL_BEGIN [self.queries removeObjectForKey:query]; } -- (void)watchStreamDidChangeOnlineState:(FSTOnlineState)onlineState { +- (void)applyChangedOnlineState:(FSTOnlineState)onlineState { self.onlineState = onlineState; for (FSTQueryListenersInfo *info in self.queries.objectEnumerator) { for (FSTQueryListener *listener in info.listeners) { - [listener clientDidChangeOnlineState:onlineState]; + [listener applyChangedOnlineState:onlineState]; } } } diff --git a/Firestore/Source/Core/FSTFirestoreClient.m b/Firestore/Source/Core/FSTFirestoreClient.m index d8bdde7..fff644d 100644 --- a/Firestore/Source/Core/FSTFirestoreClient.m +++ b/Firestore/Source/Core/FSTFirestoreClient.m @@ -187,9 +187,9 @@ NS_ASSUME_NONNULL_BEGIN [self.syncEngine userDidChange:user]; } -- (void)watchStreamDidChangeOnlineState:(FSTOnlineState)onlineState { - [self.syncEngine applyOnlineStateChange:onlineState]; - [self.eventManager watchStreamDidChangeOnlineState:onlineState]; +- (void)applyChangedOnlineState:(FSTOnlineState)onlineState { + [self.syncEngine applyChangedOnlineState:onlineState]; + [self.eventManager applyChangedOnlineState:onlineState]; } - (void)disableNetworkWithCompletion:(nullable FSTVoidErrorBlock)completion { diff --git a/Firestore/Source/Core/FSTSyncEngine.h b/Firestore/Source/Core/FSTSyncEngine.h index 316ac05..7060155 100644 --- a/Firestore/Source/Core/FSTSyncEngine.h +++ b/Firestore/Source/Core/FSTSyncEngine.h @@ -101,7 +101,7 @@ NS_ASSUME_NONNULL_BEGIN - (void)userDidChange:(FSTUser *)user; /** Applies an FSTOnlineState change to the sync engine and notifies any views of the change. */ -- (void)applyOnlineStateChange:(FSTOnlineState)onlineState; +- (void)applyChangedOnlineState:(FSTOnlineState)onlineState; @end diff --git a/Firestore/Source/Core/FSTSyncEngine.m b/Firestore/Source/Core/FSTSyncEngine.m index aa1ccae..27ab73e 100644 --- a/Firestore/Source/Core/FSTSyncEngine.m +++ b/Firestore/Source/Core/FSTSyncEngine.m @@ -318,11 +318,11 @@ NS_ASSUME_NONNULL_BEGIN [self emitNewSnapshotsWithChanges:changes remoteEvent:remoteEvent]; } -- (void)applyOnlineStateChange:(FSTOnlineState)onlineState { +- (void)applyChangedOnlineState:(FSTOnlineState)onlineState { NSMutableArray<FSTViewSnapshot *> *newViewSnapshots = [NSMutableArray array]; [self.queryViewsByQuery enumerateKeysAndObjectsUsingBlock:^(FSTQuery *query, FSTQueryView *queryView, BOOL *stop) { - FSTViewChange *viewChange = [queryView.view applyOnlineStateChange:onlineState]; + FSTViewChange *viewChange = [queryView.view applyChangedOnlineState:onlineState]; FSTAssert(viewChange.limboChanges.count == 0, @"OnlineState should not affect limbo documents."); if (viewChange.snapshot) { diff --git a/Firestore/Source/Core/FSTView.h b/Firestore/Source/Core/FSTView.h index beadf46..6ff77cd 100644 --- a/Firestore/Source/Core/FSTView.h +++ b/Firestore/Source/Core/FSTView.h @@ -143,7 +143,7 @@ typedef NS_ENUM(NSInteger, FSTLimboDocumentChangeType) { * Applies an FSTOnlineState change to the view, potentially generating an FSTViewChange if the * view's syncState changes as a result. */ -- (FSTViewChange *)applyOnlineStateChange:(FSTOnlineState)onlineState; +- (FSTViewChange *)applyChangedOnlineState:(FSTOnlineState)onlineState; @end diff --git a/Firestore/Source/Core/FSTView.m b/Firestore/Source/Core/FSTView.m index df41f4c..78019c6 100644 --- a/Firestore/Source/Core/FSTView.m +++ b/Firestore/Source/Core/FSTView.m @@ -336,7 +336,7 @@ static NSComparisonResult FSTCompareDocumentViewChangeTypes(FSTDocumentViewChang } } -- (FSTViewChange *)applyOnlineStateChange:(FSTOnlineState)onlineState { +- (FSTViewChange *)applyChangedOnlineState:(FSTOnlineState)onlineState { if (self.isCurrent && onlineState == FSTOnlineStateFailed) { // If we're offline, set `current` to NO and then call applyChanges to refresh our syncState // and generate an FSTViewChange as appropriate. We are guaranteed to get a new FSTTargetChange diff --git a/Firestore/Source/Remote/FSTRemoteStore.h b/Firestore/Source/Remote/FSTRemoteStore.h index 313ddb7..18331ff 100644 --- a/Firestore/Source/Remote/FSTRemoteStore.h +++ b/Firestore/Source/Remote/FSTRemoteStore.h @@ -83,7 +83,7 @@ NS_ASSUME_NONNULL_BEGIN @protocol FSTOnlineStateDelegate <NSObject> /** Called whenever the online state of the watch stream changes */ -- (void)watchStreamDidChangeOnlineState:(FSTOnlineState)onlineState; +- (void)applyChangedOnlineState:(FSTOnlineState)onlineState; @end diff --git a/Firestore/Source/Remote/FSTRemoteStore.m b/Firestore/Source/Remote/FSTRemoteStore.m index 1fec5e5..02bf6f2 100644 --- a/Firestore/Source/Remote/FSTRemoteStore.m +++ b/Firestore/Source/Remote/FSTRemoteStore.m @@ -180,7 +180,7 @@ static const int kOnlineAttemptsBeforeFailure = 2; self.watchStreamFailures = 0; } self.watchStreamOnlineState = newState; - [self.onlineStateDelegate watchStreamDidChangeOnlineState:newState]; + [self.onlineStateDelegate applyChangedOnlineState:newState]; } } |