On Thu, Jan 15, 2009 at 3:06 PM, Brett Wilson <bre...@chromium.org> wrote:
> > On Thu, Jan 15, 2009 at 2:06 PM, Erik Kay <erik...@chromium.org> wrote: > > The issue is one of maintenance. A lot happens at startup. As people > > make changes, it's not necessarily obvious where to insert your > > initialization code. Depending on your dependencies, your new service > > may require a complex re-ordering of initialization. If we actually > > explicitly express dependencies and automatically manage them, then we > > can be precise about it. > > I'm still a bit skeptical of how complex these dependencies are. Can > somebody give an example of such a service that required complex > interdependencies on startup and required very specific ordering? see browser_main.cc at line 164 : -=-=-=-=-=-= // Start tracking the creation and deletion of Task instance. // This construction MUST be done before main_message_loop, so that it is // destroyed after the main_message_loop. tracked_objects::AutoTracking tracking_objects; MessageLoop main_message_loop(MessageLoop::TYPE_UI); -=-=-=-=-=-= If we move main_message_loop above tracking_objects, when the function ends and all the local objects are deleted, tracking objects will be deleted first and that will caused a crash in the destructor of MessageLoop. Nicolas > > > Brett > > > > --~--~---------~--~----~------------~-------~--~----~ Chromium Developers mailing list: chromium-dev@googlegroups.com View archives, change email options, or unsubscribe: http://groups.google.com/group/chromium-dev -~----------~----~----~----~------~----~------~--~---