aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/Source/Util
Commit message (Collapse)AuthorAge
* Replace Objective-C assertions with C++ assertions (#1327)Gravatar Gil2018-05-24
| | | | | | | | * 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
* Reimplement C++ logging (#1313)Gravatar Gil2018-05-23
| | | | | | | * Add direct support for formatting Objective-C objects * Rewrite log.h * Convert FSTWarn to LOG_WARN * Convert FSTLog to LOG_DEBUG * Remove FSTLogger
* Clean up implicit retain self warnings introduced recently (#1268)Gravatar Gil2018-05-13
|
* Firestore C++: make FSTDispatchQueue delegate to C++ implementation (#1240)Gravatar Konstantin Varlamov2018-05-11
| | | | | FSTDispatchQueue now doesn't contain any logic of its own and instead just passes through all method calls to AsyncQueue (backed by an ExecutorLibdispatch).
* Firestore: use C++ Executor for user queue. (#1238)Gravatar Konstantin Varlamov2018-05-10
| | | | | | | FSTDispatchQueue enforces serial execution, which is inappropriate for user queue, because a user may configure usage of a concurrent queue in settings, breaking FSTDispatchQueue invariants. Instead, use C++ ExecutorLibdispatch directly.
* iOS: fix data race in FSTDispatchQueue. (#1070)Gravatar Konstantin Varlamov2018-04-11
| | | | | | | | | | | operationInProgress is accessed from both the main thread and from libdispatch on some other thread. Make it atomic to avoid a data race. Also reorder assertion checks to only access operationInProgress after making sure the function is running on the queue. Tested: ran unit tests using old and new versions under Thread Sanitizer, verified that TSan reports a data race for the old version, but finds no issues with the new version.
* Add lint checking for Objective-C++ sources (#1048)Gravatar Gil2018-04-09
| | | | | | | | | | | | | | | | * lint.sh now lints Objective-C++ too * cpplint checks system-style includes that should be user-style This prevents it from recognizing project sources as if they were C system headers and then complaining that they're in the wrong place. * cpplint checks #imports and #includes * cpplint checks that C++ system headers aren't #imported * cpplint checks for C system headers that could be C++ system headers * cpplint checks that Objective-C sources include their headers
* Fix for b/74749605: Cancel pending backoff operations when closing streams. ↵Gravatar Michael Lehenbauer2018-03-21
| | | | | (#958) Port of https://github.com/firebase/firebase-js-sdk/pull/564.
* Temporarily disable currently-over-aggressive assert for duplicate ↵Gravatar Michael Lehenbauer2018-03-14
| | | | FSTDispatchQueue delayed callbacks. (#922)
* Defend against users making API calls during deinit (#863)Gravatar Gil2018-03-13
| | | | | | | | | | | | | | Track operation in progress FSTDispatchQueue ... and allow dispatchAsync onto the worker queue even from the same queue if an operation is not in progress. Fixes #753. This fixes a corner case that happens when users pass us an object and we retain that object in a block submitted to the worker queue for processing. Users are not obligated to retain that object themselves. This can lead to the object's destructor (or dealloc or deinit) being called on the Firestore worker thread. If that destructor makes Firestore API calls (most likely ListenerRegistration.remove but any are possible) this will trigger the assertion.
* Add 10 second timeout waiting for connection before client behaves as-if ↵Gravatar Michael Lehenbauer2018-03-05
| | | | | | | | | | | | | | | | | | | | offline. (#872) [Port of https://github.com/firebase/firebase-js-sdk/commit/0fa319e5e019dd0d40ab441d2ff9f8f6d4724e43] * Refactored FSTOnlineState tracking out of FSTRemoteStore and into new FSTOnlineStateTracker component. * Added a 10 second timeout to transition from OnlineState.Unknown to OnlineState.Offline rather than waiting indefinitely for the stream to succeed or fail. * Removed hack to run SpecTests using an FSTDispatchQueue that wrapped dispatch_get_main_queue(). This was incompatible with [FSTDispatchQueue runDelayedCallbacksUntil:] since it queues work and blocks waiting for it to complete. Now spec tests create / use a proper FSTDispatchQueue. * Added a SpecTest to verify OnlineState timeout behavior. * Misc cleanup: * Renamed FSTOnlineState states: Failed => Offline, Healthy => Online * Renamed FSTTimerIds (ListenStreamConnection => ListenStreamConnectionBackoff) * Added ability to run timers from spec tests.
* Fix implicit retain self warnings (#808)Gravatar rsgowman2018-02-21
| | | | | | Xcode has starting warning about us implicitly retaining self references within blocks. This commit fixes it by explicitly mentioning self. No real changes are introduced here; this is effectively just making implicit behaviour explicit.
* DispatchQueue delayed callback improvements + testing (#784)Gravatar Michael Lehenbauer2018-02-15
| | | | | | | | | | | Basically a port of https://github.com/firebase/firebase-js-sdk/commit/a1e346ff93c6cbcc0a1b3b33f0fbc3a7b66e7e12 and https://github.com/firebase/firebase-js-sdk/commit/fce4168309f42aa038125f39818fbf654b65b05f * Introduces a DelayedCallback helper class in FSTDispatchQueue to encapsulate delayed callback logic. * Adds cancellation support. * Updates the idle timer in FSTStream to use new cancellation support. * Adds a FSTTimerId enum for identifying delayed operations on the queue and uses it to identify our existing backoff and idle timers. * Added containsDelayedCallback: and runDelayedCallbacksUntil: methods to FSTDispatchQueue which can be used from tests to check for the presence of a callback or to schedule them to run early. * Removes FSTTestDispatchQueue and changes idle tests to use new test methods.
* Move all Firestore Objective-C to Objective-C++ (#734)Gravatar Gil2018-01-31
| | | | | | | | | | | | | | * Move all Firestore files to Objective-C++ * Update project file references * Don't use module imports from Objective-C++ * Use extern "C" for C-accessible globals * Work around more stringent type checking in Objective-C++ * NSMutableDictionary ivars aren't implicitly casted to NSDictionary * FSTMaybeDocument callback can't be passed a function that accepts FSTDocument * NSComparisonResult can't be multiplied by -1 without casting * Add a #include <inttypes.h> where needed * Avoid using C++ keywords as variables * Remove #if __cplusplus guards
* Port comparison to C++ (#678)Gravatar Gil2018-01-19
| | | | | | | | | | | | | | | This reimplements our comparison functions as C++ Comparators and then provides compatibility shims for interoperating with existing Objective-C usage. A few specialized comparators aren't suitable for porting but only have a single usage (e.g. CompareBytes for comparing NSData * instances). In these cases I've moved them into the caller. * Use int32_t for typeof(ID) in FSTDocumentReference * Migrate callers of FSTComparison.h to Objective-C++ * Port comparison to C++ * Migrate usages of FSTComparison.h to C++ equivalents * Remove FSTComparison
* Cleanup import path for FIRLogger (#523)Gravatar rsgowman2017-12-01
|
* Port autoid to C++ and remove FSTUtil (#475)Gravatar Gil2017-11-27
| | | | | | * Port autoid to C++ * Reimplement FSTUtil on top of firestore::CreateAutoId directly * Migrate FSTUtil callers to directly use firestore::CreateAutoId * Remove FSTUtil
* Change FSTExponentialBackoff to use firestore::SecureRandom directly (#492)Gravatar Gil2017-11-27
| | | | | * Migrate FSTExponentialBackoff to Objective-C++ * Change FSTExponentialBackoff to use firestore::SecureRandom directly
* Use fully qualified imports in Firestore (#467)Gravatar Gil2017-11-16
| | | | | | | | | This simplifies the import process back into google3 and allows us to add additional directories to the project without needing to update the project files for each directory we add. This shows up most clearly in the change to Firestore/Example/Firestore.xcodeproj/project.pbxproj: this no longer needs to list essentially every directory in the project as a header search path. * Clang-format configuration for C++ files * Add support C++-only sources to the podspec * Podspec support for fully qualified imports * xcodeproj changes for fully-qualified imports * Use fully-qualified imports in Firestore sources
* Closing the write and watch stream after 60s of idleness (#388)Gravatar Sebastian Schmidt2017-10-30
|
* Fix warnings exposed by Xcode 9.1 in Firestore source (#354)Gravatar Paul Beusterien2017-10-09
|
* Release 4.3.0 (#327)Gravatar Gil2017-10-03
Initial release of Firestore at 0.8.0 Bump FirebaseCommunity to 0.1.3