mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 20:01:01 +08:00
Added lightweight generic annotations
Summary: public Added lightweight genarics annotations to make the code more readable and help the compiler catch bugs. Fixed some type bugs and improved bridge validation in a few places. Reviewed By: javache Differential Revision: D2600189 fb-gh-sync-id: f81e22f2cdc107bf8d0b15deec6d5b83aacc5b56
This commit is contained in:
committed by
facebook-github-bot-7
parent
31565781f2
commit
c5b990f65f
@@ -60,11 +60,11 @@ extern NSString *const RCTSRHTTPResponseErrorKey;
|
||||
@property (nonatomic, readonly, copy) NSString *protocol;
|
||||
|
||||
// Protocols should be an array of strings that turn into Sec-WebSocket-Protocol.
|
||||
- (instancetype)initWithURLRequest:(NSURLRequest *)request protocols:(NSArray *)protocols NS_DESIGNATED_INITIALIZER;
|
||||
- (instancetype)initWithURLRequest:(NSURLRequest *)request protocols:(NSArray<NSString *> *)protocols NS_DESIGNATED_INITIALIZER;
|
||||
- (instancetype)initWithURLRequest:(NSURLRequest *)request;
|
||||
|
||||
// Some helper constructors.
|
||||
- (instancetype)initWithURL:(NSURL *)url protocols:(NSArray *)protocols;
|
||||
- (instancetype)initWithURL:(NSURL *)url protocols:(NSArray<NSString *> *)protocols;
|
||||
- (instancetype)initWithURL:(NSURL *)url;
|
||||
|
||||
// Delegate queue will be dispatch_main_queue by default.
|
||||
|
||||
@@ -186,7 +186,7 @@ typedef void (^data_callback)(RCTSRWebSocket *webSocket, NSData *data);
|
||||
dispatch_queue_t _delegateDispatchQueue;
|
||||
|
||||
dispatch_queue_t _workQueue;
|
||||
NSMutableArray *_consumers;
|
||||
NSMutableArray<RCTSRIOConsumer *> *_consumers;
|
||||
|
||||
NSInputStream *_inputStream;
|
||||
NSOutputStream *_outputStream;
|
||||
@@ -228,12 +228,12 @@ typedef void (^data_callback)(RCTSRWebSocket *webSocket, NSData *data);
|
||||
|
||||
BOOL _isPumping;
|
||||
|
||||
NSMutableSet *_scheduledRunloops;
|
||||
NSMutableSet<NSArray *> *_scheduledRunloops;
|
||||
|
||||
// We use this to retain ourselves.
|
||||
__strong RCTSRWebSocket *_selfRetain;
|
||||
|
||||
NSArray *_requestedProtocols;
|
||||
NSArray<NSString *> *_requestedProtocols;
|
||||
RCTSRIOConsumerPool *_consumerPool;
|
||||
}
|
||||
|
||||
@@ -244,7 +244,7 @@ static __strong NSData *CRLFCRLF;
|
||||
CRLFCRLF = [[NSData alloc] initWithBytes:"\r\n\r\n" length:4];
|
||||
}
|
||||
|
||||
- (instancetype)initWithURLRequest:(NSURLRequest *)request protocols:(NSArray *)protocols;
|
||||
- (instancetype)initWithURLRequest:(NSURLRequest *)request protocols:(NSArray<NSString *> *)protocols;
|
||||
{
|
||||
RCTAssertParam(request);
|
||||
|
||||
@@ -271,7 +271,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
|
||||
return [self initWithURL:URL protocols:nil];
|
||||
}
|
||||
|
||||
- (instancetype)initWithURL:(NSURL *)URL protocols:(NSArray *)protocols;
|
||||
- (instancetype)initWithURL:(NSURL *)URL protocols:(NSArray<NSString *> *)protocols;
|
||||
{
|
||||
NSURLRequest *request = URL ? [NSURLRequest requestWithURL:URL] : nil;
|
||||
return [self initWithURLRequest:request protocols:protocols];
|
||||
@@ -1456,7 +1456,7 @@ static const size_t RCTSRFrameHeaderOverhead = 32;
|
||||
@implementation RCTSRIOConsumerPool
|
||||
{
|
||||
NSUInteger _poolSize;
|
||||
NSMutableArray *_bufferedConsumers;
|
||||
NSMutableArray<RCTSRIOConsumer *> *_bufferedConsumers;
|
||||
}
|
||||
|
||||
- (instancetype)initWithBufferCapacity:(NSUInteger)poolSize;
|
||||
|
||||
Reference in New Issue
Block a user