1 |
efrain |
1 |
// Copyright 2020 Google LLC
|
|
|
2 |
//
|
|
|
3 |
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
4 |
// you may not use this file except in compliance with the License.
|
|
|
5 |
// You may obtain a copy of the License at
|
|
|
6 |
//
|
|
|
7 |
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
8 |
//
|
|
|
9 |
// Unless required by applicable law or agreed to in writing, software
|
|
|
10 |
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
11 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
12 |
// See the License for the specific language governing permissions and
|
|
|
13 |
// limitations under the License.
|
|
|
14 |
|
|
|
15 |
#import <Foundation/Foundation.h>
|
|
|
16 |
|
|
|
17 |
/** This class helps the instrumentation deal with objects that have been wrapped with NSProxy
|
|
|
18 |
* objects after being swizzled by other SDKs. In particular, Crittercism swizzles NSURLSessions
|
|
|
19 |
* and makes every NSURLSession initialization method return an NSProxy subclass.
|
|
|
20 |
*/
|
|
|
21 |
@interface FPRProxyObjectHelper : NSObject
|
|
|
22 |
|
|
|
23 |
/** Registers a proxy object for a given class and runs the onSuccess block whenever an ivar of the
|
|
|
24 |
* given class is discovered on the proxy object.
|
|
|
25 |
*
|
|
|
26 |
* @param proxy The proxy object whose ivars will be iterated.
|
|
|
27 |
* @param superclass The superclass all ivars will be compared against. See varFoundHandler.
|
|
|
28 |
* @param varFoundHandler The block to run when an ivar isKindOfClass:aClass.
|
|
|
29 |
*/
|
|
|
30 |
+ (void)registerProxyObject:(id)proxy
|
|
|
31 |
forSuperclass:(Class)superclass
|
|
|
32 |
varFoundHandler:(void (^)(id ivar))varFoundHandler;
|
|
|
33 |
|
|
|
34 |
@end
|