Skip to content

Commit 3664b8a

Browse files
rafi-kamalcopybara-github
authored andcommitted
Project import generated by Copybara
PiperOrigin-RevId: 300708221
1 parent 3d34125 commit 3664b8a

12 files changed

Lines changed: 1049 additions & 1087 deletions

File tree

experimental/benchmarks/code_size/kernel/all_types.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ goog.module('protobuf.benchmark.KernelCodeSizeBenchmarkAllTypes');
66

77
const ByteString = goog.require('protobuf.ByteString');
88
const Int64 = goog.require('protobuf.Int64');
9-
const LazyAccessor = goog.require('protobuf.runtime.Kernel');
9+
const Kernel = goog.require('protobuf.runtime.Kernel');
1010
const TestMessage = goog.require('protobuf.testing.binary.TestMessage');
1111
const {ensureCommonBaseLine} = goog.require('protobuf.benchmark.codeSize.codeSizeBase');
1212

@@ -17,7 +17,7 @@ ensureCommonBaseLine();
1717
* @return {string}
1818
*/
1919
function accessAllTypes() {
20-
const message = new TestMessage(LazyAccessor.createEmpty());
20+
const message = new TestMessage(Kernel.createEmpty());
2121

2222
message.addPackedBoolElement(1, true);
2323
message.addPackedBoolIterable(1, [true]);

experimental/benchmarks/code_size/kernel/popular_types.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
goog.module('protobuf.benchmark.KernelCodeSizeBenchmarkPopularTypes');
2121

2222
const Int64 = goog.require('protobuf.Int64');
23-
const LazyAccessor = goog.require('protobuf.runtime.Kernel');
23+
const Kernel = goog.require('protobuf.runtime.Kernel');
2424
const TestMessage = goog.require('protobuf.testing.binary.TestMessage');
2525
const {ensureCommonBaseLine} = goog.require('protobuf.benchmark.codeSize.codeSizeBase');
2626

@@ -31,7 +31,7 @@ ensureCommonBaseLine();
3131
* @return {string}
3232
*/
3333
function accessAllTypes() {
34-
const message = new TestMessage(LazyAccessor.createEmpty());
34+
const message = new TestMessage(Kernel.createEmpty());
3535

3636
message.addRepeatedMessageElement(1, message, TestMessage.instanceCreator);
3737
message.addRepeatedMessageIterable(1, [message], TestMessage.instanceCreator);

experimental/runtime/kernel/conformance/conformance_request.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*/
44
goog.module('proto.conformance.ConformanceRequest');
55

6-
const LazyAccessor = goog.require('protobuf.runtime.Kernel');
6+
const Kernel = goog.require('protobuf.runtime.Kernel');
77
const WireFormat = goog.require('proto.conformance.WireFormat');
88

99
/**
@@ -19,8 +19,8 @@ class ConformanceRequest {
1919
* @private
2020
*/
2121
constructor(bytes) {
22-
/** @private @const {!LazyAccessor} */
23-
this.accessor_ = LazyAccessor.fromArrayBuffer(bytes);
22+
/** @private @const {!Kernel} */
23+
this.accessor_ = Kernel.fromArrayBuffer(bytes);
2424
}
2525

2626
/**

experimental/runtime/kernel/conformance/conformance_response.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
goog.module('proto.conformance.ConformanceResponse');
55

66
const ByteString = goog.require('protobuf.ByteString');
7-
const LazyAccessor = goog.require('protobuf.runtime.Kernel');
7+
const Kernel = goog.require('protobuf.runtime.Kernel');
88

99
/**
1010
* Handwritten code of conformance.ConformanceResponse.
@@ -19,8 +19,8 @@ class ConformanceResponse {
1919
* @private
2020
*/
2121
constructor(bytes) {
22-
/** @private @const {!LazyAccessor} */
23-
this.accessor_ = LazyAccessor.fromArrayBuffer(bytes);
22+
/** @private @const {!Kernel} */
23+
this.accessor_ = Kernel.fromArrayBuffer(bytes);
2424
}
2525

2626
/**

experimental/runtime/kernel/conformance/test_all_types_proto2.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
goog.module('proto.conformance.TestAllTypesProto2');
55

66
const InternalMessage = goog.require('protobuf.binary.InternalMessage');
7-
const LazyAccessor = goog.require('protobuf.runtime.Kernel');
7+
const Kernel = goog.require('protobuf.runtime.Kernel');
88

99
/**
1010
* Handwritten code of conformance.TestAllTypesProto2.
@@ -14,18 +14,18 @@ const LazyAccessor = goog.require('protobuf.runtime.Kernel');
1414
*/
1515
class TestAllTypesProto2 {
1616
/**
17-
* @param {!LazyAccessor=} accessor
17+
* @param {!Kernel=} accessor
1818
* @private
1919
*/
20-
constructor(accessor = LazyAccessor.createEmpty()) {
21-
/** @private @const {!LazyAccessor} */
20+
constructor(accessor = Kernel.createEmpty()) {
21+
/** @private @const {!Kernel} */
2222
this.accessor_ = accessor;
2323
}
2424

2525
/**
2626
* @override
2727
* @package
28-
* @return {!LazyAccessor}
28+
* @return {!Kernel}
2929
*/
3030
internalGetKernel() {
3131
return this.accessor_;
@@ -34,7 +34,7 @@ class TestAllTypesProto2 {
3434
/**
3535
* Create a request instance with the given bytes data.
3636
* If we directly use the accessor created by the binary decoding, the
37-
* LazyAccessor instance will only copy the same data over for encoding. By
37+
* Kernel instance will only copy the same data over for encoding. By
3838
* explicitly fetching data from the previous accessor and setting all fields
3939
* into a new accessor, we will actually test encoding/decoding for the binary
4040
* format.
@@ -43,7 +43,7 @@ class TestAllTypesProto2 {
4343
*/
4444
static deserialize(bytes) {
4545
const msg = new TestAllTypesProto2();
46-
const requestAccessor = LazyAccessor.fromArrayBuffer(bytes);
46+
const requestAccessor = Kernel.fromArrayBuffer(bytes);
4747

4848
if (requestAccessor.hasFieldNumber(1)) {
4949
const value = requestAccessor.getInt32WithDefault(1);

experimental/runtime/kernel/conformance/test_all_types_proto3.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
goog.module('proto.conformance.TestAllTypesProto3');
55

66
const InternalMessage = goog.require('protobuf.binary.InternalMessage');
7-
const LazyAccessor = goog.require('protobuf.runtime.Kernel');
7+
const Kernel = goog.require('protobuf.runtime.Kernel');
88

99
/**
1010
* Handwritten code of conformance.TestAllTypesProto3.
@@ -14,18 +14,18 @@ const LazyAccessor = goog.require('protobuf.runtime.Kernel');
1414
*/
1515
class TestAllTypesProto3 {
1616
/**
17-
* @param {!LazyAccessor=} accessor
17+
* @param {!Kernel=} accessor
1818
* @private
1919
*/
20-
constructor(accessor = LazyAccessor.createEmpty()) {
21-
/** @private @const {!LazyAccessor} */
20+
constructor(accessor = Kernel.createEmpty()) {
21+
/** @private @const {!Kernel} */
2222
this.accessor_ = accessor;
2323
}
2424

2525
/**
2626
* @override
2727
* @package
28-
* @return {!LazyAccessor}
28+
* @return {!Kernel}
2929
*/
3030
internalGetKernel() {
3131
return this.accessor_;
@@ -34,7 +34,7 @@ class TestAllTypesProto3 {
3434
/**
3535
* Create a request instance with the given bytes data.
3636
* If we directly use the accessor created by the binary decoding, the
37-
* LazyAccessor instance will only copy the same data over for encoding. By
37+
* Kernel instance will only copy the same data over for encoding. By
3838
* explicitly fetching data from the previous accessor and setting all fields
3939
* into a new accessor, we will actually test encoding/decoding for the binary
4040
* format.
@@ -43,7 +43,7 @@ class TestAllTypesProto3 {
4343
*/
4444
static deserialize(bytes) {
4545
const msg = new TestAllTypesProto3();
46-
const requestAccessor = LazyAccessor.fromArrayBuffer(bytes);
46+
const requestAccessor = Kernel.fromArrayBuffer(bytes);
4747

4848
if (requestAccessor.hasFieldNumber(1)) {
4949
const value = requestAccessor.getInt32WithDefault(1);

experimental/runtime/kernel/internal_message.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*/
55
goog.module('protobuf.binary.InternalMessage');
66

7-
const LazyAccessor = goog.requireType('protobuf.runtime.Kernel');
7+
const Kernel = goog.requireType('protobuf.runtime.Kernel');
88

99
/**
1010
* Interface that needs to be implemented by messages implemented with the
@@ -16,7 +16,7 @@ const LazyAccessor = goog.requireType('protobuf.runtime.Kernel');
1616
class InternalMessage {
1717
/**
1818
* @package
19-
* @return {!LazyAccessor}
19+
* @return {!Kernel}
2020
*/
2121
internalGetKernel() {}
2222
}

0 commit comments

Comments
 (0)