mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Remove methods that modify cookie storage at runtime (see issue #2622).
This change removes cookie and request handler functionality that will not supported by the NetworkService. Specifically, it is no longer possible to change cookie storage locations at runime by returning a different CefCookieManager for an already initialized CefRequestContext. After this change you will need to use a separate CefRequestContext when creating a CefBrowser if you require separate cookie storage. The following methods have been removed: - CefCookieManager::CreateManager - CefCookieManager::GetBlockingManager - CefCookieManager::SetStoragePath - CefRequestContextHandler::GetCookieManager The following methods have been renamed: - CefRequestContext::GetDefaultCookieManager to GetCookieManager. This change substantially simplifies the network implementation in CEF because it is no longer necessary to proxy objects that are normally owned by Chromium. Chromium patches that are no longer necessary will be removed as a follow-up commit. To test: Verify that `ceftests --gtest_filter=-PluginTest.*` pass with NetworkService disabled. Plugin tests will be fixed in a follow-up commit.
This commit is contained in:
@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=48b5fa68109eed1ea30fa0c805218ebd258c0573$
|
||||
// $hash=fd4529fcb0b4cebf7e94a5160854f13ee05bbab0$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_COOKIE_CAPI_H_
|
||||
@ -123,22 +123,6 @@ typedef struct _cef_cookie_manager_t {
|
||||
const cef_string_t* cookie_name,
|
||||
struct _cef_delete_cookies_callback_t* callback);
|
||||
|
||||
///
|
||||
// Sets the directory path that will be used for storing cookie data. If
|
||||
// |path| is NULL data will be stored in memory only. Otherwise, data will be
|
||||
// stored at the specified |path|. To persist session cookies (cookies without
|
||||
// an expiry date or validity interval) set |persist_session_cookies| to true
|
||||
// (1). Session cookies are generally intended to be transient and most Web
|
||||
// browsers do not persist them. If |callback| is non-NULL it will be executed
|
||||
// asnychronously on the IO thread after the manager's storage has been
|
||||
// initialized. Returns false (0) if cookies cannot be accessed.
|
||||
///
|
||||
int(CEF_CALLBACK* set_storage_path)(
|
||||
struct _cef_cookie_manager_t* self,
|
||||
const cef_string_t* path,
|
||||
int persist_session_cookies,
|
||||
struct _cef_completion_callback_t* callback);
|
||||
|
||||
///
|
||||
// Flush the backing store (if any) to disk. If |callback| is non-NULL it will
|
||||
// be executed asnychronously on the IO thread after the flush is complete.
|
||||
@ -153,36 +137,12 @@ typedef struct _cef_cookie_manager_t {
|
||||
// CefSettings.cache_path if specified or in memory otherwise. If |callback| is
|
||||
// non-NULL it will be executed asnychronously on the IO thread after the
|
||||
// manager's storage has been initialized. Using this function is equivalent to
|
||||
// calling cef_request_tContext::cef_request_context_get_global_context()->get_d
|
||||
// efault_cookie_manager().
|
||||
// calling cef_request_tContext::cef_request_context_get_global_context()->GetDe
|
||||
// faultCookieManager().
|
||||
///
|
||||
CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_get_global_manager(
|
||||
struct _cef_completion_callback_t* callback);
|
||||
|
||||
///
|
||||
// Returns a cookie manager that neither stores nor retrieves cookies. All usage
|
||||
// of cookies will be blocked including cookies accessed via the network
|
||||
// (request/response headers), via JavaScript (document.cookie), and via
|
||||
// cef_cookie_manager_t functions. No cookies will be displayed in DevTools. If
|
||||
// you wish to only block cookies sent via the network use the
|
||||
// cef_request_tHandler CanGetCookies and CanSetCookie functions instead.
|
||||
///
|
||||
CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_get_blocking_manager();
|
||||
|
||||
///
|
||||
// Creates a new cookie manager. If |path| is NULL data will be stored in memory
|
||||
// only. Otherwise, data will be stored at the specified |path|. To persist
|
||||
// session cookies (cookies without an expiry date or validity interval) set
|
||||
// |persist_session_cookies| to true (1). Session cookies are generally intended
|
||||
// to be transient and most Web browsers do not persist them. If |callback| is
|
||||
// non-NULL it will be executed asnychronously on the IO thread after the
|
||||
// manager's storage has been initialized.
|
||||
///
|
||||
CEF_EXPORT cef_cookie_manager_t* cef_cookie_manager_create_manager(
|
||||
const cef_string_t* path,
|
||||
int persist_session_cookies,
|
||||
struct _cef_completion_callback_t* callback);
|
||||
|
||||
///
|
||||
// Structure to implement for visiting cookie values. The functions of this
|
||||
// structure will always be called on the IO thread.
|
||||
|
@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=f7f1ec971c726a6a74bcc7f5cee7a8eb1911078d$
|
||||
// $hash=1038c0c3db89ce0b829d66e166b063c96b15992d$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_CAPI_H_
|
||||
@ -130,14 +130,11 @@ typedef struct _cef_request_context_t {
|
||||
struct _cef_request_context_t* self);
|
||||
|
||||
///
|
||||
// Returns the default cookie manager for this object. This will be the global
|
||||
// cookie manager if this object is the global request context. Otherwise,
|
||||
// this will be the default cookie manager used when this request context does
|
||||
// not receive a value via cef_request_tContextHandler::get_cookie_manager().
|
||||
// If |callback| is non-NULL it will be executed asnychronously on the IO
|
||||
// thread after the manager's storage has been initialized.
|
||||
// Returns the cookie manager for this object. If |callback| is non-NULL it
|
||||
// will be executed asnychronously on the IO thread after the manager's
|
||||
// storage has been initialized.
|
||||
///
|
||||
struct _cef_cookie_manager_t*(CEF_CALLBACK* get_default_cookie_manager)(
|
||||
struct _cef_cookie_manager_t*(CEF_CALLBACK* get_cookie_manager)(
|
||||
struct _cef_request_context_t* self,
|
||||
struct _cef_completion_callback_t* callback);
|
||||
|
||||
|
@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=03c829d89f0b5b7ab12634fa2f11c4903cd8edb2$
|
||||
// $hash=2bf745d270f474b3d5b36fc3fc2fca2b508ec16f$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_REQUEST_CONTEXT_HANDLER_CAPI_H_
|
||||
@ -41,7 +41,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "include/capi/cef_base_capi.h"
|
||||
#include "include/capi/cef_cookie_capi.h"
|
||||
#include "include/capi/cef_web_plugin_capi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -69,14 +68,6 @@ typedef struct _cef_request_context_handler_t {
|
||||
struct _cef_request_context_handler_t* self,
|
||||
struct _cef_request_context_t* request_context);
|
||||
|
||||
///
|
||||
// Called on the browser process IO thread to retrieve the cookie manager. If
|
||||
// this function returns NULL the default cookie manager retrievable via
|
||||
// cef_request_tContext::get_default_cookie_manager() will be used.
|
||||
///
|
||||
struct _cef_cookie_manager_t*(CEF_CALLBACK* get_cookie_manager)(
|
||||
struct _cef_request_context_handler_t* self);
|
||||
|
||||
///
|
||||
// Called on multiple browser process threads before a plugin instance is
|
||||
// loaded. |mime_type| is the mime type of the plugin that will be loaded.
|
||||
|
@ -34,7 +34,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=b5fa5783096eaa1af5e76645e2557e123af56848$
|
||||
// $hash=fcc19532b6143e9c445fcde9947260b1c93a5e68$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_API_HASH_H_
|
||||
@ -47,13 +47,13 @@
|
||||
// way that may cause binary incompatibility with other builds. The universal
|
||||
// hash value will change if any platform is affected whereas the platform hash
|
||||
// values will change only if that particular platform is affected.
|
||||
#define CEF_API_HASH_UNIVERSAL "8ae24aac4bd16d2e2d87e7d6561985064990670e"
|
||||
#define CEF_API_HASH_UNIVERSAL "114e74f2c52d90fbb3fe6b3855dba9e544e40e85"
|
||||
#if defined(OS_WIN)
|
||||
#define CEF_API_HASH_PLATFORM "fe476e7a38a8270fe783981b4bc6fac4284ab9fe"
|
||||
#define CEF_API_HASH_PLATFORM "25d0b5c8337691e2bcc21148686e4eacbe1255a6"
|
||||
#elif defined(OS_MACOSX)
|
||||
#define CEF_API_HASH_PLATFORM "ab1b4d8c4578b0bcdc97f28f13a10384057bdf95"
|
||||
#define CEF_API_HASH_PLATFORM "905d65b97689874873222e99869c8c5a361bbdb7"
|
||||
#elif defined(OS_LINUX)
|
||||
#define CEF_API_HASH_PLATFORM "73f24626e0179a3f5664d64ffe0fa2aab9edf7cf"
|
||||
#define CEF_API_HASH_PLATFORM "ef345d85855d8d5c34de2fb26d25397c5e0e3534"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -64,32 +64,6 @@ class CefCookieManager : public virtual CefBaseRefCounted {
|
||||
static CefRefPtr<CefCookieManager> GetGlobalManager(
|
||||
CefRefPtr<CefCompletionCallback> callback);
|
||||
|
||||
///
|
||||
// Returns a cookie manager that neither stores nor retrieves cookies. All
|
||||
// usage of cookies will be blocked including cookies accessed via the network
|
||||
// (request/response headers), via JavaScript (document.cookie), and via
|
||||
// CefCookieManager methods. No cookies will be displayed in DevTools. If you
|
||||
// wish to only block cookies sent via the network use the CefRequestHandler
|
||||
// CanGetCookies and CanSetCookie methods instead.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefCookieManager> GetBlockingManager();
|
||||
|
||||
///
|
||||
// Creates a new cookie manager. If |path| is empty data will be stored in
|
||||
// memory only. Otherwise, data will be stored at the specified |path|. To
|
||||
// persist session cookies (cookies without an expiry date or validity
|
||||
// interval) set |persist_session_cookies| to true. Session cookies are
|
||||
// generally intended to be transient and most Web browsers do not persist
|
||||
// them. If |callback| is non-NULL it will be executed asnychronously on the
|
||||
// IO thread after the manager's storage has been initialized.
|
||||
///
|
||||
/*--cef(optional_param=path,optional_param=callback)--*/
|
||||
static CefRefPtr<CefCookieManager> CreateManager(
|
||||
const CefString& path,
|
||||
bool persist_session_cookies,
|
||||
CefRefPtr<CefCompletionCallback> callback);
|
||||
|
||||
///
|
||||
// Set the schemes supported by this manager. The default schemes ("http",
|
||||
// "https", "ws" and "wss") will always be supported. If |callback| is non-
|
||||
@ -152,21 +126,6 @@ class CefCookieManager : public virtual CefBaseRefCounted {
|
||||
const CefString& cookie_name,
|
||||
CefRefPtr<CefDeleteCookiesCallback> callback) = 0;
|
||||
|
||||
///
|
||||
// Sets the directory path that will be used for storing cookie data. If
|
||||
// |path| is empty data will be stored in memory only. Otherwise, data will be
|
||||
// stored at the specified |path|. To persist session cookies (cookies without
|
||||
// an expiry date or validity interval) set |persist_session_cookies| to true.
|
||||
// Session cookies are generally intended to be transient and most Web
|
||||
// browsers do not persist them. If |callback| is non-NULL it will be executed
|
||||
// asnychronously on the IO thread after the manager's storage has been
|
||||
// initialized. Returns false if cookies cannot be accessed.
|
||||
///
|
||||
/*--cef(optional_param=path,optional_param=callback)--*/
|
||||
virtual bool SetStoragePath(const CefString& path,
|
||||
bool persist_session_cookies,
|
||||
CefRefPtr<CefCompletionCallback> callback) = 0;
|
||||
|
||||
///
|
||||
// Flush the backing store (if any) to disk. If |callback| is non-NULL it will
|
||||
// be executed asnychronously on the IO thread after the flush is complete.
|
||||
|
@ -144,15 +144,12 @@ class CefRequestContext : public virtual CefBaseRefCounted {
|
||||
virtual CefString GetCachePath() = 0;
|
||||
|
||||
///
|
||||
// Returns the default cookie manager for this object. This will be the global
|
||||
// cookie manager if this object is the global request context. Otherwise,
|
||||
// this will be the default cookie manager used when this request context does
|
||||
// not receive a value via CefRequestContextHandler::GetCookieManager(). If
|
||||
// |callback| is non-NULL it will be executed asnychronously on the IO thread
|
||||
// after the manager's storage has been initialized.
|
||||
// Returns the cookie manager for this object. If |callback| is non-NULL it
|
||||
// will be executed asnychronously on the IO thread after the manager's
|
||||
// storage has been initialized.
|
||||
///
|
||||
/*--cef(optional_param=callback)--*/
|
||||
virtual CefRefPtr<CefCookieManager> GetDefaultCookieManager(
|
||||
virtual CefRefPtr<CefCookieManager> GetCookieManager(
|
||||
CefRefPtr<CefCompletionCallback> callback) = 0;
|
||||
|
||||
///
|
||||
|
@ -39,7 +39,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "include/cef_base.h"
|
||||
#include "include/cef_cookie.h"
|
||||
#include "include/cef_web_plugin.h"
|
||||
|
||||
class CefRequestContext;
|
||||
@ -62,14 +61,6 @@ class CefRequestContextHandler : public virtual CefBaseRefCounted {
|
||||
virtual void OnRequestContextInitialized(
|
||||
CefRefPtr<CefRequestContext> request_context) {}
|
||||
|
||||
///
|
||||
// Called on the browser process IO thread to retrieve the cookie manager. If
|
||||
// this method returns NULL the default cookie manager retrievable via
|
||||
// CefRequestContext::GetDefaultCookieManager() will be used.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual CefRefPtr<CefCookieManager> GetCookieManager() { return NULL; }
|
||||
|
||||
///
|
||||
// Called on multiple browser process threads before a plugin instance is
|
||||
// loaded. |mime_type| is the mime type of the plugin that will be loaded.
|
||||
|
Reference in New Issue
Block a user