Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(463)

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 743803002: Avoid stale navigation requests without excessive page id knowledge in the renderer process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more saving Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 1920 matching lines...) Expand 10 before | Expand all | Expand 10 after
1931 DidAttachInterstitialPage()); 1931 DidAttachInterstitialPage());
1932 } 1932 }
1933 1933
1934 void WebContentsImpl::DetachInterstitialPage() { 1934 void WebContentsImpl::DetachInterstitialPage() {
1935 if (ShowingInterstitialPage()) 1935 if (ShowingInterstitialPage())
1936 GetRenderManager()->remove_interstitial_page(); 1936 GetRenderManager()->remove_interstitial_page();
1937 FOR_EACH_OBSERVER(WebContentsObserver, observers_, 1937 FOR_EACH_OBSERVER(WebContentsObserver, observers_,
1938 DidDetachInterstitialPage()); 1938 DidDetachInterstitialPage());
1939 } 1939 }
1940 1940
1941 void WebContentsImpl::SetHistoryLengthAndPrune( 1941 void WebContentsImpl::SetHistoryOffsetAndLength(int history_offset,
1942 const SiteInstance* site_instance, 1942 int history_length) {
1943 int history_length, 1943 // SetHistoryOffsetAndLength doesn't work when there are pending cross-site
Charlie Reis 2014/12/03 23:48:07 Does this matter anymore? It would be great to re
Avi (use Gerrit) 2014/12/04 21:15:16 In what way? Blink needs to know where we are in
Charlie Reis 2014/12/04 23:13:58 Sorry, I was ambiguous about "this." I meant this
Avi (use Gerrit) 2014/12/05 22:16:39 I'm not sure why this was put in. If it's about th
Charlie Reis 2014/12/05 22:51:15 Acknowledged.
1944 int32 minimum_page_id) {
1945 // SetHistoryLengthAndPrune doesn't work when there are pending cross-site
1946 // navigations. Callers should ensure that this is the case. 1944 // navigations. Callers should ensure that this is the case.
1947 if (GetRenderManager()->pending_render_view_host()) { 1945 if (GetRenderManager()->pending_render_view_host()) {
1948 NOTREACHED(); 1946 NOTREACHED();
1949 return; 1947 return;
1950 } 1948 }
1951 RenderViewHostImpl* rvh = GetRenderViewHostImpl(); 1949 SetHistoryOffsetAndLengthForView(
1952 if (!rvh) { 1950 GetRenderViewHost(), history_offset, history_length);
1953 NOTREACHED(); 1951 }
1954 return; 1952
1955 } 1953 void WebContentsImpl::SetHistoryOffsetAndLengthForView(
1956 if (site_instance && rvh->GetSiteInstance() != site_instance) { 1954 RenderViewHost* render_view_host,
1957 NOTREACHED(); 1955 int history_offset,
1958 return; 1956 int history_length) {
1959 } 1957 render_view_host->Send(new ViewMsg_SetHistoryOffsetAndLength(
1960 Send(new ViewMsg_SetHistoryLengthAndPrune(GetRoutingID(), 1958 render_view_host->GetRoutingID(), history_offset, history_length));
1961 history_length,
1962 minimum_page_id));
1963 } 1959 }
1964 1960
1965 void WebContentsImpl::ReloadFocusedFrame(bool ignore_cache) { 1961 void WebContentsImpl::ReloadFocusedFrame(bool ignore_cache) {
1966 RenderFrameHost* focused_frame = GetFocusedFrame(); 1962 RenderFrameHost* focused_frame = GetFocusedFrame();
1967 if (!focused_frame) 1963 if (!focused_frame)
1968 return; 1964 return;
1969 1965
1970 focused_frame->Send(new FrameMsg_Reload( 1966 focused_frame->Send(new FrameMsg_Reload(
1971 focused_frame->GetRoutingID(), ignore_cache)); 1967 focused_frame->GetRoutingID(), ignore_cache));
1972 } 1968 }
(...skipping 2163 matching lines...) Expand 10 before | Expand all | Expand 10 after
4136 4132
4137 if (!static_cast<RenderViewHostImpl*>( 4133 if (!static_cast<RenderViewHostImpl*>(
4138 render_view_host)->CreateRenderView(base::string16(), 4134 render_view_host)->CreateRenderView(base::string16(),
4139 opener_route_id, 4135 opener_route_id,
4140 proxy_routing_id, 4136 proxy_routing_id,
4141 max_page_id, 4137 max_page_id,
4142 created_with_opener_)) { 4138 created_with_opener_)) {
4143 return false; 4139 return false;
4144 } 4140 }
4145 4141
4142 SetHistoryOffsetAndLengthForView(render_view_host,
Charlie Reis 2014/12/03 23:48:07 Interesting. We don't have a similar call here to
Avi (use Gerrit) 2014/12/04 21:15:16 Today, those values are set with the navigation, w
Charlie Reis 2014/12/04 23:13:58 I like your approach. Let's keep it.
4143 controller_.GetLastCommittedEntryIndex(),
4144 controller_.GetEntryCount());
4145
4146 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID) 4146 #if defined(OS_POSIX) && !defined(OS_MACOSX) && !defined(OS_ANDROID)
4147 // Force a ViewMsg_Resize to be sent, needed to make plugins show up on 4147 // Force a ViewMsg_Resize to be sent, needed to make plugins show up on
4148 // linux. See crbug.com/83941. 4148 // linux. See crbug.com/83941.
4149 if (rwh_view) { 4149 if (rwh_view) {
4150 if (RenderWidgetHost* render_widget_host = rwh_view->GetRenderWidgetHost()) 4150 if (RenderWidgetHost* render_widget_host = rwh_view->GetRenderWidgetHost())
4151 render_widget_host->WasResized(); 4151 render_widget_host->WasResized();
4152 } 4152 }
4153 #endif 4153 #endif
4154 4154
4155 return true; 4155 return true;
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
4356 node->render_manager()->ResumeResponseDeferredAtStart(); 4356 node->render_manager()->ResumeResponseDeferredAtStart();
4357 } 4357 }
4358 4358
4359 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { 4359 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) {
4360 force_disable_overscroll_content_ = force_disable; 4360 force_disable_overscroll_content_ = force_disable;
4361 if (view_) 4361 if (view_)
4362 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); 4362 view_->SetOverscrollControllerEnabled(CanOverscrollContent());
4363 } 4363 }
4364 4364
4365 } // namespace content 4365 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698