// Copyright © 2019 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.
namespace CefSharp
{
///
/// Implement this interface to filter cookies that may be sent or received from
/// resource requests. The methods of this class will be called on the CEF IO thread
/// unless otherwise indicated.
///
public interface ICookieAccessFilter
{
///
/// Called on the CEF IO thread before a resource request is sent.
///
/// The ChromiumWebBrowser control
/// the browser object - may be null if originating from ServiceWorker or CefURLRequest
/// the frame object - may be null if originating from ServiceWorker or CefURLRequest
/// the request object - cannot be modified in this callback
/// the cookie object
/// Return true if the specified cookie can be sent with the request or false otherwise.
bool CanSendCookie(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IRequest request, Cookie cookie);
///
/// Called on the CEF IO thread after a resource response is received.
///
/// The ChromiumWebBrowser control
/// the browser object - may be null if originating from ServiceWorker or CefURLRequest
/// the frame object - may be null if originating from ServiceWorker or CefURLRequest
/// the request object - cannot be modified in this callback
/// the response object - cannot be modified in this callback
/// the cookie object
/// Return true if the specified cookie returned with the response can be saved or false otherwise.
bool CanSaveCookie(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IRequest request, IResponse response, Cookie cookie);
}
}