@@ -5393,6 +5393,49 @@ index 1d2febfba8833912f72216aa53c8c20090ee2d8b..1b2c3d84b15b12f1a187c0b7622db43c
5393
5393
} WKPageUIClientV14;
5394
5394
5395
5395
#ifdef __cplusplus
5396
+ diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm b/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm
5397
+ index 08e5b9f0135eafe1aa8f4de4a82b6b890bb919b3..aeba2827bf182556aed407dd8956ef93d267893d 100644
5398
+ --- a/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm
5399
+ +++ b/Source/WebKit/UIProcess/API/Cocoa/WKProcessPool.mm
5400
+ @@ -47,6 +47,7 @@
5401
+ #import "_WKDownloadDelegate.h"
5402
+ #import "_WKDownloadInternal.h"
5403
+ #import "_WKProcessPoolConfigurationInternal.h"
5404
+ +#import "_WKWebsiteDataStoreInternal.h"
5405
+ #import <WebCore/CertificateInfo.h>
5406
+ #import <WebCore/PluginData.h>
5407
+ #import <WebCore/RegistrableDomain.h>
5408
+ @@ -84,6 +85,18 @@ static WKProcessPool *sharedProcessPool;
5409
+ return self;
5410
+ }
5411
+
5412
+ +- (instancetype)_initWithConfiguration:(_WKProcessPoolConfiguration *)configuration AndDataStore:(WKWebsiteDataStore*)dataStore
5413
+ +{
5414
+ + if (!(self = [super init]))
5415
+ + return nil;
5416
+ +
5417
+ + API::Object::constructInWrapper<WebKit::WebProcessPool>(self, *configuration->_processPoolConfiguration);
5418
+ + _processPool->setPrimaryDataStore(*dataStore->_websiteDataStore);
5419
+ +
5420
+ + return self;
5421
+ +}
5422
+ +
5423
+ +
5424
+ - (instancetype)init
5425
+ {
5426
+ return [self _initWithConfiguration:adoptNS([[_WKProcessPoolConfiguration alloc] init]).get()];
5427
+ diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h b/Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h
5428
+ index 7cfd05697f25ca66a530b2d497706adbf284b068..c24081d210e4baeb5f7f7868eddd5afc111f687b 100644
5429
+ --- a/Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h
5430
+ +++ b/Source/WebKit/UIProcess/API/Cocoa/WKProcessPoolPrivate.h
5431
+ @@ -37,6 +37,7 @@
5432
+
5433
+ @interface WKProcessPool ()
5434
+ - (instancetype)_initWithConfiguration:(_WKProcessPoolConfiguration *)configuration __attribute__((objc_method_family(init))) NS_DESIGNATED_INITIALIZER;
5435
+ +- (instancetype)_initWithConfiguration:(_WKProcessPoolConfiguration *)configuration AndDataStore:(WKWebsiteDataStore *)dataStore __attribute__((objc_method_family(init))) NS_DESIGNATED_INITIALIZER;
5436
+ @end
5437
+
5438
+ @interface WKProcessPool (WKPrivate)
5396
5439
diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegate.h b/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegate.h
5397
5440
index cad87f3ef2ab93d93a74cec0c34b47c695de6bc6..66145a384638b97ee08516e56e1e86a83713c634 100644
5398
5441
--- a/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegate.h
@@ -12111,10 +12154,10 @@ index 0000000000000000000000000000000000000000..44dc1139c298bd119368ef4f45bbf088
12111
12154
+#include "../../ccache/ccache.xcconfig"
12112
12155
diff --git a/Tools/Playwright/Configurations/Playwright.xcconfig b/Tools/Playwright/Configurations/Playwright.xcconfig
12113
12156
new file mode 100644
12114
- index 0000000000000000000000000000000000000000..085126eb199ec714f7e8d7bc7d7b361ef55ebb73
12157
+ index 0000000000000000000000000000000000000000..d05c841a5b0f5fce481f16b8c98caf3a5846db77
12115
12158
--- /dev/null
12116
12159
+++ b/Tools/Playwright/Configurations/Playwright.xcconfig
12117
- @@ -0,0 +1,31 @@
12160
+ @@ -0,0 +1,30 @@
12118
12161
+// Copyright (C) 2010 Apple Inc. All rights reserved.
12119
12162
+//
12120
12163
+// Redistribution and use in source and binary forms, with or without
@@ -12139,7 +12182,6 @@ index 0000000000000000000000000000000000000000..085126eb199ec714f7e8d7bc7d7b361e
12139
12182
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
12140
12183
+
12141
12184
+PRODUCT_NAME = Playwright
12142
- +CODE_SIGN_ENTITLEMENTS = Playwright.entitlements;
12143
12185
+PRODUCT_BUNDLE_IDENTIFIER = org.webkit.$(PRODUCT_NAME:rfc1034identifier)
12144
12186
+GCC_PREFIX_HEADER = mac/Playwright_Prefix.pch
12145
12187
+INFOPLIST_FILE = mac/Info.plist
@@ -12298,33 +12340,6 @@ index 0000000000000000000000000000000000000000..58e52428388d927ae7681d999e6dd28e
12298
12340
+clean: ;
12299
12341
+
12300
12342
+endif
12301
- diff --git a/Tools/Playwright/Playwright.entitlements b/Tools/Playwright/Playwright.entitlements
12302
- new file mode 100644
12303
- index 0000000000000000000000000000000000000000..e4c2ba180f395dca1d341db666d5c34c2ea3ec2e
12304
- --- /dev/null
12305
- +++ b/Tools/Playwright/Playwright.entitlements
12306
- @@ -0,0 +1,21 @@
12307
- +<?xml version="1.0" encoding="UTF-8"?>
12308
- +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
12309
- +<plist version="1.0">
12310
- +<dict>
12311
- + <key>com.apple.security.app-sandbox</key>
12312
- + <true/>
12313
- + <key>com.apple.security.device.usb</key>
12314
- + <true/>
12315
- + <key>com.apple.security.files.user-selected.read-write</key>
12316
- + <true/>
12317
- + <key>com.apple.security.network.client</key>
12318
- + <true/>
12319
- + <key>com.apple.security.temporary-exception.files.absolute-path.read-only</key>
12320
- + <string>/</string>
12321
- + <key>com.apple.security.temporary-exception.mach-lookup.global-name</key>
12322
- + <array>
12323
- + <string>com.apple.Safari.SafeBrowsing.Service</string>
12324
- + <string>com.apple.WebKit.NetworkingDaemon</string>
12325
- + </array>
12326
- +</dict>
12327
- +</plist>
12328
12343
diff --git a/Tools/Playwright/Playwright.xcodeproj/project.pbxproj b/Tools/Playwright/Playwright.xcodeproj/project.pbxproj
12329
12344
new file mode 100644
12330
12345
index 0000000000000000000000000000000000000000..75a945e72d9fcad94bb89fc6325df18d3259383d
@@ -12681,10 +12696,10 @@ index 0000000000000000000000000000000000000000..00fb6b0006c743091a8bbf8edb18b211
12681
12696
+</Scheme>
12682
12697
diff --git a/Tools/Playwright/mac/AppDelegate.h b/Tools/Playwright/mac/AppDelegate.h
12683
12698
new file mode 100644
12684
- index 0000000000000000000000000000000000000000..8d655761a2fb4e0295a965d4fe9e4908deaf89ec
12699
+ index 0000000000000000000000000000000000000000..465cb7827fc47927c4e1fc6e47c6608f4ef21d26
12685
12700
--- /dev/null
12686
12701
+++ b/Tools/Playwright/mac/AppDelegate.h
12687
- @@ -0,0 +1,55 @@
12702
+ @@ -0,0 +1,56 @@
12688
12703
+/*
12689
12704
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
12690
12705
+ *
@@ -12725,6 +12740,7 @@ index 0000000000000000000000000000000000000000..8d655761a2fb4e0295a965d4fe9e4908
12725
12740
+ bool _headless;
12726
12741
+ NSMutableSet *_dialogs;
12727
12742
+ NSString* _initialURL;
12743
+ + NSString* _userDataDir;
12728
12744
+ IBOutlet NSMenuItem *_newWebKit2WindowItem;
12729
12745
+}
12730
12746
+
@@ -12742,10 +12758,10 @@ index 0000000000000000000000000000000000000000..8d655761a2fb4e0295a965d4fe9e4908
12742
12758
+@end
12743
12759
diff --git a/Tools/Playwright/mac/AppDelegate.m b/Tools/Playwright/mac/AppDelegate.m
12744
12760
new file mode 100644
12745
- index 0000000000000000000000000000000000000000..46c514097df0555f4f4ad5a135359fe1a31459dc
12761
+ index 0000000000000000000000000000000000000000..84e0cd9c2d20111e936e4b16519d20bcd5aa37db
12746
12762
--- /dev/null
12747
12763
+++ b/Tools/Playwright/mac/AppDelegate.m
12748
- @@ -0,0 +1,448 @@
12764
+ @@ -0,0 +1,486 @@
12749
12765
+/*
12750
12766
+ * Copyright (C) 2010-2016 Apple Inc. All rights reserved.
12751
12767
+ *
@@ -12833,13 +12849,18 @@ index 0000000000000000000000000000000000000000..46c514097df0555f4f4ad5a135359fe1
12833
12849
+ return nil;
12834
12850
+
12835
12851
+ _initialURL = nil;
12852
+ + _userDataDir = nil;
12836
12853
+ NSArray *arguments = [[NSProcessInfo processInfo] arguments];
12837
12854
+ NSRange subargs = NSMakeRange(1, [arguments count] - 1);
12838
12855
+ NSArray *subArray = [arguments subarrayWithRange:subargs];
12839
12856
+
12840
12857
+ for (NSString *argument in subArray) {
12841
12858
+ if (![argument hasPrefix:@"--"])
12842
12859
+ _initialURL = argument;
12860
+ + if ([argument hasPrefix:@"--user-data-dir="]) {
12861
+ + NSRange range = NSMakeRange(16, [argument length] - 16);
12862
+ + _userDataDir = [[argument substringWithRange:range] copy];
12863
+ + }
12843
12864
+ }
12844
12865
+
12845
12866
+ _headless = [arguments containsObject: @"--headless"];
@@ -12866,13 +12887,46 @@ index 0000000000000000000000000000000000000000..46c514097df0555f4f4ad5a135359fe1
12866
12887
+ [NSApp setAutomaticCustomizeTouchBarMenuItemEnabled:YES];
12867
12888
+}
12868
12889
+
12869
- +static WKWebsiteDataStore *persistentDataStore()
12890
+ +- ( WKWebsiteDataStore *)persistentDataStore
12870
12891
+{
12871
12892
+ static WKWebsiteDataStore *dataStore;
12872
12893
+
12873
12894
+ if (!dataStore) {
12874
12895
+ _WKWebsiteDataStoreConfiguration *configuration = [[[_WKWebsiteDataStoreConfiguration alloc] init] autorelease];
12875
- + configuration.networkCacheSpeculativeValidationEnabled = YES;
12896
+ + if (_userDataDir) {
12897
+ + NSURL *cookieFile = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/cookie.db", _userDataDir]];
12898
+ + [configuration _setCookieStorageFile:cookieFile];
12899
+ +
12900
+ + NSURL *applicationCacheDirectory = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/ApplicationCache", _userDataDir]];
12901
+ + [configuration setApplicationCacheDirectory:applicationCacheDirectory];
12902
+ +
12903
+ + NSURL *cacheStorageDirectory = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/CacheStorage", _userDataDir]];
12904
+ + [configuration _setCacheStorageDirectory:cacheStorageDirectory];
12905
+ +
12906
+ + NSURL *indexedDBDirectory = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/IndexedDB", _userDataDir]];
12907
+ + [configuration _setIndexedDBDatabaseDirectory:indexedDBDirectory];
12908
+ +
12909
+ + NSURL *localStorageDirectory = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/LocalStorage", _userDataDir]];
12910
+ + [configuration _setWebStorageDirectory:localStorageDirectory];
12911
+ +
12912
+ + NSURL *mediaCacheDirectory = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/MediaCache", _userDataDir]];
12913
+ + [configuration setMediaCacheDirectory:mediaCacheDirectory];
12914
+ +
12915
+ + NSURL *mediaKeysDirectory = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/MediaKeys", _userDataDir]];
12916
+ + [configuration setMediaKeysStorageDirectory:mediaKeysDirectory];
12917
+ +
12918
+ + NSURL *networkCacheDirectory = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/NetworkCache", _userDataDir]];
12919
+ + [configuration setNetworkCacheDirectory:networkCacheDirectory];
12920
+ +
12921
+ + NSURL *loadStatsDirectory = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/ResourceLoadStatistics", _userDataDir]];
12922
+ + [configuration _setResourceLoadStatisticsDirectory:loadStatsDirectory];
12923
+ +
12924
+ + NSURL *serviceWorkersDirectory = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/ServiceWorkers", _userDataDir]];
12925
+ + [configuration _setServiceWorkerRegistrationDirectory:serviceWorkersDirectory];
12926
+ +
12927
+ + NSURL *webSqlDirectory = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/WebSQL", _userDataDir]];
12928
+ + [configuration _setWebSQLDatabaseDirectory:webSqlDirectory];
12929
+ + }
12876
12930
+ dataStore = [[WKWebsiteDataStore alloc] _initWithConfiguration:configuration];
12877
12931
+ }
12878
12932
+
@@ -12885,7 +12939,7 @@ index 0000000000000000000000000000000000000000..46c514097df0555f4f4ad5a135359fe1
12885
12939
+
12886
12940
+ if (!configuration) {
12887
12941
+ configuration = [[WKWebViewConfiguration alloc] init];
12888
- + configuration.websiteDataStore = persistentDataStore() ;
12942
+ + configuration.websiteDataStore = [self persistentDataStore] ;
12889
12943
+ configuration.preferences._fullScreenEnabled = YES;
12890
12944
+ configuration.preferences._developerExtrasEnabled = YES;
12891
12945
+ configuration.preferences._mediaDevicesEnabled = YES;
@@ -12896,7 +12950,7 @@ index 0000000000000000000000000000000000000000..46c514097df0555f4f4ad5a135359fe1
12896
12950
+ configuration.preferences._domTimersThrottlingEnabled = NO;
12897
12951
+ configuration.preferences._requestAnimationFrameEnabled = YES;
12898
12952
+ _WKProcessPoolConfiguration *processConfiguration = [[[_WKProcessPoolConfiguration alloc] init] autorelease];
12899
- + configuration.processPool = [[[WKProcessPool alloc] _initWithConfiguration:processConfiguration] autorelease];
12953
+ + configuration.processPool = [[[WKProcessPool alloc] _initWithConfiguration:processConfiguration AndDataStore:configuration.websiteDataStore ] autorelease];
12900
12954
+ }
12901
12955
+ return configuration;
12902
12956
+}
@@ -13196,10 +13250,10 @@ index 0000000000000000000000000000000000000000..46c514097df0555f4f4ad5a135359fe1
13196
13250
+@end
13197
13251
diff --git a/Tools/Playwright/mac/BrowserWindow.xib b/Tools/Playwright/mac/BrowserWindow.xib
13198
13252
new file mode 100644
13199
- index 0000000000000000000000000000000000000000..aed963e861f27a467bb6a38859f8d3a446f578b8
13253
+ index 0000000000000000000000000000000000000000..f6f3d8e3a0f163e61b2f3d54819e9d25a0a3eb75
13200
13254
--- /dev/null
13201
13255
+++ b/Tools/Playwright/mac/BrowserWindow.xib
13202
- @@ -0,0 +1,169 @@
13256
+ @@ -0,0 +1,153 @@
13203
13257
+<?xml version="1.0" encoding="UTF-8"?>
13204
13258
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11191" systemVersion="16D17a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
13205
13259
+ <dependencies>
@@ -13288,22 +13342,6 @@ index 0000000000000000000000000000000000000000..aed963e861f27a467bb6a38859f8d3a4
13288
13342
+ </connections>
13289
13343
+ </button>
13290
13344
+ </toolbarItem>
13291
- + <toolbarItem implicitItemIdentifier="76DCF2B0-1DDE-47D2-9212-705E6E310CCE" label="Use Shrink To Fit" paletteLabel="Use Shrink To Fit" image="NSEnterFullScreenTemplate" id="81" customClass="MBToolbarItem">
13292
- + <nil key="toolTip"/>
13293
- + <size key="minSize" width="29" height="27"/>
13294
- + <size key="maxSize" width="29" height="27"/>
13295
- + <button key="view" verticalHuggingPriority="750" id="82">
13296
- + <rect key="frame" x="34" y="14" width="29" height="25"/>
13297
- + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
13298
- + <buttonCell key="cell" type="roundTextured" bezelStyle="texturedRounded" image="NSEnterFullScreenTemplate" imagePosition="overlaps" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="83">
13299
- + <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
13300
- + <font key="font" metaFont="system"/>
13301
- + </buttonCell>
13302
- + <connections>
13303
- + <action selector="toggleShrinkToFit:" target="-2" id="gp7-Vk-KTI"/>
13304
- + </connections>
13305
- + </button>
13306
- + </toolbarItem>
13307
13345
+ <toolbarItem implicitItemIdentifier="F1738B7F-895C-48F7-955D-0915E150BE1B" label="Share" paletteLabel="Share" image="NSShareTemplate" id="dJx-dw-gcC" customClass="MBToolbarItem">
13308
13346
+ <nil key="toolTip"/>
13309
13347
+ <size key="minSize" width="29" height="27"/>
0 commit comments