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

Unified Diff: third_party/protobuf/js/binary/reader.js

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
« no previous file with comments | « third_party/protobuf/js/binary/proto_test.js ('k') | third_party/protobuf/js/binary/reader_test.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/protobuf/js/binary/reader.js
diff --git a/third_party/protobuf/js/binary/reader.js b/third_party/protobuf/js/binary/reader.js
index 15f90432d89ee440279b25ba97a56f1bdf5aa1bd..8c5a4e88dbb9f860ae1361f5ce15942c14bd2e4d 100644
--- a/third_party/protobuf/js/binary/reader.js
+++ b/third_party/protobuf/js/binary/reader.js
@@ -744,6 +744,20 @@ jspb.BinaryReader.prototype.readSint64 = function() {
/**
+ * Reads a signed zigzag-encoded 64-bit integer field from the binary stream,
+ * or throws an error if the next field in the stream is not of the correct
+ * wire type.
+ *
+ * @return {string} The value of the signed 64-bit integer field as a decimal string.
+ */
+jspb.BinaryReader.prototype.readSint64String = function() {
+ goog.asserts.assert(
+ this.nextWireType_ == jspb.BinaryConstants.WireType.VARINT);
+ return this.decoder_.readZigzagVarint64String();
+};
+
+
+/**
* Reads an unsigned 32-bit fixed-length integer fiield from the binary stream,
* or throws an error if the next field in the stream is not of the correct
* wire type.
@@ -772,11 +786,28 @@ jspb.BinaryReader.prototype.readFixed64 = function() {
/**
+ * Reads a signed 64-bit integer field from the binary stream as a string, or
+ * throws an error if the next field in the stream is not of the correct wire
+ * type.
+ *
+ * Returns the value as a string.
+ *
+ * @return {string} The value of the unsigned 64-bit integer field as a decimal
+ * string.
+ */
+jspb.BinaryReader.prototype.readFixed64String = function() {
+ goog.asserts.assert(
+ this.nextWireType_ == jspb.BinaryConstants.WireType.FIXED64);
+ return this.decoder_.readUint64String();
+};
+
+
+/**
* Reads a signed 32-bit fixed-length integer fiield from the binary stream, or
* throws an error if the next field in the stream is not of the correct wire
* type.
*
- * @return {number} The value of the double field.
+ * @return {number} The value of the signed 32-bit integer field.
*/
jspb.BinaryReader.prototype.readSfixed32 = function() {
goog.asserts.assert(
@@ -786,11 +817,26 @@ jspb.BinaryReader.prototype.readSfixed32 = function() {
/**
+ * Reads a signed 32-bit fixed-length integer fiield from the binary stream, or
+ * throws an error if the next field in the stream is not of the correct wire
+ * type.
+ *
+ * @return {string} The value of the signed 32-bit integer field as a decimal
+ * string.
+ */
+jspb.BinaryReader.prototype.readSfixed32String = function() {
+ goog.asserts.assert(
+ this.nextWireType_ == jspb.BinaryConstants.WireType.FIXED32);
+ return this.decoder_.readInt32().toString();
+};
+
+
+/**
* Reads a signed 64-bit fixed-length integer fiield from the binary stream, or
* throws an error if the next field in the stream is not of the correct wire
* type.
*
- * @return {number} The value of the float field.
+ * @return {number} The value of the sfixed64 field.
*/
jspb.BinaryReader.prototype.readSfixed64 = function() {
goog.asserts.assert(
@@ -800,6 +846,22 @@ jspb.BinaryReader.prototype.readSfixed64 = function() {
/**
+ * Reads a signed 64-bit fixed-length integer fiield from the binary stream, or
+ * throws an error if the next field in the stream is not of the correct wire
+ * type.
+ *
+ * Returns the value as a string.
+ *
+ * @return {string} The value of the sfixed64 field as a decimal string.
+ */
+jspb.BinaryReader.prototype.readSfixed64String = function() {
+ goog.asserts.assert(
+ this.nextWireType_ == jspb.BinaryConstants.WireType.FIXED64);
+ return this.decoder_.readInt64String();
+};
+
+
+/**
* Reads a 32-bit floating-point field from the binary stream, or throws an
* error if the next field in the stream is not of the correct wire type.
*
@@ -1028,6 +1090,16 @@ jspb.BinaryReader.prototype.readPackedSint64 = function() {
/**
+ * Reads a packed sint64 field, which consists of a length header and a list of
+ * zigzag varints. Returns a list of strings.
+ * @return {!Array.<string>}
+ */
+jspb.BinaryReader.prototype.readPackedSint64String = function() {
+ return this.readPackedField_(this.decoder_.readZigzagVarint64String);
+};
+
+
+/**
* Reads a packed fixed32 field, which consists of a length header and a list
* of unsigned 32-bit ints.
* @return {!Array.<number>}
@@ -1048,6 +1120,16 @@ jspb.BinaryReader.prototype.readPackedFixed64 = function() {
/**
+ * Reads a packed fixed64 field, which consists of a length header and a list
+ * of unsigned 64-bit ints. Returns a list of strings.
+ * @return {!Array.<number>}
+ */
+jspb.BinaryReader.prototype.readPackedFixed64String = function() {
+ return this.readPackedField_(this.decoder_.readUint64String);
+};
+
+
+/**
* Reads a packed sfixed32 field, which consists of a length header and a list
* of 32-bit ints.
* @return {!Array.<number>}
@@ -1068,6 +1150,16 @@ jspb.BinaryReader.prototype.readPackedSfixed64 = function() {
/**
+ * Reads a packed sfixed64 field, which consists of a length header and a list
+ * of 64-bit ints. Returns a list of strings.
+ * @return {!Array.<string>}
+ */
+jspb.BinaryReader.prototype.readPackedSfixed64String = function() {
+ return this.readPackedField_(this.decoder_.readInt64String);
+};
+
+
+/**
* Reads a packed float field, which consists of a length header and a list of
* floats.
* @return {!Array.<number>}
« no previous file with comments | « third_party/protobuf/js/binary/proto_test.js ('k') | third_party/protobuf/js/binary/reader_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698