| Commit message (Collapse) | Author | Age |
|
|
|
|
|
| |
* Add HARD_ASSERT
* Use HARD_ASSERT
* Remove FIREBASE_ASSERT
* Remove StringPrintf
|
|
|
|
|
|
|
| |
* [De]serialize non-empty Document instances
Still TODO:
- NoDocument
- ErrorHandling
|
|
|
|
|
|
| |
* fix "target of using declaration conflicts with declaration already in scope"
* fix "call to implicitly-deleted copy constructor of *unique_ptr*"
|
|
|
|
| |
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
Still TODO:
- non-empty
- NoDocument
- ErrorHandling
|
|
|
|
|
|
|
|
|
|
|
| |
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.)
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
| |
This is more interesting than the serializing case, as we should expect
to see occasional corruption of our input byte vector.
|
|
|
|
|
|
| |
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 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
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
| |
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.)
|
| |
|
|
|
|
|
|
|
| |
* 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
Writer now owns these structs
* Writer::FromBuffer -> Writer::Wrap
* add todo for possible future simplification.
|
|
|
|
| |
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.
|
|
|
|
| |
Wraps encoding of FieldValue "Objects" (i.e. map<string, FieldValue>'s)
and their entries (i.e. pair<string, FieldValue>'s)
|
|
|
| |
Wraps encoding nested messages.
|
|
|
| |
Uses a custom pb_ostream_t. Previously used a stack allocated 1k buffer.
|
|
|
| |
Wraps the string encode method.
|
|
|
| |
Wraps the varint based encode methods.
|
|
|
| |
These can (recursively) contain other FieldValues.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* [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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
| |
|
|
|
|
|
| |
Use remote/serializer placeholder class as a hook for the test to ensure
nanopb headers can be found, and test can be linked.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Rewrite cc_test to take named arguments
Cut down on build file verbosity by having cc_test take SOURCES and
DEPENDS. The separate invocation of target_link_libraries is no longer
necessary.
* Add a cc_library rule to parallel cc_test
This cuts down on build file verbosity.
* Automatically add OBJC_FLAGS to cc_libraries if applicable
* Exclude platform-specific libraries from 'all'
This is makes it possible to declare this kind of library
unconditionally. Usage within a test or as a dependency will actually
trigger building.
* Restore secure_random_test.cc; clean-up comments
|
|
* Clean up quoting and other minor issues
* Reorganize CMake build output
Make it clearer which parts of the output pertain to external projects.
* Use a consistent ordering of ExternalProject arguments
* Prevent the top-level build from running in parallel
This prevents spurious failures when running make -j.
* Actually parse arguments in the xcodebuild function
* Use ExternalProject features when available
* submodule limits from CMake 3.0
* shallow clones from CMake 3.6
* git progress output from CMake 3.8
* Only build the parts of leveldb we need
Skip building the tools and other libraries
* Avoid installing ExternalProjects
Consume build output directly so that we can build just the targets we
need. Installing causes all targets to be built.
This doesn't matter as much for these targets but the gRPC build
includes a ton of stuff we don't need so it's worth adopting this as a
general strategy.
* Define an external build for grpc
* Test that grpc can link successfully.
* Add a FindGRPC CMake module
* Actually comment ExternalProjext_GitSource
|