mirror of
https://github.com/status-im/react-native-webview.git
synced 2025-02-23 17:28:37 +00:00
* fix(WKWebview): [iOS] Add shared process pool so cookies and localStorage are shared across webviews (#68) * Add optional shared process pool BREAKING CHANGE: useSharedProcessPool prop is set to true by default. If you want the old behavior, please use useSharedProcessPool={false}
37 lines
801 B
Objective-C
37 lines
801 B
Objective-C
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#import <Foundation/Foundation.h>
|
|
#import "RNCWKProcessPoolManager.h"
|
|
|
|
@interface RNCWKProcessPoolManager() {
|
|
WKProcessPool *_sharedProcessPool;
|
|
}
|
|
@end
|
|
|
|
@implementation RNCWKProcessPoolManager
|
|
|
|
+ (id) sharedManager {
|
|
static RNCWKProcessPoolManager *_sharedManager = nil;
|
|
@synchronized(self) {
|
|
if(_sharedManager == nil) {
|
|
_sharedManager = [[super alloc] init];
|
|
}
|
|
return _sharedManager;
|
|
}
|
|
}
|
|
|
|
- (WKProcessPool *)sharedProcessPool {
|
|
if (!_sharedProcessPool) {
|
|
_sharedProcessPool = [[WKProcessPool alloc] init];
|
|
}
|
|
return _sharedProcessPool;
|
|
}
|
|
|
|
@end
|
|
|