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

Issue 1380043002: Implement a simple ThreadChecker for Mojo and add to |internal::SharedData| and |internal::Router|. (Closed)

Created:
5 years, 2 months ago by Anand Mistry (off Chromium)
Modified:
5 years, 2 months ago
CC:
chromium-reviews, qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, darin (slow to review), ben+mojo_chromium.org, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Implement a simple ThreadChecker for Mojo and add to |internal::SharedData| and |internal::Router|. |internal::SharedData| is used in several places, in particular, callbacks, which are very easy to misuse by copying around between threads. |internal::Router| is used commonly between the various bindings classes, making it an ideal place to catch misuse of bindings. BUG=537911 Committed: https://crrev.com/7cff2feae7fcccc416827013df112396c84b5017 Cr-Commit-Position: refs/heads/master@{#352508}

Patch Set 1 #

Patch Set 2 : Fix builds #

Patch Set 3 : Add underspecified deps. #

Total comments: 9

Patch Set 4 : Fix build rules. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+136 lines, -5 lines) Patch
M third_party/mojo/mojo_edk_tests.gyp View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M third_party/mojo/mojo_public.gyp View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/mojo/src/mojo/public/cpp/bindings/BUILD.gn View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M third_party/mojo/src/mojo/public/cpp/bindings/lib/router.h View 5 chunks +23 lines, -4 lines 0 comments Download
M third_party/mojo/src/mojo/public/cpp/bindings/lib/router.cc View 2 chunks +4 lines, -0 lines 0 comments Download
M third_party/mojo/src/mojo/public/cpp/bindings/lib/shared_data.h View 1 3 chunks +9 lines, -1 line 0 comments Download
A third_party/mojo/src/mojo/public/cpp/bindings/lib/thread_checker.h View 1 chunk +37 lines, -0 lines 0 comments Download
A third_party/mojo/src/mojo/public/cpp/bindings/lib/thread_checker_posix.h View 1 chunk +31 lines, -0 lines 0 comments Download
A third_party/mojo/src/mojo/public/cpp/bindings/lib/thread_checker_posix.cc View 1 1 chunk +24 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (2 generated)
Anand Mistry (off Chromium)
Note, the use of assert() in a few places is due to dependencies.
5 years, 2 months ago (2015-10-01 07:40:03 UTC) #2
yzshen1
Thanks, Anand. It mostly looks good. https://codereview.chromium.org/1380043002/diff/40001/third_party/mojo/mojo_public.gyp File third_party/mojo/mojo_public.gyp (right): https://codereview.chromium.org/1380043002/diff/40001/third_party/mojo/mojo_public.gyp#newcode167 third_party/mojo/mojo_public.gyp:167: 'sources!': [ I ...
5 years, 2 months ago (2015-10-01 16:48:10 UTC) #3
Anand Mistry (off Chromium)
https://codereview.chromium.org/1380043002/diff/40001/third_party/mojo/mojo_public.gyp File third_party/mojo/mojo_public.gyp (right): https://codereview.chromium.org/1380043002/diff/40001/third_party/mojo/mojo_public.gyp#newcode167 third_party/mojo/mojo_public.gyp:167: 'sources!': [ On 2015/10/01 16:48:09, yzshen1 wrote: > I ...
5 years, 2 months ago (2015-10-01 23:16:52 UTC) #4
yzshen1
LGTM https://codereview.chromium.org/1380043002/diff/40001/third_party/mojo/src/mojo/public/cpp/bindings/lib/shared_data.h File third_party/mojo/src/mojo/public/cpp/bindings/lib/shared_data.h (right): https://codereview.chromium.org/1380043002/diff/40001/third_party/mojo/src/mojo/public/cpp/bindings/lib/shared_data.h#newcode60 third_party/mojo/src/mojo/public/cpp/bindings/lib/shared_data.h:60: assert(thread_checker_.CalledOnValidThread()); On 2015/10/01 23:16:52, Anand Mistry wrote: > ...
5 years, 2 months ago (2015-10-02 16:05:45 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1380043002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1380043002/60001
5 years, 2 months ago (2015-10-06 00:28:28 UTC) #7
commit-bot: I haz the power
Committed patchset #4 (id:60001)
5 years, 2 months ago (2015-10-06 01:37:21 UTC) #8
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/7cff2feae7fcccc416827013df112396c84b5017 Cr-Commit-Position: refs/heads/master@{#352508}
5 years, 2 months ago (2015-10-06 01:38:04 UTC) #9
Elliot Glaysher
5 years, 2 months ago (2015-10-06 18:26:52 UTC) #10
Message was sent while issue was closed.
A revert of this CL (patchset #4 id:60001) has been created in
https://codereview.chromium.org/1369933004/ by erg@chromium.org.

The reason for reverting is: Mandoline now crashes immediately on startup.
Reverting this change locally fixes it.

(mandoline is probably doing something unsafe, but it worked previously to this
patch.)

mandoline:
../../third_party/mojo/src/mojo/public/cpp/bindings/lib/shared_data.h:64: void
mojo::internal::SharedData<mojo::internal::SharedPtr<mojo::Callback<void
()>::Runnable>::Impl>::Holder::Release() [T =
mojo::internal::SharedPtr<mojo::Callback<void ()>::Runnable>::Impl]: Assertion
`thread_checker_.CalledOnValidThread()' failed.
.

Powered by Google App Engine
This is Rietveld 408576698