aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Source/Remote/FSTOnlineStateTracker.mm
diff options
context:
space:
mode:
authorGravatar Gil <mcg@google.com>2018-05-24 11:00:23 -0700
committerGravatar GitHub <noreply@github.com>2018-05-24 11:00:23 -0700
commit8037a4bf79b8ae49162c2b6f099d62ec17a7f283 (patch)
tree5a15df8664abbcf3e63479fa3e7560fd8c2fbe9e /Firestore/Source/Remote/FSTOnlineStateTracker.mm
parentde4fe203525072babcdec444a06e42e77f0aa714 (diff)
Replace Objective-C assertions with C++ assertions (#1327)
* Migrate FSTFail to HARD_FAIL * FSTCFail -> HARD_FAIL * FSTCAssert -> HARD_ASSERT * FSTAssert -> HARD_ASSERT * Replace FSTAssert with NSAssert in dead Objective-C code * Remove FSTAssert.h
Diffstat (limited to 'Firestore/Source/Remote/FSTOnlineStateTracker.mm')
-rw-r--r--Firestore/Source/Remote/FSTOnlineStateTracker.mm12
1 files changed, 6 insertions, 6 deletions
diff --git a/Firestore/Source/Remote/FSTOnlineStateTracker.mm b/Firestore/Source/Remote/FSTOnlineStateTracker.mm
index e512a3c..fb993e5 100644
--- a/Firestore/Source/Remote/FSTOnlineStateTracker.mm
+++ b/Firestore/Source/Remote/FSTOnlineStateTracker.mm
@@ -16,9 +16,9 @@
#import "Firestore/Source/Remote/FSTOnlineStateTracker.h"
#import "Firestore/Source/Remote/FSTRemoteStore.h"
-#import "Firestore/Source/Util/FSTAssert.h"
#import "Firestore/Source/Util/FSTDispatchQueue.h"
+#include "Firestore/core/src/firebase/firestore/util/hard_assert.h"
#include "Firestore/core/src/firebase/firestore/util/log.h"
NS_ASSUME_NONNULL_BEGIN
@@ -75,15 +75,15 @@ static const NSTimeInterval kOnlineStateTimeout = 10;
if (self.watchStreamFailures == 0) {
[self setAndBroadcastState:FSTOnlineStateUnknown];
- FSTAssert(!self.onlineStateTimer, @"onlineStateTimer shouldn't be started yet");
+ HARD_ASSERT(!self.onlineStateTimer, "onlineStateTimer shouldn't be started yet");
self.onlineStateTimer = [self.queue
dispatchAfterDelay:kOnlineStateTimeout
timerID:FSTTimerIDOnlineStateTimeout
block:^{
self.onlineStateTimer = nil;
- FSTAssert(
+ HARD_ASSERT(
self.state == FSTOnlineStateUnknown,
- @"Timer should be canceled if we transitioned to a different state.");
+ "Timer should be canceled if we transitioned to a different state.");
LOG_DEBUG(
"Watch stream didn't reach Online or Offline within %s seconds. "
"Considering client offline.",
@@ -104,8 +104,8 @@ static const NSTimeInterval kOnlineStateTimeout = 10;
// To get to FSTOnlineStateOnline, updateState: must have been called which would have reset
// our heuristics.
- FSTAssert(self.watchStreamFailures == 0, @"watchStreamFailures must be 0");
- FSTAssert(!self.onlineStateTimer, @"onlineStateTimer must be nil");
+ HARD_ASSERT(self.watchStreamFailures == 0, "watchStreamFailures must be 0");
+ HARD_ASSERT(!self.onlineStateTimer, "onlineStateTimer must be nil");
} else {
self.watchStreamFailures++;
if (self.watchStreamFailures >= kMaxWatchStreamFailures) {