aboutsummaryrefslogtreecommitdiff
path: root/patch_reader.h
diff options
context:
space:
mode:
authorAnton Bikineev <bikineev@chromium.org>2021-05-15 22:35:36 +0000
committerCopybara-Service <copybara-worker@google.com>2021-07-25 21:14:18 -0700
commit1a96551a279242efef41468357e38d3091e884bc (patch)
tree04fb6730d8927a839d99d24492555b877077317d /patch_reader.h
parent147f86be24a5ceb5447a9376fdc8c65044bb2977 (diff)
downloadzucchini-1a96551a279242efef41468357e38d3091e884bc.tar.gz
components: Replace base::Optional and friends with absl counterparts
This replaces: - base::Optional -> absl::optional - include "base/optional.h" -> include "third_party/abseil-cpp/absl/types/optional.h" - base::nullopt -> absl::nullopt - base::make_optional -> absl::make_optional Bug: 1202909 Change-Id: If697b7bf69b199c1796f873eedca3359cdb48c64 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2897151 Commit-Queue: Anton Bikineev <bikineev@chromium.org> Owners-Override: Anton Bikineev <bikineev@chromium.org> Reviewed-by: Peter Kasting <pkasting@chromium.org> Cr-Commit-Position: refs/heads/master@{#883296} NOKEYCHECK=True GitOrigin-RevId: 1156b5f891de178171e71b9221a96bef1ced3d3b
Diffstat (limited to 'patch_reader.h')
-rw-r--r--patch_reader.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/patch_reader.h b/patch_reader.h
index 515da50..93d64b0 100644
--- a/patch_reader.h
+++ b/patch_reader.h
@@ -14,11 +14,11 @@
#include "base/debug/stack_trace.h"
#include "base/logging.h"
#include "base/numerics/checked_math.h"
-#include "base/optional.h"
#include "components/zucchini/buffer_source.h"
#include "components/zucchini/buffer_view.h"
#include "components/zucchini/image_utils.h"
#include "components/zucchini/patch_utils.h"
+#include "third_party/abseil-cpp/absl/types/optional.h"
namespace zucchini {
@@ -77,8 +77,8 @@ bool ParseVarInt(BufferSource* source, T* value) {
// - bool Initialize(BufferSource* source): Consumes data from BufferSource and
// initializes internal states. Returns true if successful, and false
// otherwise (|source| may be partially consumed).
-// - base::Optional<MAIN_TYPE> GetNext(OPT_PARAMS): Decodes consumed data and
-// returns the next item as base::Optional (returns base::nullopt on failure).
+// - absl::optional<MAIN_TYPE> GetNext(OPT_PARAMS): Decodes consumed data and
+// returns the next item as absl::optional (returns absl::nullopt on failure).
// - bool Done() const: Returns true if no more items remain; otherwise false.
//
// Usage of *Source instances don't mix, and GetNext() have dissimilar
@@ -94,7 +94,7 @@ class EquivalenceSource {
// Core functions.
bool Initialize(BufferSource* source);
- base::Optional<Equivalence> GetNext();
+ absl::optional<Equivalence> GetNext();
bool Done() const {
return src_skip_.empty() && dst_skip_.empty() && copy_count_.empty();
}
@@ -123,7 +123,7 @@ class ExtraDataSource {
// Core functions.
bool Initialize(BufferSource* source);
// |size| is the size in bytes of the buffer requested.
- base::Optional<ConstBufferView> GetNext(offset_t size);
+ absl::optional<ConstBufferView> GetNext(offset_t size);
bool Done() const { return extra_data_.empty(); }
// Accessors for unittest.
@@ -142,7 +142,7 @@ class RawDeltaSource {
// Core functions.
bool Initialize(BufferSource* source);
- base::Optional<RawDeltaUnit> GetNext();
+ absl::optional<RawDeltaUnit> GetNext();
bool Done() const {
return raw_delta_skip_.empty() && raw_delta_diff_.empty();
}
@@ -167,7 +167,7 @@ class ReferenceDeltaSource {
// Core functions.
bool Initialize(BufferSource* source);
- base::Optional<int32_t> GetNext();
+ absl::optional<int32_t> GetNext();
bool Done() const { return source_.empty(); }
// Accessors for unittest.
@@ -186,7 +186,7 @@ class TargetSource {
// Core functions.
bool Initialize(BufferSource* source);
- base::Optional<offset_t> GetNext();
+ absl::optional<offset_t> GetNext();
bool Done() const { return extra_targets_.empty(); }
// Accessors for unittest.
@@ -256,8 +256,8 @@ class PatchElementReader {
class EnsemblePatchReader {
public:
// If data read from |buffer| is well-formed, initializes and returns
- // an instance of EnsemblePatchReader. Otherwise returns base::nullopt.
- static base::Optional<EnsemblePatchReader> Create(ConstBufferView buffer);
+ // an instance of EnsemblePatchReader. Otherwise returns absl::nullopt.
+ static absl::optional<EnsemblePatchReader> Create(ConstBufferView buffer);
EnsemblePatchReader();
EnsemblePatchReader(EnsemblePatchReader&&);