From f02bca7de92ea801f5699519bd4cae72addc11d6 Mon Sep 17 00:00:00 2001 From: Adam Ernst Date: Thu, 8 Dec 2016 07:28:16 -0800 Subject: [PATCH] Rename and merge files for RCTWebSocketObserver protocol Summary: No need to have two files; merge it into one and give it an appropriate name. Reviewed By: javache Differential Revision: D4296716 fbshipit-source-id: 904d13c23bb8d403b8efcb60f9a4aa5df5b08972 --- Libraries/WebSocket/RCTWebSocketObserver.h | 2 +- ...Proxy.h => RCTWebSocketObserverProtocol.h} | 7 +++-- React/Base/RCTWebSocketProxyDelegate.h | 18 ----------- React/Modules/RCTDevMenu.m | 4 +-- React/React.xcodeproj/project.pbxproj | 30 +++++++------------ 5 files changed, 17 insertions(+), 44 deletions(-) rename React/Base/{RCTWebSocketProxy.h => RCTWebSocketObserverProtocol.h} (71%) delete mode 100644 React/Base/RCTWebSocketProxyDelegate.h diff --git a/Libraries/WebSocket/RCTWebSocketObserver.h b/Libraries/WebSocket/RCTWebSocketObserver.h index 7a1248976..0e4362bcf 100644 --- a/Libraries/WebSocket/RCTWebSocketObserver.h +++ b/Libraries/WebSocket/RCTWebSocketObserver.h @@ -8,7 +8,7 @@ */ #import -#import +#import #if RCT_DEV // Only supported in dev mode diff --git a/React/Base/RCTWebSocketProxy.h b/React/Base/RCTWebSocketObserverProtocol.h similarity index 71% rename from React/Base/RCTWebSocketProxy.h rename to React/Base/RCTWebSocketObserverProtocol.h index 3eedea187..b1aae8bbd 100644 --- a/React/Base/RCTWebSocketProxy.h +++ b/React/Base/RCTWebSocketObserverProtocol.h @@ -8,15 +8,16 @@ */ #import -#import #if RCT_DEV // Only supported in dev mode -@protocol RCTWebSocketProxyDelegate; +@protocol RCTWebSocketObserverDelegate +- (void)didReceiveWebSocketMessage:(NSDictionary *)message; +@end @protocol RCTWebSocketObserver - (instancetype)initWithURL:(NSURL *)url; -@property (nonatomic, weak) id delegate; +@property (nonatomic, weak) id delegate; - (void)start; @end diff --git a/React/Base/RCTWebSocketProxyDelegate.h b/React/Base/RCTWebSocketProxyDelegate.h deleted file mode 100644 index 278ddc884..000000000 --- a/React/Base/RCTWebSocketProxyDelegate.h +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Copyright (c) 2015-present, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -#import - -#if RCT_DEV // Only supported in dev mode - -@protocol RCTWebSocketProxyDelegate -- (void)didReceiveWebSocketMessage:(NSDictionary *)message; -@end - -#endif diff --git a/React/Modules/RCTDevMenu.m b/React/Modules/RCTDevMenu.m index e8862ff19..cf2f9370d 100644 --- a/React/Modules/RCTDevMenu.m +++ b/React/Modules/RCTDevMenu.m @@ -20,7 +20,7 @@ #import "RCTProfile.h" #import "RCTRootView.h" #import "RCTUtils.h" -#import "RCTWebSocketProxy.h" +#import "RCTWebSocketObserverProtocol.h" #if RCT_DEV @@ -131,7 +131,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init) typedef void(^RCTDevMenuAlertActionHandler)(UIAlertAction *action); -@interface RCTDevMenu () +@interface RCTDevMenu () @property (nonatomic, strong) Class executorClass; diff --git a/React/React.xcodeproj/project.pbxproj b/React/React.xcodeproj/project.pbxproj index 8f8bbb17a..d27e07c5f 100644 --- a/React/React.xcodeproj/project.pbxproj +++ b/React/React.xcodeproj/project.pbxproj @@ -216,8 +216,7 @@ 3D302F4D1DF828F800D6DDAE /* RCTURLRequestDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1345A83A1B265A0E00583190 /* RCTURLRequestDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3D302F4E1DF828F800D6DDAE /* RCTURLRequestHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 1345A83B1B265A0E00583190 /* RCTURLRequestHandler.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3D302F4F1DF828F800D6DDAE /* RCTUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4F1A601E3B00E9B192 /* RCTUtils.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 3D302F501DF828F800D6DDAE /* RCTWebSocketProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DB910701C74B21600838BBE /* RCTWebSocketProxy.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 3D302F511DF828F800D6DDAE /* RCTWebSocketProxyDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DB910711C74B21600838BBE /* RCTWebSocketProxyDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 3D302F501DF828F800D6DDAE /* RCTWebSocketObserverProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DB910701C74B21600838BBE /* RCTWebSocketObserverProtocol.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3D302F521DF828F800D6DDAE /* RCTJSCErrorHandling.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DC724301D8BF99A00808C32 /* RCTJSCErrorHandling.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3D302F531DF828F800D6DDAE /* RCTJSCExecutor.h in Headers */ = {isa = PBXBuildFile; fileRef = 134FCB391A6E7F0800051CC8 /* RCTJSCExecutor.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3D302F541DF828F800D6DDAE /* JSCSamplingProfiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 369123DF1DDC75850095B341 /* JSCSamplingProfiler.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -333,8 +332,7 @@ 3D302FC91DF8290600D6DDAE /* RCTURLRequestDelegate.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 1345A83A1B265A0E00583190 /* RCTURLRequestDelegate.h */; }; 3D302FCA1DF8290600D6DDAE /* RCTURLRequestHandler.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 1345A83B1B265A0E00583190 /* RCTURLRequestHandler.h */; }; 3D302FCB1DF8290600D6DDAE /* RCTUtils.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4F1A601E3B00E9B192 /* RCTUtils.h */; }; - 3D302FCC1DF8290600D6DDAE /* RCTWebSocketProxy.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3DB910701C74B21600838BBE /* RCTWebSocketProxy.h */; }; - 3D302FCD1DF8290600D6DDAE /* RCTWebSocketProxyDelegate.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3DB910711C74B21600838BBE /* RCTWebSocketProxyDelegate.h */; }; + 3D302FCC1DF8290600D6DDAE /* RCTWebSocketObserverProtocol.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3DB910701C74B21600838BBE /* RCTWebSocketObserverProtocol.h */; }; 3D302FCE1DF8290600D6DDAE /* RCTJSCErrorHandling.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3DC724301D8BF99A00808C32 /* RCTJSCErrorHandling.h */; }; 3D302FCF1DF8290600D6DDAE /* RCTJSCExecutor.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 134FCB391A6E7F0800051CC8 /* RCTJSCExecutor.h */; }; 3D302FD01DF8290600D6DDAE /* JSCSamplingProfiler.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 369123DF1DDC75850095B341 /* JSCSamplingProfiler.h */; }; @@ -473,8 +471,7 @@ 3D80D9481DF6FA890028D040 /* RCTURLRequestDelegate.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 1345A83A1B265A0E00583190 /* RCTURLRequestDelegate.h */; }; 3D80D9491DF6FA890028D040 /* RCTURLRequestHandler.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 1345A83B1B265A0E00583190 /* RCTURLRequestHandler.h */; }; 3D80D94A1DF6FA890028D040 /* RCTUtils.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4F1A601E3B00E9B192 /* RCTUtils.h */; }; - 3D80D94B1DF6FA890028D040 /* RCTWebSocketProxy.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3DB910701C74B21600838BBE /* RCTWebSocketProxy.h */; }; - 3D80D94C1DF6FA890028D040 /* RCTWebSocketProxyDelegate.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3DB910711C74B21600838BBE /* RCTWebSocketProxyDelegate.h */; }; + 3D80D94B1DF6FA890028D040 /* RCTWebSocketObserverProtocol.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3DB910701C74B21600838BBE /* RCTWebSocketObserverProtocol.h */; }; 3D80D94D1DF6FA890028D040 /* RCTJSCErrorHandling.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 3DC724301D8BF99A00808C32 /* RCTJSCErrorHandling.h */; }; 3D80D94E1DF6FA890028D040 /* RCTJSCExecutor.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 134FCB391A6E7F0800051CC8 /* RCTJSCExecutor.h */; }; 3D80D94F1DF6FA890028D040 /* JSCSamplingProfiler.h in Copy Headers */ = {isa = PBXBuildFile; fileRef = 369123DF1DDC75850095B341 /* JSCSamplingProfiler.h */; }; @@ -597,8 +594,7 @@ 3D80DA421DF820620028D040 /* RCTURLRequestDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1345A83A1B265A0E00583190 /* RCTURLRequestDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3D80DA431DF820620028D040 /* RCTURLRequestHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 1345A83B1B265A0E00583190 /* RCTURLRequestHandler.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3D80DA441DF820620028D040 /* RCTUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = 83CBBA4F1A601E3B00E9B192 /* RCTUtils.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 3D80DA451DF820620028D040 /* RCTWebSocketProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DB910701C74B21600838BBE /* RCTWebSocketProxy.h */; settings = {ATTRIBUTES = (Private, ); }; }; - 3D80DA461DF820620028D040 /* RCTWebSocketProxyDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DB910711C74B21600838BBE /* RCTWebSocketProxyDelegate.h */; settings = {ATTRIBUTES = (Private, ); }; }; + 3D80DA451DF820620028D040 /* RCTWebSocketObserverProtocol.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DB910701C74B21600838BBE /* RCTWebSocketObserverProtocol.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3D80DA471DF820620028D040 /* RCTJSCErrorHandling.h in Headers */ = {isa = PBXBuildFile; fileRef = 3DC724301D8BF99A00808C32 /* RCTJSCErrorHandling.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3D80DA481DF820620028D040 /* RCTJSCExecutor.h in Headers */ = {isa = PBXBuildFile; fileRef = 134FCB391A6E7F0800051CC8 /* RCTJSCExecutor.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3D80DA491DF820620028D040 /* JSCSamplingProfiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 369123DF1DDC75850095B341 /* JSCSamplingProfiler.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -822,8 +818,7 @@ 3D302FC91DF8290600D6DDAE /* RCTURLRequestDelegate.h in Copy Headers */, 3D302FCA1DF8290600D6DDAE /* RCTURLRequestHandler.h in Copy Headers */, 3D302FCB1DF8290600D6DDAE /* RCTUtils.h in Copy Headers */, - 3D302FCC1DF8290600D6DDAE /* RCTWebSocketProxy.h in Copy Headers */, - 3D302FCD1DF8290600D6DDAE /* RCTWebSocketProxyDelegate.h in Copy Headers */, + 3D302FCC1DF8290600D6DDAE /* RCTWebSocketObserverProtocol.h in Copy Headers */, 3D302FCE1DF8290600D6DDAE /* RCTJSCErrorHandling.h in Copy Headers */, 3D302FCF1DF8290600D6DDAE /* RCTJSCExecutor.h in Copy Headers */, 3D302FD01DF8290600D6DDAE /* JSCSamplingProfiler.h in Copy Headers */, @@ -985,8 +980,7 @@ 3D80D9481DF6FA890028D040 /* RCTURLRequestDelegate.h in Copy Headers */, 3D80D9491DF6FA890028D040 /* RCTURLRequestHandler.h in Copy Headers */, 3D80D94A1DF6FA890028D040 /* RCTUtils.h in Copy Headers */, - 3D80D94B1DF6FA890028D040 /* RCTWebSocketProxy.h in Copy Headers */, - 3D80D94C1DF6FA890028D040 /* RCTWebSocketProxyDelegate.h in Copy Headers */, + 3D80D94B1DF6FA890028D040 /* RCTWebSocketObserverProtocol.h in Copy Headers */, 3D80D94D1DF6FA890028D040 /* RCTJSCErrorHandling.h in Copy Headers */, 3D80D94E1DF6FA890028D040 /* RCTJSCExecutor.h in Copy Headers */, 3D80D94F1DF6FA890028D040 /* JSCSamplingProfiler.h in Copy Headers */, @@ -1295,8 +1289,7 @@ 3D7A27DD1DE32541002E3F95 /* JSCWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCWrapper.cpp; sourceTree = ""; }; 3D7A27DE1DE32541002E3F95 /* JSCWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCWrapper.h; sourceTree = ""; }; 3D7A27E11DE325B7002E3F95 /* RCTJSCErrorHandling.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RCTJSCErrorHandling.mm; sourceTree = ""; }; - 3DB910701C74B21600838BBE /* RCTWebSocketProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWebSocketProxy.h; sourceTree = ""; }; - 3DB910711C74B21600838BBE /* RCTWebSocketProxyDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWebSocketProxyDelegate.h; sourceTree = ""; }; + 3DB910701C74B21600838BBE /* RCTWebSocketObserverProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTWebSocketObserverProtocol.h; sourceTree = ""; }; 3DC724301D8BF99A00808C32 /* RCTJSCErrorHandling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTJSCErrorHandling.h; sourceTree = ""; }; 3EDCA8A21D3591E700450C31 /* RCTErrorCustomizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTErrorCustomizer.h; sourceTree = ""; }; 3EDCA8A31D3591E700450C31 /* RCTErrorInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTErrorInfo.h; sourceTree = ""; }; @@ -1745,8 +1738,7 @@ 1345A83B1B265A0E00583190 /* RCTURLRequestHandler.h */, 83CBBA4F1A601E3B00E9B192 /* RCTUtils.h */, 83CBBA501A601E3B00E9B192 /* RCTUtils.m */, - 3DB910701C74B21600838BBE /* RCTWebSocketProxy.h */, - 3DB910711C74B21600838BBE /* RCTWebSocketProxyDelegate.h */, + 3DB910701C74B21600838BBE /* RCTWebSocketObserverProtocol.h */, ); path = Base; sourceTree = ""; @@ -1812,8 +1804,7 @@ 3D302F4D1DF828F800D6DDAE /* RCTURLRequestDelegate.h in Headers */, 3D302F4E1DF828F800D6DDAE /* RCTURLRequestHandler.h in Headers */, 3D302F4F1DF828F800D6DDAE /* RCTUtils.h in Headers */, - 3D302F501DF828F800D6DDAE /* RCTWebSocketProxy.h in Headers */, - 3D302F511DF828F800D6DDAE /* RCTWebSocketProxyDelegate.h in Headers */, + 3D302F501DF828F800D6DDAE /* RCTWebSocketObserverProtocol.h in Headers */, 3D302F521DF828F800D6DDAE /* RCTJSCErrorHandling.h in Headers */, 3D302F531DF828F800D6DDAE /* RCTJSCExecutor.h in Headers */, 3D302F541DF828F800D6DDAE /* JSCSamplingProfiler.h in Headers */, @@ -1996,8 +1987,7 @@ 3D80DA421DF820620028D040 /* RCTURLRequestDelegate.h in Headers */, 3D80DA431DF820620028D040 /* RCTURLRequestHandler.h in Headers */, 3D80DA441DF820620028D040 /* RCTUtils.h in Headers */, - 3D80DA451DF820620028D040 /* RCTWebSocketProxy.h in Headers */, - 3D80DA461DF820620028D040 /* RCTWebSocketProxyDelegate.h in Headers */, + 3D80DA451DF820620028D040 /* RCTWebSocketObserverProtocol.h in Headers */, 3D80DA471DF820620028D040 /* RCTJSCErrorHandling.h in Headers */, 3D80DA481DF820620028D040 /* RCTJSCExecutor.h in Headers */, 3D80DA491DF820620028D040 /* JSCSamplingProfiler.h in Headers */,