Skip to content

Commit fb7db9c

Browse files
committed
Doc - Update CefSettings.CachePath and RootCachePath xml doc
Resolves #4925
1 parent 606d9df commit fb7db9c

File tree

4 files changed

+66
-41
lines changed

4 files changed

+66
-41
lines changed

CefSharp.Core.Runtime/CefSettingsBase.h

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -145,13 +145,22 @@ namespace CefSharp
145145
}
146146

147147
/// <summary>
148-
/// The root directory that all CefSettings.CachePath and RequestContextSettings.CachePath values must have in common. If this
149-
/// value is empty and CefSettings.CachePath is non-empty then it will default to the CefSettings.CachePath value.
150-
/// If this value is non-empty then it must be an absolute path. Failure to set this value correctly may result in the sandbox
151-
/// blocking read/write access to the CachePath directory. NOTE: CefSharp does not implement the CHROMIUM SANDBOX. A non-empty
152-
/// RootCachePath can be used in conjuncation with an empty CefSettings.CachePath in instances where you would like browsers
153-
/// attached to the Global RequestContext (the default) created in "incognito mode" and instances created with a custom
154-
/// RequestContext using a disk based cache.
148+
/// The root directory for installation-specific data and the parent directory for profile-specific data.
149+
/// All CachePath and RequestContextSettings.CachePath" values must have this parent directory
150+
/// in common. If this value is empty and <see cref="CachePath"> is non-empty then it will default to the
151+
/// CachePath value. Any non-empty value must be an absolute path. If both values are empty then
152+
/// the default platform-specific directory will be used ("AppData\Local\CEF\User Data" directory under the user
153+
/// profile directory on Windows).
154+
///
155+
/// **Use of the default directory is not recommended in production applications(see below).**
156+
///
157+
/// Multiple application instances writing to the same RootCachePath directory could result in data corruption.
158+
/// A process singleton lock based on the RootCachePath value is therefore used to protect against this.
159+
/// This singleton behavior applies to all CEF-based applications using version 120 or newer.
160+
/// You should customize RootCachePath for your application and implement IBrowserProcessHandler.OnAlreadyRunningAppRelaunch,
161+
/// which will then be called on any app relaunch with the same RootCachePath value.
162+
///
163+
/// Failure to set the RootCachePath value correctly may result in startup crashes or other unexpected behaviors
155164
/// </summary>
156165
property String^ RootCachePath
157166
{
@@ -277,11 +286,15 @@ namespace CefSharp
277286
}
278287

279288
/// <summary>
280-
/// To persist session cookies (cookies without an expiry date or validity interval) by default when using the global cookie
281-
/// manager set this value to true. Session cookies are generally intended to be transient and most Web browsers do not persist
282-
/// them. A CachePath value must also be specified to enable this feature. Also configurable using the "persist-session-cookies"
283-
/// command-line switch. Can be overridden for individual RequestContext instances via the
284-
/// RequestContextSettings.PersistSessionCookies value.
289+
/// The directory where data for the global browser cache will be stored on disk.
290+
/// If this value is non-empty then it must be an absolute path that is either equal to or a child directory
291+
/// of RootCachePath. If this value is empty then browsers will be created in "incognito mode"
292+
/// where in-memory caches are used for storage and no profile-specific data is persisted to disk
293+
/// (installation-specific data will still be persisted in RootCachePath). HTML5 databases
294+
/// such as localStorage will only persist across sessions if a cache path is specified.
295+
/// Can be overridden for individual RequestContext instances via the RequestContextSettings.CachePath value.
296+
/// Any child directory value will be ignored and the "default" profile (also a child directory) will be used
297+
/// instead.
285298
/// </summary>
286299
property bool PersistSessionCookies
287300
{

CefSharp.Core.Runtime/RequestContextSettings.h

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,13 @@ namespace CefSharp
5959
}
6060

6161
/// <summary>
62-
/// The location where cache data for this request context will be stored on
63-
/// disk. If this value is non-empty then it must be an absolute path that is
64-
/// either equal to or a child directory of CefSettings.RootCachePath.
65-
/// If the value is empty then browsers will be created in "incognito mode"
66-
/// where in-memory caches are used for storage and no data is persisted to disk.
67-
/// HTML5 databases such as localStorage will only persist across sessions if a
68-
/// cache path is specified. To share the global browser cache and related
69-
/// configuration set this value to match the CefSettings.CachePath value.
62+
/// The directory where cache data for this request context will be stored on disk.
63+
/// If this value is non - empty then it must be an absolute path that is either equal to or a
64+
/// child directory of CefSettings.RootCachePath.If this value is empty then browsers will be
65+
/// created in "incognito mode" where in - memory caches are used for storage and no profile -
66+
/// specific data is persisted to disk(installation - specific data will still be persisted in RootCachePath).
67+
/// HTML5 databases such as localStorage will only persist across sessions if a cache path is specified.
68+
/// To share the global browser cache and related configuration set this value to match the CefSettings.CachePath value.
7069
/// </summary>
7170
property String^ CachePath
7271
{

CefSharp.Core/CefSettingsBase.cs

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,15 @@ public string BrowserSubprocessPath
116116
}
117117

118118
/// <summary>
119-
/// The location where data for the global browser cache will be stored on disk. In this value is non-empty then it must be
120-
/// an absolute path that is must be either equal to or a child directory of CefSettings.RootCachePath (if RootCachePath is
121-
/// empty it will default to this value). If the value is empty then browsers will be created in "incognito mode" where
122-
/// in-memory caches are used for storage and no data is persisted to disk. HTML5 databases such as localStorage will only
123-
/// persist across sessions if a cache path is specified. Can be overridden for individual RequestContext instances via the
124-
/// RequestContextSettings.CachePath value.
119+
/// The directory where data for the global browser cache will be stored on disk.
120+
/// If this value is non-empty then it must be an absolute path that is either equal to or a child directory
121+
/// of <see cref="RootCachePath"/>. If this value is empty then browsers will be created in "incognito mode"
122+
/// where in-memory caches are used for storage and no profile-specific data is persisted to disk
123+
/// (installation-specific data will still be persisted in <see cref="RootCachePath"/>). HTML5 databases
124+
/// such as localStorage will only persist across sessions if a cache path is specified.
125+
/// Can be overridden for individual RequestContext instances via the <see cref="RequestContextSettings.CachePath"/> value.
126+
/// Any child directory value will be ignored and the "default" profile (also a child directory) will be used
127+
/// instead.
125128
/// </summary>
126129
public string CachePath
127130
{
@@ -130,13 +133,22 @@ public string CachePath
130133
}
131134

132135
/// <summary>
133-
/// The root directory that all CefSettings.CachePath and RequestContextSettings.CachePath values must have in common. If this
134-
/// value is empty and CefSettings.CachePath is non-empty then it will default to the CefSettings.CachePath value.
135-
/// If this value is non-empty then it must be an absolute path. Failure to set this value correctly may result in the sandbox
136-
/// blocking read/write access to the CachePath directory. NOTE: CefSharp does not implement the CHROMIUM SANDBOX. A non-empty
137-
/// RootCachePath can be used in conjuncation with an empty CefSettings.CachePath in instances where you would like browsers
138-
/// attached to the Global RequestContext (the default) created in "incognito mode" and instances created with a custom
139-
/// RequestContext using a disk based cache.
136+
/// The root directory for installation-specific data and the parent directory for profile-specific data.
137+
/// All <see cref="CachePath"> and <see cref="RequestContextSettings.CachePath"/> values must have this parent directory
138+
/// in common. If this value is empty and <see cref="CachePath"> is non-empty then it will default to the
139+
/// <see cref="CachePath"> value. Any non-empty value must be an absolute path. If both values are empty then
140+
/// the default platform-specific directory will be used ("AppData\Local\CEF\User Data" directory under the user
141+
/// profile directory on Windows).
142+
///
143+
/// **Use of the default directory is not recommended in production applications(see below).**
144+
///
145+
/// Multiple application instances writing to the same RootCachePath directory could result in data corruption.
146+
/// A process singleton lock based on the RootCachePath value is therefore used to protect against this.
147+
/// This singleton behavior applies to all CEF-based applications using version 120 or newer.
148+
/// You should customize RootCachePath for your application and implement <see cref="IBrowserProcessHandler.OnAlreadyRunningAppRelaunch"/>,
149+
/// which will then be called on any app relaunch with the same RootCachePath value.
150+
///
151+
/// Failure to set the RootCachePath value correctly may result in startup crashes or other unexpected behaviors
140152
/// </summary>
141153
public string RootCachePath
142154
{

CefSharp.Core/RequestContextSettings.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@ public bool PersistSessionCookies
3030
}
3131

3232
/// <summary>
33-
/// The location where cache data for this request context will be stored on
34-
/// disk. If this value is non-empty then it must be an absolute path that is
35-
/// either equal to or a child directory of CefSettings.RootCachePath.
36-
/// If the value is empty then browsers will be created in "incognito mode"
37-
/// where in-memory caches are used for storage and no data is persisted to disk.
38-
/// HTML5 databases such as localStorage will only persist across sessions if a
39-
/// cache path is specified. To share the global browser cache and related
40-
/// configuration set this value to match the CefSettings.CachePath value.
33+
/// The directory where cache data for this request context will be stored on disk.
34+
/// If this value is non - empty then it must be an absolute path that is either equal to or a
35+
/// child directory of <see cref="CefSettingsBase.RootCachePath"/>.
36+
/// If this value is empty then browsers will be created in "incognito mode" where in - memory
37+
/// caches are used for storage and no profile - specific data is persisted to disk
38+
/// (installation - specific data will still be persisted in <see cref="CefSettingsBase.RootCachePath"/>).
39+
/// HTML5 databases such as localStorage will only persist across sessions if a cache path is specified.
40+
/// To share the global browser cache and related configuration set this value to match the
41+
/// <see cref="CefSettingsBase.CachePath"/> value.
4142
/// </summary>
4243
public String CachePath
4344
{

0 commit comments

Comments
 (0)