Commit Graph
9 Commits
Author SHA1 Message Date
Gil cd460eca2d Rationalize input validation exceptions and assertion failures (#4107)
* Rationalize input validation exceptions and assertions

... under a single ThrowHandler concept. This makes it possible to set
an alternative ThrowHandler in our C# bindings that properly translates
input validation exceptions to the correct .NET exception types.

* Rename api/input_validation.h to util/exception.h

* Reimplement util/hard_assert.h in terms of util/exception.h
2019-10-18 12:58:45 -07:00
Gil 9a3ba6e66d Make disabling GC prevent even scheduling it (#2862)
* Make disabling GC prevent even scheduling it

Make the linkage of kFIRFirestoreCacheSizeUnlimited explicitly
extern "C". This previously had no fixed linkage in the header and must
have accidentally worked because the implementation had C++ linkage.

Move internal CacheSizeUnlimited to api::Settings and the
definition of kFIRFirestoreCacheSizeUnlimited into the Objective-C
language binding.

Migrate settings defaults to C++ settings

Ensure that all defaults are compiler initialized to ensure there are no
initialization order problems.
2019-04-18 18:17:34 -07:00
Michael Lehenbauer 6dca5e601c Port FirestoreSettings to C++. (#2804)
* Creates a C++ api::Settings class as a container for the settings we pass
  into the core client.
* Adds [FIRFirestoreSettings internalSettings] to convert from public API
  settings to api::Settings.

Input validation, etc. still happens in FIRFirestoreSettings.
2019-04-14 12:28:22 -07:00
Gil 2e8b9181fa Port FSTUsageValidation to C++ (#2670)
* Port FSTUsageValidation to C++

* Add an error log level
2019-03-28 13:19:28 -07:00
rsgowman ca38562d3f Fix build for non-clang compilers (#2391) 2019-03-01 13:51:59 -05:00
Michael Lehenbauer 5c67653de3 Change timestampsInSnapshots default to true and deprecate the setting. (#2251) 2019-01-11 13:47:13 -08:00
Greg Soltis 305f87215e Wire together LRU GC (#1905)
* Wire together LRU GC
* Default enabled, threshold set to `100 MB`.
2018-11-26 14:33:28 -08:00
Konstantin Varlamov a17740e914 Add a flag to control whether DocumentSnapshots return Dates or Timestamps for timestamp fields (#831)
* add a new property `timestampsInSnapshotsEnabled` to `FirestoreSettings`, `false` by default;
* add a verbose warning message urging users to opt into the new behavior;
* set `timestampsInSnapshotsEnabled` to true in the integration tests to reduce the verbose console
spam during the test run and make sure the flag won't break anything once it's flipped.
2018-03-30 14:50:15 -04:00
Gil 729b8d176c Move all Firestore Objective-C to Objective-C++ (#734)
* 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
2018-01-31 11:23:55 -08:00