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

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

Issue 669613005: Ensure that the browser’s copy of page id is in sync with the renderer’s. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/crash_logging.h"
10 #include "base/debug/trace_event.h" 11 #include "base/debug/trace_event.h"
11 #include "base/lazy_instance.h" 12 #include "base/lazy_instance.h"
12 #include "base/logging.h" 13 #include "base/logging.h"
13 #include "base/metrics/histogram.h" 14 #include "base/metrics/histogram.h"
14 #include "base/metrics/stats_counters.h" 15 #include "base/metrics/stats_counters.h"
15 #include "base/process/process.h" 16 #include "base/process/process.h"
16 #include "base/strings/string16.h" 17 #include "base/strings/string16.h"
17 #include "base/strings/string_number_conversions.h" 18 #include "base/strings/string_number_conversions.h"
18 #include "base/strings/string_util.h" 19 #include "base/strings/string_util.h"
19 #include "base/strings/utf_string_conversions.h" 20 #include "base/strings/utf_string_conversions.h"
(...skipping 3561 matching lines...) Expand 10 before | Expand all | Expand 10 after
3581 FOR_EACH_OBSERVER(WebContentsObserver, 3582 FOR_EACH_OBSERVER(WebContentsObserver,
3582 observers_, 3583 observers_,
3583 RenderProcessGone(GetCrashedStatus())); 3584 RenderProcessGone(GetCrashedStatus()));
3584 } 3585 }
3585 3586
3586 void WebContentsImpl::RenderViewDeleted(RenderViewHost* rvh) { 3587 void WebContentsImpl::RenderViewDeleted(RenderViewHost* rvh) {
3587 FOR_EACH_OBSERVER(WebContentsObserver, observers_, RenderViewDeleted(rvh)); 3588 FOR_EACH_OBSERVER(WebContentsObserver, observers_, RenderViewDeleted(rvh));
3588 } 3589 }
3589 3590
3590 void WebContentsImpl::UpdateState(RenderViewHost* rvh, 3591 void WebContentsImpl::UpdateState(RenderViewHost* rvh,
3592 int32 rvh_page_id,
3591 int32 page_id, 3593 int32 page_id,
3592 const PageState& page_state) { 3594 const PageState& page_state) {
3595 if (rvh_page_id != page_id) {
3596 base::debug::SetCrashKeyValue("renderer_page_id",
3597 base::IntToString(page_id));
3598 base::debug::SetCrashKeyValue("browser_page_id",
3599 base::IntToString(rvh_page_id));
3600 NavigationEntryImpl* entry = NavigationEntryImpl::FromNavigationEntry(
3601 controller_.GetLastCommittedEntry());
3602 // The question being answered here is: when there is a page id mismatch
3603 // between the renderer and the browser, which value (if either) matches
3604 // that of the last committed entry?
3605 if (entry) {
3606 if (entry->site_instance() == rvh->GetSiteInstance()) {
3607 base::debug::SetCrashKeyValue("last_committed_page_id",
3608 base::IntToString(entry->GetPageID()));
3609 } else {
3610 base::debug::SetCrashKeyValue("last_committed_page_id",
3611 "site instance mismatch");
3612 }
3613 } else {
3614 base::debug::SetCrashKeyValue("last_committed_page_id", "no entry");
3615 }
3616 CHECK(false);
3617 }
3593 // Ensure that this state update comes from either the active RVH or one of 3618 // Ensure that this state update comes from either the active RVH or one of
3594 // the swapped out RVHs. We don't expect to hear from any other RVHs. 3619 // the swapped out RVHs. We don't expect to hear from any other RVHs.
3595 // TODO(nasko): This should go through RenderFrameHost. 3620 // TODO(nasko): This should go through RenderFrameHost.
3596 // TODO(creis): We can't update state for cross-process subframes until we 3621 // TODO(creis): We can't update state for cross-process subframes until we
3597 // have FrameNavigationEntries. Once we do, this should be a DCHECK. 3622 // have FrameNavigationEntries. Once we do, this should be a DCHECK.
3598 if (rvh != GetRenderViewHost() && 3623 if (rvh != GetRenderViewHost() &&
3599 !GetRenderManager()->IsRVHOnSwappedOutList( 3624 !GetRenderManager()->IsRVHOnSwappedOutList(
3600 static_cast<RenderViewHostImpl*>(rvh))) 3625 static_cast<RenderViewHostImpl*>(rvh)))
3601 return; 3626 return;
3602 3627
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
4325 node->render_manager()->ResumeResponseDeferredAtStart(); 4350 node->render_manager()->ResumeResponseDeferredAtStart();
4326 } 4351 }
4327 4352
4328 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { 4353 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) {
4329 force_disable_overscroll_content_ = force_disable; 4354 force_disable_overscroll_content_ = force_disable;
4330 if (view_) 4355 if (view_)
4331 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); 4356 view_->SetOverscrollControllerEnabled(CanOverscrollContent());
4332 } 4357 }
4333 4358
4334 } // namespace content 4359 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698