| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "content/browser/renderer_host/cross_site_resource_handler.h" | 7 #include "content/browser/renderer_host/cross_site_resource_handler.h" |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 StartCrossSiteTransition(request_id, NULL); | 132 StartCrossSiteTransition(request_id, NULL); |
| 133 } | 133 } |
| 134 | 134 |
| 135 // We have to buffer the call until after the transition completes. | 135 // We have to buffer the call until after the transition completes. |
| 136 completed_during_transition_ = true; | 136 completed_during_transition_ = true; |
| 137 completed_status_ = status; | 137 completed_status_ = status; |
| 138 completed_security_info_ = security_info; | 138 completed_security_info_ = security_info; |
| 139 | 139 |
| 140 // Return false to tell RDH not to notify the world or clean up the | 140 // Return false to tell RDH not to notify the world or clean up the |
| 141 // pending request. We will do so in ResumeResponse. | 141 // pending request. We will do so in ResumeResponse. |
| 142 did_defer_ = true; |
| 142 return false; | 143 return false; |
| 143 } | 144 } |
| 144 | 145 |
| 145 // We can now send the response to the new renderer, which will cause | 146 // We can now send the response to the new renderer, which will cause |
| 146 // WebContentsImpl to swap in the new renderer and destroy the old one. | 147 // WebContentsImpl to swap in the new renderer and destroy the old one. |
| 147 void CrossSiteResourceHandler::ResumeResponse() { | 148 void CrossSiteResourceHandler::ResumeResponse() { |
| 148 DCHECK(request_id_ != -1); | 149 DCHECK(request_id_ != -1); |
| 149 DCHECK(in_cross_site_transition_); | 150 DCHECK(in_cross_site_transition_); |
| 150 in_cross_site_transition_ = false; | 151 in_cross_site_transition_ = false; |
| 151 | 152 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 } | 210 } |
| 210 | 211 |
| 211 void CrossSiteResourceHandler::ResumeIfDeferred() { | 212 void CrossSiteResourceHandler::ResumeIfDeferred() { |
| 212 if (did_defer_) { | 213 if (did_defer_) { |
| 213 did_defer_ = false; | 214 did_defer_ = false; |
| 214 controller()->Resume(); | 215 controller()->Resume(); |
| 215 } | 216 } |
| 216 } | 217 } |
| 217 | 218 |
| 218 } // namespace content | 219 } // namespace content |
| OLD | NEW |