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

Issue 534953002: Mojo: Cancel WaitingCallbacks when their HandleWrappers are closed. (Closed)

Created:
6 years, 3 months ago by Sam McNally
Modified:
6 years, 3 months ago
Reviewers:
sky, abarth-chromium
CC:
Aaron Boodman, ben+mojo_chromium.org, chrome-apps-syd-reviews_chromium.org, chromium-reviews, darin (slow to review), qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Mojo: Cancel WaitingCallbacks when their HandleWrappers are closed. Currently, if a JS connector is left to be garbage collected, the handle and the WaitingCallback both become ready to be collected at the same time. If the handle is collected first, this results in an asynchronous wait on a closed handle. With this change, WaitingCallback registers itself as an observer to be notified when the handle it's watching is closing and cancels the wait if the handle closes while the wait is in progress. BUG=406487 Committed: https://crrev.com/a9e9f87c058a47db6c5709b38aae09acd56b11cc Cr-Commit-Position: refs/heads/master@{#294775}

Patch Set 1 : #

Total comments: 2

Patch Set 2 : ObserverList #

Total comments: 10

Patch Set 3 : address comments #

Total comments: 2

Patch Set 4 : DISALLOW_COPY_AND_ASSIGN #

Unified diffs Side-by-side diffs Delta from patch set Stats (+178 lines, -11 lines) Patch
M mojo/apps/js/test/BUILD.gn View 1 2 1 chunk +1 line, -0 lines 0 comments Download
A mojo/apps/js/test/handle_unittest.cc View 1 2 3 1 chunk +89 lines, -0 lines 0 comments Download
M mojo/bindings/js/BUILD.gn View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M mojo/bindings/js/handle.h View 1 2 2 chunks +9 lines, -1 line 0 comments Download
M mojo/bindings/js/handle.cc View 1 2 2 chunks +23 lines, -0 lines 0 comments Download
A mojo/bindings/js/handle_close_observer.h View 1 2 1 chunk +20 lines, -0 lines 0 comments Download
M mojo/bindings/js/support.cc View 1 chunk +2 lines, -1 line 0 comments Download
M mojo/bindings/js/waiting_callback.h View 1 2 4 chunks +14 lines, -3 lines 0 comments Download
M mojo/bindings/js/waiting_callback.cc View 1 2 4 chunks +17 lines, -6 lines 0 comments Download
M mojo/mojo_apps.gypi View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M mojo/mojo_base.gyp View 1 2 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 15 (5 generated)
Sam McNally
6 years, 3 months ago (2014-09-03 05:14:47 UTC) #3
abarth-chromium
https://codereview.chromium.org/534953002/diff/20001/mojo/bindings/js/handle.cc File mojo/bindings/js/handle.cc (right): https://codereview.chromium.org/534953002/diff/20001/mojo/bindings/js/handle.cc#newcode39 mojo/bindings/js/handle.cc:39: (*it++)->OnHandleClosed(); What if observers_ is modified during this iteration?
6 years, 3 months ago (2014-09-03 05:21:56 UTC) #4
Sam McNally
https://codereview.chromium.org/534953002/diff/20001/mojo/bindings/js/handle.cc File mojo/bindings/js/handle.cc (right): https://codereview.chromium.org/534953002/diff/20001/mojo/bindings/js/handle.cc#newcode39 mojo/bindings/js/handle.cc:39: (*it++)->OnHandleClosed(); On 2014/09/03 05:21:55, abarth wrote: > What if ...
6 years, 3 months ago (2014-09-03 05:37:27 UTC) #6
sky
Is it possible to write test coverage? I'm making abarth a real reviewer here as ...
6 years, 3 months ago (2014-09-03 15:47:04 UTC) #8
Sam McNally
On 2014/09/03 15:47:04, sky wrote: > Is it possible to write test coverage? > Done. ...
6 years, 3 months ago (2014-09-08 04:31:52 UTC) #9
sky
LGTM https://codereview.chromium.org/534953002/diff/80001/mojo/apps/js/test/handle_unittest.cc File mojo/apps/js/test/handle_unittest.cc (right): https://codereview.chromium.org/534953002/diff/80001/mojo/apps/js/test/handle_unittest.cc#newcode30 mojo/apps/js/test/handle_unittest.cc:30: }; private:DISALLOW...
6 years, 3 months ago (2014-09-08 16:07:02 UTC) #10
Sam McNally
abarth: do you want to take a look? https://codereview.chromium.org/534953002/diff/80001/mojo/apps/js/test/handle_unittest.cc File mojo/apps/js/test/handle_unittest.cc (right): https://codereview.chromium.org/534953002/diff/80001/mojo/apps/js/test/handle_unittest.cc#newcode30 mojo/apps/js/test/handle_unittest.cc:30: }; ...
6 years, 3 months ago (2014-09-09 00:02:46 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patchset/534953002/100001
6 years, 3 months ago (2014-09-15 00:54:35 UTC) #13
commit-bot: I haz the power
Committed patchset #4 (id:100001) as e66d4f1a59f6f3db331a89dbb3603b71d29128bc
6 years, 3 months ago (2014-09-15 01:25:24 UTC) #14
commit-bot: I haz the power
6 years, 3 months ago (2014-09-15 01:29:01 UTC) #15
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/a9e9f87c058a47db6c5709b38aae09acd56b11cc
Cr-Commit-Position: refs/heads/master@{#294775}

Powered by Google App Engine
This is Rietveld 408576698