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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 609943002: 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, 3 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index b6ff8109294e6b8da9454c4cee3f9241cf83a6e8..d36ed9578b3e8484ce32f9e12b2e300e1cc75a1a 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -7,6 +7,7 @@
#include <utility>
#include "base/command_line.h"
+#include "base/debug/crash_logging.h"
#include "base/debug/trace_event.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
@@ -3629,8 +3630,29 @@ void WebContentsImpl::RenderViewDeleted(RenderViewHost* rvh) {
}
void WebContentsImpl::UpdateState(RenderViewHost* rvh,
+ int32 browser_page_id,
int32 page_id,
const PageState& page_state) {
+ if (browser_page_id != page_id) {
+ base::debug::SetCrashKeyValue("renderer_id", base::IntToString(page_id));
Charlie Reis 2014/09/26 19:30:11 nit: Let's spell these out at renderer_page_id and
Avi (use Gerrit) 2014/09/26 19:58:18 Done.
+ base::debug::SetCrashKeyValue("browser_id",
+ base::IntToString(browser_page_id));
+ if (rvh != GetRenderViewHost() &&
+ !GetRenderManager()->IsRVHOnSwappedOutList(
+ static_cast<RenderViewHostImpl*>(rvh))) {
+ base::debug::SetCrashKeyValue("quick_discard", "yes");
Charlie Reis 2014/09/26 19:30:11 What's quick_discard? Can you add a comment for t
Avi (use Gerrit) 2014/09/26 19:58:18 Done.
+ } else {
+ base::debug::SetCrashKeyValue("quick_discard", "no");
+ int entry_index = controller_.GetEntryIndexWithPageID(
+ rvh->GetSiteInstance(), page_id);
+ bool renderer_id_matches_last_commmitted_entry =
+ entry_index == controller_.GetLastCommittedEntryIndex();
+ base::debug::SetCrashKeyValue(
+ "is_last_committed_entry",
+ renderer_id_matches_last_commmitted_entry ? "yes" : "no");
Charlie Reis 2014/09/26 19:30:11 Maybe it would be more useful (and easier) to repo
Avi (use Gerrit) 2014/09/26 19:58:18 Done.
+ }
+ CHECK(false);
+ }
// Ensure that this state update comes from either the active RVH or one of
// the swapped out RVHs. We don't expect to hear from any other RVHs.
// TODO(nasko): This should go through RenderFrameHost.

Powered by Google App Engine
This is Rietveld 408576698