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/browser/frame_host/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 207 pending_web_ui_type_(WebUI::kNoWebUI), | 207 pending_web_ui_type_(WebUI::kNoWebUI), |
| 208 should_reuse_web_ui_(false), | 208 should_reuse_web_ui_(false), |
| 209 weak_ptr_factory_(this) { | 209 weak_ptr_factory_(this) { |
| 210 bool is_swapped_out = !!(flags & CREATE_RF_SWAPPED_OUT); | 210 bool is_swapped_out = !!(flags & CREATE_RF_SWAPPED_OUT); |
| 211 bool hidden = !!(flags & CREATE_RF_HIDDEN); | 211 bool hidden = !!(flags & CREATE_RF_HIDDEN); |
| 212 frame_tree_->AddRenderViewHostRef(render_view_host_); | 212 frame_tree_->AddRenderViewHostRef(render_view_host_); |
| 213 GetProcess()->AddRoute(routing_id_, this); | 213 GetProcess()->AddRoute(routing_id_, this); |
| 214 g_routing_id_frame_map.Get().insert(std::make_pair( | 214 g_routing_id_frame_map.Get().insert(std::make_pair( |
| 215 RenderFrameHostID(GetProcess()->GetID(), routing_id_), | 215 RenderFrameHostID(GetProcess()->GetID(), routing_id_), |
| 216 this)); | 216 this)); |
| 217 site_instance_->AddObserver(this); | |
| 217 | 218 |
| 218 if (is_swapped_out) { | 219 if (is_swapped_out) { |
| 219 rfh_state_ = STATE_SWAPPED_OUT; | 220 rfh_state_ = STATE_SWAPPED_OUT; |
| 220 } else { | 221 } else { |
| 221 rfh_state_ = STATE_DEFAULT; | 222 rfh_state_ = STATE_DEFAULT; |
| 222 GetSiteInstance()->IncrementActiveFrameCount(); | 223 GetSiteInstance()->IncrementActiveFrameCount(); |
| 223 } | 224 } |
| 224 | 225 |
| 225 // New child frames should inherit the nav_entry_id of their parent. | 226 // New child frames should inherit the nav_entry_id of their parent. |
| 226 if (frame_tree_node_->parent()) { | 227 if (frame_tree_node_->parent()) { |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 255 | 256 |
| 256 RenderFrameHostImpl::~RenderFrameHostImpl() { | 257 RenderFrameHostImpl::~RenderFrameHostImpl() { |
| 257 // Release the WebUI instances before all else as the WebUI may accesses the | 258 // Release the WebUI instances before all else as the WebUI may accesses the |
| 258 // RenderFrameHost during cleanup. | 259 // RenderFrameHost during cleanup. |
| 259 ClearAllWebUI(); | 260 ClearAllWebUI(); |
| 260 | 261 |
| 261 GetProcess()->RemoveRoute(routing_id_); | 262 GetProcess()->RemoveRoute(routing_id_); |
| 262 g_routing_id_frame_map.Get().erase( | 263 g_routing_id_frame_map.Get().erase( |
| 263 RenderFrameHostID(GetProcess()->GetID(), routing_id_)); | 264 RenderFrameHostID(GetProcess()->GetID(), routing_id_)); |
| 264 | 265 |
| 266 site_instance_->RemoveObserver(this); | |
| 267 | |
| 265 if (delegate_ && render_frame_created_) | 268 if (delegate_ && render_frame_created_) |
| 266 delegate_->RenderFrameDeleted(this); | 269 delegate_->RenderFrameDeleted(this); |
| 267 | 270 |
| 268 bool is_active = IsRFHStateActive(rfh_state_); | 271 bool is_active = IsRFHStateActive(rfh_state_); |
| 269 | 272 |
| 270 // If this RenderFrameHost is swapped out, it already decremented the active | 273 // If this RenderFrameHost is swapped out, it already decremented the active |
| 271 // frame count of the SiteInstance it belongs to. | 274 // frame count of the SiteInstance it belongs to. |
| 272 if (is_active) | 275 if (is_active) |
| 273 GetSiteInstance()->DecrementActiveFrameCount(); | 276 GetSiteInstance()->DecrementActiveFrameCount(); |
| 274 | 277 |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 510 IPC_MESSAGE_HANDLER(FrameHostMsg_Detach, OnDetach) | 513 IPC_MESSAGE_HANDLER(FrameHostMsg_Detach, OnDetach) |
| 511 IPC_MESSAGE_HANDLER(FrameHostMsg_FrameFocused, OnFrameFocused) | 514 IPC_MESSAGE_HANDLER(FrameHostMsg_FrameFocused, OnFrameFocused) |
| 512 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStartProvisionalLoad, | 515 IPC_MESSAGE_HANDLER(FrameHostMsg_DidStartProvisionalLoad, |
| 513 OnDidStartProvisionalLoad) | 516 OnDidStartProvisionalLoad) |
| 514 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailProvisionalLoadWithError, | 517 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailProvisionalLoadWithError, |
| 515 OnDidFailProvisionalLoadWithError) | 518 OnDidFailProvisionalLoadWithError) |
| 516 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailLoadWithError, | 519 IPC_MESSAGE_HANDLER(FrameHostMsg_DidFailLoadWithError, |
| 517 OnDidFailLoadWithError) | 520 OnDidFailLoadWithError) |
| 518 IPC_MESSAGE_HANDLER_GENERIC(FrameHostMsg_DidCommitProvisionalLoad, | 521 IPC_MESSAGE_HANDLER_GENERIC(FrameHostMsg_DidCommitProvisionalLoad, |
| 519 OnDidCommitProvisionalLoad(msg)) | 522 OnDidCommitProvisionalLoad(msg)) |
| 520 IPC_MESSAGE_HANDLER(FrameHostMsg_DidDropNavigation, OnDidDropNavigation) | |
| 521 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateState, OnUpdateState) | 523 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateState, OnUpdateState) |
| 522 IPC_MESSAGE_HANDLER(FrameHostMsg_OpenURL, OnOpenURL) | 524 IPC_MESSAGE_HANDLER(FrameHostMsg_OpenURL, OnOpenURL) |
| 523 IPC_MESSAGE_HANDLER(FrameHostMsg_DocumentOnLoadCompleted, | 525 IPC_MESSAGE_HANDLER(FrameHostMsg_DocumentOnLoadCompleted, |
| 524 OnDocumentOnLoadCompleted) | 526 OnDocumentOnLoadCompleted) |
| 525 IPC_MESSAGE_HANDLER(FrameHostMsg_BeforeUnload_ACK, OnBeforeUnloadACK) | 527 IPC_MESSAGE_HANDLER(FrameHostMsg_BeforeUnload_ACK, OnBeforeUnloadACK) |
| 526 IPC_MESSAGE_HANDLER(FrameHostMsg_SwapOut_ACK, OnSwapOutACK) | 528 IPC_MESSAGE_HANDLER(FrameHostMsg_SwapOut_ACK, OnSwapOutACK) |
| 527 IPC_MESSAGE_HANDLER(FrameHostMsg_ContextMenu, OnContextMenu) | 529 IPC_MESSAGE_HANDLER(FrameHostMsg_ContextMenu, OnContextMenu) |
| 528 IPC_MESSAGE_HANDLER(FrameHostMsg_JavaScriptExecuteResponse, | 530 IPC_MESSAGE_HANDLER(FrameHostMsg_JavaScriptExecuteResponse, |
| 529 OnJavaScriptExecuteResponse) | 531 OnJavaScriptExecuteResponse) |
| 530 IPC_MESSAGE_HANDLER(FrameHostMsg_VisualStateResponse, | 532 IPC_MESSAGE_HANDLER(FrameHostMsg_VisualStateResponse, |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 683 | 685 |
| 684 gfx::NativeViewAccessible | 686 gfx::NativeViewAccessible |
| 685 RenderFrameHostImpl::AccessibilityGetNativeViewAccessible() { | 687 RenderFrameHostImpl::AccessibilityGetNativeViewAccessible() { |
| 686 RenderWidgetHostViewBase* view = static_cast<RenderWidgetHostViewBase*>( | 688 RenderWidgetHostViewBase* view = static_cast<RenderWidgetHostViewBase*>( |
| 687 render_view_host_->GetWidget()->GetView()); | 689 render_view_host_->GetWidget()->GetView()); |
| 688 if (view) | 690 if (view) |
| 689 return view->AccessibilityGetNativeViewAccessible(); | 691 return view->AccessibilityGetNativeViewAccessible(); |
| 690 return NULL; | 692 return NULL; |
| 691 } | 693 } |
| 692 | 694 |
| 695 void RenderFrameHostImpl::RenderProcessGone(SiteInstanceImpl* site_instance) { | |
| 696 DCHECK(site_instance == site_instance_.get()); | |
| 697 | |
| 698 // The render process is gone, this frame can no longer be loading. | |
| 699 ResetLoadingState(); | |
| 700 } | |
| 701 | |
| 693 bool RenderFrameHostImpl::CreateRenderFrame(int proxy_routing_id, | 702 bool RenderFrameHostImpl::CreateRenderFrame(int proxy_routing_id, |
| 694 int opener_routing_id, | 703 int opener_routing_id, |
| 695 int parent_routing_id, | 704 int parent_routing_id, |
| 696 int previous_sibling_routing_id) { | 705 int previous_sibling_routing_id) { |
| 697 TRACE_EVENT0("navigation", "RenderFrameHostImpl::CreateRenderFrame"); | 706 TRACE_EVENT0("navigation", "RenderFrameHostImpl::CreateRenderFrame"); |
| 698 DCHECK(!IsRenderFrameLive()) << "Creating frame twice"; | 707 DCHECK(!IsRenderFrameLive()) << "Creating frame twice"; |
| 699 | 708 |
| 700 // The process may (if we're sharing a process with another host that already | 709 // The process may (if we're sharing a process with another host that already |
| 701 // initialized it) or may not (we have our own process or the old process | 710 // initialized it) or may not (we have our own process or the old process |
| 702 // crashed) have been initialized. Calling Init multiple times will be | 711 // crashed) have been initialized. Calling Init multiple times will be |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1035 !validated_params.was_within_same_page) { | 1044 !validated_params.was_within_same_page) { |
| 1036 RenderWidgetHostImpl::From(GetView()->GetRenderWidgetHost()) | 1045 RenderWidgetHostImpl::From(GetView()->GetRenderWidgetHost()) |
| 1037 ->StartNewContentRenderingTimeout(); | 1046 ->StartNewContentRenderingTimeout(); |
| 1038 } | 1047 } |
| 1039 | 1048 |
| 1040 // PlzNavigate | 1049 // PlzNavigate |
| 1041 if (IsBrowserSideNavigationEnabled()) | 1050 if (IsBrowserSideNavigationEnabled()) |
| 1042 pending_commit_ = false; | 1051 pending_commit_ = false; |
| 1043 } | 1052 } |
| 1044 | 1053 |
| 1045 void RenderFrameHostImpl::OnDidDropNavigation() { | |
| 1046 // At the end of Navigate(), the FrameTreeNode's DidStartLoading is called to | |
| 1047 // force the spinner to start, even if the renderer didn't yet begin the load. | |
| 1048 // If it turns out that the renderer dropped the navigation, the spinner needs | |
| 1049 // to be turned off. | |
| 1050 frame_tree_node_->DidStopLoading(); | |
| 1051 navigation_handle_.reset(); | |
| 1052 } | |
| 1053 | |
| 1054 void RenderFrameHostImpl::OnUpdateState(const PageState& state) { | 1054 void RenderFrameHostImpl::OnUpdateState(const PageState& state) { |
| 1055 // TODO(creis): Verify the state's ISN matches the last committed FNE. | 1055 // TODO(creis): Verify the state's ISN matches the last committed FNE. |
| 1056 | 1056 |
| 1057 // Without this check, the renderer can trick the browser into using | 1057 // Without this check, the renderer can trick the browser into using |
| 1058 // filenames it can't access in a future session restore. | 1058 // filenames it can't access in a future session restore. |
| 1059 // TODO(creis): Move CanAccessFilesOfPageState to RenderFrameHostImpl. | 1059 // TODO(creis): Move CanAccessFilesOfPageState to RenderFrameHostImpl. |
| 1060 if (!render_view_host_->CanAccessFilesOfPageState(state)) { | 1060 if (!render_view_host_->CanAccessFilesOfPageState(state)) { |
| 1061 bad_message::ReceivedBadMessage( | 1061 bad_message::ReceivedBadMessage( |
| 1062 GetProcess(), bad_message::RFH_CAN_ACCESS_FILES_OF_PAGE_STATE); | 1062 GetProcess(), bad_message::RFH_CAN_ACCESS_FILES_OF_PAGE_STATE); |
| 1063 return; | 1063 return; |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1309 frame_tree_node_->render_manager()->IsPendingDeletion(this)) { | 1309 frame_tree_node_->render_manager()->IsPendingDeletion(this)) { |
| 1310 render_view_host_->set_is_active(false); | 1310 render_view_host_->set_is_active(false); |
| 1311 render_view_host_->set_is_swapped_out(true); | 1311 render_view_host_->set_is_swapped_out(true); |
| 1312 } | 1312 } |
| 1313 | 1313 |
| 1314 if (frame_tree_node_->render_manager()->DeleteFromPendingList(this)) { | 1314 if (frame_tree_node_->render_manager()->DeleteFromPendingList(this)) { |
| 1315 // We are now deleted. | 1315 // We are now deleted. |
| 1316 return; | 1316 return; |
| 1317 } | 1317 } |
| 1318 | 1318 |
| 1319 ResetLoadingState(); | |
| 1320 | |
| 1319 // If this RFH wasn't pending deletion, then it is now swapped out. | 1321 // If this RFH wasn't pending deletion, then it is now swapped out. |
| 1320 SetState(RenderFrameHostImpl::STATE_SWAPPED_OUT); | 1322 SetState(RenderFrameHostImpl::STATE_SWAPPED_OUT); |
| 1321 } | 1323 } |
| 1322 | 1324 |
| 1323 void RenderFrameHostImpl::OnContextMenu(const ContextMenuParams& params) { | 1325 void RenderFrameHostImpl::OnContextMenu(const ContextMenuParams& params) { |
| 1324 // Validate the URLs in |params|. If the renderer can't request the URLs | 1326 // Validate the URLs in |params|. If the renderer can't request the URLs |
| 1325 // directly, don't show them in the context menu. | 1327 // directly, don't show them in the context menu. |
| 1326 ContextMenuParams validated_params(params); | 1328 ContextMenuParams validated_params(params); |
| 1327 RenderProcessHost* process = GetProcess(); | 1329 RenderProcessHost* process = GetProcess(); |
| 1328 | 1330 |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1694 delegate_->EnterFullscreenMode(GetLastCommittedURL().GetOrigin()); | 1696 delegate_->EnterFullscreenMode(GetLastCommittedURL().GetOrigin()); |
| 1695 else | 1697 else |
| 1696 delegate_->ExitFullscreenMode(/* will_cause_resize */ true); | 1698 delegate_->ExitFullscreenMode(/* will_cause_resize */ true); |
| 1697 | 1699 |
| 1698 // The previous call might change the fullscreen state. We need to make sure | 1700 // The previous call might change the fullscreen state. We need to make sure |
| 1699 // the renderer is aware of that, which is done via the resize message. | 1701 // the renderer is aware of that, which is done via the resize message. |
| 1700 render_view_host_->GetWidget()->WasResized(); | 1702 render_view_host_->GetWidget()->WasResized(); |
| 1701 } | 1703 } |
| 1702 | 1704 |
| 1703 void RenderFrameHostImpl::OnDidStartLoading(bool to_different_document) { | 1705 void RenderFrameHostImpl::OnDidStartLoading(bool to_different_document) { |
| 1704 // Any main frame load to a new document should reset the load since it will | 1706 bool was_previously_loading = frame_tree_node_->frame_tree()->IsLoading(); |
| 1705 // replace the current page and any frames. | 1707 is_loading_ = true; |
| 1706 if (to_different_document && !GetParent()) | |
| 1707 is_loading_ = false; | |
| 1708 | 1708 |
| 1709 // This method should never be called when the frame is loading. | 1709 // Only inform the FrameTreeNode of a change in load state if the load state |
| 1710 // Unfortunately, it can happen if a history navigation happens during a | 1710 // of this RenderFrameHost is being tracked. |
| 1711 // BeforeUnload or Unload event. | 1711 bool is_load_tracked = |
| 1712 // TODO(fdegans): Change this to a DCHECK after LoadEventProgress has been | 1712 this == frame_tree_node_->render_manager()->current_frame_host() || |
| 1713 // refactored in Blink. See crbug.com/466089 | 1713 (IsBrowserSideNavigationEnabled() |
| 1714 if (is_loading_) { | 1714 ? this == |
| 1715 LOG(WARNING) << "OnDidStartLoading was called twice."; | 1715 frame_tree_node_->render_manager()->speculative_frame_host() |
| 1716 return; | 1716 : this == frame_tree_node_->render_manager()->pending_frame_host()); |
|
nasko
2016/02/11 16:33:45
This seems rather hard to read. Can we find a simp
clamy
2016/02/12 12:25:42
Done.
| |
| 1717 if (is_load_tracked) { | |
| 1718 frame_tree_node_->DidStartLoading(to_different_document, | |
| 1719 was_previously_loading); | |
| 1717 } | 1720 } |
| 1718 | |
| 1719 frame_tree_node_->DidStartLoading(to_different_document); | |
| 1720 is_loading_ = true; | |
| 1721 } | 1721 } |
| 1722 | 1722 |
| 1723 void RenderFrameHostImpl::OnDidStopLoading() { | 1723 void RenderFrameHostImpl::OnDidStopLoading() { |
| 1724 // This method should never be called when the frame is not loading. | 1724 // This method should never be called when the frame is not loading. |
| 1725 // Unfortunately, it can happen if a history navigation happens during a | 1725 // Unfortunately, it can happen if a history navigation happens during a |
| 1726 // BeforeUnload or Unload event. | 1726 // BeforeUnload or Unload event. |
| 1727 // TODO(fdegans): Change this to a DCHECK after LoadEventProgress has been | 1727 // TODO(fdegans): Change this to a DCHECK after LoadEventProgress has been |
| 1728 // refactored in Blink. See crbug.com/466089 | 1728 // refactored in Blink. See crbug.com/466089 |
| 1729 if (!is_loading_) { | 1729 if (!is_loading_) { |
| 1730 LOG(WARNING) << "OnDidStopLoading was called twice."; | 1730 LOG(WARNING) << "OnDidStopLoading was called twice."; |
| 1731 return; | 1731 return; |
| 1732 } | 1732 } |
| 1733 | 1733 |
| 1734 is_loading_ = false; | 1734 is_loading_ = false; |
| 1735 frame_tree_node_->DidStopLoading(); | |
| 1736 navigation_handle_.reset(); | 1735 navigation_handle_.reset(); |
| 1736 | |
| 1737 // Only inform the FrameTreeNode of a change in load state if the load state | |
| 1738 // of this RenderFrameHost is being tracked. | |
| 1739 bool is_load_tracked = | |
| 1740 this == frame_tree_node_->render_manager()->current_frame_host() || | |
| 1741 (IsBrowserSideNavigationEnabled() | |
| 1742 ? this == | |
| 1743 frame_tree_node_->render_manager()->speculative_frame_host() | |
| 1744 : this == frame_tree_node_->render_manager()->pending_frame_host()); | |
| 1745 if (is_load_tracked) | |
| 1746 frame_tree_node_->DidStopLoading(); | |
| 1737 } | 1747 } |
| 1738 | 1748 |
| 1739 void RenderFrameHostImpl::OnDidChangeLoadProgress(double load_progress) { | 1749 void RenderFrameHostImpl::OnDidChangeLoadProgress(double load_progress) { |
| 1740 frame_tree_node_->DidChangeLoadProgress(load_progress); | 1750 frame_tree_node_->DidChangeLoadProgress(load_progress); |
| 1741 } | 1751 } |
| 1742 | 1752 |
| 1743 void RenderFrameHostImpl::OnSerializeAsMHTMLResponse( | 1753 void RenderFrameHostImpl::OnSerializeAsMHTMLResponse( |
| 1744 int job_id, | 1754 int job_id, |
| 1745 bool success, | 1755 bool success, |
| 1746 const std::set<std::string>& digests_of_uris_of_serialized_resources) { | 1756 const std::set<std::string>& digests_of_uris_of_serialized_resources) { |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1906 // throbber needs to be kept in sync with what's happening in the UI. For | 1916 // throbber needs to be kept in sync with what's happening in the UI. For |
| 1907 // example, the throbber will start immediately when the user navigates even | 1917 // example, the throbber will start immediately when the user navigates even |
| 1908 // if the renderer is delayed. There is also an issue with the throbber | 1918 // if the renderer is delayed. There is also an issue with the throbber |
| 1909 // starting because the WebUI (which controls whether the favicon is | 1919 // starting because the WebUI (which controls whether the favicon is |
| 1910 // displayed) happens synchronously. If the start loading messages was | 1920 // displayed) happens synchronously. If the start loading messages was |
| 1911 // asynchronous, then the default favicon would flash in. | 1921 // asynchronous, then the default favicon would flash in. |
| 1912 // | 1922 // |
| 1913 // Blink doesn't send throb notifications for JavaScript URLs, so it is not | 1923 // Blink doesn't send throb notifications for JavaScript URLs, so it is not |
| 1914 // done here either. | 1924 // done here either. |
| 1915 if (!common_params.url.SchemeIs(url::kJavaScriptScheme)) | 1925 if (!common_params.url.SchemeIs(url::kJavaScriptScheme)) |
| 1916 frame_tree_node_->DidStartLoading(true); | 1926 OnDidStartLoading(true); |
| 1917 } | 1927 } |
| 1918 | 1928 |
| 1919 void RenderFrameHostImpl::NavigateToInterstitialURL(const GURL& data_url) { | 1929 void RenderFrameHostImpl::NavigateToInterstitialURL(const GURL& data_url) { |
| 1920 DCHECK(data_url.SchemeIs(url::kDataScheme)); | 1930 DCHECK(data_url.SchemeIs(url::kDataScheme)); |
| 1921 CommonNavigationParams common_params( | 1931 CommonNavigationParams common_params( |
| 1922 data_url, Referrer(), ui::PAGE_TRANSITION_LINK, | 1932 data_url, Referrer(), ui::PAGE_TRANSITION_LINK, |
| 1923 FrameMsg_Navigate_Type::NORMAL, false, false, base::TimeTicks::Now(), | 1933 FrameMsg_Navigate_Type::NORMAL, false, false, base::TimeTicks::Now(), |
| 1924 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), LOFI_OFF, | 1934 FrameMsg_UILoadMetricsReportType::NO_REPORT, GURL(), GURL(), LOFI_OFF, |
| 1925 base::TimeTicks::Now()); | 1935 base::TimeTicks::Now()); |
| 1926 if (IsBrowserSideNavigationEnabled()) { | 1936 if (IsBrowserSideNavigationEnabled()) { |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2245 | 2255 |
| 2246 const image_downloader::ImageDownloaderPtr& | 2256 const image_downloader::ImageDownloaderPtr& |
| 2247 RenderFrameHostImpl::GetMojoImageDownloader() { | 2257 RenderFrameHostImpl::GetMojoImageDownloader() { |
| 2248 if (!mojo_image_downloader_.get() && GetServiceRegistry()) { | 2258 if (!mojo_image_downloader_.get() && GetServiceRegistry()) { |
| 2249 GetServiceRegistry()->ConnectToRemoteService( | 2259 GetServiceRegistry()->ConnectToRemoteService( |
| 2250 mojo::GetProxy(&mojo_image_downloader_)); | 2260 mojo::GetProxy(&mojo_image_downloader_)); |
| 2251 } | 2261 } |
| 2252 return mojo_image_downloader_; | 2262 return mojo_image_downloader_; |
| 2253 } | 2263 } |
| 2254 | 2264 |
| 2265 void RenderFrameHostImpl::ResetLoadingState() { | |
| 2266 if (is_loading()) { | |
| 2267 // When pending deletion, just set the loading state to not loading. | |
| 2268 // Otherwise, OnDidStopLoading will take care of that, as well as sending | |
| 2269 // notification to the FrameTreeNode about the change in loading state. | |
| 2270 if (rfh_state_ != STATE_DEFAULT) | |
| 2271 is_loading_ = false; | |
| 2272 else | |
| 2273 OnDidStopLoading(); | |
| 2274 } | |
| 2275 } | |
| 2276 | |
| 2255 bool RenderFrameHostImpl::IsSameSiteInstance( | 2277 bool RenderFrameHostImpl::IsSameSiteInstance( |
| 2256 RenderFrameHostImpl* other_render_frame_host) { | 2278 RenderFrameHostImpl* other_render_frame_host) { |
| 2257 // As a sanity check, make sure the frame belongs to the same BrowserContext. | 2279 // As a sanity check, make sure the frame belongs to the same BrowserContext. |
| 2258 CHECK_EQ(GetSiteInstance()->GetBrowserContext(), | 2280 CHECK_EQ(GetSiteInstance()->GetBrowserContext(), |
| 2259 other_render_frame_host->GetSiteInstance()->GetBrowserContext()); | 2281 other_render_frame_host->GetSiteInstance()->GetBrowserContext()); |
| 2260 return GetSiteInstance() == other_render_frame_host->GetSiteInstance(); | 2282 return GetSiteInstance() == other_render_frame_host->GetSiteInstance(); |
| 2261 } | 2283 } |
| 2262 | 2284 |
| 2263 void RenderFrameHostImpl::SetAccessibilityMode(AccessibilityMode mode) { | 2285 void RenderFrameHostImpl::SetAccessibilityMode(AccessibilityMode mode) { |
| 2264 Send(new FrameMsg_SetAccessibilityMode(routing_id_, mode)); | 2286 Send(new FrameMsg_SetAccessibilityMode(routing_id_, mode)); |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2565 *dst = src; | 2587 *dst = src; |
| 2566 | 2588 |
| 2567 if (src.routing_id != -1) | 2589 if (src.routing_id != -1) |
| 2568 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); | 2590 dst->tree_id = RoutingIDToAXTreeID(src.routing_id); |
| 2569 | 2591 |
| 2570 if (src.parent_routing_id != -1) | 2592 if (src.parent_routing_id != -1) |
| 2571 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); | 2593 dst->parent_tree_id = RoutingIDToAXTreeID(src.parent_routing_id); |
| 2572 } | 2594 } |
| 2573 | 2595 |
| 2574 } // namespace content | 2596 } // namespace content |
| OLD | NEW |