Name Description Size
Cookie.cpp Cookie: creation helper **************************************************************************** 6809
Cookie.h The Cookie class is the main cookie storage medium for use within cookie code. 4954
CookieCommons.cpp 16177
CookieCommons.h 4183
CookieJarSettings.cpp 15170
CookieJarSettings.h CookieJarSettings ~~~~~~~~~~~~~~ CookieJarSettings is a snapshot of the cookie jar's configurations in a precise moment of time, such as the cookie policy and cookie permissions. This object is used by top-level documents to have a consistent cookie jar configuration also in case the user changes it. New configurations will apply only to new top-level documents. CookieJarSettings creation ~~~~~~~~~~~~~~~~~~~~~~~ CookieJarSettings is created when the top-level document's nsIChannel's nsILoadInfo is constructed. Any sub-resource and any sub-document inherits it from that nsILoadInfo. Also dedicated workers and their resources inherit it from the parent document. SharedWorkers and ServiceWorkers have their own CookieJarSettings because they don't have a single parent document (SharedWorkers could have more than one, ServiceWorkers have none). In Chrome code, we have a new CookieJarSettings when we download resources via 'Save-as...' and we also have a new CookieJarSettings for favicon downloading. Content-scripts WebExtensions also have their own CookieJarSettings because they don't have a direct access to the document they are running into. Anything else will have a special CookieJarSettings which blocks everything (CookieJarSettings::GetBlockingAll()) by forcing BEHAVIOR_REJECT as policy. When this happens, that context will not have access to the cookie jar and no cookies are sent or received. Propagation of CookieJarSettings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CookieJarSettings are shared inside the same top-level document via its nsIChannel's nsILoadInfo. This is done automatically if you pass a nsINode to NS_NewChannel(), and it must be done manually if you use a different channel constructor. For instance, this happens for any worker networking operation. We use the same CookieJarSettings for any resource belonging to the top-level document even if cross-origin. This makes the browser behave consistently a scenario where A loads B which loads A again, and cookie policy/permission changes in the meantime. Cookie Permissions propagation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CookieJarSettings populates the known cookie permissions only when required. Initially the list is empty, but when CookieJarSettings::CookiePermission() is called, the requested permission is stored in the internal list if it doesn't exist yet. This is actually nice because it relies on the permission propagation from parent to content process. No extra IPC is required. Note that we store permissions with UNKNOWN_ACTION values too because they can be set after the loading of the top-level document and we don't want to return a different value when this happens. Use of CookieJarSettings ~~~~~~~~~~~~~~~~~~~~~ In theory, there should not be direct access to cookie permissions or cookieBehavior pref. Everything should pass through CookieJarSettings. A reference to CookieJarSettings can be obtained from nsILoadInfo::GetCookieJarSettings(), from Document::CookieJarSettings() and from the WorkerPrivate::CookieJarSettings(). CookieJarSettings is thread-safe, but the permission list must be touched only on the main-thread. Testing ~~~~~~~ If you need to test the changing of cookie policy or a cookie permission, you need to workaround CookieJarSettings. This can be done opening a new window and running the test into that new global. 6815
CookieKey.h 1776
CookieLogging.cpp 5425
CookieLogging.h 1707
CookiePersistentStorage.cpp 75356
CookiePersistentStorage.h 4991
CookiePrivateStorage.cpp 1447
CookiePrivateStorage.h 1540
CookieService.cpp CookieService impl: useful types & constants **************************************************************************** 76707
CookieService.h CookieService: class declaration **************************************************************************** 6846
CookieServiceChild.cpp 19046
CookieServiceChild.h 2710
CookieServiceParent.cpp 6942
CookieServiceParent.h 2262
CookieStorage.cpp 30159
CookieStorage.h 6774
CookieXPCShellUtils.jsm -*- Mode: indent-tabs-mode: nil; js-indent-level: 2 -*- 1210
PCookieService.ipdl PCookieService Provides IPDL methods for setting and getting cookies. These are stored on and managed by the parent; the child process goes through the parent for all cookie operations. Lower-level programmatic operations (i.e. those provided by the nsICookieManager interface) are not currently implemented and requesting these interfaces in the child will fail. @see nsICookieService @see nsICookiePermission 2321
moz.build 1722
nsICookie.idl Main cookie object interface. 3536
nsICookieJarSettings.idl Cookie jar settings for top-level documents. Please see CookieJarSettings.h for more details. 1894
nsICookieManager.idl An optional interface for accessing or removing the cookies that are in the cookie list 9395
nsICookiePermission.idl An interface to test for cookie permissions 1102
nsICookieService.idl @see nsICookieService::runInTransaction 7269
test 3