Provide a protocol for GPBExtensionRegistry's lookup support.
This allows some to use an alternative registry if they have a different
implementation.
This is really just wiring though the change to use the GPBExtensionRegistry
protocol vs the concrete GPBExtensionRegistry through the other apis.
diff --git a/objectivec/GPBMessage.h b/objectivec/GPBMessage.h
index 01253a4..990a796 100644
--- a/objectivec/GPBMessage.h
+++ b/objectivec/GPBMessage.h
@@ -36,7 +36,7 @@
@class GPBCodedInputStream;
@class GPBCodedOutputStream;
@class GPBExtensionDescriptor;
-@class GPBExtensionRegistry;
+@protocol GPBExtensionRegistry;
@class GPBFieldDescriptor;
@class GPBUnknownFieldSet;
@@ -147,7 +147,7 @@
* @return A new instance of the generated class.
**/
+ (nullable instancetype)parseFromData:(NSData *)data
- extensionRegistry:(nullable GPBExtensionRegistry *)extensionRegistry
+ extensionRegistry:(nullable id<GPBExtensionRegistry>)extensionRegistry
error:(NSError **)errorPtr;
/**
@@ -171,7 +171,7 @@
**/
+ (nullable instancetype)parseFromCodedInputStream:(GPBCodedInputStream *)input
extensionRegistry:
- (nullable GPBExtensionRegistry *)extensionRegistry
+ (nullable id<GPBExtensionRegistry>)extensionRegistry
error:(NSError **)errorPtr;
/**
@@ -196,7 +196,7 @@
**/
+ (nullable instancetype)parseDelimitedFromCodedInputStream:(GPBCodedInputStream *)input
extensionRegistry:
- (nullable GPBExtensionRegistry *)extensionRegistry
+ (nullable id<GPBExtensionRegistry>)extensionRegistry
error:(NSError **)errorPtr;
/**
@@ -239,7 +239,7 @@
* @return An initialized instance of the generated class.
**/
- (nullable instancetype)initWithData:(NSData *)data
- extensionRegistry:(nullable GPBExtensionRegistry *)extensionRegistry
+ extensionRegistry:(nullable id<GPBExtensionRegistry>)extensionRegistry
error:(NSError **)errorPtr;
/**
@@ -264,7 +264,7 @@
**/
- (nullable instancetype)initWithCodedInputStream:(GPBCodedInputStream *)input
extensionRegistry:
- (nullable GPBExtensionRegistry *)extensionRegistry
+ (nullable id<GPBExtensionRegistry>)extensionRegistry
error:(NSError **)errorPtr;
/**
@@ -278,7 +278,7 @@
* unsuccessful.
**/
- (void)mergeFromData:(NSData *)data
- extensionRegistry:(nullable GPBExtensionRegistry *)extensionRegistry;
+ extensionRegistry:(nullable id<GPBExtensionRegistry>)extensionRegistry;
/**
* Merges the fields from another message (of the same type) into this