gcs::ObjectWriteStream can be "closed" without an explicit Close() call. At this time this class does not use any of the mechanisms [*] that trigger such behavior. Nevertheless, we defensively prepare for them by checking either condition. [*]: These mechanisms include: - resumable uploads that are "resumed" after the upload completed are born "closed", - uploads that prescribe their total size u
| 216 | // - uploads that prescribe their total size using the `x-upload-content-length` header |
| 217 | // are completed and "closed" as soon as the upload reaches that size. |
| 218 | bool closed() const override { return closed_ || !stream_.IsOpen(); } |
| 219 | |
| 220 | Status Write(const void* data, int64_t nbytes) override { |
| 221 | if (closed()) return Status::Invalid("Cannot write to a closed stream"); |
nothing calls this directly
no outgoing calls
no test coverage detected