forked from chromiumembedded/java-cef
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCefCookieAccessFilter.java
More file actions
52 lines (48 loc) · 2.55 KB
/
CefCookieAccessFilter.java
File metadata and controls
52 lines (48 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright (c) 2019 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
package org.cef.handler;
import org.cef.browser.CefBrowser;
import org.cef.browser.CefFrame;
import org.cef.network.CefCookie;
import org.cef.network.CefRequest;
import org.cef.network.CefResponse;
/**
* 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 IO thread.
*/
public interface CefCookieAccessFilter {
/**
* Called on the IO thread before a resource request is sent. The |browser| and |frame| values
* represent the source of the request, and may be null for requests originating from service
* workers or CefURLRequest.
*
* @param browser The corresponding browser.
* @param frame The frame generating the event. Instance only valid within the scope of this
* method.
* @param request The request itself. Cannot be modified in this callback. Instance only valid
* within the scope of this method.
* @param cookie The cookie that will be sent with the request. Cannot be modified in this
* callback. Instance only valid within the scope of this method.
* @return True if the cookie can be sent or false otherwise.
*/
boolean canSendCookie(CefBrowser browser, CefFrame frame, CefRequest request, CefCookie cookie);
/**
* Called on the IO thread after a resource response is received. The |browser| and |frame|
* values represent the source of the request, and may be null for requests originating from
* service workers or CefURLRequest.
*
* @param browser The corresponding browser.
* @param frame The frame generating the event. Instance only valid within the scope of this
* method.
* @param request The request itself. Cannot be modified in this callback. Instance only valid
* within the scope of this method.
* @param response The request response. Cannot be modified in this callback. Instance only
* valid within the scope of this method.
* @param cookie The cookie that will be sent with the request. Cannot be modified in this
* callback. Instance only valid within the scope of this method.
* @return True if the cookie can be saved or false otherwise.
*/
boolean canSaveCookie(CefBrowser browser, CefFrame frame, CefRequest request,
CefResponse response, CefCookie cookie);
}