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

Issue 2379993003: Mojo C++ bindings: make String16 and gfx::Size available in Blink (Closed)

Created:
4 years, 2 months ago by Zhiqiang Zhang (Slow)
Modified:
4 years, 1 month ago
CC:
Aaron Boodman, abarth-chromium, blink-reviews, chromium-reviews, darin (slow to review), qsr+mojo_chromium.org, viettrungluu+watch_chromium.org, yzshen+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Mojo C++ bindings: make String16 and gfx::Size available in Blink This CL adds C++ bindings for String16 and Size in Blink, which will be used in a follow-up CL (https://codereview.chromium.org/2367393002/). BUG=624136, 649630 Committed: https://crrev.com/fb032b1e3fec6f34883a1f432ff38cebb6875045 Cr-Commit-Position: refs/heads/master@{#423487}

Patch Set 1 #

Total comments: 5

Patch Set 2 : Addressed rockot's comments #

Patch Set 3 : fixed build issue caused by namespaces #

Patch Set 4 : fixed Windows build #

Patch Set 5 : more fixing for Windows build #

Patch Set 6 : I want a Windows machine... #

Patch Set 7 : style fix. #

Total comments: 5

Patch Set 8 : addressed esprehn and rockot's comments #

Total comments: 6

Patch Set 9 : Using ConstCArray to avoid copying #

Total comments: 1

Patch Set 10 : trying to fix Windows build #

Total comments: 3

Patch Set 11 : addressed esprehn's comments #

Patch Set 12 : map to blink::IntSize #

Patch Set 13 : mapping back to WebSize :( #

Unified diffs Side-by-side diffs Delta from patch set Stats (+383 lines, -2 lines) Patch
M mojo/common/common_custom_types.mojom View 1 2 3 4 5 6 7 8 9 10 1 chunk +6 lines, -2 lines 0 comments Download
M mojo/common/common_custom_types_struct_traits.h View 1 2 3 4 5 6 7 8 2 chunks +8 lines, -0 lines 0 comments Download
M mojo/common/common_custom_types_struct_traits.cc View 1 2 3 4 5 6 7 8 9 1 chunk +20 lines, -0 lines 0 comments Download
M mojo/common/common_custom_types_unittest.cc View 1 chunk +13 lines, -0 lines 0 comments Download
M mojo/common/test_common_custom_types.mojom View 1 1 chunk +1 line, -0 lines 0 comments Download
M mojo/public/cpp/bindings/array_traits_carray.h View 1 2 3 4 5 6 7 8 9 2 chunks +23 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +6 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/platform/mojo/CommonCustomTypes.typemap View 1 2 3 4 5 6 7 8 1 chunk +11 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/platform/mojo/CommonCustomTypesStructTraits.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +22 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/platform/mojo/CommonCustomTypesStructTraits.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +41 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/platform/mojo/CommonCustomTypesStructTraitsTest.cpp View 1 2 3 4 5 6 7 8 9 10 1 chunk +69 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/mojo/DEPS View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/platform/mojo/Geometry.typemap View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +17 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/platform/mojo/GeometryStructTraits.h View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +23 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/platform/mojo/GeometryStructTraits.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +20 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/platform/mojo/GeometryStructTraitsTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +98 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/mojo/blink_typemaps.gni View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 103 (57 generated)
Zhiqiang Zhang (Slow)
mkwst@, rockot@, please review this patch. I'm not very sure if I'm putting the files ...
4 years, 2 months ago (2016-09-29 16:39:47 UTC) #2
Zhiqiang Zhang (Slow)
-mkwst +tsepez,pdr
4 years, 2 months ago (2016-09-29 19:54:43 UTC) #4
Tom Sepez
https://codereview.chromium.org/2379993003/diff/1/mojo/common/common_custom_types.mojom File mojo/common/common_custom_types.mojom (right): https://codereview.chromium.org/2379993003/diff/1/mojo/common/common_custom_types.mojom#newcode27 mojo/common/common_custom_types.mojom:27: // Corresponds to |blink::WebString| in Wouldn't this violate DEPS, ...
4 years, 2 months ago (2016-09-29 20:13:09 UTC) #5
Zhiqiang Zhang (Slow)
https://codereview.chromium.org/2379993003/diff/1/mojo/common/common_custom_types.mojom File mojo/common/common_custom_types.mojom (right): https://codereview.chromium.org/2379993003/diff/1/mojo/common/common_custom_types.mojom#newcode27 mojo/common/common_custom_types.mojom:27: // Corresponds to |blink::WebString| in On 2016/09/29 20:13:08, Tom ...
4 years, 2 months ago (2016-09-29 20:39:31 UTC) #6
Ken Rockot(use gerrit already)
lgtm https://codereview.chromium.org/2379993003/diff/1/mojo/common/common_custom_types.mojom File mojo/common/common_custom_types.mojom (right): https://codereview.chromium.org/2379993003/diff/1/mojo/common/common_custom_types.mojom#newcode27 mojo/common/common_custom_types.mojom:27: // Corresponds to |blink::WebString| in On 2016/09/29 at ...
4 years, 2 months ago (2016-09-29 22:00:48 UTC) #7
Tom Sepez
LGTM per Ken's explanation.
4 years, 2 months ago (2016-09-30 16:34:38 UTC) #8
Zhiqiang Zhang (Slow)
PTAL. Addressed rockot's comments https://codereview.chromium.org/2379993003/diff/1/third_party/WebKit/Source/platform/mojo/CommonCustomTypesStructTraitsTest.cpp File third_party/WebKit/Source/platform/mojo/CommonCustomTypesStructTraitsTest.cpp (right): https://codereview.chromium.org/2379993003/diff/1/third_party/WebKit/Source/platform/mojo/CommonCustomTypesStructTraitsTest.cpp#newcode70 third_party/WebKit/Source/platform/mojo/CommonCustomTypesStructTraitsTest.cpp:70: base::RunLoop runLoop; On 2016/09/29 22:00:48, ...
4 years, 2 months ago (2016-09-30 17:55:53 UTC) #11
Ken Rockot(use gerrit already)
lgtm
4 years, 2 months ago (2016-09-30 18:02:53 UTC) #12
Zhiqiang Zhang (Slow)
+jochen for EMEA WEbkit/Source/platform review
4 years, 2 months ago (2016-10-03 10:24:51 UTC) #36
Zhiqiang Zhang (Slow)
+tkent for APAC Blink review. Hopefully we can get approval by tomorrow.
4 years, 2 months ago (2016-10-03 22:59:30 UTC) #38
tkent
I'm not familiar with Mojo. haraken@, can you review this?
4 years, 2 months ago (2016-10-03 23:15:49 UTC) #40
haraken
LGTM on my side +esprehn for the String conversion.
4 years, 2 months ago (2016-10-04 02:19:20 UTC) #42
esprehn
This patch doesn't look right it's round tripping all the strings through Vectors, but the ...
4 years, 2 months ago (2016-10-04 06:13:00 UTC) #44
Ken Rockot(use gerrit already)
https://codereview.chromium.org/2379993003/diff/120001/mojo/common/common_custom_types_struct_traits.cc File mojo/common/common_custom_types_struct_traits.cc (right): https://codereview.chromium.org/2379993003/diff/120001/mojo/common/common_custom_types_struct_traits.cc#newcode23 mojo/common/common_custom_types_struct_traits.cc:23: if (!data.ReadData(&raw_data)) To esprehn@'s point, you can do: mojo::ArrayDataView<int16_t> ...
4 years, 2 months ago (2016-10-04 06:28:40 UTC) #45
Zhiqiang Zhang (Slow)
https://codereview.chromium.org/2379993003/diff/120001/mojo/common/common_custom_types_struct_traits.cc File mojo/common/common_custom_types_struct_traits.cc (right): https://codereview.chromium.org/2379993003/diff/120001/mojo/common/common_custom_types_struct_traits.cc#newcode23 mojo/common/common_custom_types_struct_traits.cc:23: if (!data.ReadData(&raw_data)) On 2016/10/04 06:28:40, Ken Rockot wrote: > ...
4 years, 2 months ago (2016-10-04 10:07:19 UTC) #48
Zhiqiang Zhang (Slow)
PTAL. Addressed comments from esprehn and rockot. https://codereview.chromium.org/2379993003/diff/120001/mojo/common/common_custom_types_struct_traits.cc File mojo/common/common_custom_types_struct_traits.cc (right): https://codereview.chromium.org/2379993003/diff/120001/mojo/common/common_custom_types_struct_traits.cc#newcode23 mojo/common/common_custom_types_struct_traits.cc:23: if (!data.ReadData(&raw_data)) ...
4 years, 2 months ago (2016-10-04 13:21:59 UTC) #50
Ken Rockot(use gerrit already)
https://codereview.chromium.org/2379993003/diff/160001/mojo/common/common_custom_types_struct_traits.cc File mojo/common/common_custom_types_struct_traits.cc (right): https://codereview.chromium.org/2379993003/diff/160001/mojo/common/common_custom_types_struct_traits.cc#newcode15 mojo/common/common_custom_types_struct_traits.cc:15: return std::vector<uint16_t>(str.data(), str.data() + str.size()); Another reason to add ...
4 years, 2 months ago (2016-10-04 18:20:29 UTC) #55
Ken Rockot(use gerrit already)
Actually mojo::CArray should work as-is, since there's no reason T can't be a const type.
4 years, 2 months ago (2016-10-04 18:23:44 UTC) #56
Zhiqiang Zhang (Slow)
PTAL. Addressed more comments from rockot@. Left a comment for esprehn@ https://codereview.chromium.org/2379993003/diff/160001/mojo/common/common_custom_types_struct_traits.cc File mojo/common/common_custom_types_struct_traits.cc (right): ...
4 years, 2 months ago (2016-10-04 20:06:22 UTC) #59
Zhiqiang Zhang (Slow)
On 2016/10/04 at 20:06:22, Zhiqiang Zhang wrote: > PTAL. > > Addressed more comments from ...
4 years, 2 months ago (2016-10-04 20:09:41 UTC) #60
Zhiqiang Zhang (Slow)
Ping! esprehn@ & rockot@, are you OK with the patch now?
4 years, 2 months ago (2016-10-05 16:26:20 UTC) #67
Ken Rockot(use gerrit already)
On 2016/10/05 at 16:26:20, zqzhang wrote: > Ping! > esprehn@ & rockot@, are you OK ...
4 years, 2 months ago (2016-10-05 16:30:19 UTC) #68
Ken Rockot(use gerrit already)
On 2016/10/05 at 16:30:19, Ken Rockot wrote: > On 2016/10/05 at 16:26:20, zqzhang wrote: > ...
4 years, 2 months ago (2016-10-05 16:34:06 UTC) #69
esprehn
That DCHECK is8Bit is scary, isn't that when we're sending a string through mojo? That ...
4 years, 2 months ago (2016-10-05 17:38:53 UTC) #70
Ken Rockot(use gerrit already)
Could be a CHECK instead if that would be less scary. I don't see a ...
4 years, 2 months ago (2016-10-05 17:47:56 UTC) #71
Ken Rockot(use gerrit already)
On 2016/10/05 at 17:47:56, Ken Rockot wrote: > Could be a CHECK instead if that ...
4 years, 2 months ago (2016-10-05 17:48:30 UTC) #72
esprehn
Actually can we step back here, why do we need a String16 type in the ...
4 years, 2 months ago (2016-10-05 18:14:25 UTC) #73
Ken Rockot(use gerrit already)
On Wed, Oct 5, 2016 at 11:14 AM, <esprehn@chromium.org> wrote: > Actually can we step ...
4 years, 2 months ago (2016-10-05 18:19:16 UTC) #74
Ken Rockot(use gerrit already)
On Wed, Oct 5, 2016 at 11:14 AM, <esprehn@chromium.org> wrote: > Actually can we step ...
4 years, 2 months ago (2016-10-05 18:19:17 UTC) #75
esprehn
On 2016/10/05 at 18:19:17, rockot wrote: > On Wed, Oct 5, 2016 at 11:14 AM, ...
4 years, 2 months ago (2016-10-05 18:30:11 UTC) #76
esprehn
On 2016/10/05 at 18:30:11, esprehn wrote: > ... > > > > In this case ...
4 years, 2 months ago (2016-10-05 18:32:09 UTC) #77
Ken Rockot(use gerrit already)
Ah, so 16-bit WebString is UCS-2 and base::string16 is UTF-16, got it. I think it ...
4 years, 2 months ago (2016-10-05 19:04:55 UTC) #80
Ken Rockot(use gerrit already)
Ah, so 16-bit WebString is UCS-2 and base::string16 is UTF-16, got it. I think it ...
4 years, 2 months ago (2016-10-05 19:04:55 UTC) #81
esprehn
I think this is fine to land, we should just avoid adding any new IPCs ...
4 years, 2 months ago (2016-10-05 19:45:12 UTC) #82
esprehn
lgtm
4 years, 2 months ago (2016-10-05 19:45:22 UTC) #83
esprehn
btw I think you probably want to map to IntSize, not WebSize for blink. WebSize ...
4 years, 2 months ago (2016-10-05 19:46:56 UTC) #84
Zhiqiang Zhang (Slow)
On 2016/10/05 at 19:46:56, esprehn wrote: > btw I think you probably want to map ...
4 years, 2 months ago (2016-10-05 20:46:04 UTC) #85
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/2379993003/240001
4 years, 2 months ago (2016-10-05 20:47:11 UTC) #88
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_compile_dbg_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_compile_dbg_ng/builds/270679)
4 years, 2 months ago (2016-10-05 23:00:31 UTC) #90
Zhiqiang Zhang (Slow)
Hmm, interesting... When mapping gfx::Size to blink::IntSize, it got link error on Windows. I think ...
4 years, 2 months ago (2016-10-05 23:13:13 UTC) #91
Zhiqiang Zhang (Slow)
On 2016/10/05 at 23:13:13, Zhiqiang Zhang wrote: > Hmm, interesting... > When mapping gfx::Size to ...
4 years, 2 months ago (2016-10-05 23:32:49 UTC) #92
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/2379993003/260001
4 years, 2 months ago (2016-10-05 23:52:15 UTC) #95
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/155051)
4 years, 2 months ago (2016-10-06 02:33:19 UTC) #97
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/2379993003/260001
4 years, 2 months ago (2016-10-06 08:40:28 UTC) #99
commit-bot: I haz the power
Committed patchset #13 (id:260001)
4 years, 2 months ago (2016-10-06 09:23:40 UTC) #101
commit-bot: I haz the power
4 years, 2 months ago (2016-10-06 09:25:05 UTC) #103
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/fb032b1e3fec6f34883a1f432ff38cebb6875045
Cr-Commit-Position: refs/heads/master@{#423487}

Powered by Google App Engine
This is Rietveld 408576698