| 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 "content/browser/web_contents/render_view_host_manager.h" | 5 #include "content/browser/web_contents/render_view_host_manager.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 | 234 |
| 235 void RenderViewHostManager::SetWebUIPostCommit(WebUIImpl* web_ui) { | 235 void RenderViewHostManager::SetWebUIPostCommit(WebUIImpl* web_ui) { |
| 236 DCHECK(!web_ui_.get()); | 236 DCHECK(!web_ui_.get()); |
| 237 web_ui_.reset(web_ui); | 237 web_ui_.reset(web_ui); |
| 238 } | 238 } |
| 239 | 239 |
| 240 void RenderViewHostManager::RendererAbortedProvisionalLoad( | 240 void RenderViewHostManager::RendererAbortedProvisionalLoad( |
| 241 RenderViewHost* render_view_host) { | 241 RenderViewHost* render_view_host) { |
| 242 // We used to cancel the pending renderer here for cross-site downloads. | 242 // We used to cancel the pending renderer here for cross-site downloads. |
| 243 // However, it's not safe to do that because the download logic repeatedly | 243 // However, it's not safe to do that because the download logic repeatedly |
| 244 // looks for this TabContents based on a render view ID. Instead, we just | 244 // looks for this WebContents based on a render view ID. Instead, we just |
| 245 // leave the pending renderer around until the next navigation event | 245 // leave the pending renderer around until the next navigation event |
| 246 // (Navigate, DidNavigate, etc), which will clean it up properly. | 246 // (Navigate, DidNavigate, etc), which will clean it up properly. |
| 247 // TODO(creis): All of this will go away when we move the cross-site logic | 247 // TODO(creis): All of this will go away when we move the cross-site logic |
| 248 // to ResourceDispatcherHost, so that we intercept responses rather than | 248 // to ResourceDispatcherHost, so that we intercept responses rather than |
| 249 // navigation events. (That's necessary to support onunload anyway.) Once | 249 // navigation events. (That's necessary to support onunload anyway.) Once |
| 250 // we've made that change, we won't create a pending renderer until we know | 250 // we've made that change, we won't create a pending renderer until we know |
| 251 // the response is not a download. | 251 // the response is not a download. |
| 252 } | 252 } |
| 253 | 253 |
| 254 void RenderViewHostManager::RendererProcessClosing( | 254 void RenderViewHostManager::RendererProcessClosing( |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 } | 838 } |
| 839 } | 839 } |
| 840 | 840 |
| 841 bool RenderViewHostManager::IsSwappedOut(RenderViewHost* rvh) { | 841 bool RenderViewHostManager::IsSwappedOut(RenderViewHost* rvh) { |
| 842 if (!rvh->GetSiteInstance()) | 842 if (!rvh->GetSiteInstance()) |
| 843 return false; | 843 return false; |
| 844 | 844 |
| 845 return swapped_out_hosts_.find(rvh->GetSiteInstance()->GetId()) != | 845 return swapped_out_hosts_.find(rvh->GetSiteInstance()->GetId()) != |
| 846 swapped_out_hosts_.end(); | 846 swapped_out_hosts_.end(); |
| 847 } | 847 } |
| OLD | NEW |