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 |
587 RenderFrameHostImpl* new_frame = frame_tree_->AddFrame( | 594 RenderFrameHostImpl* new_frame = frame_tree_->AddFrame( |
588 frame_tree_node_, new_routing_id, frame_name); | 595 frame_tree_node_, GetProcess()->GetID(), new_routing_id, frame_name); |
| 596 if (!new_frame) |
| 597 return; |
589 | 598 |
590 // We know that the RenderFrame has been created in this case, immediately | 599 // We know that the RenderFrame has been created in this case, immediately |
591 // after the CreateChildFrame IPC was sent. | 600 // after the CreateChildFrame IPC was sent. |
592 new_frame->set_render_frame_created(true); | 601 new_frame->set_render_frame_created(true); |
593 | 602 |
594 if (delegate_) | 603 if (delegate_) |
595 delegate_->RenderFrameCreated(new_frame); | 604 delegate_->RenderFrameCreated(new_frame); |
596 } | 605 } |
597 | 606 |
598 void RenderFrameHostImpl::OnDetach() { | 607 void RenderFrameHostImpl::OnDetach() { |
(...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1464 // Clear any state if a pending navigation is canceled or preempted. | 1473 // Clear any state if a pending navigation is canceled or preempted. |
1465 if (suspended_nav_params_) | 1474 if (suspended_nav_params_) |
1466 suspended_nav_params_.reset(); | 1475 suspended_nav_params_.reset(); |
1467 | 1476 |
1468 TRACE_EVENT_ASYNC_END0("navigation", | 1477 TRACE_EVENT_ASYNC_END0("navigation", |
1469 "RenderFrameHostImpl navigation suspended", this); | 1478 "RenderFrameHostImpl navigation suspended", this); |
1470 navigations_suspended_ = false; | 1479 navigations_suspended_ = false; |
1471 } | 1480 } |
1472 | 1481 |
1473 } // namespace content | 1482 } // namespace content |
OLD | NEW |