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 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 // A navigation in the original page has taken place. Cancel the pending | 447 // A navigation in the original page has taken place. Cancel the pending |
448 // one. | 448 // one. |
449 CancelPending(); | 449 CancelPending(); |
450 cross_navigation_pending_ = false; | 450 cross_navigation_pending_ = false; |
451 } else { | 451 } else { |
452 // No one else should be sending us DidNavigate in this state. | 452 // No one else should be sending us DidNavigate in this state. |
453 DCHECK(false); | 453 DCHECK(false); |
454 } | 454 } |
455 } | 455 } |
456 | 456 |
457 // TODO(creis): Take in RenderFrameHost instead, since frames can have openers. | 457 void RenderFrameHostManager::DidDisownOpener( |
458 void RenderFrameHostManager::DidDisownOpener(RenderViewHost* render_view_host) { | 458 RenderFrameHost* render_frame_host) { |
459 // Notify all RenderViewHosts but the one that notified us. This is necessary | 459 // Notify all RenderFrameHosts but the one that notified us. This is necessary |
460 // in case a process swap has occurred while the message was in flight. | 460 // in case a process swap has occurred while the message was in flight. |
461 for (RenderFrameProxyHostMap::iterator iter = proxy_hosts_.begin(); | 461 for (RenderFrameProxyHostMap::iterator iter = proxy_hosts_.begin(); |
462 iter != proxy_hosts_.end(); | 462 iter != proxy_hosts_.end(); |
463 ++iter) { | 463 ++iter) { |
464 DCHECK_NE(iter->second->GetSiteInstance(), | 464 DCHECK_NE(iter->second->GetSiteInstance(), |
465 current_frame_host()->GetSiteInstance()); | 465 current_frame_host()->GetSiteInstance()); |
466 iter->second->GetRenderViewHost()->DisownOpener(); | 466 iter->second->DisownOpener(); |
467 } | 467 } |
468 | 468 |
469 if (render_frame_host_->render_view_host() != render_view_host) | 469 if (render_frame_host_.get() != render_frame_host) |
470 render_frame_host_->render_view_host()->DisownOpener(); | 470 render_frame_host_->DisownOpener(); |
471 | 471 |
472 if (pending_render_frame_host_ && | 472 if (pending_render_frame_host_ && |
473 pending_render_frame_host_->render_view_host() != render_view_host) { | 473 pending_render_frame_host_.get() != render_frame_host) { |
474 pending_render_frame_host_->render_view_host()->DisownOpener(); | 474 pending_render_frame_host_->DisownOpener(); |
475 } | 475 } |
476 } | 476 } |
477 | 477 |
478 void RenderFrameHostManager::RendererProcessClosing( | 478 void RenderFrameHostManager::RendererProcessClosing( |
479 RenderProcessHost* render_process_host) { | 479 RenderProcessHost* render_process_host) { |
480 // Remove any swapped out RVHs from this process, so that we don't try to | 480 // Remove any swapped out RVHs from this process, so that we don't try to |
481 // swap them back in while the process is exiting. Start by finding them, | 481 // swap them back in while the process is exiting. Start by finding them, |
482 // since there could be more than one. | 482 // since there could be more than one. |
483 std::list<int> ids_to_remove; | 483 std::list<int> ids_to_remove; |
484 for (RenderFrameProxyHostMap::iterator iter = proxy_hosts_.begin(); | 484 for (RenderFrameProxyHostMap::iterator iter = proxy_hosts_.begin(); |
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1658 void RenderFrameHostManager::DeleteRenderFrameProxyHost( | 1658 void RenderFrameHostManager::DeleteRenderFrameProxyHost( |
1659 SiteInstance* instance) { | 1659 SiteInstance* instance) { |
1660 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); | 1660 RenderFrameProxyHostMap::iterator iter = proxy_hosts_.find(instance->GetId()); |
1661 if (iter != proxy_hosts_.end()) { | 1661 if (iter != proxy_hosts_.end()) { |
1662 delete iter->second; | 1662 delete iter->second; |
1663 proxy_hosts_.erase(iter); | 1663 proxy_hosts_.erase(iter); |
1664 } | 1664 } |
1665 } | 1665 } |
1666 | 1666 |
1667 } // namespace content | 1667 } // namespace content |
OLD | NEW |