Skip to content

Commit de03f37

Browse files
authored
browser(webkit): follow up to roll, fix Win (#1091)
1 parent 971ab77 commit de03f37

File tree

2 files changed

+30
-83
lines changed

2 files changed

+30
-83
lines changed

browser_patches/webkit/BUILD_NUMBER

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1153
1+
1154

browser_patches/webkit/patches/bootstrap.diff

+29-82
Original file line numberDiff line numberDiff line change
@@ -4738,18 +4738,6 @@ index 87930048f4fd18d6098af7de4da25be532df5931..2bb2afcf9473b0d5d97efbe18dd7b814
47384738
Vector<WTF::Function<void(bool)>> m_listeners;
47394739
Timer m_updateStateTimer;
47404740

4741-
diff --git a/Source/WebCore/platform/network/curl/CookieJarDB.h b/Source/WebCore/platform/network/curl/CookieJarDB.h
4742-
index 112f632128b1aa72b4639b62a3eb5a79e37c5f80..37cc9c38d914c13361cf11a5a175d4df3da09f21 100644
4743-
--- a/Source/WebCore/platform/network/curl/CookieJarDB.h
4744-
+++ b/Source/WebCore/platform/network/curl/CookieJarDB.h
4745-
@@ -65,6 +65,7 @@ public:
4746-
bool deleteCookies(const String& url);
4747-
bool deleteAllCookies();
4748-
4749-
+ Vector<Cookie> getAllCookies();
4750-
WEBCORE_EXPORT CookieJarDB(const String& databasePath);
4751-
WEBCORE_EXPORT ~CookieJarDB();
4752-
47534741
diff --git a/Source/WebCore/platform/win/KeyEventWin.cpp b/Source/WebCore/platform/win/KeyEventWin.cpp
47544742
index 44737686187a06a92c408ea60b63a48ac8481334..c754a763688b52e7ddd47493296ef9b0c6adc527 100644
47554743
--- a/Source/WebCore/platform/win/KeyEventWin.cpp
@@ -12070,18 +12058,6 @@ index 4c5147dcd38a53e2feaeaae0fce38f92dc60eba6..4b1cab0c187352688740c7cca79483fa
1207012058

1207112059
return 0;
1207212060
}
12073-
diff --git a/Tools/MiniBrowser/win/BrowserWindow.h b/Tools/MiniBrowser/win/BrowserWindow.h
12074-
index 0989d7b1470eaf6b1453861bf482ae68f287aa8d..a7ec3facc0973a128cc4ba07b67e08e3dcce8a4f 100644
12075-
--- a/Tools/MiniBrowser/win/BrowserWindow.h
12076-
+++ b/Tools/MiniBrowser/win/BrowserWindow.h
12077-
@@ -51,7 +51,6 @@ public:
12078-
12079-
virtual void print() = 0;
12080-
virtual void launchInspector() = 0;
12081-
- virtual void openProxySettings() = 0;
12082-
12083-
virtual _bstr_t userAgent() = 0;
12084-
void setUserAgent(UINT menuID);
1208512061
diff --git a/Tools/MiniBrowser/win/Common.cpp b/Tools/MiniBrowser/win/Common.cpp
1208612062
index 87fde928c12a91f13a4f8bc2f2dc24097e42f2d0..c81685683a61cfa9f39de2de695e3c7a9b0ab1e3 100644
1208712063
--- a/Tools/MiniBrowser/win/Common.cpp
@@ -12363,7 +12339,7 @@ index d79c6fdc4fa05e1e4b9acdcc6932e571163320eb..d7902d4d0da67b9874ce32004e465b13
1236312339
+ bool m_headless;
1236412340
};
1236512341
diff --git a/Tools/MiniBrowser/win/WebKitBrowserWindow.cpp b/Tools/MiniBrowser/win/WebKitBrowserWindow.cpp
12366-
index dc2b3f257600e3f4d172875ebb821769a160979d..5a33e4bd2d329e9060d33409b8cabbfcbc886c5a 100644
12342+
index dc2b3f257600e3f4d172875ebb821769a160979d..852f3207690c53f4fb5657d3f2d5709e7972a272 100644
1236712343
--- a/Tools/MiniBrowser/win/WebKitBrowserWindow.cpp
1236812344
+++ b/Tools/MiniBrowser/win/WebKitBrowserWindow.cpp
1236912345
@@ -39,6 +39,8 @@
@@ -12415,65 +12391,53 @@ index dc2b3f257600e3f4d172875ebb821769a160979d..5a33e4bd2d329e9060d33409b8cabbfc
1241512391
WKPageSetPageUIClient(page, &uiClient.base);
1241612392

1241712393
WKPageStateClientV0 stateClient = { };
12418-
@@ -159,28 +167,30 @@ WebKitBrowserWindow::WebKitBrowserWindow(BrowserWindowClient& client, WKPageConf
12394+
@@ -159,7 +167,6 @@ WebKitBrowserWindow::WebKitBrowserWindow(BrowserWindowClient& client, WKPageConf
1241912395
stateClient.didChangeActiveURL = didChangeActiveURL;
1242012396
WKPageSetPageStateClient(page, &stateClient.base);
1242112397

1242212398
- updateProxySettings();
1242312399
resetZoom();
1242412400
}
1242512401

12426-
-void WebKitBrowserWindow::updateProxySettings()
12402+
@@ -183,6 +190,29 @@ void WebKitBrowserWindow::updateProxySettings()
12403+
WKWebsiteDataStoreEnableCustomNetworkProxySettings(store, url.get(), excludeHosts.get());
12404+
}
12405+
1242712406
+WebKitBrowserWindow::~WebKitBrowserWindow()
12428-
{
12429-
- auto context = WKPageGetContext(WKViewGetPage(m_view.get()));
12430-
- auto store = WKWebsiteDataStoreGetDefaultDataStore();
12407+
+{
1243112408
+ if (m_alertDialog) {
1243212409
+ WKRelease(m_alertDialog);
1243312410
+ m_alertDialog = NULL;
1243412411
+ }
12435-
12436-
- if (!m_proxy.enable) {
12437-
- WKWebsiteDataStoreDisableNetworkProxySettings(store);
12438-
- return;
12412+
+
1243912413
+ if (m_confirmDialog) {
1244012414
+ WKRelease(m_confirmDialog);
1244112415
+ m_confirmDialog = NULL;
12442-
}
12443-
12444-
- if (!m_proxy.custom) {
12445-
- WKWebsiteDataStoreEnableDefaultNetworkProxySettings(store);
12446-
- return;
12416+
+ }
12417+
+
1244712418
+ if (m_promptDialog) {
1244812419
+ WKRelease(m_promptDialog);
1244912420
+ m_promptDialog = NULL;
12450-
}
12451-
12452-
- auto url = createWKURL(m_proxy.url);
12453-
- auto excludeHosts = createWKString(m_proxy.excludeHosts);
12454-
- WKWebsiteDataStoreEnableCustomNetworkProxySettings(store, url.get(), excludeHosts.get());
12421+
+ }
12422+
+
1245512423
+ if (m_beforeUnloadDialog) {
1245612424
+ WKRelease(m_beforeUnloadDialog);
1245712425
+ m_beforeUnloadDialog = NULL;
1245812426
+ }
12459-
}
12460-
12427+
+}
12428+
+
1246112429
HRESULT WebKitBrowserWindow::init()
12462-
@@ -247,13 +257,6 @@ void WebKitBrowserWindow::launchInspector()
12463-
WKInspectorShow(inspector);
12430+
{
12431+
return S_OK;
12432+
@@ -251,7 +281,6 @@ void WebKitBrowserWindow::openProxySettings()
12433+
{
12434+
if (askProxySettings(m_hMainWnd, m_proxy))
12435+
updateProxySettings();
12436+
-
1246412437
}
1246512438

12466-
-void WebKitBrowserWindow::openProxySettings()
12467-
-{
12468-
- if (askProxySettings(m_hMainWnd, m_proxy))
12469-
- updateProxySettings();
12470-
-
12471-
-}
12472-
-
1247312439
void WebKitBrowserWindow::setUserAgent(_bstr_t& customUAString)
12474-
{
12475-
auto page = WKViewGetPage(m_view.get());
12476-
@@ -381,18 +384,100 @@ bool WebKitBrowserWindow::canTrustServerCertificate(WKProtectionSpaceRef protect
12440+
@@ -381,18 +410,100 @@ bool WebKitBrowserWindow::canTrustServerCertificate(WKProtectionSpaceRef protect
1247712441
return false;
1247812442
}
1247912443

@@ -12505,7 +12469,9 @@ index dc2b3f257600e3f4d172875ebb821769a160979d..5a33e4bd2d329e9060d33409b8cabbfc
1250512469
+}
1250612470
+
1250712471
+void WebKitBrowserWindow::runJavaScriptPrompt(WKPageRef page, WKStringRef message, WKStringRef defaultValue, WKFrameRef frame, WKSecurityOriginRef securityOrigin, WKPageRunJavaScriptPromptResultListenerRef listener, const void *clientInfo)
12508-
+{
12472+
{
12473+
- auto& newWindow = MainWindow::create().leakRef();
12474+
- auto factory = [configuration](BrowserWindowClient& client, HWND mainWnd, bool) -> auto {
1250912475
+ auto& thisWindow = toWebKitBrowserWindow(clientInfo);
1251012476
+ WKRetain(listener);
1251112477
+ thisWindow.m_promptDialog = listener;
@@ -12552,9 +12518,7 @@ index dc2b3f257600e3f4d172875ebb821769a160979d..5a33e4bd2d329e9060d33409b8cabbfc
1255212518
+}
1255312519
+
1255412520
+WKPageRef WebKitBrowserWindow::createViewCallback(WKPageConfigurationRef configuration, bool navigate)
12555-
{
12556-
- auto& newWindow = MainWindow::create().leakRef();
12557-
- auto factory = [configuration](BrowserWindowClient& client, HWND mainWnd, bool) -> auto {
12521+
+{
1255812522
+ auto context = WKPageConfigurationGetContext(configuration);
1255912523
+ auto dataStore = WKPageConfigurationGetWebsiteDataStore(configuration);
1256012524
+ auto& newWindow = MainWindow::create(context, dataStore, s_headless).leakRef();
@@ -12582,7 +12546,7 @@ index dc2b3f257600e3f4d172875ebb821769a160979d..5a33e4bd2d329e9060d33409b8cabbfc
1258212546
}
1258312547

1258412548
diff --git a/Tools/MiniBrowser/win/WebKitBrowserWindow.h b/Tools/MiniBrowser/win/WebKitBrowserWindow.h
12585-
index 373d0de77e852c673a6615e0acedd5195e3c021b..9a7f46822593ceb984520cfc90bd7c08d04bf5f7 100644
12549+
index 373d0de77e852c673a6615e0acedd5195e3c021b..2e63607a2299b57947f367fcebc1aa88374827fc 100644
1258612550
--- a/Tools/MiniBrowser/win/WebKitBrowserWindow.h
1258712551
+++ b/Tools/MiniBrowser/win/WebKitBrowserWindow.h
1258812552
@@ -26,6 +26,7 @@
@@ -12609,24 +12573,7 @@ index 373d0de77e852c673a6615e0acedd5195e3c021b..9a7f46822593ceb984520cfc90bd7c08
1260912573

1261012574
HRESULT init() override;
1261112575
HWND hwnd() override;
12612-
@@ -49,7 +54,6 @@ private:
12613-
12614-
void print() override;
12615-
void launchInspector() override;
12616-
- void openProxySettings() override;
12617-
12618-
_bstr_t userAgent() override;
12619-
void setUserAgent(_bstr_t&) override;
12620-
@@ -61,8 +65,6 @@ private:
12621-
void zoomIn() override;
12622-
void zoomOut() override;
12623-
12624-
- void updateProxySettings();
12625-
-
12626-
bool canTrustServerCertificate(WKProtectionSpaceRef);
12627-
12628-
static void didChangeTitle(const void*);
12629-
@@ -71,6 +73,12 @@ private:
12576+
@@ -71,6 +76,12 @@ private:
1263012577
static void didChangeActiveURL(const void*);
1263112578
static void didReceiveAuthenticationChallenge(WKPageRef, WKAuthenticationChallengeRef, const void*);
1263212579
static WKPageRef createNewPage(WKPageRef, WKPageConfigurationRef, WKNavigationActionRef, WKWindowFeaturesRef, const void *);
@@ -12639,7 +12586,7 @@ index 373d0de77e852c673a6615e0acedd5195e3c021b..9a7f46822593ceb984520cfc90bd7c08
1263912586
static void didNotHandleKeyEvent(WKPageRef, WKNativeEventPtr, const void*);
1264012587

1264112588
BrowserWindowClient& m_client;
12642-
@@ -78,4 +86,8 @@ private:
12589+
@@ -78,4 +89,8 @@ private:
1264312590
HWND m_hMainWnd { nullptr };
1264412591
ProxySettings m_proxy { };
1264512592
std::unordered_map<std::wstring, std::wstring> m_acceptedServerTrustCerts;

0 commit comments

Comments
 (0)