Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
HeikoKlare committed Sep 25, 2024
1 parent 2e422ed commit ffb43cd
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -486,14 +486,19 @@ public void create(Composite parent, int style) {
int hr = containingEnvironment.environment().QueryInterface(COM.IID_ICoreWebView2Environment2, ppv);
if (hr == COM.S_OK) environment2 = new ICoreWebView2Environment2(ppv[0]);
// The webview calls are queued to be executed when it is done executing the current task.
IUnknown setupBrowserCallback = newCallback((result, pv) -> {
containingEnvironment.environment().CreateCoreWebView2Controller(browser.handle, getSetupCallback());
}

private IUnknown getSetupCallback() {
return newCallback((result, pv) -> {
if ((int)result == COM.S_OK) {
new IUnknown(pv).AddRef();
setupBrowser((int)result, pv);
} else {
containingEnvironment.environment().CreateCoreWebView2Controller(browser.handle, getSetupCallback());
}
setupBrowser((int)result, pv);
return COM.S_OK;
});
containingEnvironment.environment().CreateCoreWebView2Controller(browser.handle, setupBrowserCallback);
}

void setupBrowser(int hr, long pv) {
Expand Down

0 comments on commit ffb43cd

Please sign in to comment.