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 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
577 HasWebUIScheme(delegate_->GetMainFrameLastCommittedURL()) ? level : 0; | 577 HasWebUIScheme(delegate_->GetMainFrameLastCommittedURL()) ? level : 0; |
578 | 578 |
579 if (resolved_level >= ::logging::GetMinLogLevel()) { | 579 if (resolved_level >= ::logging::GetMinLogLevel()) { |
580 logging::LogMessage("CONSOLE", line_no, resolved_level).stream() << "\"" << | 580 logging::LogMessage("CONSOLE", line_no, resolved_level).stream() << "\"" << |
581 message << "\", source: " << source_id << " (" << line_no << ")"; | 581 message << "\", source: " << source_id << " (" << line_no << ")"; |
582 } | 582 } |
583 } | 583 } |
584 | 584 |
585 void RenderFrameHostImpl::OnCreateChildFrame(int new_routing_id, | 585 void RenderFrameHostImpl::OnCreateChildFrame(int new_routing_id, |
586 const std::string& frame_name) { | 586 const std::string& frame_name) { |
587 // It is possible that while a new RenderFrameHost was committed, the | |
588 // RenderFrame corresponding to this host sent an IPC message to create a | |
589 // frame and it is delivered after this host is swapped out. | |
590 // Ignore such messages, as we know this RenderFrameHost is going away. | |
591 if (rfh_state_ != RenderFrameHostImpl::STATE_DEFAULT) | |
592 return; | |
593 | |
594 RenderFrameHostImpl* new_frame = frame_tree_->AddFrame( | 587 RenderFrameHostImpl* new_frame = frame_tree_->AddFrame( |
595 frame_tree_node_, GetProcess()->GetID(), new_routing_id, frame_name); | 588 frame_tree_node_, new_routing_id, frame_name); |
596 if (!new_frame) | |
597 return; | |
598 | 589 |
599 // We know that the RenderFrame has been created in this case, immediately | 590 // We know that the RenderFrame has been created in this case, immediately |
600 // after the CreateChildFrame IPC was sent. | 591 // after the CreateChildFrame IPC was sent. |
601 new_frame->set_render_frame_created(true); | 592 new_frame->set_render_frame_created(true); |
602 | 593 |
603 if (delegate_) | 594 if (delegate_) |
604 delegate_->RenderFrameCreated(new_frame); | 595 delegate_->RenderFrameCreated(new_frame); |
605 } | 596 } |
606 | 597 |
607 void RenderFrameHostImpl::OnDetach() { | 598 void RenderFrameHostImpl::OnDetach() { |
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1473 // Clear any state if a pending navigation is canceled or preempted. | 1464 // Clear any state if a pending navigation is canceled or preempted. |
1474 if (suspended_nav_params_) | 1465 if (suspended_nav_params_) |
1475 suspended_nav_params_.reset(); | 1466 suspended_nav_params_.reset(); |
1476 | 1467 |
1477 TRACE_EVENT_ASYNC_END0("navigation", | 1468 TRACE_EVENT_ASYNC_END0("navigation", |
1478 "RenderFrameHostImpl navigation suspended", this); | 1469 "RenderFrameHostImpl navigation suspended", this); |
1479 navigations_suspended_ = false; | 1470 navigations_suspended_ = false; |
1480 } | 1471 } |
1481 | 1472 |
1482 } // namespace content | 1473 } // namespace content |
OLD | NEW |