| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "chrome/browser/chromeos/options/cert_library.h" | 5 #include "chrome/browser/chromeos/options/cert_library.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/i18n/string_compare.h" | 10 #include "base/i18n/string_compare.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 // static | 106 // static |
| 107 void CertLibrary::Shutdown() { | 107 void CertLibrary::Shutdown() { |
| 108 CHECK(g_cert_library); | 108 CHECK(g_cert_library); |
| 109 delete g_cert_library; | 109 delete g_cert_library; |
| 110 g_cert_library = NULL; | 110 g_cert_library = NULL; |
| 111 } | 111 } |
| 112 | 112 |
| 113 // static | 113 // static |
| 114 CertLibrary* CertLibrary::Get() { | 114 CertLibrary* CertLibrary::Get() { |
| 115 CHECK(g_cert_library) << "CertLibrary::Get() called before Initialize()"; | 115 // CertLibrary::Get() called before Initialize() |
| 116 CHECK(g_cert_library); |
| 116 return g_cert_library; | 117 return g_cert_library; |
| 117 } | 118 } |
| 118 | 119 |
| 119 // static | 120 // static |
| 120 bool CertLibrary::IsInitialized() { | 121 bool CertLibrary::IsInitialized() { |
| 121 return g_cert_library; | 122 return g_cert_library; |
| 122 } | 123 } |
| 123 | 124 |
| 124 CertLibrary::CertLibrary() { | 125 CertLibrary::CertLibrary() { |
| 125 CertLoader::Get()->AddObserver(this); | 126 CertLoader::Get()->AddObserver(this); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 return user_certs_; | 269 return user_certs_; |
| 269 if (type == CERT_TYPE_SERVER) | 270 if (type == CERT_TYPE_SERVER) |
| 270 return server_certs_; | 271 return server_certs_; |
| 271 if (type == CERT_TYPE_SERVER_CA) | 272 if (type == CERT_TYPE_SERVER_CA) |
| 272 return server_ca_certs_; | 273 return server_ca_certs_; |
| 273 DCHECK(type == CERT_TYPE_DEFAULT); | 274 DCHECK(type == CERT_TYPE_DEFAULT); |
| 274 return certs_; | 275 return certs_; |
| 275 } | 276 } |
| 276 | 277 |
| 277 } // namespace chromeos | 278 } // namespace chromeos |
| OLD | NEW |