Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Unified Diff: third_party/protobuf/src/google/protobuf/reflection.h

Issue 2495533002: third_party/protobuf: Update to HEAD (83d681ee2c) (Closed)
Patch Set: Make chrome settings proto generated file a component Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/protobuf/src/google/protobuf/reflection.h
diff --git a/third_party/protobuf/src/google/protobuf/reflection.h b/third_party/protobuf/src/google/protobuf/reflection.h
index 671aafdc4e276e6e30752fda3c6dded6e6f0bbfd..d5a6653cb9f82cf5ea18c0b92699e5e4710b56b5 100755
--- a/third_party/protobuf/src/google/protobuf/reflection.h
+++ b/third_party/protobuf/src/google/protobuf/reflection.h
@@ -80,6 +80,12 @@ class RepeatedFieldRef<
typedef IteratorType iterator;
typedef IteratorType const_iterator;
+ typedef T value_type;
+ typedef T& reference;
+ typedef const T& const_reference;
+ typedef int size_type;
+ typedef ptrdiff_t difference_type;
+
iterator begin() const {
return iterator(data_, accessor_, true);
}
@@ -202,11 +208,18 @@ class RepeatedFieldRef<
typedef IteratorType iterator;
typedef IteratorType const_iterator;
+ typedef T value_type;
+ typedef T& reference;
+ typedef const T& const_reference;
+ typedef int size_type;
+ typedef ptrdiff_t difference_type;
+
iterator begin() const {
return iterator(data_, accessor_, true, NewMessage());
}
iterator end() const {
- return iterator(data_, accessor_, false, NewMessage());
+ // The end iterator must not be dereferenced, no need for scratch space.
+ return iterator(data_, accessor_, false, NULL);
}
private:
@@ -356,7 +369,7 @@ class LIBPROTOBUF_EXPORT RepeatedFieldAccessor {
virtual void Swap(Field* data, const RepeatedFieldAccessor* other_mutator,
Field* other_data) const = 0;
- // Create an iterator that points at the begining of the repeated field.
+ // Create an iterator that points at the beginning of the repeated field.
virtual Iterator* BeginIterator(const Field* data) const = 0;
// Create an iterator that points at the end of the repeated field.
virtual Iterator* EndIterator(const Field* data) const = 0;
@@ -428,13 +441,13 @@ class RepeatedFieldRefIterator
public:
// Constructor for non-message fields.
RepeatedFieldRefIterator(const void* data,
- const RepeatedFieldAccessor* accessor,
- bool begin)
- : data_(data), accessor_(accessor),
- iterator_(begin ? accessor->BeginIterator(data) :
- accessor->EndIterator(data)),
- scratch_space_(new AccessorValueType) {
- }
+ const RepeatedFieldAccessor* accessor, bool begin)
+ : data_(data),
+ accessor_(accessor),
+ iterator_(begin ? accessor->BeginIterator(data)
+ : accessor->EndIterator(data)),
+ // The end iterator must not be dereferenced, no need for scratch space.
+ scratch_space_(begin ? new AccessorValueType : NULL) {}
// Constructor for message fields.
RepeatedFieldRefIterator(const void* data,
const RepeatedFieldAccessor* accessor,
« no previous file with comments | « third_party/protobuf/src/google/protobuf/metadata.h ('k') | third_party/protobuf/src/google/protobuf/reflection_ops.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698