From 5263b233211572e7fd89958e920d51201020ba23 Mon Sep 17 00:00:00 2001 From: Nick Lockwood Date: Thu, 18 Jun 2015 09:41:38 -0700 Subject: [PATCH] Renamed RCTDataManager to RCTNetworking --- .../Initialization/loadSourceMap.js | 6 +++--- .../Network/RCTNetwork.xcodeproj/project.pbxproj | 12 ++++++------ .../Network/{RCTDataManager.h => RCTNetworking.h} | 2 +- .../Network/{RCTDataManager.m => RCTNetworking.m} | 8 ++++---- Libraries/Network/XMLHttpRequest.ios.js | 6 +++--- 5 files changed, 17 insertions(+), 17 deletions(-) rename Libraries/Network/{RCTDataManager.h => RCTNetworking.h} (87%) rename Libraries/Network/{RCTDataManager.m => RCTNetworking.m} (98%) diff --git a/Libraries/JavaScriptAppEngine/Initialization/loadSourceMap.js b/Libraries/JavaScriptAppEngine/Initialization/loadSourceMap.js index c3499ac9f..80b7fc5a3 100644 --- a/Libraries/JavaScriptAppEngine/Initialization/loadSourceMap.js +++ b/Libraries/JavaScriptAppEngine/Initialization/loadSourceMap.js @@ -18,7 +18,7 @@ var SourceMapConsumer = require('SourceMap').SourceMapConsumer; var SourceMapURL = require('./source-map-url'); var RCTSourceCode = NativeModules.SourceCode; -var RCTDataManager = NativeModules.DataManager; +var RCTNetworking = NativeModules.Networking; function loadSourceMap(): Promise { return fetchSourceMap() @@ -34,9 +34,9 @@ function fetchSourceMap(): Promise { return Promise.reject(new Error('RCTSourceCode module is not available')); } - if (!RCTDataManager) { + if (!RCTNetworking) { // Used internally by fetch - return Promise.reject(new Error('RCTDataManager module is not available')); + return Promise.reject(new Error('RCTNetworking module is not available')); } return new Promise(RCTSourceCode.getScriptText) diff --git a/Libraries/Network/RCTNetwork.xcodeproj/project.pbxproj b/Libraries/Network/RCTNetwork.xcodeproj/project.pbxproj index becf442fa..48b84fd03 100644 --- a/Libraries/Network/RCTNetwork.xcodeproj/project.pbxproj +++ b/Libraries/Network/RCTNetwork.xcodeproj/project.pbxproj @@ -9,7 +9,7 @@ /* Begin PBXBuildFile section */ 1372B7371AB03E7B00659ED6 /* RCTReachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 1372B7361AB03E7B00659ED6 /* RCTReachability.m */; }; 352DA0BA1B17855800AA15A8 /* RCTHTTPRequestHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 352DA0B81B17855800AA15A8 /* RCTHTTPRequestHandler.m */; }; - 58B512081A9E6CE300147676 /* RCTDataManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B512071A9E6CE300147676 /* RCTDataManager.m */; }; + 58B512081A9E6CE300147676 /* RCTNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 58B512071A9E6CE300147676 /* RCTNetworking.m */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -30,8 +30,8 @@ 352DA0B71B17855800AA15A8 /* RCTHTTPRequestHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTHTTPRequestHandler.h; sourceTree = ""; }; 352DA0B81B17855800AA15A8 /* RCTHTTPRequestHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTHTTPRequestHandler.m; sourceTree = ""; }; 58B511DB1A9E6C8500147676 /* libRCTNetwork.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTNetwork.a; sourceTree = BUILT_PRODUCTS_DIR; }; - 58B512061A9E6CE300147676 /* RCTDataManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTDataManager.h; sourceTree = ""; }; - 58B512071A9E6CE300147676 /* RCTDataManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTDataManager.m; sourceTree = ""; }; + 58B512061A9E6CE300147676 /* RCTNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RCTNetworking.h; sourceTree = ""; }; + 58B512071A9E6CE300147676 /* RCTNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTNetworking.m; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -48,8 +48,8 @@ 58B511D21A9E6C8500147676 = { isa = PBXGroup; children = ( - 58B512061A9E6CE300147676 /* RCTDataManager.h */, - 58B512071A9E6CE300147676 /* RCTDataManager.m */, + 58B512061A9E6CE300147676 /* RCTNetworking.h */, + 58B512071A9E6CE300147676 /* RCTNetworking.m */, 352DA0B71B17855800AA15A8 /* RCTHTTPRequestHandler.h */, 352DA0B81B17855800AA15A8 /* RCTHTTPRequestHandler.m */, 1372B7351AB03E7B00659ED6 /* RCTReachability.h */, @@ -125,7 +125,7 @@ buildActionMask = 2147483647; files = ( 1372B7371AB03E7B00659ED6 /* RCTReachability.m in Sources */, - 58B512081A9E6CE300147676 /* RCTDataManager.m in Sources */, + 58B512081A9E6CE300147676 /* RCTNetworking.m in Sources */, 352DA0BA1B17855800AA15A8 /* RCTHTTPRequestHandler.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/Libraries/Network/RCTDataManager.h b/Libraries/Network/RCTNetworking.h similarity index 87% rename from Libraries/Network/RCTDataManager.h rename to Libraries/Network/RCTNetworking.h index 424b65b9c..d8bc39524 100644 --- a/Libraries/Network/RCTDataManager.h +++ b/Libraries/Network/RCTNetworking.h @@ -11,7 +11,7 @@ #import "RCTBridgeModule.h" -@interface RCTDataManager : NSObject +@interface RCTNetworking : NSObject @end diff --git a/Libraries/Network/RCTDataManager.m b/Libraries/Network/RCTNetworking.m similarity index 98% rename from Libraries/Network/RCTDataManager.m rename to Libraries/Network/RCTNetworking.m index 49ce6d754..b5819cfc7 100644 --- a/Libraries/Network/RCTDataManager.m +++ b/Libraries/Network/RCTNetworking.m @@ -7,7 +7,7 @@ * of patent rights can be found in the PATENTS file in the same directory. */ -#import "RCTDataManager.h" +#import "RCTNetworking.h" #import "RCTAssert.h" #import "RCTConvert.h" @@ -19,7 +19,7 @@ typedef void (^RCTHTTPQueryResult)(NSError *error, NSDictionary *result); -@interface RCTDataManager () +@interface RCTNetworking () - (void)processDataForHTTPQuery:(NSDictionary *)data callback:(void (^)(NSError *error, NSDictionary *result))callback; @@ -30,7 +30,7 @@ typedef void (^RCTHTTPQueryResult)(NSError *error, NSDictionary *result); */ @interface RCTHTTPFormDataHelper : NSObject -@property (nonatomic, weak) RCTDataManager *dataManager; +@property (nonatomic, weak) RCTNetworking *dataManager; @end @@ -207,7 +207,7 @@ typedef void (^RCTDataLoaderCallback)(NSData *data, NSString *MIMEType, NSError /** * Bridge module that provides the JS interface to the network stack. */ -@implementation RCTDataManager +@implementation RCTNetworking { NSInteger _currentRequestID; NSMapTable *_activeRequests; diff --git a/Libraries/Network/XMLHttpRequest.ios.js b/Libraries/Network/XMLHttpRequest.ios.js index 151781c91..6eb586c26 100644 --- a/Libraries/Network/XMLHttpRequest.ios.js +++ b/Libraries/Network/XMLHttpRequest.ios.js @@ -12,7 +12,7 @@ 'use strict'; var FormData = require('FormData'); -var RCTDataManager = require('NativeModules').DataManager; +var RCTNetworking = require('NativeModules').Networking; var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); var XMLHttpRequestBase = require('XMLHttpRequestBase'); @@ -89,7 +89,7 @@ class XMLHttpRequest extends XMLHttpRequestBase { if (data instanceof FormData) { data = {formData: data.getParts()}; } - RCTDataManager.sendRequest( + RCTNetworking.sendRequest( { method, url, @@ -103,7 +103,7 @@ class XMLHttpRequest extends XMLHttpRequestBase { abortImpl(): void { if (this._requestId) { - RCTDataManager.cancelRequest(this._requestId); + RCTNetworking.cancelRequest(this._requestId); this._clearSubscriptions(); this._requestId = null; }