ICoreWebView2CookieManager

Trait ICoreWebView2CookieManager 

Source
pub trait ICoreWebView2CookieManager: IUnknown {
    // Required methods
    unsafe fn create_cookie(
        &self,
        name: LPCWSTR,
        value: LPCWSTR,
        domain: LPCWSTR,
        path: LPCWSTR,
        cookie: *mut *mut *mut ICoreWebView2CookieVTable,
    ) -> HRESULT;
    unsafe fn copy_cookie(
        &self,
        cookie_param: *mut *mut ICoreWebView2CookieVTable,
        cookie: *mut *mut *mut ICoreWebView2CookieVTable,
    ) -> HRESULT;
    unsafe fn get_cookies(
        &self,
        uri: LPCWSTR,
        handler: *mut *mut ICoreWebView2GetCookiesCompletedHandlerVTable,
    ) -> HRESULT;
    unsafe fn add_or_update_cookie(
        &self,
        cookie: *mut *mut ICoreWebView2CookieVTable,
    ) -> HRESULT;
    unsafe fn delete_cookie(
        &self,
        cookie: *mut *mut ICoreWebView2CookieVTable,
    ) -> HRESULT;
    unsafe fn delete_cookies(&self, name: LPCWSTR, uri: LPCWSTR) -> HRESULT;
    unsafe fn delete_cookies_with_domain_and_path(
        &self,
        name: LPCWSTR,
        domain: LPCWSTR,
        path: LPCWSTR,
    ) -> HRESULT;
    unsafe fn delete_all_cookies(&self) -> HRESULT;
}
Expand description

Creates, adds or updates, gets, or or view the cookies. The changes would apply to the context of the user profile. That is, other WebViews under the same user profile could be affected.

Required Methods§

Create a cookie object with a specified name, value, domain, and path. One can set other optional properties after cookie creation. This only creates a cookie object and it is not added to the cookie manager until you call AddOrUpdateCookie. Leading or trailing whitespace(s), empty string, and special characters are not allowed for name. See ICoreWebView2Cookie for more details.

Creates a cookie whose params matches those of the specified cookie.

Source

unsafe fn get_cookies( &self, uri: LPCWSTR, handler: *mut *mut ICoreWebView2GetCookiesCompletedHandlerVTable, ) -> HRESULT

Gets a list of cookies matching the specific URI. If uri is empty string or null, all cookies under the same profile are returned. You can modify the cookie objects by calling ICoreWebView2CookieManager::AddOrUpdateCookie, and the changes will be applied to the webview. \snippet ScenarioCookieManagement.cpp GetCookies

Adds or updates a cookie with the given cookie data; may overwrite cookies with matching name, domain, and path if they exist. This method will fail if the domain of the given cookie is not specified. \snippet ScenarioCookieManagement.cpp AddOrUpdateCookie

Deletes a cookie whose name and domain/path pair match those of the specified cookie.

Source

unsafe fn delete_cookies(&self, name: LPCWSTR, uri: LPCWSTR) -> HRESULT

Deletes cookies with matching name and uri. Cookie name is required. All cookies with the given name where domain and path match provided URI are deleted.

Source

unsafe fn delete_cookies_with_domain_and_path( &self, name: LPCWSTR, domain: LPCWSTR, path: LPCWSTR, ) -> HRESULT

Deletes cookies with matching name and domain/path pair. Cookie name is required. If domain is specified, deletes only cookies with the exact domain. If path is specified, deletes only cookies with the exact path.

Source

unsafe fn delete_all_cookies(&self) -> HRESULT

Deletes all cookies under the same profile. This could affect other WebViews under the same user profile.

Trait Implementations§

Source§

impl ComInterface for dyn ICoreWebView2CookieManager

Source§

const IID: IID = IID_ICORE_WEB_VIEW2_COOKIE_MANAGER

The associated id for this interface
Source§

type VTable = ICoreWebView2CookieManagerVTable

A COM compatible V-Table
Source§

type Super = dyn IUnknown

The interface that this interface inherits from
Source§

fn is_iid_in_inheritance_chain(riid: &GUID) -> bool

Check whether a given IID is in the inheritance hierarchy of this interface
Source§

impl<C: ICoreWebView2CookieManager> ProductionComInterface<C> for dyn ICoreWebView2CookieManager

Source§

fn vtable<O: Offset>() -> Self::VTable

Get the vtable for a particular COM interface

Implementations on Foreign Types§

Source§

impl<T: ICoreWebView2CookieManager + ComInterface + ?Sized> ICoreWebView2CookieManager for ComPtr<T>

Source§

impl<T: ICoreWebView2CookieManager + ComInterface + ?Sized> ICoreWebView2CookieManager for ComRc<T>

Implementors§