Skip to content

Commit

Permalink
fix(ios): add some new cordova-ios classes used by Cordova plugins (#…
Browse files Browse the repository at this point in the history
…7115)

Co-authored-by: Ryan Bosher <ryan@bosher.co.nz>
  • Loading branch information
jcesarmobile and bosh-code authored Dec 8, 2023
1 parent 7977a6d commit 5fb902b
Show file tree
Hide file tree
Showing 5 changed files with 86 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
objects = {

/* Begin PBXBuildFile section */
0B61A7E52B114AA00035F2DB /* CDVWebViewProcessPoolFactory.m in Sources */ = {isa = PBXBuildFile; fileRef = 0B61A7E32B114A9F0035F2DB /* CDVWebViewProcessPoolFactory.m */; };
0B61A7E62B114AA00035F2DB /* CDVWebViewProcessPoolFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 0B61A7E42B114AA00035F2DB /* CDVWebViewProcessPoolFactory.h */; settings = {ATTRIBUTES = (Public, ); }; };
2F4F657C2091F1FD00EAA994 /* NSDictionary+CordovaPreferences.m in Sources */ = {isa = PBXBuildFile; fileRef = 2F4F657A2091F1FD00EAA994 /* NSDictionary+CordovaPreferences.m */; };
2F4F657D2091F1FD00EAA994 /* NSDictionary+CordovaPreferences.h in Headers */ = {isa = PBXBuildFile; fileRef = 2F4F657B2091F1FD00EAA994 /* NSDictionary+CordovaPreferences.h */; settings = {ATTRIBUTES = (Public, ); }; };
2F5C86E11FE94845004B09C7 /* CapacitorCordova.h in Headers */ = {isa = PBXBuildFile; fileRef = 2F5C86DF1FE94845004B09C7 /* CapacitorCordova.h */; settings = {ATTRIBUTES = (Public, ); }; };
Expand Down Expand Up @@ -37,6 +39,8 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
0B61A7E32B114A9F0035F2DB /* CDVWebViewProcessPoolFactory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVWebViewProcessPoolFactory.m; sourceTree = "<group>"; };
0B61A7E42B114AA00035F2DB /* CDVWebViewProcessPoolFactory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVWebViewProcessPoolFactory.h; sourceTree = "<group>"; };
2F4F657A2091F1FD00EAA994 /* NSDictionary+CordovaPreferences.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+CordovaPreferences.m"; sourceTree = "<group>"; };
2F4F657B2091F1FD00EAA994 /* NSDictionary+CordovaPreferences.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+CordovaPreferences.h"; sourceTree = "<group>"; };
2F5C86DC1FE94845004B09C7 /* Cordova.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Cordova.framework; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -144,6 +148,8 @@
2F4F657A2091F1FD00EAA994 /* NSDictionary+CordovaPreferences.m */,
2F856BFD203DEB320047344A /* CDVViewController.h */,
2F856BFE203DEB320047344A /* CDVViewController.m */,
0B61A7E42B114AA00035F2DB /* CDVWebViewProcessPoolFactory.h */,
0B61A7E32B114A9F0035F2DB /* CDVWebViewProcessPoolFactory.m */,
);
path = Public;
sourceTree = "<group>";
Expand All @@ -169,6 +175,7 @@
2F8AC284217F3A20008C2C33 /* CDVURLProtocol.h in Headers */,
2F92AB5324D9ABA000954A4A /* CDVPlugin+Resources.h in Headers */,
62959B66252524CD00A3D7F1 /* CDVScreenOrientationDelegate.h in Headers */,
0B61A7E62B114AA00035F2DB /* CDVWebViewProcessPoolFactory.h in Headers */,
62959B6A252524D700A3D7F1 /* CDVPluginManager.h in Headers */,
2F5C86E11FE94845004B09C7 /* CapacitorCordova.h in Headers */,
);
Expand Down Expand Up @@ -247,6 +254,7 @@
2F5C871F1FE98418004B09C7 /* CDVCommandDelegateImpl.m in Sources */,
2F5C871D1FE98418004B09C7 /* CDVPluginResult.m in Sources */,
2F4F657C2091F1FD00EAA994 /* NSDictionary+CordovaPreferences.m in Sources */,
0B61A7E52B114AA00035F2DB /* CDVWebViewProcessPoolFactory.m in Sources */,
2F5C87211FE98418004B09C7 /* CDVPlugin.m in Sources */,
2F92AB5224D9ABA000954A4A /* CDVPlugin+Resources.m in Sources */,
2FAD9773203C77B9000D30F8 /* CDVConfigParser.m in Sources */,
Expand Down
1 change: 1 addition & 0 deletions ios/CapacitorCordova/CapacitorCordova/CapacitorCordova.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ FOUNDATION_EXPORT const unsigned char CapacitorCordovaVersionString[];
#import <Cordova/CDVScreenOrientationDelegate.h>
#import <Cordova/CDVURLProtocol.h>
#import <Cordova/CDVViewController.h>
#import <Cordova/CDVWebViewProcessPoolFactory.h>
#import <Cordova/NSDictionary+CordovaPreferences.h>
2 changes: 1 addition & 1 deletion ios/CapacitorCordova/CapacitorCordova/Classes/Public/CDV.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
#import "CDVViewController.h"
#import "CDVURLProtocol.h"
#import "CDVScreenOrientationDelegate.h"

#import "CDVWebViewProcessPoolFactory.h"
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/

#import <WebKit/WebKit.h>

@interface CDVWebViewProcessPoolFactory : NSObject
@property (nonatomic, retain) WKProcessPool* sharedPool;

+(instancetype) sharedFactory;
-(WKProcessPool*) sharedProcessPool;
@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
*/

@import Foundation;
@import WebKit;
#import <Cordova/CDVWebViewProcessPoolFactory.h>

static CDVWebViewProcessPoolFactory *factory = nil;

@implementation CDVWebViewProcessPoolFactory

+ (instancetype)sharedFactory
{
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
factory = [[CDVWebViewProcessPoolFactory alloc] init];
});

return factory;
}

- (instancetype)init
{
if (self = [super init]) {
_sharedPool = [[WKProcessPool alloc] init];
}
return self;
}

- (WKProcessPool*) sharedProcessPool {
return _sharedPool;
}
@end

0 comments on commit 5fb902b

Please sign in to comment.