mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
bfbd841f38
Summary: Changelog: [internal] `moved_`, introduced in D8526571 (https://github.com/facebook/react-native/commit/979ea2094e74ae8da0288fd5038f1f2838bd7763), no longer servers its purpose. Let's remove it. Reviewed By: JoshuaGross Differential Revision: D24475715 fbshipit-source-id: 162d1fc4ed3d4a67885d8f140904dd80763dcaa0
57 lines
1.4 KiB
C++
57 lines
1.4 KiB
C++
/*
|
|
* 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 "ImageRequest.h"
|
|
|
|
namespace facebook {
|
|
namespace react {
|
|
|
|
ImageRequest::ImageRequest(
|
|
const ImageSource &imageSource,
|
|
std::shared_ptr<const ImageTelemetry> telemetry)
|
|
: imageSource_(imageSource), telemetry_(telemetry) {
|
|
coordinator_ = std::make_shared<ImageResponseObserverCoordinator>();
|
|
}
|
|
|
|
ImageRequest::ImageRequest(ImageRequest &&other) noexcept
|
|
: imageSource_(std::move(other.imageSource_)),
|
|
telemetry_(std::move(other.telemetry_)),
|
|
coordinator_(std::move(other.coordinator_)) {
|
|
other.coordinator_ = nullptr;
|
|
other.cancelRequest_ = nullptr;
|
|
other.telemetry_ = nullptr;
|
|
}
|
|
|
|
ImageRequest::~ImageRequest() {
|
|
if (cancelRequest_) {
|
|
cancelRequest_();
|
|
}
|
|
}
|
|
|
|
void ImageRequest::setCancelationFunction(
|
|
std::function<void(void)> cancelationFunction) {
|
|
cancelRequest_ = cancelationFunction;
|
|
}
|
|
|
|
const std::shared_ptr<const ImageTelemetry> &ImageRequest::getSharedTelemetry()
|
|
const {
|
|
return telemetry_;
|
|
}
|
|
|
|
const ImageResponseObserverCoordinator &ImageRequest::getObserverCoordinator()
|
|
const {
|
|
return *coordinator_;
|
|
}
|
|
|
|
const std::shared_ptr<const ImageResponseObserverCoordinator>
|
|
&ImageRequest::getSharedObserverCoordinator() const {
|
|
return coordinator_;
|
|
}
|
|
|
|
} // namespace react
|
|
} // namespace facebook
|