-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
iOS: Introduced RCTImageURLLoaderWithAttribution
Summary: Changelog: [iOS] [Changed] - New internal image attribution support, but files importing RCTImageLoader.h must be converted to ObjC++ This new interface is the same as RCTImageURLLoader, but with additional support to pass in optional attribution information. The attribution info is not strictly defined (we may do so in the future though), and it's up to the hosting application and RCTImageURLLoader classes to handle it. Reviewed By: sammy-SC Differential Revision: D18492882 fbshipit-source-id: c3870c60e6c2e7c65758fc3235ebf5db369e07dc
- Loading branch information
1 parent
806a2b8
commit fdcdca4
Showing
6 changed files
with
136 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
#import <React/RCTImageLoaderProtocol.h> | ||
#import <React/RCTImageURLLoaderWithAttribution.h> | ||
|
||
@protocol RCTImageLoaderWithAttributionProtocol<RCTImageLoaderProtocol> | ||
|
||
/** | ||
* Same as the variant in RCTImageURLLoaderProtocol, but allows passing attribution | ||
* information that each image URL loader can process. | ||
*/ | ||
- (RCTImageLoaderCancellationBlock)loadImageWithURLRequest:(NSURLRequest *)imageURLRequest | ||
size:(CGSize)size | ||
scale:(CGFloat)scale | ||
clipped:(BOOL)clipped | ||
resizeMode:(RCTResizeMode)resizeMode | ||
attribution:(const facebook::react::ImageURLLoaderAttribution &)attribution | ||
progressBlock:(RCTImageLoaderProgressBlock)progressBlock | ||
partialLoadBlock:(RCTImageLoaderPartialLoadBlock)partialLoadBlock | ||
completionBlock:(RCTImageLoaderCompletionBlock)completionBlock; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
#import <React/RCTImageURLLoader.h> | ||
|
||
namespace facebook { | ||
namespace react { | ||
|
||
struct ImageURLLoaderAttribution { | ||
int32_t surfaceId = 0; | ||
}; | ||
|
||
} // namespace react | ||
} // namespace facebook | ||
|
||
/** | ||
* Same as the RCTImageURLLoader interface, but allows passing in optional `attribution` information. | ||
* This is useful for per-app logging and other instrumentation. | ||
*/ | ||
@protocol RCTImageURLLoaderWithAttribution <RCTImageURLLoader> | ||
|
||
/** | ||
* Same as the RCTImageURLLoader variant above, but allows optional `attribution` information. | ||
*/ | ||
- (RCTImageLoaderCancellationBlock)loadImageForURL:(NSURL *)imageURL | ||
size:(CGSize)size | ||
scale:(CGFloat)scale | ||
resizeMode:(RCTResizeMode)resizeMode | ||
attribution:(const facebook::react::ImageURLLoaderAttribution &)attribution | ||
progressHandler:(RCTImageLoaderProgressBlock)progressHandler | ||
partialLoadHandler:(RCTImageLoaderPartialLoadBlock)partialLoadHandler | ||
completionHandler:(RCTImageLoaderCompletionBlock)completionHandler; | ||
|
||
@end |
File renamed without changes.
File renamed without changes.