| 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 "android_webview/browser/aw_login_delegate.h" | 5 #include "android_webview/browser/aw_login_delegate.h" |
| 6 | 6 |
| 7 #include "android_webview/browser/aw_browser_context.h" | 7 #include "android_webview/browser/aw_browser_context.h" |
| 8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/supports_user_data.h" | 10 #include "base/supports_user_data.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 58 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
| 59 base::Bind(&AwLoginDelegate::HandleHttpAuthRequestOnUIThread, | 59 base::Bind(&AwLoginDelegate::HandleHttpAuthRequestOnUIThread, |
| 60 this, (count->auth_attempts_ == 0))); | 60 this, (count->auth_attempts_ == 0))); |
| 61 count->auth_attempts_++; | 61 count->auth_attempts_++; |
| 62 } | 62 } |
| 63 | 63 |
| 64 AwLoginDelegate::~AwLoginDelegate() { | 64 AwLoginDelegate::~AwLoginDelegate() { |
| 65 // The Auth handler holds a ref count back on |this| object, so it should be | 65 // The Auth handler holds a ref count back on |this| object, so it should be |
| 66 // impossible to reach here while this object still owns an auth handler. | 66 // impossible to reach here while this object still owns an auth handler. |
| 67 DCHECK(aw_http_auth_handler_ == NULL); | 67 DCHECK(!aw_http_auth_handler_); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void AwLoginDelegate::Proceed(const base::string16& user, | 70 void AwLoginDelegate::Proceed(const base::string16& user, |
| 71 const base::string16& password) { | 71 const base::string16& password) { |
| 72 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 72 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 73 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 73 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
| 74 base::Bind(&AwLoginDelegate::ProceedOnIOThread, | 74 base::Bind(&AwLoginDelegate::ProceedOnIOThread, |
| 75 this, user, password)); | 75 this, user, password)); |
| 76 } | 76 } |
| 77 | 77 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 void AwLoginDelegate::DeleteAuthHandlerSoon() { | 128 void AwLoginDelegate::DeleteAuthHandlerSoon() { |
| 129 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { | 129 if (!BrowserThread::CurrentlyOn(BrowserThread::UI)) { |
| 130 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, | 130 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, |
| 131 base::Bind(&AwLoginDelegate::DeleteAuthHandlerSoon, this)); | 131 base::Bind(&AwLoginDelegate::DeleteAuthHandlerSoon, this)); |
| 132 return; | 132 return; |
| 133 } | 133 } |
| 134 aw_http_auth_handler_.reset(); | 134 aw_http_auth_handler_.reset(); |
| 135 } | 135 } |
| 136 | 136 |
| 137 } // namespace android_webview | 137 } // namespace android_webview |
| OLD | NEW |