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

Issue 59153005: Begin implementing V8 bindings for Mojo (Closed)

Created:
7 years, 1 month ago by abarth-chromium
Modified:
7 years, 1 month ago
CC:
chromium-reviews, darin (slow to review), viettrungluu+watch_chromium.org, ben+mojo_chromium.org
Visibility:
Public.

Description

Begin implementing V8 bindings for Mojo This CL contains the beginnings of JavaScript bindings for the core Mojo system. The approach in this CL is to bind as close to the "metal" as possible so as to self-host as much as possiblem in the VM. I've tried to avoid retaining any state on the C++ side of the bindings, but I didn't quite succeed because V8 requires embedders to retain state in order to access the memory that backs ArrayBuffers. In this CL, I've added some basic bindings for the symbols exported by core.h. Specifically, I've created bindings for CreateMessagePipe, Close, Wait, WaitMany, WriteMessage, and ReadMessage. R=aa@chromium.org, darin@chromium.org BUG=317398 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=234347

Patch Set 1 #

Patch Set 2 : spelling #

Total comments: 23

Patch Set 3 : Now with tests #

Patch Set 4 : Fix style nits #

Total comments: 2

Patch Set 5 : Work-in-progress on top of Gini #

Patch Set 6 : Has all the functions bound #

Patch Set 7 : Now with a basic unit test #

Patch Set 8 : Moar copyright #

Total comments: 25

Patch Set 9 : Address Aaron's comments #

Patch Set 10 : Fix skipped comment #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+906 lines, -132 lines) Patch
A gin/arguments.h View 1 2 3 4 5 6 7 8 9 1 chunk +54 lines, -0 lines 0 comments Download
A gin/arguments.cc View 1 2 3 4 5 6 7 8 9 1 chunk +36 lines, -0 lines 2 comments Download
M gin/array_buffer.h View 1 2 3 4 2 chunks +39 lines, -6 lines 0 comments Download
M gin/array_buffer.cc View 1 2 3 4 5 chunks +63 lines, -30 lines 0 comments Download
M gin/converter.h View 1 2 3 4 5 6 7 8 3 chunks +23 lines, -1 line 0 comments Download
M gin/converter.cc View 1 2 3 4 5 6 7 8 3 chunks +35 lines, -1 line 0 comments Download
A gin/dictionary.h View 1 2 3 4 1 chunk +50 lines, -0 lines 0 comments Download
A gin/dictionary.cc View 1 2 3 4 1 chunk +40 lines, -0 lines 0 comments Download
M gin/gin.gyp View 1 2 3 4 5 6 2 chunks +25 lines, -4 lines 0 comments Download
M gin/per_isolate_data.h View 1 2 3 4 5 6 7 8 1 chunk +4 lines, -2 lines 0 comments Download
M gin/per_isolate_data.cc View 1 2 3 4 5 6 7 8 1 chunk +11 lines, -3 lines 0 comments Download
M gin/runner.cc View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
A + gin/test/gtest.h View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -4 lines 0 comments Download
A gin/test/gtest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +76 lines, -0 lines 0 comments Download
M mojo/apps/js/DEPS View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M mojo/apps/js/main.cc View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
D mojo/apps/js/v8_environment.h View 1 2 1 chunk +0 lines, -16 lines 0 comments Download
M mojo/apps/js/v8_environment.cc View 1 2 1 chunk +0 lines, -49 lines 0 comments Download
M mojo/mojo.gyp View 1 2 3 4 5 6 7 8 3 chunks +41 lines, -4 lines 0 comments Download
A + mojo/public/bindings/js/DEPS View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
A mojo/public/bindings/js/core.h View 1 2 3 4 5 6 7 8 1 chunk +18 lines, -0 lines 0 comments Download
A mojo/public/bindings/js/core.cc View 1 2 3 4 5 6 7 8 9 1 chunk +161 lines, -0 lines 0 comments Download
A mojo/public/bindings/js/handle.h View 1 2 3 4 1 chunk +23 lines, -0 lines 0 comments Download
A mojo/public/bindings/js/handle.cc View 1 2 3 4 1 chunk +19 lines, -0 lines 0 comments Download
A mojo/public/bindings/js/mojo.h View 1 2 3 4 5 6 7 8 1 chunk +18 lines, -0 lines 0 comments Download
A mojo/public/bindings/js/mojo.cc View 1 2 3 4 5 6 7 8 1 chunk +34 lines, -0 lines 0 comments Download
A + mojo/public/bindings/js/mojo_unittests.js View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -7 lines 0 comments Download
A mojo/public/bindings/js/runner_delegate.h View 1 2 3 4 5 6 7 8 1 chunk +29 lines, -0 lines 0 comments Download
A mojo/public/bindings/js/runner_delegate.cc View 1 2 3 4 5 6 7 8 1 chunk +23 lines, -0 lines 0 comments Download
A + mojo/public/bindings/js/test/DEPS View 1 2 3 4 5 6 1 chunk +0 lines, -1 line 0 comments Download
A mojo/public/bindings/js/test/harness.cc View 1 2 3 4 5 6 7 8 1 chunk +69 lines, -0 lines 0 comments Download

Messages

Total messages: 24 (0 generated)
abarth-chromium
7 years, 1 month ago (2013-11-08 10:37:34 UTC) #1
Aaron Boodman
I'm reviewing this now, but a meta question: I wonder if it makes sense for ...
7 years, 1 month ago (2013-11-08 21:09:40 UTC) #2
darin (slow to review)
We could do that, but then we need to come up with a name for ...
7 years, 1 month ago (2013-11-08 21:18:20 UTC) #3
abarth-chromium
On 2013/11/08 21:09:40, Aaron Boodman wrote: > I'm reviewing this now, but a meta question: ...
7 years, 1 month ago (2013-11-08 21:18:55 UTC) #4
abarth-chromium
Now with unittests! The next step is to improve the testing infrastructure so that it's ...
7 years, 1 month ago (2013-11-08 23:28:16 UTC) #5
Aaron Boodman
I wrote something very similar to this for an internal project, and it was named ...
7 years, 1 month ago (2013-11-09 04:02:54 UTC) #6
Aaron Boodman
(the gin name is a reference to the defunct v8-juice project, which had an approach ...
7 years, 1 month ago (2013-11-09 04:03:39 UTC) #7
Aaron Boodman
After looking at this more, I think it makes sense to just move forward a ...
7 years, 1 month ago (2013-11-09 08:26:02 UTC) #8
abarth-chromium
Thank you for the thoughtful review. I'm going to try breaking this CL into pieces ...
7 years, 1 month ago (2013-11-09 08:52:37 UTC) #9
abarth-chromium
I've extracted the non-Mojo specific parts of this CL into https://codereview.chromium.org/67763002/. I'll rebase this CL ...
7 years, 1 month ago (2013-11-09 11:52:20 UTC) #10
Aaron Boodman
I'll review the other CL too, but I wanted to respond to these points in ...
7 years, 1 month ago (2013-11-09 21:12:11 UTC) #11
abarth-chromium
Ok, I've reworked this CL to layer on top of Gini (still called Gin in ...
7 years, 1 month ago (2013-11-11 00:00:31 UTC) #12
abarth-chromium
Ok, this CL has some testing now. It's ready for review. Thanks!
7 years, 1 month ago (2013-11-11 10:13:18 UTC) #13
Aaron Boodman
https://codereview.chromium.org/59153005/diff/620001/gin/arguments.h File gin/arguments.h (right): https://codereview.chromium.org/59153005/diff/620001/gin/arguments.h#newcode24 gin/arguments.h:24: bool Next(T* out) { I think we'll eventually need ...
7 years, 1 month ago (2013-11-11 19:01:08 UTC) #14
abarth-chromium
Thanks for the review! https://codereview.chromium.org/59153005/diff/620001/gin/arguments.h File gin/arguments.h (right): https://codereview.chromium.org/59153005/diff/620001/gin/arguments.h#newcode24 gin/arguments.h:24: bool Next(T* out) { On ...
7 years, 1 month ago (2013-11-11 20:17:41 UTC) #15
Aaron Boodman
https://codereview.chromium.org/59153005/diff/620001/mojo/public/bindings/js/core.cc File mojo/public/bindings/js/core.cc (right): https://codereview.chromium.org/59153005/diff/620001/mojo/public/bindings/js/core.cc#newcode20 mojo/public/bindings/js/core.cc:20: void Close(const v8::FunctionCallbackInfo<v8::Value>& info) { On 2013/11/11 20:17:42, abarth ...
7 years, 1 month ago (2013-11-11 20:33:22 UTC) #16
abarth-chromium
Done. The only comment I didn't address was having GetNext return a T instead of ...
7 years, 1 month ago (2013-11-11 21:05:48 UTC) #17
Aaron Boodman
lgtm https://codereview.chromium.org/59153005/diff/620001/mojo/public/bindings/js/core.cc File mojo/public/bindings/js/core.cc (right): https://codereview.chromium.org/59153005/diff/620001/mojo/public/bindings/js/core.cc#newcode101 mojo/public/bindings/js/core.cc:101: return args.ThrowTypeError("Expected MojoWaitFlags."); On 2013/11/11 20:17:42, abarth wrote: ...
7 years, 1 month ago (2013-11-11 21:12:48 UTC) #18
abarth-chromium
On 2013/11/11 21:12:48, Aaron Boodman wrote: > Note: you didn't address this one. I'm fine ...
7 years, 1 month ago (2013-11-11 21:32:12 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/abarth@chromium.org/59153005/680003
7 years, 1 month ago (2013-11-11 21:35:35 UTC) #20
Aaron Boodman
https://codereview.chromium.org/59153005/diff/680003/gin/arguments.cc File gin/arguments.cc (right): https://codereview.chromium.org/59153005/diff/680003/gin/arguments.cc#newcode27 gin/arguments.cc:27: stream << "Error processing argument " << next_ - ...
7 years, 1 month ago (2013-11-11 21:37:31 UTC) #21
Aaron Boodman
https://codereview.chromium.org/59153005/diff/680003/gin/arguments.cc File gin/arguments.cc (right): https://codereview.chromium.org/59153005/diff/680003/gin/arguments.cc#newcode27 gin/arguments.cc:27: stream << "Error processing argument " << next_ - ...
7 years, 1 month ago (2013-11-11 21:38:58 UTC) #22
abarth-chromium
It does the wrong thing if you call ThrowError before calling GetNext. I imagine we'll ...
7 years, 1 month ago (2013-11-11 21:42:24 UTC) #23
abarth-chromium
7 years, 1 month ago (2013-11-12 00:41:31 UTC) #24
Message was sent while issue was closed.
Committed patchset #10 manually as r234347.

Powered by Google App Engine
This is Rietveld 408576698