File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,13 +61,19 @@ class AppWindow {
6161
6262HRESULT AppWindow::OnCreateCoreWebView2ControllerCompleted(HRESULT result, ICoreWebView2Controller* controller)
6363{
64- // ...
64+ if (result == S_OK)
65+ {
66+ // ...
6567
66- // Save PID of the browser process serving last WebView created from our
67- // CoreWebView2Environment.
68- CHECK_FAILURE (m_webView->get_BrowserProcessId(&m_newestBrowserPid));
68+ // Save PID of the browser process serving last WebView created from our
69+ // CoreWebView2Environment. We know the controller was created with
70+ // S_OK, and it hasn't been closed (we haven't called Close and no
71+ // ProcessFailed event could have been raised yet) so the PID is
72+ // available.
73+ CHECK_FAILURE (m_webView->get_BrowserProcessId(&m_newestBrowserPid));
6974
70- // ...
75+ // ...
76+ }
7177}
7278
7379void AppWindow::CloseWebView(/* ... * /) {
You can’t perform that action at this time.
0 commit comments