Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: chrome/browser/ssl/ssl_client_auth_observer.cc

Issue 1106593002: [chrome/browser/se*-ss*] favor DCHECK_CURRENTLY_ON for better logs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/spellchecker/spellcheck_service.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/ssl/ssl_client_auth_observer.h" 5 #include "chrome/browser/ssl/ssl_client_auth_observer.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 // Stop observing now that the delegate has been resolved. 60 // Stop observing now that the delegate has been resolved.
61 StopObserving(); 61 StopObserving();
62 delegate_.reset(); 62 delegate_.reset();
63 } 63 }
64 64
65 void SSLClientAuthObserver::Observe( 65 void SSLClientAuthObserver::Observe(
66 int type, 66 int type,
67 const content::NotificationSource& source, 67 const content::NotificationSource& source,
68 const content::NotificationDetails& details) { 68 const content::NotificationDetails& details) {
69 DVLOG(1) << "SSLClientAuthObserver::Observe " << this; 69 DVLOG(1) << "SSLClientAuthObserver::Observe " << this;
70 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 70 DCHECK_CURRENTLY_ON(BrowserThread::UI);
71 DCHECK(type == chrome::NOTIFICATION_SSL_CLIENT_AUTH_CERT_SELECTED); 71 DCHECK(type == chrome::NOTIFICATION_SSL_CLIENT_AUTH_CERT_SELECTED);
72 72
73 CertDetails* cert_details = content::Details<CertDetails>(details).ptr(); 73 CertDetails* cert_details = content::Details<CertDetails>(details).ptr();
74 if (!cert_details->first->host_and_port.Equals( 74 if (!cert_details->first->host_and_port.Equals(
75 cert_request_info_->host_and_port)) 75 cert_request_info_->host_and_port))
76 return; 76 return;
77 77
78 DVLOG(1) << this << " got matching notification and selecting cert " 78 DVLOG(1) << this << " got matching notification and selecting cert "
79 << cert_details->second; 79 << cert_details->second;
80 StopObserving(); 80 StopObserving();
81 delegate_->ContinueWithCertificate(cert_details->second); 81 delegate_->ContinueWithCertificate(cert_details->second);
82 delegate_.reset(); 82 delegate_.reset();
83 OnCertSelectedByNotification(); 83 OnCertSelectedByNotification();
84 } 84 }
85 85
86 void SSLClientAuthObserver::StartObserving() { 86 void SSLClientAuthObserver::StartObserving() {
87 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 87 DCHECK_CURRENTLY_ON(BrowserThread::UI);
88 notification_registrar_.Add( 88 notification_registrar_.Add(
89 this, chrome::NOTIFICATION_SSL_CLIENT_AUTH_CERT_SELECTED, 89 this, chrome::NOTIFICATION_SSL_CLIENT_AUTH_CERT_SELECTED,
90 content::Source<content::BrowserContext>(browser_context_)); 90 content::Source<content::BrowserContext>(browser_context_));
91 } 91 }
92 92
93 void SSLClientAuthObserver::StopObserving() { 93 void SSLClientAuthObserver::StopObserving() {
94 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 94 DCHECK_CURRENTLY_ON(BrowserThread::UI);
95 notification_registrar_.RemoveAll(); 95 notification_registrar_.RemoveAll();
96 } 96 }
OLDNEW
« no previous file with comments | « chrome/browser/spellchecker/spellcheck_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698