1// Copyright (c) 2011 The Chromium Authors. All rights reserved. 2// Use of this source code is governed by a BSD-style license that can be 3// found in the LICENSE file. 4 5#ifndef CHROME_BROWSER_PROFILES_PROFILE_KEYED_SERVICE_H_ 6#define CHROME_BROWSER_PROFILES_PROFILE_KEYED_SERVICE_H_ 7 8// Base class for all ProfileKeyedServices to allow for correct destruction 9// order. 10// 11// Many services that hang off Profile have a two-pass shutdown. Many 12// subsystems need a first pass shutdown phase where they drop references. Not 13// all services will need this, so there's a default implementation. Only once 14// every system has been given a chance to drop references do we start deleting 15// objects. 16class ProfileKeyedService { 17 public: 18 // The first pass is to call Shutdown on a ProfileKeyedService. 19 virtual void Shutdown() {} 20 21 // The second pass is the actual deletion of each object. 22 virtual ~ProfileKeyedService() {} 23}; 24 25#endif // CHROME_BROWSER_PROFILES_PROFILE_KEYED_SERVICE_H_ 26 27