Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ssl/ssl_error_handler.h" | 5 #include "content/browser/ssl/ssl_error_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "content/browser/renderer_host/render_view_host.h" | 8 #include "content/browser/renderer_host/render_view_host.h" |
| 9 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 9 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
| 10 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" | 10 #include "content/browser/renderer_host/resource_dispatcher_host_request_info.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 128 | 128 |
| 129 // It is important that we notify the net::URLRequest only once. If we try | 129 // It is important that we notify the net::URLRequest only once. If we try |
| 130 // to notify the request twice, it may no longer exist and |this| might have | 130 // to notify the request twice, it may no longer exist and |this| might have |
| 131 // already have been deleted. | 131 // already have been deleted. |
| 132 DCHECK(!request_has_been_notified_); | 132 DCHECK(!request_has_been_notified_); |
| 133 if (request_has_been_notified_) | 133 if (request_has_been_notified_) |
| 134 return; | 134 return; |
| 135 | 135 |
| 136 net::URLRequest* request = | 136 net::URLRequest* request = |
| 137 resource_dispatcher_host_->GetURLRequest(request_id_); | 137 resource_dispatcher_host_->GetURLRequest(request_id_); |
| 138 if (request) { | 138 if (request && request->is_pending()) { |
|
darin (slow to review)
2012/02/27 19:26:25
oh, hmm...
have you considered cancelling the req
tpayne
2012/02/27 19:30:51
I haven't seen any instances where the request had
wtc
2012/02/28 20:02:12
tpayne: do you know why the request may be not pen
tpayne
2012/02/28 21:53:58
The state that is causing the flakiness is request
tpayne
2012/02/29 01:15:11
The original cancel is occurring with this stack:
tpayne
2012/02/29 01:58:24
One more level up, it turns out that NavigateToPen
| |
| 139 // The request can be NULL if it was cancelled by the renderer (as the | 139 // The request can be NULL if it was cancelled by the renderer (as the |
| 140 // result of the user navigating to a new page from the location bar). | 140 // result of the user navigating to a new page from the location bar). |
| 141 DVLOG(1) << "CompleteCancelRequest() url: " << request->url().spec(); | 141 DVLOG(1) << "CompleteCancelRequest() url: " << request->url().spec(); |
| 142 SSLCertErrorHandler* cert_error = AsSSLCertErrorHandler(); | 142 SSLCertErrorHandler* cert_error = AsSSLCertErrorHandler(); |
| 143 if (cert_error) | 143 if (cert_error) |
| 144 request->SimulateSSLError(error, cert_error->ssl_info()); | 144 request->SimulateSSLError(error, cert_error->ssl_info()); |
| 145 else | 145 else |
| 146 request->SimulateError(error); | 146 request->SimulateError(error); |
| 147 } | 147 } |
| 148 request_has_been_notified_ = true; | 148 request_has_been_notified_ = true; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 183 // already have been deleted. | 183 // already have been deleted. |
| 184 DCHECK(!request_has_been_notified_); | 184 DCHECK(!request_has_been_notified_); |
| 185 if (request_has_been_notified_) | 185 if (request_has_been_notified_) |
| 186 return; | 186 return; |
| 187 | 187 |
| 188 request_has_been_notified_ = true; | 188 request_has_been_notified_ = true; |
| 189 | 189 |
| 190 // We're done with this object on the IO thread. | 190 // We're done with this object on the IO thread. |
| 191 Release(); | 191 Release(); |
| 192 } | 192 } |
| OLD | NEW |