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

Issue 287233005: Revert of Only dispatch menu events if they have a valid target. (Closed)

Created:
6 years, 7 months ago by Nico
Modified:
6 years, 7 months ago
Reviewers:
flackr, sadrul
CC:
chromium-reviews, tfarina, tdresser+watch_chromium.org
Visibility:
Public.

Description

Revert of Only dispatch menu events if they have a valid target. (https://codereview.chromium.org/284903002/) Reason for revert: Made the asan bot red: Direct leak of 664 byte(s) in 1 object(s) allocated from: #0 0x4b7c7b in operator new(unsigned long) /usr/local/google/work/chromium/src/third_party/llvm/projects/compiler-rt/lib/asan/asan_new_delete.cc:62 #1 0x5a4ffc in RunMenu ui/views/controls/menu/menu_controller_unittest.cc:158 #2 0x5a4ffc in views::MenuControllerTest_EventTargeter_Test::TestBody() ui/views/controls/menu/menu_controller_unittest.cc:218 #3 0xb2b838 in HandleExceptionsInMethodIfSupported\u003Ctesting::Test, void> testing/gtest/src/gtest.cc:2045 #4 0xb2b838 in testing::Test::Run() testing/gtest/src/gtest.cc:2061 #5 0xb2d2c8 in testing::TestInfo::Run() testing/gtest/src/gtest.cc:2237 #6 0xb2e006 in testing::TestCase::Run() testing/gtest/src/gtest.cc:2344 #7 0xb3e7fa in testing::internal::UnitTestImpl::RunAllTests() testing/gtest/src/gtest.cc:4065 #8 0xb3de40 in HandleExceptionsInMethodIfSupported\u003Ctesting::internal::UnitTestImpl, bool> testing/gtest/src/gtest.cc:2045 #9 0xb3de40 in testing::UnitTest::Run() testing/gtest/src/gtest.cc:3697 #10 0xafaee4 in RUN_ALL_TESTS testing/gtest/include/gtest/gtest.h:2231 #11 0xafaee4 in base::TestSuite::Run() base/test/test_suite.cc:206 #12 0xaf2656 in Run base/callback.h:401 #13 0xaf2656 in base::(anonymous namespace)::LaunchUnitTestsInternal(int, char**, base::Callback\u003Cint ()> const&, int) base/test/launcher/unit_test_launcher.cc:494 #14 0x83846a in main ui/views/run_all_unittests.cc:43 #15 0x7ff88421176c in __libc_start_main /build/buildd/eglibc-2.15/csu/libc-start.c:226 Probably easy to fix (and thus easy to reland), but from skimming the test it's not obvious to me what's supposed to free controller_. I'm guessing the second block in the new test just needs an explicit delete? (An "Owned by X" comment close to controller_ would've helped me) Original issue's description: > Only dispatch menu events if they have a valid target. > > BUG=370162 > TEST=In touchview, open wrench menu and press a key (i.e. 'T'), nothing should happen. > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=271283 TBR=sadrul@chromium.org,flackr@chromium.org NOTREECHECKS=true NOTRY=true BUG=370162 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=271306

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+22 lines, -184 lines) Patch
M ui/events/event_utils.h View 2 chunks +0 lines, -6 lines 0 comments Download
M ui/events/event_utils.cc View 1 chunk +0 lines, -47 lines 0 comments Download
M ui/views/controls/menu/menu_controller.h View 1 chunk +0 lines, -4 lines 0 comments Download
M ui/views/controls/menu/menu_controller_unittest.cc View 6 chunks +21 lines, -106 lines 0 comments Download
M ui/views/controls/menu/menu_event_dispatcher_linux.cc View 2 chunks +1 line, -21 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Nico
Created Revert of Only dispatch menu events if they have a valid target.
6 years, 7 months ago (2014-05-18 18:59:51 UTC) #1
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/thakis@chromium.org/287233005/1
6 years, 7 months ago (2014-05-18 19:00:06 UTC) #2
commit-bot: I haz the power
Change committed as 271306
6 years, 7 months ago (2014-05-18 19:00:24 UTC) #3
flackr
6 years, 7 months ago (2014-05-20 18:18:57 UTC) #4
Message was sent while issue was closed.
On 2014/05/18 19:00:24, I haz the power (commit-bot) wrote:
> Change committed as 271306

lgtm, it looks like we don't delete MenuController (my breakpoints in the
destructor don't fire), but perhaps because it's still referenced by the
active_instance_ it isn't considered a leak
(https://code.google.com/p/chromium/codesearch#chromium/src/ui/views/controls/...).
In EventTargeter however I create a second MenuController which would clobber
the active instance pointer. It should be simple to modify MenuControllerTest to
free up its menu controller after each test and before creating another menu,
will put a CL up soon.

Powered by Google App Engine
This is Rietveld 408576698