OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/cert_store_impl.h" | 5 #include "content/browser/cert_store_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <functional> | 8 #include <functional> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 return false; | 114 return false; |
115 if (cert) | 115 if (cert) |
116 *cert = iter->second; | 116 *cert = iter->second; |
117 return true; | 117 return true; |
118 } | 118 } |
119 | 119 |
120 void CertStoreImpl::RemoveCertInternal(int cert_id) { | 120 void CertStoreImpl::RemoveCertInternal(int cert_id) { |
121 CertMap::iterator cert_iter = id_to_cert_.find(cert_id); | 121 CertMap::iterator cert_iter = id_to_cert_.find(cert_id); |
122 DCHECK(cert_iter != id_to_cert_.end()); | 122 DCHECK(cert_iter != id_to_cert_.end()); |
123 | 123 |
124 ReverseCertMap::iterator id_iter = cert_to_id_.find(cert_iter->second); | 124 ReverseCertMap::iterator id_iter = cert_to_id_.find(cert_iter->second.get()); |
125 DCHECK(id_iter != cert_to_id_.end()); | 125 DCHECK(id_iter != cert_to_id_.end()); |
126 cert_to_id_.erase(id_iter); | 126 cert_to_id_.erase(id_iter); |
127 | 127 |
128 cert_iter->second->Release(); | 128 cert_iter->second->Release(); |
129 id_to_cert_.erase(cert_iter); | 129 id_to_cert_.erase(cert_iter); |
130 } | 130 } |
131 | 131 |
132 void CertStoreImpl::RemoveCertsForRenderProcesHost(int process_id) { | 132 void CertStoreImpl::RemoveCertsForRenderProcesHost(int process_id) { |
133 base::AutoLock auto_lock(cert_lock_); | 133 base::AutoLock auto_lock(cert_lock_); |
134 | 134 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 const NotificationSource& source, | 173 const NotificationSource& source, |
174 const NotificationDetails& details) { | 174 const NotificationDetails& details) { |
175 DCHECK(type == NOTIFICATION_RENDERER_PROCESS_TERMINATED || | 175 DCHECK(type == NOTIFICATION_RENDERER_PROCESS_TERMINATED || |
176 type == NOTIFICATION_RENDERER_PROCESS_CLOSED); | 176 type == NOTIFICATION_RENDERER_PROCESS_CLOSED); |
177 RenderProcessHost* rph = Source<RenderProcessHost>(source).ptr(); | 177 RenderProcessHost* rph = Source<RenderProcessHost>(source).ptr(); |
178 DCHECK(rph); | 178 DCHECK(rph); |
179 RemoveCertsForRenderProcesHost(rph->GetID()); | 179 RemoveCertsForRenderProcesHost(rph->GetID()); |
180 } | 180 } |
181 | 181 |
182 } // namespace content | 182 } // namespace content |
OLD | NEW |