// Copyright © 2021 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using System.Threading.Tasks;
namespace CefSharp.Internals
{
///
/// BrowserProcessHandler implementation that takes a
/// and resolves when is called.
///
public class InitializeAsyncBrowserProcessHandler : CefSharp.Handler.BrowserProcessHandler
{
private TaskCompletionSource taskCompletionSource;
///
/// Default constructor
///
/// task complection source
public InitializeAsyncBrowserProcessHandler(TaskCompletionSource tcs)
{
taskCompletionSource = tcs;
}
///
protected override void OnContextInitialized()
{
base.OnContextInitialized();
taskCompletionSource.TrySetResult(true);
}
}
}