1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/profile/public/notifications.txt Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,61 @@ 1.4 +This Source Code Form is subject to the terms of the Mozilla Public 1.5 +License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 +file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.7 + 1.8 +nsIObserver topics for profile changing. Profile changing happens in phases 1.9 +in the order given below. An observer may register separately for each phase 1.10 +of the process depending on its needs. 1.11 + 1.12 +"profile-change-teardown" 1.13 + All async activity must be stopped in this phase. Typically, 1.14 + the application level observer will close all open windows. 1.15 + This is the last phase in which the subject's vetoChange() 1.16 + method may still be called. 1.17 + The next notification will be either 1.18 + profile-change-teardown-veto or profile-before-change. 1.19 + 1.20 +"profile-before-change" 1.21 + Called before the profile has changed. Use this notification 1.22 + to prepare for the profile going away. If a component is 1.23 + holding any state which needs to be flushed to a profile-relative 1.24 + location, it should be done here. 1.25 + 1.26 +"profile-do-change" 1.27 + Called after the profile has changed. Do the work to 1.28 + respond to having a new profile. Any change which 1.29 + affects others must be done in this phase. 1.30 + 1.31 +"profile-after-change" 1.32 + Called after the profile has changed. Use this notification 1.33 + to make changes that are dependent on what some other listener 1.34 + did during its profile-do-change. For example, to respond to 1.35 + new preferences. 1.36 + 1.37 +"profile-initial-state" 1.38 + Called after all phases of a change have completed. Typically 1.39 + in this phase, an application level observer will open a new window. 1.40 + 1.41 +Contexts for profile changes. These are passed as the someData param to the 1.42 +observer's Observe() method. 1.43 + 1.44 +"startup" 1.45 + Going from no profile to a profile. 1.46 + The following topics happen in this context: 1.47 + profile-do-change 1.48 + profile-after-change 1.49 + 1.50 +"shutdown-persist" 1.51 + The user is logging out and whatever data the observer stores 1.52 + for the current profile should be released from memory and 1.53 + saved to disk. 1.54 + The following topics happen in this context: 1.55 + profile-change-net-teardown 1.56 + profile-change-teardown 1.57 + profile-before-change 1.58 + 1.59 +See https://wiki.mozilla.org/XPCOM_Shutdown for more details about the shutdown 1.60 +process. 1.61 + 1.62 +NOTE: Long ago there was be a "shutdown-cleanse" version of shutdown which was 1.63 +intended to clear profile data. This is no longer sent and observer code should 1.64 +remove support for it.