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

Issue 2114673002: Fix restore of a tab from a recently-closed browser window (Closed)

Created:
4 years, 5 months ago by blundell
Modified:
4 years, 5 months ago
Reviewers:
sky
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix restore of a tab from a recently-closed browser window https://codereview.chromium.org/1343833002 introduced a manually-written copy constructor and assignment operator for TabRestoreService::Tab in order to accommodate a new member that had to be copied via an explicit Clone() method. However, that CL failed to copy the fields of TabRestoreService::Entry, the base class of TabRestoreService::Tab. This problem resulted in not being able to restore individual tabs from a recently-closed browser window because the ID of the tab got lost in a copy somewhere along the way and didn't match the one of the menu item that the user clicked on. This CL also adds a browsertest that fails without this change. BUG=622752 TEST=On a desktop system, open 2 tabs, close the browser window and open a new browser window. In that new window go into the "Recently Closed" section of the History menu, find the entry that says "2 Tabs", and click on one of the individual tabs. That tab should be restored in the new window. Committed: https://crrev.com/3d931371a8a5f795e7b9a559489b50a877f3db8a Cr-Commit-Position: refs/heads/master@{#406523}

Patch Set 1 #

Patch Set 2 : Add test #

Total comments: 2

Patch Set 3 : Rebase #

Patch Set 4 : Response to review #

Total comments: 6

Patch Set 5 : Response to review #

Unified diffs Side-by-side diffs Delta from patch set Stats (+139 lines, -1 line) Patch
M chrome/browser/sessions/tab_restore_browsertest.cc View 1 2 3 4 2 chunks +69 lines, -0 lines 0 comments Download
M components/components_tests.gyp View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M components/sessions/BUILD.gn View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M components/sessions/core/tab_restore_service.cc View 1 2 3 2 chunks +5 lines, -1 line 0 comments Download
A components/sessions/core/tab_restore_service_unittest.cc View 1 2 3 4 1 chunk +63 lines, -0 lines 0 comments Download

Messages

Total messages: 21 (9 generated)
blundell
4 years, 5 months ago (2016-07-05 13:49:17 UTC) #3
blundell
I believe that the red bots are unrelated.
4 years, 5 months ago (2016-07-05 13:49:41 UTC) #4
sky
The browser_test is fine, but given we have a manual assignment operator perhaps we should ...
4 years, 5 months ago (2016-07-06 16:09:07 UTC) #5
blundell
On 2016/07/06 16:09:07, sky wrote: > The browser_test is fine, but given we have a ...
4 years, 5 months ago (2016-07-06 16:12:50 UTC) #6
sky
Such a test would have caught the regression, right? On Wed, Jul 6, 2016 at ...
4 years, 5 months ago (2016-07-06 19:35:08 UTC) #7
blundell
Unittest added :). https://codereview.chromium.org/2114673002/diff/20001/components/sessions/core/tab_restore_service.cc File components/sessions/core/tab_restore_service.cc (right): https://codereview.chromium.org/2114673002/diff/20001/components/sessions/core/tab_restore_service.cc#newcode60 components/sessions/core/tab_restore_service.cc:60: from_last_session = tab.from_last_session; On 2016/07/06 16:09:07, ...
4 years, 5 months ago (2016-07-19 11:21:54 UTC) #12
sky
LGTM https://codereview.chromium.org/2114673002/diff/60001/chrome/browser/sessions/tab_restore_browsertest.cc File chrome/browser/sessions/tab_restore_browsertest.cc (right): https://codereview.chromium.org/2114673002/diff/60001/chrome/browser/sessions/tab_restore_browsertest.cc#newcode445 chrome/browser/sessions/tab_restore_browsertest.cc:445: EXPECT_EQ(entry->type, sessions::TabRestoreService::WINDOW); nit: assertions have expected, actual. You ...
4 years, 5 months ago (2016-07-19 17:42:41 UTC) #13
blundell
Thanks, Scott! https://codereview.chromium.org/2114673002/diff/60001/chrome/browser/sessions/tab_restore_browsertest.cc File chrome/browser/sessions/tab_restore_browsertest.cc (right): https://codereview.chromium.org/2114673002/diff/60001/chrome/browser/sessions/tab_restore_browsertest.cc#newcode445 chrome/browser/sessions/tab_restore_browsertest.cc:445: EXPECT_EQ(entry->type, sessions::TabRestoreService::WINDOW); On 2016/07/19 17:42:40, sky wrote: ...
4 years, 5 months ago (2016-07-20 08:18:12 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2114673002/80001
4 years, 5 months ago (2016-07-20 08:19:01 UTC) #17
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 5 months ago (2016-07-20 09:15:49 UTC) #18
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-20 09:15:58 UTC) #19
commit-bot: I haz the power
4 years, 5 months ago (2016-07-20 09:17:42 UTC) #21
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/3d931371a8a5f795e7b9a559489b50a877f3db8a
Cr-Commit-Position: refs/heads/master@{#406523}

Powered by Google App Engine
This is Rietveld 408576698