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

Issue 1624343003: Minor fixes for WidgetRemovalsObserver::OnWillRemoveView (Closed)

Created:
4 years, 11 months ago by dmazzoni
Modified:
4 years, 10 months ago
Reviewers:
sky
CC:
chromium-reviews, tfarina, tdanderson+views_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Minor fixes for WidgetRemovalsObserver::OnWillRemoveView Previously it was called whenever a view was removed, even if it was just moved within the same widget. Now it's only called if it's actually removed entirely, or moved to a different widget. BUG=581127 Committed: https://crrev.com/b5c59b11b49b910758899d8b3261a08665ca3fa0 Cr-Commit-Position: refs/heads/master@{#372448}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Only call when deleting or moving to a different widget #

Patch Set 3 : Get rid of code to call on children #

Patch Set 4 : Update comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+78 lines, -3 lines) Patch
M ui/views/view.cc View 1 2 3 1 chunk +5 lines, -2 lines 0 comments Download
M ui/views/widget/widget_removals_observer.h View 1 2 3 1 chunk +5 lines, -1 line 0 comments Download
M ui/views/widget/widget_unittest.cc View 1 2 3 2 chunks +68 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 17 (6 generated)
dmazzoni
4 years, 11 months ago (2016-01-25 21:04:35 UTC) #2
sky
https://codereview.chromium.org/1624343003/diff/1/ui/views/view.cc File ui/views/view.cc (right): https://codereview.chromium.org/1624343003/diff/1/ui/views/view.cc#newcode1827 ui/views/view.cc:1827: GetWidget()->NotifyWillRemoveView(this); Doing this here means we have to constantly ...
4 years, 11 months ago (2016-01-25 21:22:15 UTC) #3
dmazzoni
https://codereview.chromium.org/1624343003/diff/1/ui/views/view.cc File ui/views/view.cc (right): https://codereview.chromium.org/1624343003/diff/1/ui/views/view.cc#newcode1827 ui/views/view.cc:1827: GetWidget()->NotifyWillRemoveView(this); On 2016/01/25 21:22:14, sky wrote: > Doing this ...
4 years, 11 months ago (2016-01-25 21:44:27 UTC) #4
sky
I believe the expectation is that if you cared about descendants of the view being ...
4 years, 11 months ago (2016-01-25 23:35:29 UTC) #5
dmazzoni
On 2016/01/25 23:35:29, sky wrote: > I believe the expectation is that if you cared ...
4 years, 10 months ago (2016-01-26 19:20:01 UTC) #7
sky
LGTM - I think you should also update the description of WidgetRemovalsObserver::OnWillRemoveView to make it ...
4 years, 10 months ago (2016-01-26 22:32:46 UTC) #8
dmazzoni
Documentation updated. Thanks.
4 years, 10 months ago (2016-01-29 22:08:22 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1624343003/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1624343003/60001
4 years, 10 months ago (2016-01-29 22:09:59 UTC) #12
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 10 months ago (2016-01-29 23:08:21 UTC) #14
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/b5c59b11b49b910758899d8b3261a08665ca3fa0 Cr-Commit-Position: refs/heads/master@{#372448}
4 years, 10 months ago (2016-01-29 23:09:35 UTC) #16
joedow
4 years, 10 months ago (2016-01-30 00:21:25 UTC) #17
Message was sent while issue was closed.
A revert of this CL (patchset #4 id:60001) has been created in
https://codereview.chromium.org/1654433005/ by joedow@chromium.org.

The reason for reverting is: Causing a failure on the Linux Chromium OS ASan
LSan Tests bot.

Link to failure log:
https://build.chromium.org/p/chromium.memory/builders/Linux%20Chromium%20OS%2...

First error from log (7 in total related to widget tests):
Indirect leak of 512 byte(s) in 1 object(s) allocated from:
    #0 0x55bbab in operator new(unsigned long)
(/mnt/data/b/build/slave/Linux_Chromium_OS_ASan_LSan_Tests__1_/build/src/out/Release/views_unittests+0x55bbab)
    #1 0xe8002c in allocate
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/ext/new_allocator.h:92:27
    #2 0xe8002c in _M_allocate_node
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/stl_deque.h:525
    #3 0xe8002c in _M_create_nodes
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/stl_deque.h:619
    #4 0xe8002c in _M_initialize_map
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/stl_deque.h:593
    #5 0xe8002c in _Deque_base
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/stl_deque.h:452
    #6 0xe8002c in deque
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/stl_deque.h:772
    #7 0xe8002c in ui::EventHandler::EventHandler()
ui/events/event_handler.cc:12
    #8 0x103aa66 in views::View::View() ui/views/view.cc:100:7
    #9 0xb1cb16 in
views::test::WidgetTest_WidgetRemovalsObserverCalled_Test::TestBody()
ui/views/widget/widget_unittest.cc:3479:21
    #10 0xd196ab in HandleExceptionsInMethodIfSupported<testing::Test, void>
testing/gtest/src/gtest.cc:2458:12
    #11 0xd196ab in testing::Test::Run() testing/gtest/src/gtest.cc:2474
    #12 0xd1ba77 in testing::TestInfo::Run() testing/gtest/src/gtest.cc:2656:5
    #13 0xd1c86a in testing::TestCase::Run() testing/gtest/src/gtest.cc:2774:5
    #14 0xd31660 in testing::internal::UnitTestImpl::RunAllTests()
testing/gtest/src/gtest.cc:4647:11
    #15 0xd30a8b in
HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool>
testing/gtest/src/gtest.cc:2458:12
    #16 0xd30a8b in testing::UnitTest::Run() testing/gtest/src/gtest.cc:4255
    #17 0xcdd3a6 in RUN_ALL_TESTS testing/gtest/include/gtest/gtest.h:2237:10
    #18 0xcdd3a6 in base::TestSuite::Run() base/test/test_suite.cc:231
    #19 0xcd0642 in Run base/callback.h:394:12
    #20 0xcd0642 in base::(anonymous
namespace)::LaunchUnitTestsInternal(base::Callback<int ()> const&, int, int,
bool, base::Callback<void ()> const&)
base/test/launcher/unit_test_launcher.cc:206
    #21 0xcd02dc in base::LaunchUnitTests(int, char**, base::Callback<int ()>
const&) base/test/launcher/unit_test_launcher.cc:445:10
    #22 0x981c94 in main ui/views/run_all_unittests.cc:53:10
    #23 0x7ff93a18876c in __libc_start_main
/build/buildd/eglibc-2.15/csu/libc-start.c:226.

Powered by Google App Engine
This is Rietveld 408576698