Commit b37536a9 authored by Devlin Cronin's avatar Devlin Cronin Committed by Commit Bot

[Cleanup] Downgrade CHECK to DCHECK in TabStripModel

This CHECK was added to (help) ensure we tracked down the cases when
we were trying to set an invalid opener. It's been a few cycles, and we
haven't seen any crashes, so downgrade to a DCHECK.

Bug: 700518
Change-Id: I3f607fe4ae7b98bbaac30fa910c0bf7394388270
Reviewed-on: https://chromium-review.googlesource.com/693309Reviewed-by: default avatarScott Violet <sky@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#506611}
parent 49aa4d3f
......@@ -555,16 +555,11 @@ WebContents* TabStripModel::GetOpenerOfWebContentsAt(int index) {
void TabStripModel::SetOpenerOfWebContentsAt(int index,
WebContents* opener) {
DCHECK(ContainsIndex(index));
if (opener) {
// The TabStripModel only maintains the references to openers that it itself
// owns; trying to set an opener to an external WebContents can result in
// the opener being used after its freed. See crbug.com/698681.
// TODO(devlin): This is a CHECK right now to track down any other cases
// where this can happen. If there aren't any, we might be able to downgrade
// this to a DCHECK.
CHECK_NE(kNoTab, GetIndexOfWebContents(opener))
<< "Cannot set opener to a web contents not owned by this tab strip.";
}
// The TabStripModel only maintains the references to openers that it itself
// owns; trying to set an opener to an external WebContents can result in
// the opener being used after its freed. See crbug.com/698681.
DCHECK(!opener || GetIndexOfWebContents(opener) != kNoTab)
<< "Cannot set opener to a web contents not owned by this tab strip.";
contents_data_[index]->set_opener(opener);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment