Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2008 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 "base/nss_init.h" | 5 #include "base/nss_init.h" |
| 6 | 6 |
| 7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
| 8 #include <nss.h> | 8 #include <nss.h> |
| 9 #include <plarena.h> | 9 #include <plarena.h> |
| 10 #include <prerror.h> | 10 #include <prerror.h> |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 124 if (root_) { | 124 if (root_) { |
| 125 SECMOD_UnloadUserModule(root_); | 125 SECMOD_UnloadUserModule(root_); |
| 126 SECMOD_DestroyModule(root_); | 126 SECMOD_DestroyModule(root_); |
| 127 root_ = NULL; | 127 root_ = NULL; |
| 128 } | 128 } |
| 129 | 129 |
| 130 // Have to clear the cache, or NSS_Shutdown fails with SEC_ERROR_BUSY | 130 // Have to clear the cache, or NSS_Shutdown fails with SEC_ERROR_BUSY |
| 131 SSL_ClearSessionCache(); | 131 SSL_ClearSessionCache(); |
| 132 | 132 |
| 133 SECStatus status = NSS_Shutdown(); | 133 SECStatus status = NSS_Shutdown(); |
| 134 if (status != SECSuccess) | 134 if (status != SECSuccess) { |
| 135 LOG(ERROR) << "NSS_Shutdown failed, leak? See " | 135 // We LOG(INFO) because this failure is relatively harmless |
| 136 "http://code.google.com/p/chromium/issues/detail?id=4609"; | 136 // (leaking, but we're shutting down anyway). |
| 137 LOG(INFO) << "NSS_Shutdown failed; see " | |
| 138 "http://code.google.com/p/chromium/issues/detail?id=4609"; | |
| 139 } | |
| 137 | 140 |
| 138 PL_ArenaFinish(); | 141 PL_ArenaFinish(); |
| 139 | 142 |
| 140 PRStatus prstatus = PR_Cleanup(); | 143 PRStatus prstatus = PR_Cleanup(); |
| 141 if (prstatus != PR_SUCCESS) | 144 if (prstatus != PR_SUCCESS) { |
| 142 LOG(ERROR) << "PR_Cleanup failed?"; | 145 // We LOG(ERROR) here because this failure is bad: it indicates |
| 146 // a potential race. | |
|
wtc
2009/08/04 17:42:21
Nit: "a potential race" => "NSPR isn't initialized
| |
| 147 LOG(ERROR) << "PR_Cleanup failed; see " | |
| 148 "http://code.google.com/p/chromium/issues/detail?id=18410"; | |
| 149 } | |
| 143 } | 150 } |
| 144 | 151 |
| 145 private: | 152 private: |
| 146 SECMODModule *root_; | 153 SECMODModule *root_; |
| 147 }; | 154 }; |
| 148 | 155 |
| 149 } // namespace | 156 } // namespace |
| 150 | 157 |
| 151 namespace base { | 158 namespace base { |
| 152 | 159 |
| 153 void EnsureNSSInit() { | 160 void EnsureNSSInit() { |
| 154 Singleton<NSSInitSingleton>::get(); | 161 Singleton<NSSInitSingleton>::get(); |
| 155 } | 162 } |
| 156 | 163 |
| 157 } // namespace base | 164 } // namespace base |
| OLD | NEW |