MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / FindFactory

Method FindFactory

Sources/Shared/IO/WebRequest.cpp:1460–1481  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1458 }
1459
1460 WebSessionFactory* WebSessionBase::FindFactory()
1461 {
1462 if (_factory == nullptr) {
1463#if defined(DEATH_TARGET_WINDOWS)
1464 std::unique_ptr<WebSessionFactory> factory = std::make_unique<WebSessionFactoryWinHTTP>();
1465 if (!factory->Initialize()) {
1466 return nullptr;
1467 }
1468 _factory = Death::move(factory);
1469#elif defined(DEATH_TARGET_ANDROID) || defined(DEATH_TARGET_APPLE) || defined(DEATH_TARGET_SWITCH) || defined(DEATH_TARGET_VITA) || defined(DEATH_TARGET_UNIX)
1470 std::unique_ptr<WebSessionFactory> factory = std::make_unique<WebSessionFactoryCURL>();
1471 if (!factory->Initialize()) {
1472 return nullptr;
1473 }
1474 _factory = Death::move(factory);
1475#else
1476# pragma message("Unsupported platform for Death::IO::WebRequest")
1477#endif
1478 }
1479
1480 return _factory.get();
1481 }
1482
1483 WebSession WebSession::New()
1484 {

Callers

nothing calls this directly

Calls 2

InitializeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected