OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame_host/render_frame_host_manager.h" | 5 #include "content/browser/frame_host/render_frame_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/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 // Notify all swapped out hosts, including the pending RVH. | 395 // Notify all swapped out hosts, including the pending RVH. |
396 for (RenderFrameHostMap::iterator iter = swapped_out_hosts_.begin(); | 396 for (RenderFrameHostMap::iterator iter = swapped_out_hosts_.begin(); |
397 iter != swapped_out_hosts_.end(); | 397 iter != swapped_out_hosts_.end(); |
398 ++iter) { | 398 ++iter) { |
399 DCHECK_NE(iter->second->render_view_host()->GetSiteInstance(), | 399 DCHECK_NE(iter->second->render_view_host()->GetSiteInstance(), |
400 current_host()->GetSiteInstance()); | 400 current_host()->GetSiteInstance()); |
401 iter->second->render_view_host()->DisownOpener(); | 401 iter->second->render_view_host()->DisownOpener(); |
402 } | 402 } |
403 } | 403 } |
404 | 404 |
405 void RenderFrameHostManager::RendererAbortedProvisionalLoad( | |
406 RenderViewHost* render_view_host) { | |
407 // We used to cancel the pending renderer here for cross-site downloads. | |
408 // However, it's not safe to do that because the download logic repeatedly | |
409 // looks for this WebContents based on a render view ID. Instead, we just | |
410 // leave the pending renderer around until the next navigation event | |
411 // (Navigate, DidNavigate, etc), which will clean it up properly. | |
412 // TODO(creis): All of this will go away when we move the cross-site logic | |
413 // to ResourceDispatcherHost, so that we intercept responses rather than | |
414 // navigation events. (That's necessary to support onunload anyway.) Once | |
415 // we've made that change, we won't create a pending renderer until we know | |
416 // the response is not a download. | |
417 } | |
418 | |
419 void RenderFrameHostManager::RendererProcessClosing( | 405 void RenderFrameHostManager::RendererProcessClosing( |
420 RenderProcessHost* render_process_host) { | 406 RenderProcessHost* render_process_host) { |
421 // Remove any swapped out RVHs from this process, so that we don't try to | 407 // Remove any swapped out RVHs from this process, so that we don't try to |
422 // swap them back in while the process is exiting. Start by finding them, | 408 // swap them back in while the process is exiting. Start by finding them, |
423 // since there could be more than one. | 409 // since there could be more than one. |
424 std::list<int> ids_to_remove; | 410 std::list<int> ids_to_remove; |
425 for (RenderFrameHostMap::iterator iter = swapped_out_hosts_.begin(); | 411 for (RenderFrameHostMap::iterator iter = swapped_out_hosts_.begin(); |
426 iter != swapped_out_hosts_.end(); | 412 iter != swapped_out_hosts_.end(); |
427 ++iter) { | 413 ++iter) { |
428 if (iter->second->GetProcess() == render_process_host) | 414 if (iter->second->GetProcess() == render_process_host) |
(...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1361 SiteInstance* instance) const { | 1347 SiteInstance* instance) const { |
1362 RenderFrameHostMap::const_iterator iter = | 1348 RenderFrameHostMap::const_iterator iter = |
1363 swapped_out_hosts_.find(instance->GetId()); | 1349 swapped_out_hosts_.find(instance->GetId()); |
1364 if (iter != swapped_out_hosts_.end()) | 1350 if (iter != swapped_out_hosts_.end()) |
1365 return iter->second; | 1351 return iter->second; |
1366 | 1352 |
1367 return NULL; | 1353 return NULL; |
1368 } | 1354 } |
1369 | 1355 |
1370 } // namespace content | 1356 } // namespace content |
OLD | NEW |