Chromium Code Reviews| 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/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 949 return nullptr; | 949 return nullptr; |
| 950 | 950 |
| 951 // Opener routing ID could refer to either a RenderFrameProxy or a | 951 // Opener routing ID could refer to either a RenderFrameProxy or a |
| 952 // RenderFrame, so need to check both. | 952 // RenderFrame, so need to check both. |
| 953 RenderFrameProxy* opener_proxy = | 953 RenderFrameProxy* opener_proxy = |
| 954 RenderFrameProxy::FromRoutingID(opener_frame_routing_id); | 954 RenderFrameProxy::FromRoutingID(opener_frame_routing_id); |
| 955 if (opener_proxy) { | 955 if (opener_proxy) { |
| 956 if (opener_view_routing_id) | 956 if (opener_view_routing_id) |
| 957 *opener_view_routing_id = opener_proxy->render_view()->GetRoutingID(); | 957 *opener_view_routing_id = opener_proxy->render_view()->GetRoutingID(); |
| 958 | 958 |
| 959 // TODO(nasko,alexmos): This check won't be needed once swappedout:// is | 959 return opener_proxy->web_frame(); |
| 960 // gone. | |
| 961 if (opener_proxy->IsMainFrameDetachedFromTree()) { | |
| 962 DCHECK(!SiteIsolationPolicy::IsSwappedOutStateForbidden()); | |
| 963 return opener_proxy->render_view()->webview()->mainFrame(); | |
| 964 } else { | |
| 965 return opener_proxy->web_frame(); | |
| 966 } | |
| 967 } | 960 } |
| 968 | 961 |
| 969 RenderFrameImpl* opener_frame = | 962 RenderFrameImpl* opener_frame = |
| 970 RenderFrameImpl::FromRoutingID(opener_frame_routing_id); | 963 RenderFrameImpl::FromRoutingID(opener_frame_routing_id); |
| 971 if (opener_frame) { | 964 if (opener_frame) { |
| 972 if (opener_view_routing_id) | 965 if (opener_view_routing_id) |
| 973 *opener_view_routing_id = opener_frame->render_view()->GetRoutingID(); | 966 *opener_view_routing_id = opener_frame->render_view()->GetRoutingID(); |
| 974 return opener_frame->GetWebFrame(); | 967 return opener_frame->GetWebFrame(); |
| 975 } | 968 } |
| 976 | 969 |
| 977 return nullptr; | 970 return nullptr; |
| 978 } | 971 } |
| 979 | 972 |
| 980 // RenderFrameImpl ---------------------------------------------------------- | 973 // RenderFrameImpl ---------------------------------------------------------- |
| 981 RenderFrameImpl::RenderFrameImpl(const CreateParams& params) | 974 RenderFrameImpl::RenderFrameImpl(const CreateParams& params) |
| 982 : frame_(NULL), | 975 : frame_(NULL), |
| 983 is_main_frame_(true), | 976 is_main_frame_(true), |
| 984 in_browser_initiated_detach_(false), | 977 in_browser_initiated_detach_(false), |
| 985 in_frame_tree_(false), | 978 in_frame_tree_(false), |
| 986 render_view_(params.render_view->AsWeakPtr()), | 979 render_view_(params.render_view->AsWeakPtr()), |
| 987 routing_id_(params.routing_id), | 980 routing_id_(params.routing_id), |
| 988 is_swapped_out_(false), | 981 is_swapped_out_(false), |
|
dmazzoni
2016/03/11 20:31:34
Why not delete this as part of the same change?
Charlie Reis
2016/03/11 21:56:56
We're just doing it in pieces to keep the size rea
nasko
2016/03/11 22:35:33
Indeed. It is already removed in my next iteration
| |
| 989 render_frame_proxy_(NULL), | 982 render_frame_proxy_(NULL), |
| 990 is_detaching_(false), | 983 is_detaching_(false), |
| 991 proxy_routing_id_(MSG_ROUTING_NONE), | 984 proxy_routing_id_(MSG_ROUTING_NONE), |
| 992 #if defined(ENABLE_PLUGINS) | 985 #if defined(ENABLE_PLUGINS) |
| 993 plugin_power_saver_helper_(nullptr), | 986 plugin_power_saver_helper_(nullptr), |
| 994 plugin_find_handler_(nullptr), | 987 plugin_find_handler_(nullptr), |
| 995 #endif | 988 #endif |
| 996 cookie_jar_(this), | 989 cookie_jar_(this), |
| 997 selection_text_offset_(0), | 990 selection_text_offset_(0), |
| 998 selection_range_(gfx::Range::InvalidRange()), | 991 selection_range_(gfx::Range::InvalidRange()), |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1051 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, OnDestruct()); | 1044 FOR_EACH_OBSERVER(RenderFrameObserver, observers_, OnDestruct()); |
| 1052 | 1045 |
| 1053 base::trace_event::TraceLog::GetInstance()->RemoveProcessLabel(routing_id_); | 1046 base::trace_event::TraceLog::GetInstance()->RemoveProcessLabel(routing_id_); |
| 1054 | 1047 |
| 1055 #if defined(VIDEO_HOLE) | 1048 #if defined(VIDEO_HOLE) |
| 1056 if (contains_media_player_) | 1049 if (contains_media_player_) |
| 1057 render_view_->UnregisterVideoHoleFrame(this); | 1050 render_view_->UnregisterVideoHoleFrame(this); |
| 1058 #endif | 1051 #endif |
| 1059 | 1052 |
| 1060 if (is_main_frame_) { | 1053 if (is_main_frame_) { |
| 1061 // When using swapped out frames, RenderFrameProxy is owned by | |
| 1062 // RenderFrameImpl in the case it is the main frame. Ensure it is deleted | |
| 1063 // along with this object. | |
| 1064 if (render_frame_proxy_ && | |
| 1065 !SiteIsolationPolicy::IsSwappedOutStateForbidden()) { | |
| 1066 // The following method calls back into this object and clears | |
| 1067 // |render_frame_proxy_|. | |
| 1068 render_frame_proxy_->frameDetached( | |
| 1069 blink::WebRemoteFrameClient::DetachType::Remove); | |
| 1070 } | |
| 1071 | |
| 1072 // Ensure the RenderView doesn't point to this object, once it is destroyed. | 1054 // Ensure the RenderView doesn't point to this object, once it is destroyed. |
| 1073 // TODO(nasko): Add a check that the |main_render_frame_| of |render_view_| | 1055 // TODO(nasko): Add a check that the |main_render_frame_| of |render_view_| |
| 1074 // is |this|, once the object is no longer leaked. | 1056 // is |this|, once the object is no longer leaked. |
| 1075 // See https://crbug.com/464764. | 1057 // See https://crbug.com/464764. |
| 1076 render_view_->main_render_frame_ = nullptr; | 1058 render_view_->main_render_frame_ = nullptr; |
| 1077 } | 1059 } |
| 1078 | 1060 |
| 1079 render_view_->UnregisterRenderFrame(this); | 1061 render_view_->UnregisterRenderFrame(this); |
| 1080 g_routing_id_frame_map.Get().erase(routing_id_); | 1062 g_routing_id_frame_map.Get().erase(routing_id_); |
| 1081 RenderThread::Get()->RemoveRoute(routing_id_); | 1063 RenderThread::Get()->RemoveRoute(routing_id_); |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1536 before_unload_start_time, | 1518 before_unload_start_time, |
| 1537 before_unload_end_time)); | 1519 before_unload_end_time)); |
| 1538 } | 1520 } |
| 1539 | 1521 |
| 1540 void RenderFrameImpl::OnSwapOut( | 1522 void RenderFrameImpl::OnSwapOut( |
| 1541 int proxy_routing_id, | 1523 int proxy_routing_id, |
| 1542 bool is_loading, | 1524 bool is_loading, |
| 1543 const FrameReplicationState& replicated_frame_state) { | 1525 const FrameReplicationState& replicated_frame_state) { |
| 1544 TRACE_EVENT1("navigation", "RenderFrameImpl::OnSwapOut", "id", routing_id_); | 1526 TRACE_EVENT1("navigation", "RenderFrameImpl::OnSwapOut", "id", routing_id_); |
| 1545 RenderFrameProxy* proxy = NULL; | 1527 RenderFrameProxy* proxy = NULL; |
| 1546 bool swapped_out_forbidden = | |
| 1547 SiteIsolationPolicy::IsSwappedOutStateForbidden(); | |
| 1548 | 1528 |
| 1549 // This codepath should only be hit for subframes when in --site-per-process. | 1529 // This codepath should only be hit for subframes when in --site-per-process. |
| 1550 CHECK(is_main_frame_ || SiteIsolationPolicy::AreCrossProcessFramesPossible()); | 1530 CHECK(is_main_frame_ || SiteIsolationPolicy::AreCrossProcessFramesPossible()); |
| 1551 | 1531 |
| 1552 // Only run unload if we're not swapped out yet, but send the ack either way. | 1532 // Only run unload if we're not swapped out yet, but send the ack either way. |
| 1553 if (!is_swapped_out_) { | 1533 if (!is_swapped_out_) { |
| 1554 // Swap this RenderFrame out so the frame can navigate to a page rendered by | 1534 // Swap this RenderFrame out so the frame can navigate to a page rendered by |
| 1555 // a different process. This involves running the unload handler and | 1535 // a different process. This involves running the unload handler and |
| 1556 // clearing the page. We also allow this process to exit if there are no | 1536 // clearing the page. We also allow this process to exit if there are no |
| 1557 // other active RenderFrames in it. | 1537 // other active RenderFrames in it. |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 1579 if (is_main_frame_) | 1559 if (is_main_frame_) |
| 1580 render_view_->SetSwappedOut(true); | 1560 render_view_->SetSwappedOut(true); |
| 1581 is_swapped_out_ = true; | 1561 is_swapped_out_ = true; |
| 1582 | 1562 |
| 1583 // Set the proxy here, since OnStop() below could cause an onload event | 1563 // Set the proxy here, since OnStop() below could cause an onload event |
| 1584 // handler to execute, which could trigger code such as | 1564 // handler to execute, which could trigger code such as |
| 1585 // willCheckAndDispatchMessageEvent() that needs the proxy. | 1565 // willCheckAndDispatchMessageEvent() that needs the proxy. |
| 1586 if (proxy) | 1566 if (proxy) |
| 1587 set_render_frame_proxy(proxy); | 1567 set_render_frame_proxy(proxy); |
| 1588 | 1568 |
| 1589 // Now that we're swapped out and filtering IPC messages, stop loading to | |
| 1590 // ensure that no other in-progress navigation continues. We do this here | |
| 1591 // to avoid sending a DidStopLoading message to the browser process. | |
| 1592 // TODO(creis): Should we be stopping all frames here and using | |
| 1593 // StopAltErrorPageFetcher with RenderView::OnStop, or just stopping this | |
| 1594 // frame? | |
| 1595 if (!swapped_out_forbidden) | |
| 1596 OnStop(); | |
| 1597 | |
| 1598 // Transfer settings such as initial drawing parameters to the remote frame, | 1569 // Transfer settings such as initial drawing parameters to the remote frame, |
| 1599 // if one is created, that will replace this frame. | 1570 // if one is created, that will replace this frame. |
| 1600 if (!is_main_frame_ && proxy) | 1571 if (!is_main_frame_ && proxy) |
| 1601 proxy->web_frame()->initializeFromFrame(frame_); | 1572 proxy->web_frame()->initializeFromFrame(frame_); |
| 1602 | 1573 |
| 1603 // Replace the page with a blank dummy URL. The unload handler will not be | |
| 1604 // run a second time, thanks to a check in FrameLoader::stopLoading. | |
| 1605 // TODO(creis): Need to add a better way to do this that avoids running the | |
| 1606 // beforeunload handler. For now, we just run it a second time silently. | |
| 1607 if (!swapped_out_forbidden) | |
| 1608 NavigateToSwappedOutURL(); | |
| 1609 | |
| 1610 // Let WebKit know that this view is hidden so it can drop resources and | 1574 // Let WebKit know that this view is hidden so it can drop resources and |
| 1611 // stop compositing. | 1575 // stop compositing. |
| 1612 // TODO(creis): Support this for subframes as well. | 1576 // TODO(creis): Support this for subframes as well. |
| 1613 if (is_main_frame_) { | 1577 if (is_main_frame_) { |
| 1614 render_view_->webview()->setVisibilityState( | 1578 render_view_->webview()->setVisibilityState( |
| 1615 blink::WebPageVisibilityStateHidden, false); | 1579 blink::WebPageVisibilityStateHidden, false); |
| 1616 } | 1580 } |
| 1617 } | 1581 } |
| 1618 | 1582 |
| 1619 // It is now safe to show modal dialogs again. | 1583 // It is now safe to show modal dialogs again. |
| 1620 // TODO(creis): Deal with modal dialogs from subframes. | 1584 // TODO(creis): Deal with modal dialogs from subframes. |
| 1621 if (is_main_frame_) | 1585 if (is_main_frame_) |
| 1622 render_view_->suppress_dialogs_until_swap_out_ = false; | 1586 render_view_->suppress_dialogs_until_swap_out_ = false; |
| 1623 | 1587 |
| 1624 Send(new FrameHostMsg_SwapOut_ACK(routing_id_)); | 1588 Send(new FrameHostMsg_SwapOut_ACK(routing_id_)); |
| 1625 | 1589 |
| 1626 RenderViewImpl* render_view = render_view_.get(); | 1590 RenderViewImpl* render_view = render_view_.get(); |
| 1627 bool is_main_frame = is_main_frame_; | 1591 bool is_main_frame = is_main_frame_; |
| 1628 int routing_id = GetRoutingID(); | 1592 int routing_id = GetRoutingID(); |
| 1629 | 1593 |
| 1630 // Now that all of the cleanup is complete and the browser side is notified, | 1594 // Now that all of the cleanup is complete and the browser side is notified, |
| 1631 // start using the RenderFrameProxy, if one is created. | 1595 // start using the RenderFrameProxy, if one is created. |
| 1632 if (proxy && swapped_out_forbidden) { | 1596 if (proxy) { |
| 1633 // The swap call deletes this RenderFrame via frameDetached. Do not access | 1597 // The swap call deletes this RenderFrame via frameDetached. Do not access |
| 1634 // any members after this call. | 1598 // any members after this call. |
| 1635 // TODO(creis): WebFrame::swap() can return false. Most of those cases | 1599 // TODO(creis): WebFrame::swap() can return false. Most of those cases |
| 1636 // should be due to the frame being detached during unload (in which case | 1600 // should be due to the frame being detached during unload (in which case |
| 1637 // the necessary cleanup has happened anyway), but it might be possible for | 1601 // the necessary cleanup has happened anyway), but it might be possible for |
| 1638 // it to return false without detaching. Catch those cases below to track | 1602 // it to return false without detaching. Catch those cases below to track |
| 1639 // down https://crbug.com/575245. | 1603 // down https://crbug.com/575245. |
| 1640 frame_->swap(proxy->web_frame()); | 1604 frame_->swap(proxy->web_frame()); |
| 1641 | 1605 |
| 1642 // For main frames, the swap should have cleared the RenderView's pointer to | 1606 // For main frames, the swap should have cleared the RenderView's pointer to |
| 1643 // this frame. | 1607 // this frame. |
| 1644 if (is_main_frame) { | 1608 if (is_main_frame) { |
| 1645 base::debug::SetCrashKeyValue("swapout_frame_id", | 1609 base::debug::SetCrashKeyValue("swapout_frame_id", |
| 1646 base::IntToString(routing_id)); | 1610 base::IntToString(routing_id)); |
| 1647 base::debug::SetCrashKeyValue("swapout_proxy_id", | 1611 base::debug::SetCrashKeyValue("swapout_proxy_id", |
| 1648 base::IntToString(proxy->routing_id())); | 1612 base::IntToString(proxy->routing_id())); |
| 1649 base::debug::SetCrashKeyValue( | 1613 base::debug::SetCrashKeyValue( |
| 1650 "swapout_view_id", base::IntToString(render_view->GetRoutingID())); | 1614 "swapout_view_id", base::IntToString(render_view->GetRoutingID())); |
| 1651 CHECK(!render_view->main_render_frame_); | 1615 CHECK(!render_view->main_render_frame_); |
| 1652 } | 1616 } |
| 1653 | 1617 |
| 1654 if (is_loading) | 1618 if (is_loading) |
| 1655 proxy->OnDidStartLoading(); | 1619 proxy->OnDidStartLoading(); |
| 1656 } | 1620 } |
| 1657 | 1621 |
| 1658 // In --site-per-process, initialize the WebRemoteFrame with the replication | 1622 // Initialize the WebRemoteFrame with the replication state passed by the |
| 1659 // state passed by the process that is now rendering the frame. | 1623 // process that is now rendering the frame. |
| 1660 // TODO(alexmos): We cannot yet do this for swapped-out main frames, because | 1624 if (proxy) |
| 1661 // in that case we leave the LocalFrame as the main frame visible to Blink | |
| 1662 // and don't call swap() above. Because swap() is what creates a RemoteFrame | |
| 1663 // in proxy->web_frame(), the RemoteFrame will not exist for main frames. | |
| 1664 // When we do an unconditional swap for all frames, we can remove | |
| 1665 // !is_main_frame below. | |
|
dcheng
2016/03/11 20:32:28
This TODO is stale right? I don't see a !is_main_f
nasko
2016/03/11 22:35:33
Indeed it no longer applies, which is why I've rem
| |
| 1666 if (proxy && swapped_out_forbidden) | |
| 1667 proxy->SetReplicatedState(replicated_frame_state); | 1625 proxy->SetReplicatedState(replicated_frame_state); |
| 1668 | 1626 |
| 1669 // Safe to exit if no one else is using the process. | 1627 // Safe to exit if no one else is using the process. |
| 1670 // TODO(nasko): Remove the dependency on RenderViewImpl here and ref count | 1628 // TODO(nasko): Remove the dependency on RenderViewImpl here and ref count |
| 1671 // the process based on the lifetime of this RenderFrameImpl object. | 1629 // the process based on the lifetime of this RenderFrameImpl object. |
| 1672 if (is_main_frame) { | 1630 if (is_main_frame) |
| 1673 render_view->WasSwappedOut(); | 1631 render_view->WasSwappedOut(); |
| 1674 } | |
| 1675 } | 1632 } |
| 1676 | 1633 |
| 1677 void RenderFrameImpl::OnDeleteFrame() { | 1634 void RenderFrameImpl::OnDeleteFrame() { |
| 1678 // TODO(nasko): If this message is received right after a commit has | 1635 // TODO(nasko): If this message is received right after a commit has |
| 1679 // swapped a RenderFrameProxy with this RenderFrame, the proxy needs to be | 1636 // swapped a RenderFrameProxy with this RenderFrame, the proxy needs to be |
| 1680 // recreated in addition to the RenderFrame being deleted. | 1637 // recreated in addition to the RenderFrame being deleted. |
| 1681 // See https://crbug.com/569683 for details. | 1638 // See https://crbug.com/569683 for details. |
| 1682 in_browser_initiated_detach_ = true; | 1639 in_browser_initiated_detach_ = true; |
| 1683 | 1640 |
| 1684 // This will result in a call to RendeFrameImpl::frameDetached, which | 1641 // This will result in a call to RendeFrameImpl::frameDetached, which |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2102 WebString::fromUTF8(params.text_track_text_size)); | 2059 WebString::fromUTF8(params.text_track_text_size)); |
| 2103 } | 2060 } |
| 2104 | 2061 |
| 2105 void RenderFrameImpl::OnPostMessageEvent( | 2062 void RenderFrameImpl::OnPostMessageEvent( |
| 2106 const FrameMsg_PostMessage_Params& params) { | 2063 const FrameMsg_PostMessage_Params& params) { |
| 2107 // Find the source frame if it exists. | 2064 // Find the source frame if it exists. |
| 2108 WebFrame* source_frame = NULL; | 2065 WebFrame* source_frame = NULL; |
| 2109 if (params.source_routing_id != MSG_ROUTING_NONE) { | 2066 if (params.source_routing_id != MSG_ROUTING_NONE) { |
| 2110 RenderFrameProxy* source_proxy = | 2067 RenderFrameProxy* source_proxy = |
| 2111 RenderFrameProxy::FromRoutingID(params.source_routing_id); | 2068 RenderFrameProxy::FromRoutingID(params.source_routing_id); |
| 2112 if (source_proxy) { | 2069 if (source_proxy) |
| 2113 // Currently, navigating a top-level frame cross-process does not swap | 2070 source_frame = source_proxy->web_frame(); |
| 2114 // the WebLocalFrame for a WebRemoteFrame in the frame tree, and the | |
| 2115 // WebRemoteFrame will not have an associated blink::Frame. If this is | |
| 2116 // the case for |source_proxy|, use the corresponding (swapped-out) | |
| 2117 // WebLocalFrame instead, so that event.source for this message can be | |
| 2118 // set and used properly. | |
| 2119 if (source_proxy->IsMainFrameDetachedFromTree()) | |
| 2120 source_frame = source_proxy->render_view()->webview()->mainFrame(); | |
| 2121 else | |
| 2122 source_frame = source_proxy->web_frame(); | |
| 2123 } | |
| 2124 } | 2071 } |
| 2125 | 2072 |
| 2126 // If the message contained MessagePorts, create the corresponding endpoints. | 2073 // If the message contained MessagePorts, create the corresponding endpoints. |
| 2127 blink::WebMessagePortChannelArray channels = | 2074 blink::WebMessagePortChannelArray channels = |
| 2128 WebMessagePortChannelImpl::CreatePorts( | 2075 WebMessagePortChannelImpl::CreatePorts( |
| 2129 params.message_ports, params.new_routing_ids, | 2076 params.message_ports, params.new_routing_ids, |
| 2130 base::ThreadTaskRunnerHandle::Get().get()); | 2077 base::ThreadTaskRunnerHandle::Get().get()); |
| 2131 | 2078 |
| 2132 WebSerializedScriptValue serialized_script_value; | 2079 WebSerializedScriptValue serialized_script_value; |
| 2133 if (params.is_data_raw_string) { | 2080 if (params.is_data_raw_string) { |
| (...skipping 2644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4778 info.urlRequest, info.navigationType, info.defaultPolicy, | 4725 info.urlRequest, info.navigationType, info.defaultPolicy, |
| 4779 is_redirect)) { | 4726 is_redirect)) { |
| 4780 return blink::WebNavigationPolicyIgnore; | 4727 return blink::WebNavigationPolicyIgnore; |
| 4781 } | 4728 } |
| 4782 #endif | 4729 #endif |
| 4783 | 4730 |
| 4784 Referrer referrer( | 4731 Referrer referrer( |
| 4785 RenderViewImpl::GetReferrerFromRequest(frame_, info.urlRequest)); | 4732 RenderViewImpl::GetReferrerFromRequest(frame_, info.urlRequest)); |
| 4786 | 4733 |
| 4787 // TODO(nick): Is consulting |is_main_frame| here correct? | 4734 // TODO(nick): Is consulting |is_main_frame| here correct? |
| 4788 if (SiteIsolationPolicy::IsSwappedOutStateForbidden() && !is_main_frame_) { | 4735 if (is_main_frame_ && is_swapped_out_) { |
| 4789 // There's no reason to ignore navigations on subframes, since the swap out | 4736 if (info.urlRequest.url() != GURL(kSwappedOutURL)) { |
|
Charlie Reis
2016/03/11 21:56:56
I suppose this is next on the chopping block? May
nasko
2016/03/11 22:35:33
Yes, it is. As mentioned elsewhere, I want to rip
| |
| 4790 // logic no longer applies. | 4737 // Targeted links may try to navigate a swapped out frame. Allow the |
| 4791 } else { | 4738 // browser process to navigate the tab instead. Note that it is also |
| 4792 if (is_swapped_out_) { | 4739 // possible for non-targeted navigations (from this view) to arrive |
| 4793 if (info.urlRequest.url() != GURL(kSwappedOutURL)) { | 4740 // here just after we are swapped out. It's ok to send them to the |
| 4794 // Targeted links may try to navigate a swapped out frame. Allow the | 4741 // browser, as long as they're for the top level frame. |
| 4795 // browser process to navigate the tab instead. Note that it is also | 4742 // TODO(creis): Ensure this supports targeted form submissions when |
| 4796 // possible for non-targeted navigations (from this view) to arrive | 4743 // fixing http://crbug.com/101395. |
| 4797 // here just after we are swapped out. It's ok to send them to the | 4744 if (frame_->parent() == NULL) { |
| 4798 // browser, as long as they're for the top level frame. | 4745 OpenURL(info.urlRequest.url(), referrer, info.defaultPolicy, |
| 4799 // TODO(creis): Ensure this supports targeted form submissions when | 4746 info.replacesCurrentHistoryItem, false); |
| 4800 // fixing http://crbug.com/101395. | 4747 return blink::WebNavigationPolicyIgnore; // Suppress the load here. |
| 4801 if (frame_->parent() == NULL) { | |
| 4802 OpenURL(info.urlRequest.url(), referrer, info.defaultPolicy, | |
| 4803 info.replacesCurrentHistoryItem, false); | |
| 4804 return blink::WebNavigationPolicyIgnore; // Suppress the load here. | |
| 4805 } | |
| 4806 | |
| 4807 // We should otherwise ignore in-process iframe navigations, if they | |
| 4808 // arrive just after we are swapped out. | |
| 4809 return blink::WebNavigationPolicyIgnore; | |
| 4810 } | 4748 } |
| 4811 | 4749 |
| 4812 // Allow kSwappedOutURL to complete. | 4750 // We should otherwise ignore in-process iframe navigations, if they |
| 4813 return info.defaultPolicy; | 4751 // arrive just after we are swapped out. |
| 4752 return blink::WebNavigationPolicyIgnore; | |
| 4814 } | 4753 } |
| 4754 | |
| 4755 // Allow kSwappedOutURL to complete. | |
| 4756 return info.defaultPolicy; | |
| 4815 } | 4757 } |
| 4816 | 4758 |
| 4817 // Webkit is asking whether to navigate to a new URL. | 4759 // Webkit is asking whether to navigate to a new URL. |
| 4818 // This is fine normally, except if we're showing UI from one security | 4760 // This is fine normally, except if we're showing UI from one security |
| 4819 // context and they're trying to navigate to a different context. | 4761 // context and they're trying to navigate to a different context. |
| 4820 const GURL& url = info.urlRequest.url(); | 4762 const GURL& url = info.urlRequest.url(); |
| 4821 | 4763 |
| 4822 // If the browser is interested, then give it a chance to look at the request. | 4764 // If the browser is interested, then give it a chance to look at the request. |
| 4823 if (is_content_initiated && IsTopLevelNavigation(frame_) && | 4765 if (is_content_initiated && IsTopLevelNavigation(frame_) && |
| 4824 render_view_->renderer_preferences_ | 4766 render_view_->renderer_preferences_ |
| (...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6132 int match_count, | 6074 int match_count, |
| 6133 int ordinal, | 6075 int ordinal, |
| 6134 const WebRect& selection_rect, | 6076 const WebRect& selection_rect, |
| 6135 bool final_status_update) { | 6077 bool final_status_update) { |
| 6136 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, | 6078 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, |
| 6137 selection_rect, ordinal, | 6079 selection_rect, ordinal, |
| 6138 final_status_update)); | 6080 final_status_update)); |
| 6139 } | 6081 } |
| 6140 | 6082 |
| 6141 } // namespace content | 6083 } // namespace content |
| OLD | NEW |