| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_NET_SSL_CONFIG_SERVICE_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_NET_SSL_CONFIG_SERVICE_MANAGER_H_ |
| 6 #define CHROME_BROWSER_NET_SSL_CONFIG_SERVICE_MANAGER_H_ | 6 #define CHROME_BROWSER_NET_SSL_CONFIG_SERVICE_MANAGER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 namespace net { | 9 namespace net { |
| 10 class SSLConfigService; | 10 class SSLConfigService; |
| 11 } // namespace net | 11 } // namespace net |
| 12 | 12 |
| 13 class PrefService; | 13 class PrefService; |
| 14 | 14 |
| 15 // An interface for creating SSLConfigService objects for the current platform. | 15 // An interface for creating SSLConfigService objects for the current platform. |
| 16 class SSLConfigServiceManager { | 16 class SSLConfigServiceManager { |
| 17 public: | 17 public: |
| 18 // Create an instance of the default SSLConfigServiceManager for the current | 18 // Create an instance of the default SSLConfigServiceManager for the current |
| 19 // platform. The lifetime of the PrefService objects must be longer than that | 19 // platform. The lifetime of the PrefService objects must be longer than that |
| 20 // of the manager. On Linux, get SSL preferences from local_state object. If | 20 // of the manager. Get SSL preferences from local_state object. If SSL |
| 21 // SSL preferences don't exist in local_state object, then get the data from | 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 | 22 // user_prefs object and migrate it to local_state object and then delete the |
| 23 // data from user_prefs object. | 23 // data from user_prefs object. |
| 24 static SSLConfigServiceManager* CreateDefaultManager( | 24 static SSLConfigServiceManager* CreateDefaultManager( |
| 25 PrefService* user_prefs, | 25 PrefService* user_prefs, |
| 26 PrefService* local_state); | 26 PrefService* local_state); |
| 27 | 27 |
| 28 virtual ~SSLConfigServiceManager() {} | 28 virtual ~SSLConfigServiceManager() {} |
| 29 | 29 |
| 30 // Get an SSLConfigService instance. It may be a new instance or the manager | 30 // Get an SSLConfigService instance. It may be a new instance or the manager |
| 31 // may return the same instance multiple times. | 31 // may return the same instance multiple times. |
| 32 // The caller should hold a reference as long as it needs the instance (eg, | 32 // The caller should hold a reference as long as it needs the instance (eg, |
| 33 // using scoped_refptr.) | 33 // using scoped_refptr.) |
| 34 virtual net::SSLConfigService* Get() = 0; | 34 virtual net::SSLConfigService* Get() = 0; |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 #endif // CHROME_BROWSER_NET_SSL_CONFIG_SERVICE_MANAGER_H_ | 37 #endif // CHROME_BROWSER_NET_SSL_CONFIG_SERVICE_MANAGER_H_ |
| OLD | NEW |