aboutsummaryrefslogtreecommitdiffhomepage
path: root/Firestore/core/src/firebase/firestore/remote
Commit message (Collapse)AuthorAge
* Convert googletest and nanopb CMake builds to add_subdirectory (#1522)Gravatar Gil2018-07-13
| | | | | | | | | | | | | | | | | | | | | | | | | | * Add a download-only boringssl ExternalProject Match boringssl version to grpc submodule version Note: not yet in use * Split grpc into separate download and build tasks This allows other external targets to download into the gRPC source tree before grpc is actually built. * Convert grpc to an http download * Build googletest with add_subdirectory Also: * Revert library-name modifications in the abseil-cpp build * Move abseil-cpp add_subdirectory build into place * Build nanopb with add_subdirectory * Force nanopb first to work around ODR violations This is a temporary work-around for b/111328563.
* Firestore CMake cleanup (#1510)Gravatar Gil2018-07-11
| | | | | | | | | | | | | | | * Pull out sanitizer options into a separate file * Reorder packages * Remove the extra "external/$target" directory from PREFIX Instead of BINARY_DIR/external/foo/src/foo the contents will be in BINARY_DIR/src/foo. * Make libprotobuf-nanopb targets line up with nanopb's CMakeLists.txt * Fix CMake style
* C++ migration: add a C++ implementation of `FSTExponentialBackoff` (#1465)Gravatar Konstantin Varlamov2018-07-10
| | | | | | | | | | | This is a pretty close port of `FSTExponentialBackoff`. The changes are pretty minor: * delay is calculated using <chrono> duration types, not plain numbers, which should be a little more type-safe; * split a piece of code into a ClampDelay function, because it's reasonably close to std::clamp; * rephrased the class-level comment to make it clearer that the first attempt always has delay = 0; * added simple tests (other platforms don't have tests for this). Also make sure that canceling a DelayedOperation is always valid.
* Add support for NoDocument in the local serializer (#1484)Gravatar rsgowman2018-07-03
|
* Refactor nanopb decoding methods (#1438)Gravatar rsgowman2018-06-25
| | | Rather than decoding the type, and then the contents, decode them both at once.
* Refactored a few methods from anon namespace to remote serializer (#1435)Gravatar rsgowman2018-06-22
|
* Initial creation of the local serializer. (#1415)Gravatar rsgowman2018-06-21
| | | Added a single, basic test as a motivator.
* Skip unknown fields while decoding BatchGetDocumentsResponse proto objects ↵Gravatar rsgowman2018-06-05
| | | | (#1377)
* Skip unknown fields while decoding FieldValue proto objects. (#1354)Gravatar rsgowman2018-06-04
|
* Rename nanopb generated headers from foo.pb.h to foo.nanopb.h (#1371)Gravatar rsgowman2018-06-04
| | | | | This avoids a collision with the libprotobuf generated files. Also removes the "well-known" cpp protos, relying on libprotobuf to supply these instead.
* Allow repeated entries in Value proto. (#1346)Gravatar rsgowman2018-05-30
| | | | | | | Normally, this would be unexpected, as only a single entry in the Value proto *should* be present. However, the proto docs state that parsers should be able to handle repeated fields. (In the case of repeated fields, the last one "wins".)
* Handle deserializing BatchGetDocumentsResponse error case... (#1344)Gravatar rsgowman2018-05-29
| | | | ... where neither 'found' nor 'missing' fields set.
* "Handle" BatchGetDocumentsResponse.transaction (by ignoring it) (#1318)Gravatar rsgowman2018-05-28
|
* Deserialize NoDocument instances (#1311)Gravatar rsgowman2018-05-23
| | | | | | Note that it isn't possible to *serialize* NoDocuments. Still TODO: - Error handling
* Add a HARD_ASSERT C++ assertion macro (#1304)Gravatar Gil2018-05-22
| | | | | | * Add HARD_ASSERT * Use HARD_ASSERT * Remove FIREBASE_ASSERT * Remove StringPrintf
* [De]serialize non-empty Document instances (#1284)Gravatar rsgowman2018-05-22
| | | | | | | * [De]serialize non-empty Document instances Still TODO: - NoDocument - ErrorHandling
* fix build for Firestore copybara import (#1308)Gravatar zxu2018-05-22
| | | | | | * fix "target of using declaration conflicts with declaration already in scope" * fix "call to implicitly-deleted copy constructor of *unique_ptr*"
* Refactoring serializer.cc (#1281)Gravatar rsgowman2018-05-16
| | | | Mostly to make existing methods a bit more general to support followup PR (which will allow encoding/decoding documents with contents.)
* [De]serialize empty Document instances (#1262)Gravatar rsgowman2018-05-15
| | | | | | | | | * [De]serialize empty Document instances Still TODO: - non-empty - NoDocument - ErrorHandling
* Trivial/noop fix to the serializer (#1264)Gravatar rsgowman2018-05-14
| | | | | | | | | | | Was using google_firestore_v1beta1_MapValue_FieldsEntry_key_tag to tag the key/value pair. (But that tag should be used for the *key* of the key/value pair, not the pair itself.) Switched to using google_firestore_v1beta1_MapValue_fields_tag. This previously worked anyways by coincidence. These two values happen to be the same. (But it caused me all sorts of confusion as I adapted this for Document contents.)
* Refactor serializer (#1250)Gravatar rsgowman2018-05-11
| | | | | Moved Tag, Reader, Writer from serializer.cc's anon namespace to firebase::firestore::nanopb This should be bug-for-bug compatible. No changes were made to the moved methods.
* [De]serialize Timestamps via the remote Serializer (#1233)Gravatar rsgowman2018-05-09
|
* [De]serialize DocumentKeys via the remote Serializer (#1212)Gravatar rsgowman2018-05-04
|
* Add error handler for serializer (for deserializing cases) (#1181)Gravatar rsgowman2018-05-01
| | | | | This is more interesting than the serializing case, as we should expect to see occasional corruption of our input byte vector.
* Adjust serializer test to verify via libprotobuf. (#1039)Gravatar rsgowman2018-04-24
| | | | | | Previously, the tests would compare serialization results against a precomputed (via protoc) array of bytes. Now they serialize via our nanopb based class and deserialize via libprotobuf (and vice versa) and then ensure the result is the same as the input
* Add clang-tidy checks for Firestore (#1078)Gravatar Gil2018-04-12
| | | | | | | | | | | | | | | | | | | | * Add a .clang-tidy configuration for Firestore C++ * Fix clang-tidy warnings * typedef -> using * const ref + rvalue ref -> pass by value * NULL -> nullptr * remove useless default initializations * remove useless const value-type parameter declarations (definitions can still use them) * use auto instead of repeating types in a cast * Fix typos * Address use of static method through instance warnings * Address use after move warnings
* Refactor deserialization methods (#1038)Gravatar rsgowman2018-04-11
|
* FIREBASE_DEV_ASSERT -> FIREBASE_ASSERT within serializer.cc (#1062)Gravatar rsgowman2018-04-10
|
* 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
* Add error handling for serializer (for serializing case only) (#991)Gravatar rsgowman2018-04-05
| | | | | | | | Deserializing not handled yet. Note that the serializing case is fairly uninteresting, as assuming valid input is passed in, there's no real reason why it should fail (and if it does fail, it indicates a gross violation of our understanding of the system.)
* Add ObjectValue::Map alias (#967)Gravatar rsgowman2018-03-27
|
* Renames in serializer to reflect recent changes (#957)Gravatar rsgowman2018-03-23
| | | | | | | * Rename Writer::Encode* methods to Writer::Write* * Rename: s/stream/writer/ (approximately) but only where it applies to Writer (rather than pb_ostream_t).
* Move creation of pb_ostream_t's into Writer (#920)Gravatar rsgowman2018-03-15
| | | | | | | | | | * Move creation of pb_ostream_t's into Writer Writer now owns these structs * Writer::FromBuffer -> Writer::Wrap * add todo for possible future simplification.
* Partial wrapping of pb_ostream_t (pt5) (#916)Gravatar rsgowman2018-03-14
| | | | Wraps encoding of FieldValue's. At this point, raw pb_ostream_t structs aren't used outside of Writer, except during creation of a Writer.
* Partial wrapping of pb_ostream_t (pt4) (#915)Gravatar rsgowman2018-03-13
| | | | Wraps encoding of FieldValue "Objects" (i.e. map<string, FieldValue>'s) and their entries (i.e. pair<string, FieldValue>'s)
* Partial wrapping of pb_ostream_t (pt3) (#907)Gravatar rsgowman2018-03-13
| | | Wraps encoding nested messages.
* Allow serializing arbitrary length FieldValues (#889)Gravatar rsgowman2018-03-12
| | | Uses a custom pb_ostream_t. Previously used a stack allocated 1k buffer.
* Partial wrapping of pb_ostream_t (pt2) (#903)Gravatar rsgowman2018-03-12
| | | Wraps the string encode method.
* Partial wrapping of pb_ostream_t (pt1) (#899)Gravatar rsgowman2018-03-09
| | | Wraps the varint based encode methods.
* [De]Serialize FieldValue map_values ("Objects") (#878)Gravatar rsgowman2018-03-08
| | | These can (recursively) contain other FieldValues.
* Serialize (and deserialize) string values (#864)Gravatar rsgowman2018-02-28
|
* Add FieldValue.boolean_value() (#862)Gravatar rsgowman2018-02-27
|
* Eliminate TypedValue and serialize direct from FieldValue to bytes. (#860)Gravatar rsgowman2018-02-27
| | | | | | | | This will likely only apply for proto messages that use 'oneof's. (Because we need to serialize these manually.) The problem was that as we were adding additional types, TypeValue was evolving into a parallel implementation of the FieldValue union. When serializing/deserializing oneofs we need to supply a custom value to serialize and a custom function to do the work. There's no value in translating from FieldValue to TypeValue just to store as this custom object. We might as well just store the FieldValue model directly and write the custom serializer/deserializer to use the model directly.
* Refactor [En|De]codeVarint to be symetric wrt tags (#837)Gravatar rsgowman2018-02-22
| | | | | | | | Since we can't decode a value before knowing it's type, I've pulled the tag handling out of these methods. More context over here: https://github.com/firebase/firebase-ios-sdk/pull/829
* Serialize (and deserialize) int64 values (#818) (#829)Gravatar rsgowman2018-02-22
|
* [En|De]codeUnsignedVarint -> [En|De]codeVarint (#817)Gravatar rsgowman2018-02-20
| | | | | | | | | | | | * [En|De]codeUnsignedVarint -> [En|De]codeVarint The 'unsigned' portion was misleading, as these varints work with both signed and unsigned integers. (The 'signed' varints also work with both signed and unsigned integers, but use zig-zag encoding so that negative numbers are encoded more efficiently. Note that 'signed' varints aren't used in the Value proto, so won't appear in the serializer class for at least the short term.) Added some docstrings to help disambiguate this.
* Serialize (and deserialize) bool values (#791)Gravatar rsgowman2018-02-16
|
* Serialize and deserialize null (#783)Gravatar rsgowman2018-02-13
| | | | | | | | | | | | | | | | | | | | | | | | | | * Build (grpc's) nanopb with -DPB_FIELD_16BIT We require (at least) 16 bit fields. (By default, nanopb uses 8 bit fields, ie allowing up to 256 field tags.) Also note that this patch adds this to grpc's nanopb, rather than to our nanopb. We'll need to eventually either: a) we instruct grpc to use our nanopb b) we rely on grpc's nanopb instead of using our own. (^ marked as a TODO for now.) * Add some dependant protos Imported from protobuf. Nanopb requires these to be present (though anything using libprotobuf does not, as these are already built into that.) * Add generated nanopb protos based off of newly added proto definitions * Build the nanopb protos * Serialize and deserialize null
* ./style.shGravatar Rich Gowman2018-02-06
|
* Hook up nanopb to firestorep projectGravatar Rich Gowman2018-02-06
| | | | | Use remote/serializer placeholder class as a hook for the test to ensure nanopb headers can be found, and test can be linked.