Files
react-native/ReactCommon/fabric/imagemanager/platform/ios/ImageManager.mm
T
Valentin Shergin 12c09a2d6c Fabric: Bunch of code style changes
Summary: Code style only.

Reviewed By: sahrens

Differential Revision: D15681737

fbshipit-source-id: 24cc2e9b9434448026e7cb3cfd274ea14bd835a2
2019-06-07 12:03:58 -07:00

39 lines
1003 B
Plaintext

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "ImageManager.h"
#import <React/RCTImageLoader.h>
#import <react/utils/ManagedObjectWrapper.h>
#import "RCTImageManager.h"
namespace facebook {
namespace react {
ImageManager::ImageManager(ContextContainer::Shared const &contextContainer)
{
RCTImageLoader *imageLoader =
(RCTImageLoader *)unwrapManagedObject(contextContainer->at<std::shared_ptr<void>>("RCTImageLoader"));
self_ = (__bridge_retained void *)[[RCTImageManager alloc] initWithImageLoader:imageLoader];
}
ImageManager::~ImageManager()
{
CFRelease(self_);
self_ = nullptr;
}
ImageRequest ImageManager::requestImage(const ImageSource &imageSource) const
{
RCTImageManager *imageManager = (__bridge RCTImageManager *)self_;
return [imageManager requestImage:imageSource];
}
} // namespace react
} // namespace facebook