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_NET_SSL_CONFIG_SERVICE_MANAGER_H_ 6 #define CHROME_BROWSER_NET_SSL_CONFIG_SERVICE_MANAGER_H_ 7 #pragma once 8 9 namespace net { 10 class SSLConfigService; 11 } // namespace net 12 13 class PrefService; 14 15 // An interface for creating SSLConfigService objects for the current platform. 16 class SSLConfigServiceManager { 17 public: 18 // Create an instance of the default SSLConfigServiceManager for the current 19 // platform. The lifetime of the PrefService objects must be longer than that 20 // of the manager. Get SSL preferences from local_state object. If SSL 21 // preferences don't exist in local_state object, then get the data from 22 // user_prefs object and migrate it to local_state object and then delete the 23 // data from user_prefs object. 24 static SSLConfigServiceManager* CreateDefaultManager( 25 PrefService* user_prefs, 26 PrefService* local_state); 27 28 virtual ~SSLConfigServiceManager() {} 29 30 // Get an SSLConfigService instance. It may be a new instance or the manager 31 // may return the same instance multiple times. 32 // The caller should hold a reference as long as it needs the instance (eg, 33 // using scoped_refptr.) 34 virtual net::SSLConfigService* Get() = 0; 35 }; 36 37 #endif // CHROME_BROWSER_NET_SSL_CONFIG_SERVICE_MANAGER_H_ 38