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

Issue 2770153003: mojo: Support sync calls through ThreadSafeInterfacePtr (Closed)

Created:
3 years, 9 months ago by watk
Modified:
3 years, 8 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)
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

mojo: Support sync calls through ThreadSafeInterfacePtr Previously ThreadSafeInterfacePtr only supported async calls. Now it also supports sync calls. The one caveat to be aware of is that sync calls will block both the calling thread and the thread that the underlying InterfacePtr is bound to. That means, e.g., that the InterfacePtr can't be bound to the IO thread. Letting the call be async on the InterfacePtr thread is left as a TODO. BUG=668565 Review-Url: https://codereview.chromium.org/2770153003 Cr-Commit-Position: refs/heads/master@{#461016} Committed: https://chromium.googlesource.com/chromium/src/+/0c3ac0678cbc511f793dfd7386729b1b2ae2e7e1

Patch Set 1 #

Total comments: 1

Patch Set 2 : Fix more tests #

Total comments: 21

Patch Set 3 : make it threadsafe #

Total comments: 10

Patch Set 4 : Addressed comments #

Patch Set 5 : SyncMethodCommonTests now run with both IP and TSIP #

Total comments: 8

Patch Set 6 : afds #

Unified diffs Side-by-side diffs Delta from patch set Stats (+253 lines, -46 lines) Patch
M mojo/public/cpp/bindings/tests/sync_method_unittest.cc View 1 2 3 4 5 16 chunks +129 lines, -37 lines 0 comments Download
M mojo/public/cpp/bindings/thread_safe_interface_ptr.h View 1 2 3 4 5 4 chunks +124 lines, -9 lines 0 comments Download

Messages

Total messages: 30 (12 generated)
watk
Hey Yuzhu, I wanted to share my current WIP to get some feedback from you, ...
3 years, 9 months ago (2017-03-24 02:40:52 UTC) #2
watk
3 years, 9 months ago (2017-03-27 05:58:45 UTC) #3
yzshen1
> I'm thinking it's probably possible to make > ThreadSafeInterfacePtr another > dimension of the ...
3 years, 9 months ago (2017-03-27 22:18:25 UTC) #6
watk
I appreciate the comments, this is pretty subtle. Replying without a new patch set in ...
3 years, 9 months ago (2017-03-27 23:45:29 UTC) #7
yzshen1
https://codereview.chromium.org/2770153003/diff/20001/mojo/public/cpp/bindings/thread_safe_interface_ptr.h File mojo/public/cpp/bindings/thread_safe_interface_ptr.h (right): https://codereview.chromium.org/2770153003/diff/20001/mojo/public/cpp/bindings/thread_safe_interface_ptr.h#newcode99 mojo/public/cpp/bindings/thread_safe_interface_ptr.h:99: forward_with_responder_.Run(std::move(*message), On 2017/03/27 23:45:29, watk wrote: > On 2017/03/27 ...
3 years, 9 months ago (2017-03-28 00:06:48 UTC) #8
watk
https://codereview.chromium.org/2770153003/diff/20001/mojo/public/cpp/bindings/thread_safe_interface_ptr.h File mojo/public/cpp/bindings/thread_safe_interface_ptr.h (right): https://codereview.chromium.org/2770153003/diff/20001/mojo/public/cpp/bindings/thread_safe_interface_ptr.h#newcode99 mojo/public/cpp/bindings/thread_safe_interface_ptr.h:99: forward_with_responder_.Run(std::move(*message), On 2017/03/28 00:06:48, yzshen1 wrote: > On 2017/03/27 ...
3 years, 9 months ago (2017-03-28 00:14:35 UTC) #9
yzshen1
https://codereview.chromium.org/2770153003/diff/20001/mojo/public/cpp/bindings/tests/sync_method_unittest.cc File mojo/public/cpp/bindings/tests/sync_method_unittest.cc (right): https://codereview.chromium.org/2770153003/diff/20001/mojo/public/cpp/bindings/tests/sync_method_unittest.cc#newcode854 mojo/public/cpp/bindings/tests/sync_method_unittest.cc:854: TSIPQueuedMessagesProcessedBeforeErrorNotification) { Because connection error handler is not exposed ...
3 years, 8 months ago (2017-03-28 15:56:03 UTC) #10
watk
On 2017/03/28 15:56:03, yzshen1 wrote: > https://codereview.chromium.org/2770153003/diff/20001/mojo/public/cpp/bindings/tests/sync_method_unittest.cc > File mojo/public/cpp/bindings/tests/sync_method_unittest.cc (right): > > https://codereview.chromium.org/2770153003/diff/20001/mojo/public/cpp/bindings/tests/sync_method_unittest.cc#newcode854 > ...
3 years, 8 months ago (2017-03-28 23:08:44 UTC) #11
watk
Ok, uploaded a new patchset for feedback (I only have two days left before I'm ...
3 years, 8 months ago (2017-03-29 07:47:36 UTC) #12
yzshen1
https://codereview.chromium.org/2770153003/diff/40001/mojo/public/cpp/bindings/thread_safe_interface_ptr.h File mojo/public/cpp/bindings/thread_safe_interface_ptr.h (right): https://codereview.chromium.org/2770153003/diff/40001/mojo/public/cpp/bindings/thread_safe_interface_ptr.h#newcode61 mojo/public/cpp/bindings/thread_safe_interface_ptr.h:61: pending_sync_responses_.front()->event.Signal(); Shouldn't we signal all the events? https://codereview.chromium.org/2770153003/diff/40001/mojo/public/cpp/bindings/thread_safe_interface_ptr.h#newcode118 mojo/public/cpp/bindings/thread_safe_interface_ptr.h:118: ...
3 years, 8 months ago (2017-03-29 23:16:47 UTC) #13
watk
Thanks! I'm going to focus on tests. I tried making "use_tsip" a parameter of the ...
3 years, 8 months ago (2017-03-30 02:26:05 UTC) #14
watk
Ok, I think these tests look reasonable. SyncMethodCommonTests now run with IP and TSIP. I'll ...
3 years, 8 months ago (2017-03-30 06:30:37 UTC) #17
yzshen1
Only a few nits. Thanks! https://codereview.chromium.org/2770153003/diff/40001/mojo/public/cpp/bindings/thread_safe_interface_ptr.h File mojo/public/cpp/bindings/thread_safe_interface_ptr.h (right): https://codereview.chromium.org/2770153003/diff/40001/mojo/public/cpp/bindings/thread_safe_interface_ptr.h#newcode118 mojo/public/cpp/bindings/thread_safe_interface_ptr.h:118: // TODO(yzshen, watk): We ...
3 years, 8 months ago (2017-03-30 20:53:06 UTC) #18
watk
https://codereview.chromium.org/2770153003/diff/40001/mojo/public/cpp/bindings/thread_safe_interface_ptr.h File mojo/public/cpp/bindings/thread_safe_interface_ptr.h (right): https://codereview.chromium.org/2770153003/diff/40001/mojo/public/cpp/bindings/thread_safe_interface_ptr.h#newcode118 mojo/public/cpp/bindings/thread_safe_interface_ptr.h:118: // TODO(yzshen, watk): We block both this thread and ...
3 years, 8 months ago (2017-03-31 00:27:27 UTC) #19
yzshen1
lgtm
3 years, 8 months ago (2017-03-31 00:51:45 UTC) #22
watk
Thanks! Just in time before I go on vacation for three weeks :)
3 years, 8 months ago (2017-03-31 03:28:52 UTC) #25
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/2770153003/120001
3 years, 8 months ago (2017-03-31 03:29:28 UTC) #27
commit-bot: I haz the power
3 years, 8 months ago (2017-03-31 03:37:58 UTC) #30
Message was sent while issue was closed.
Committed patchset #6 (id:120001) as
https://chromium.googlesource.com/chromium/src/+/0c3ac0678cbc511f793dfd738672...

Powered by Google App Engine
This is Rietveld 408576698