The BrowserAddedForProfileObserver class implemented in //chrome/browser/profiles/profile_window.cc|h is used to run a callback when a browser window is opened for a given profile. There are two possible improvements to this class:
1/ Change the type of the |callback| ctor argument from ProfileManager::CreateCallback to OnceCallback since it will only be called once.
2/ BrowserAddedForProfileObserver deletes itself after performing its function. Howeever, if the class is not properly used it may leak. That is, if a browser window is never opened for the given profile, the callback is never invoked and the object does not delete itself.
Comment 1 by msarda@google.com
, Dec 20Status: Assigned (was: Untriaged)