Commit 3f4337f2 authored by Peter Boström's avatar Peter Boström Committed by Commit Bot

CHECK for owned_contents in TabDragController

Used to test grt@'s hypothesis in https://crbug.com/677806.

Bug: 677806
Change-Id: I1f2fa6c799fdd765f7dfbe2530f4fb5916fbb5f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2443976
Commit-Queue: Peter Boström <pbos@chromium.org>
Commit-Queue: Connie Wan <connily@chromium.org>
Auto-Submit: Peter Boström <pbos@chromium.org>
Reviewed-by: default avatarConnie Wan <connily@chromium.org>
Cr-Commit-Position: refs/heads/master@{#813016}
parent b6516b0e
......@@ -1216,6 +1216,9 @@ void TabDragController::Attach(TabDragContext* attached_context,
if (drag_data_[i].pinned)
add_types |= TabStripModel::ADD_PINNED;
// We should have owned_contents here, this CHECK is used to gather data
// for https://crbug.com/677806.
CHECK(drag_data_[i].owned_contents);
attached_context_->GetTabStripModel()->InsertWebContentsAt(
index + i - first_tab_index(),
std::move(drag_data_[i].owned_contents), add_types, group_);
......@@ -1755,6 +1758,9 @@ void TabDragController::CompleteDrag() {
std::vector<TabStripModelDelegate::NewStripContents> contentses;
for (size_t i = 0; i < drag_data_.size(); ++i) {
TabStripModelDelegate::NewStripContents item;
// We should have owned_contents here, this CHECK is used to gather data
// for https://crbug.com/677806.
CHECK(drag_data_[i].owned_contents);
item.web_contents = std::move(drag_data_[i].owned_contents);
item.add_types = drag_data_[i].pinned ? TabStripModel::ADD_PINNED
: TabStripModel::ADD_NONE;
......
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