@@ -102,10 +102,39 @@ public ColorType clone() {
102102 * The location where cache data will be stored on disk. If empty an in-memory
103103 * cache will be used for some features and a temporary disk cache for others.
104104 * HTML5 databases such as localStorage will only persist across sessions if a
105- * cache path is specified.
105+ * cache path is specified. If this is set and root_cache_path is also set, the cache_path
106+ * directory must reside within root_cache_path.
106107 */
107108 public String cache_path = null ;
108109
110+ /**
111+ * The root directory for installation-specific data and the parent directory
112+ * for profile-specific data. All CefSettings.cache_path and
113+ * CefRequestContextSettings.cache_path values must have this parent
114+ * directory in common. If this value is empty and CefSettings.cache_path is
115+ * non-empty then it will default to the CefSettings.cache_path value. Any
116+ * non-empty value must be an absolute path. If both values are empty then
117+ * the default platform-specific directory will be used
118+ * ("~/.config/cef_user_data" directory on Linux, "~/Library/Application
119+ * Support/CEF/User Data" directory on MacOS, "AppData\Local\CEF\User Data"
120+ * directory under the user profile directory on Windows). Use of the default
121+ * directory is not recommended in production applications (see below).
122+ *
123+ * Multiple application instances writing to the same root_cache_path
124+ * directory could result in data corruption. A process singleton lock based
125+ * on the root_cache_path value is therefore used to protect against this.
126+ * This singleton behavior applies to all CEF-based applications using
127+ * version 120 or newer. You should customize root_cache_path for your
128+ * application and implement CefAppHandler::
129+ * onAlreadyRunningAppRelaunch, which will then be called on any app relaunch
130+ * with the same root_cache_path value.
131+ *
132+ * Failure to set the root_cache_path value correctly may result in startup
133+ * crashes or other unexpected behaviors (for example, the sandbox blocking
134+ * read/write access to certain files).
135+ */
136+ public String root_cache_path = null ;
137+
109138 /**
110139 * To persist session cookies (cookies without an expiry date or validity
111140 * interval) by default when using the global cookie manager set this value to
@@ -239,6 +268,7 @@ public CefSettings clone() {
239268 tmp .windowless_rendering_enabled = windowless_rendering_enabled ;
240269 tmp .command_line_args_disabled = command_line_args_disabled ;
241270 tmp .cache_path = cache_path ;
271+ tmp .root_cache_path = root_cache_path ;
242272 tmp .persist_session_cookies = persist_session_cookies ;
243273 tmp .user_agent = user_agent ;
244274 tmp .user_agent_product = user_agent_product ;
0 commit comments