Files
react-native/packages/react-native/Libraries/Network/RCTNetworkPlugins.mm
T
Kevin Gozali 6d317cf1f8 Sort iOS plugin maps
Summary:
A simple sorting of the plugins list in each map. This is to sync with Meta internal tools update.

Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D47581872

fbshipit-source-id: 522f845eaee63c2812315eb4b8c25237d114ccd4
2023-07-19 01:10:23 -07:00

37 lines
1018 B
Plaintext

/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @generated by an internal plugin build system
*/
#ifndef RN_DISABLE_OSS_PLUGIN_HEADER
// OSS-compatibility layer
#import "RCTNetworkPlugins.h"
#import <string>
#import <unordered_map>
Class RCTNetworkClassProvider(const char *name) {
// Intentionally leak to avoid crashing after static destructors are run.
static const auto sCoreModuleClassMap = new const std::unordered_map<std::string, Class (*)(void)>{
{"DataRequestHandler", RCTDataRequestHandlerCls},
{"FileRequestHandler", RCTFileRequestHandlerCls},
{"HTTPRequestHandler", RCTHTTPRequestHandlerCls},
{"Networking", RCTNetworkingCls},
};
auto p = sCoreModuleClassMap->find(name);
if (p != sCoreModuleClassMap->end()) {
auto classFunc = p->second;
return classFunc();
}
return nil;
}
#endif // RN_DISABLE_OSS_PLUGIN_HEADER