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_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 HasWebUIScheme(delegate_->GetMainFrameLastCommittedURL()) ? level : 0; | 604 HasWebUIScheme(delegate_->GetMainFrameLastCommittedURL()) ? level : 0; |
605 | 605 |
606 if (resolved_level >= ::logging::GetMinLogLevel()) { | 606 if (resolved_level >= ::logging::GetMinLogLevel()) { |
607 logging::LogMessage("CONSOLE", line_no, resolved_level).stream() << "\"" << | 607 logging::LogMessage("CONSOLE", line_no, resolved_level).stream() << "\"" << |
608 message << "\", source: " << source_id << " (" << line_no << ")"; | 608 message << "\", source: " << source_id << " (" << line_no << ")"; |
609 } | 609 } |
610 } | 610 } |
611 | 611 |
612 void RenderFrameHostImpl::OnCreateChildFrame(int new_routing_id, | 612 void RenderFrameHostImpl::OnCreateChildFrame(int new_routing_id, |
613 const std::string& frame_name) { | 613 const std::string& frame_name) { |
| 614 // It is possible that while a new RenderFrameHost was committed, the |
| 615 // RenderFrame corresponding to this host sent an IPC message to create a |
| 616 // frame and it is delivered after this host is swapped out. |
| 617 // Ignore such messages, as we know this RenderFrameHost is going away. |
| 618 if (rfh_state_ != RenderFrameHostImpl::STATE_DEFAULT) |
| 619 return; |
| 620 |
614 RenderFrameHostImpl* new_frame = frame_tree_->AddFrame( | 621 RenderFrameHostImpl* new_frame = frame_tree_->AddFrame( |
615 frame_tree_node_, new_routing_id, frame_name); | 622 frame_tree_node_, GetProcess()->GetID(), new_routing_id, frame_name); |
| 623 if (!new_frame) |
| 624 return; |
616 | 625 |
617 // We know that the RenderFrame has been created in this case, immediately | 626 // We know that the RenderFrame has been created in this case, immediately |
618 // after the CreateChildFrame IPC was sent. | 627 // after the CreateChildFrame IPC was sent. |
619 new_frame->set_render_frame_created(true); | 628 new_frame->set_render_frame_created(true); |
620 | 629 |
621 if (delegate_) | 630 if (delegate_) |
622 delegate_->RenderFrameCreated(new_frame); | 631 delegate_->RenderFrameCreated(new_frame); |
623 } | 632 } |
624 | 633 |
625 void RenderFrameHostImpl::OnDetach() { | 634 void RenderFrameHostImpl::OnDetach() { |
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1557 // Clear any state if a pending navigation is canceled or preempted. | 1566 // Clear any state if a pending navigation is canceled or preempted. |
1558 if (suspended_nav_params_) | 1567 if (suspended_nav_params_) |
1559 suspended_nav_params_.reset(); | 1568 suspended_nav_params_.reset(); |
1560 | 1569 |
1561 TRACE_EVENT_ASYNC_END0("navigation", | 1570 TRACE_EVENT_ASYNC_END0("navigation", |
1562 "RenderFrameHostImpl navigation suspended", this); | 1571 "RenderFrameHostImpl navigation suspended", this); |
1563 navigations_suspended_ = false; | 1572 navigations_suspended_ = false; |
1564 } | 1573 } |
1565 | 1574 |
1566 } // namespace content | 1575 } // namespace content |
OLD | NEW |