| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 DCHECK(!defer); // Since !has_started_response_. | 141 DCHECK(!defer); // Since !has_started_response_. |
| 142 } | 142 } |
| 143 | 143 |
| 144 // We have to buffer the call until after the transition completes. | 144 // We have to buffer the call until after the transition completes. |
| 145 completed_during_transition_ = true; | 145 completed_during_transition_ = true; |
| 146 completed_status_ = status; | 146 completed_status_ = status; |
| 147 completed_security_info_ = security_info; | 147 completed_security_info_ = security_info; |
| 148 | 148 |
| 149 // Return false to tell RDH not to notify the world or clean up the | 149 // Return false to tell RDH not to notify the world or clean up the |
| 150 // pending request. We will do so in ResumeResponse. | 150 // pending request. We will do so in ResumeResponse. |
| 151 did_defer_ = true; |
| 151 return false; | 152 return false; |
| 152 } | 153 } |
| 153 | 154 |
| 154 // We can now send the response to the new renderer, which will cause | 155 // We can now send the response to the new renderer, which will cause |
| 155 // WebContentsImpl to swap in the new renderer and destroy the old one. | 156 // WebContentsImpl to swap in the new renderer and destroy the old one. |
| 156 void CrossSiteResourceHandler::ResumeResponse() { | 157 void CrossSiteResourceHandler::ResumeResponse() { |
| 157 DCHECK(request_id_ != -1); | 158 DCHECK(request_id_ != -1); |
| 158 DCHECK(in_cross_site_transition_); | 159 DCHECK(in_cross_site_transition_); |
| 159 in_cross_site_transition_ = false; | 160 in_cross_site_transition_ = false; |
| 160 | 161 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 } | 243 } |
| 243 | 244 |
| 244 void CrossSiteResourceHandler::ResumeIfDeferred() { | 245 void CrossSiteResourceHandler::ResumeIfDeferred() { |
| 245 if (did_defer_) { | 246 if (did_defer_) { |
| 246 did_defer_ = false; | 247 did_defer_ = false; |
| 247 controller()->Resume(); | 248 controller()->Resume(); |
| 248 } | 249 } |
| 249 } | 250 } |
| 250 | 251 |
| 251 } // namespace content | 252 } // namespace content |
| OLD | NEW |