mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Code style only. Reviewed By: sahrens Differential Revision: D15681737 fbshipit-source-id: 24cc2e9b9434448026e7cb3cfd274ea14bd835a2
39 lines
1003 B
Plaintext
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
|