diff options
Diffstat (limited to 'content/browser')
12 files changed, 23 insertions, 41 deletions
diff --git a/content/browser/android/web_contents_observer_proxy.cc b/content/browser/android/web_contents_observer_proxy.cc index 8566bee..a8e5eac 100644 --- a/content/browser/android/web_contents_observer_proxy.cc +++ b/content/browser/android/web_contents_observer_proxy.cc @@ -79,8 +79,7 @@ void WebContentsObserverProxy::RenderProcessGone( was_oom_protected); } -void WebContentsObserverProxy::DidStartLoading( - RenderViewHost* render_view_host) { +void WebContentsObserverProxy::DidStartLoading() { JNIEnv* env = AttachCurrentThread(); ScopedJavaLocalRef<jobject> obj(weak_java_observer_.get(env)); if (obj.is_null()) @@ -91,8 +90,7 @@ void WebContentsObserverProxy::DidStartLoading( jstring_url.obj()); } -void WebContentsObserverProxy::DidStopLoading( - RenderViewHost* render_view_host) { +void WebContentsObserverProxy::DidStopLoading() { JNIEnv* env = AttachCurrentThread(); ScopedJavaLocalRef<jobject> obj(weak_java_observer_.get(env)); if (obj.is_null()) diff --git a/content/browser/android/web_contents_observer_proxy.h b/content/browser/android/web_contents_observer_proxy.h index 1d45011..7ee1a22 100644 --- a/content/browser/android/web_contents_observer_proxy.h +++ b/content/browser/android/web_contents_observer_proxy.h @@ -32,8 +32,8 @@ class WebContentsObserverProxy : public WebContentsObserver { private: void RenderViewReady() override; void RenderProcessGone(base::TerminationStatus termination_status) override; - void DidStartLoading(RenderViewHost* render_view_host) override; - void DidStopLoading(RenderViewHost* render_view_host) override; + void DidStartLoading() override; + void DidStopLoading() override; void DidFailProvisionalLoad(RenderFrameHost* render_frame_host, const GURL& validated_url, int error_code, diff --git a/content/browser/frame_host/interstitial_page_impl.cc b/content/browser/frame_host/interstitial_page_impl.cc index 197d9d4..f7ee287 100644 --- a/content/browser/frame_host/interstitial_page_impl.cc +++ b/content/browser/frame_host/interstitial_page_impl.cc @@ -483,8 +483,7 @@ void InterstitialPageImpl::DidNavigate( // as complete. Without this, navigating in a UI test to a URL that triggers // an interstitial would hang. web_contents_was_loading_ = controller_->delegate()->IsLoading(); - controller_->delegate()->SetIsLoading( - controller_->delegate()->GetRenderViewHost(), false, true, NULL); + controller_->delegate()->SetIsLoading(false, true, NULL); } RendererPreferences InterstitialPageImpl::GetRendererPrefs( @@ -591,8 +590,7 @@ void InterstitialPageImpl::Proceed() { // Resumes the throbber, if applicable. if (web_contents_was_loading_) - controller_->delegate()->SetIsLoading( - controller_->delegate()->GetRenderViewHost(), true, true, NULL); + controller_->delegate()->SetIsLoading(true, true, NULL); // If this is a new navigation, the old page is going away, so we cancel any // blocked requests for it. If it is not a new navigation, then it means the diff --git a/content/browser/frame_host/navigation_controller_delegate.h b/content/browser/frame_host/navigation_controller_delegate.h index 90fd4d3..e578a84 100644 --- a/content/browser/frame_host/navigation_controller_delegate.h +++ b/content/browser/frame_host/navigation_controller_delegate.h @@ -71,8 +71,7 @@ class NavigationControllerDelegate { virtual void AttachInterstitialPage( InterstitialPageImpl* interstitial_page) = 0; virtual void DetachInterstitialPage() = 0; - virtual void SetIsLoading(RenderViewHost* render_view_host, - bool is_loading, + virtual void SetIsLoading(bool is_loading, bool to_different_document, LoadNotificationDetails* details) = 0; }; diff --git a/content/browser/frame_host/navigation_controller_impl_browsertest.cc b/content/browser/frame_host/navigation_controller_impl_browsertest.cc index 66646f7..6f54e00 100644 --- a/content/browser/frame_host/navigation_controller_impl_browsertest.cc +++ b/content/browser/frame_host/navigation_controller_impl_browsertest.cc @@ -289,7 +289,7 @@ class FrameNavigateParamsCapturer : public WebContentsObserver { message_loop_runner_->Quit(); } - void DidStopLoading(RenderViewHost* render_view_host) override { + void DidStopLoading() override { if (!navigations_remaining_) message_loop_runner_->Quit(); } @@ -359,9 +359,7 @@ class LoadCommittedCapturer : public WebContentsObserver { message_loop_runner_->Quit(); } - void DidStopLoading(RenderViewHost* render_view_host) override { - message_loop_runner_->Quit(); - } + void DidStopLoading() override { message_loop_runner_->Quit(); } // The id of the FrameTreeNode whose navigations to observe. int frame_tree_node_id_; diff --git a/content/browser/frame_host/navigation_controller_impl_unittest.cc b/content/browser/frame_host/navigation_controller_impl_unittest.cc index 3b56740..c18ca9b 100644 --- a/content/browser/frame_host/navigation_controller_impl_unittest.cc +++ b/content/browser/frame_host/navigation_controller_impl_unittest.cc @@ -3078,7 +3078,7 @@ TEST_F(NavigationControllerTest, ShowBrowserURLAfterFailUntilModified) { params.showing_repost_interstitial = false; main_test_rfh()->OnMessageReceived( FrameHostMsg_DidFailProvisionalLoadWithError(0, params)); - contents()->SetIsLoading(test_rvh(), false, true, NULL); + contents()->SetIsLoading(false, true, NULL); EXPECT_EQ(url, controller.GetVisibleEntry()->GetURL()); // If something else later modifies the contents of the about:blank page, then diff --git a/content/browser/web_contents/aura/overscroll_navigation_overlay.cc b/content/browser/web_contents/aura/overscroll_navigation_overlay.cc index a96b0d2..c0c4a41 100644 --- a/content/browser/web_contents/aura/overscroll_navigation_overlay.cc +++ b/content/browser/web_contents/aura/overscroll_navigation_overlay.cc @@ -304,7 +304,7 @@ void OverscrollNavigationOverlay::DidFirstVisuallyNonEmptyPaint() { } } -void OverscrollNavigationOverlay::DidStopLoading(RenderViewHost* host) { +void OverscrollNavigationOverlay::DidStopLoading() { // Don't compare URLs in this case - it's possible they won't match if // a gesture-nav initiated navigation was interrupted by some other in-site // navigation ((e.g., from a script, or from a bookmark). diff --git a/content/browser/web_contents/aura/overscroll_navigation_overlay.h b/content/browser/web_contents/aura/overscroll_navigation_overlay.h index db9871c..6e0ec07 100644 --- a/content/browser/web_contents/aura/overscroll_navigation_overlay.h +++ b/content/browser/web_contents/aura/overscroll_navigation_overlay.h @@ -89,7 +89,7 @@ class CONTENT_EXPORT OverscrollNavigationOverlay // Overridden from WebContentsObserver: void DidFirstVisuallyNonEmptyPaint() override; - void DidStopLoading(RenderViewHost* host) override; + void DidStopLoading() override; // The WebContents which is being navigated. WebContentsImpl* web_contents_; diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc index 9b4875c..e4b6baf 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc @@ -3392,8 +3392,7 @@ bool WebContentsImpl::HasAccessedInitialDocument() { // Notifies the RenderWidgetHost instance about the fact that the page is // loading, or done loading. -void WebContentsImpl::SetIsLoading(RenderViewHost* render_view_host, - bool is_loading, +void WebContentsImpl::SetIsLoading(bool is_loading, bool to_different_document, LoadNotificationDetails* details) { if (is_loading == is_loading_) @@ -3421,13 +3420,11 @@ void WebContentsImpl::SetIsLoading(RenderViewHost* render_view_host, if (is_loading) { TRACE_EVENT_ASYNC_BEGIN1("browser,navigation", "WebContentsImpl Loading", this, "URL", url); - FOR_EACH_OBSERVER(WebContentsObserver, observers_, - DidStartLoading(render_view_host)); + FOR_EACH_OBSERVER(WebContentsObserver, observers_, DidStartLoading()); } else { TRACE_EVENT_ASYNC_END1("browser,navigation", "WebContentsImpl Loading", this, "URL", url); - FOR_EACH_OBSERVER(WebContentsObserver, observers_, - DidStopLoading(render_view_host)); + FOR_EACH_OBSERVER(WebContentsObserver, observers_, DidStopLoading()); } // TODO(avi): Remove. http://crbug.com/170921 @@ -3835,7 +3832,7 @@ void WebContentsImpl::RenderViewTerminated(RenderViewHost* rvh, if (delegate_) delegate_->HideValidationMessage(this); - SetIsLoading(rvh, false, true, NULL); + SetIsLoading(false, true, nullptr); NotifyDisconnected(); SetIsCrashed(status, error_code); @@ -3943,8 +3940,7 @@ void WebContentsImpl::RequestMove(const gfx::Rect& new_bounds) { void WebContentsImpl::DidStartLoading(RenderFrameHost* render_frame_host, bool to_different_document) { - SetIsLoading(render_frame_host->GetRenderViewHost(), true, - to_different_document, NULL); + SetIsLoading(true, to_different_document, nullptr); // Notify accessibility that the user is navigating away from the // current document. @@ -3980,8 +3976,7 @@ void WebContentsImpl::DidStopLoading(RenderFrameHost* render_frame_host) { controller_.GetCurrentEntryIndex())); } - SetIsLoading(render_frame_host->GetRenderViewHost(), false, true, - details.get()); + SetIsLoading(false, true, details.get()); } void WebContentsImpl::DidCancelLoading() { diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h index 3a86786..19f42c0 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h @@ -660,8 +660,7 @@ class CONTENT_EXPORT WebContentsImpl // Changes the IsLoading state and notifies the delegate as needed. // |details| is used to provide details on the load that just finished // (but can be null if not applicable). - void SetIsLoading(RenderViewHost* render_view_host, - bool is_loading, + void SetIsLoading(bool is_loading, bool to_different_document, LoadNotificationDetails* details) override; diff --git a/content/browser/web_contents/web_contents_impl_browsertest.cc b/content/browser/web_contents/web_contents_impl_browsertest.cc index 876bd7b..8cdfedf 100644 --- a/content/browser/web_contents/web_contents_impl_browsertest.cc +++ b/content/browser/web_contents/web_contents_impl_browsertest.cc @@ -497,14 +497,14 @@ struct LoadProgressDelegateAndObserver : public WebContentsDelegate, } // WebContentsObserver: - void DidStartLoading(RenderViewHost* render_view_host) override { + void DidStartLoading() override { EXPECT_FALSE(did_start_loading); EXPECT_EQ(0U, progresses.size()); EXPECT_FALSE(did_stop_loading); did_start_loading = true; } - void DidStopLoading(RenderViewHost* render_view_host) override { + void DidStopLoading() override { EXPECT_TRUE(did_start_loading); EXPECT_GE(progresses.size(), 1U); EXPECT_FALSE(did_stop_loading); @@ -642,4 +642,3 @@ IN_PROC_BROWSER_TEST_F(WebContentsImplBrowserTest, } } // namespace content - diff --git a/content/browser/web_contents/web_contents_impl_unittest.cc b/content/browser/web_contents/web_contents_impl_unittest.cc index d56e218..67e8e40 100644 --- a/content/browser/web_contents/web_contents_impl_unittest.cc +++ b/content/browser/web_contents/web_contents_impl_unittest.cc @@ -2765,12 +2765,8 @@ class LoadingWebContentsObserver : public WebContentsObserver { } ~LoadingWebContentsObserver() override {} - void DidStartLoading(RenderViewHost* rvh) override { - is_loading_ = true; - } - void DidStopLoading(RenderViewHost* rvh) override { - is_loading_ = false; - } + void DidStartLoading() override { is_loading_ = true; } + void DidStopLoading() override { is_loading_ = false; } bool is_loading() const { return is_loading_; } |