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

Issue 11280150: Add support for surrogates when serializing and deserializing for native ports (Closed)

Created:
8 years ago by Søren Gjesse
Modified:
8 years ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add support for surrogates when serializing and deserializing for native ports As Dart allows creating string with UTF-16 surrogate code units which are not always in lead/trail pairs, we need to support this in the communication with native ports. This change allows surrogate code units in messages to/from native ports and supports them in the UTF-8 encoding used on the Dart_CObject structure string representation. R=ager@google.com, erikcorry@google.com, asiva@google.com BUG= Committed: https://code.google.com/p/dart/source/detail?r=15585

Patch Set 1 #

Total comments: 3

Patch Set 2 : Added Utf16::CodePointIterator #

Total comments: 13

Patch Set 3 : Addressed review comments from asiva@ #

Patch Set 4 : Addressed additional comments from asiva@ #

Patch Set 5 : Use iterator reset #

Total comments: 6

Patch Set 6 : Only allow legal UTF-8 #

Patch Set 7 : Fixed long line #

Total comments: 9

Patch Set 8 : Addressed more review comments #

Patch Set 9 : Rebased to r15579 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+134 lines, -65 lines) Patch
M runtime/vm/dart_api_message.cc View 1 2 3 4 5 6 7 8 2 chunks +23 lines, -8 lines 0 comments Download
M runtime/vm/object.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/snapshot_test.cc View 1 2 3 4 5 6 7 8 6 chunks +96 lines, -43 lines 0 comments Download
M runtime/vm/unicode.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -1 line 0 comments Download
M runtime/vm/unicode.cc View 1 2 3 4 5 6 7 8 8 chunks +13 lines, -12 lines 0 comments Download

Messages

Total messages: 23 (0 generated)
Søren Gjesse
8 years ago (2012-11-23 14:06:14 UTC) #1
erikcorry
Are snapshots untrusted data? Do you create symbols from snapshots? Is it possible to canonicalize ...
8 years ago (2012-11-23 14:25:47 UTC) #2
Søren Gjesse
On 2012/11/23 14:25:47, erikcorry wrote: > Are snapshots untrusted data? Do you create symbols from ...
8 years ago (2012-11-26 08:52:50 UTC) #3
Søren Gjesse
https://codereview.chromium.org/11280150/diff/1/runtime/vm/dart_api_message.cc File runtime/vm/dart_api_message.cc (right): https://codereview.chromium.org/11280150/diff/1/runtime/vm/dart_api_message.cc#newcode397 runtime/vm/dart_api_message.cc:397: for (intptr_t i = 0; i < len; i++) ...
8 years ago (2012-11-26 08:53:00 UTC) #4
siva
https://codereview.chromium.org/11280150/diff/5001/runtime/vm/dart_api_message.cc File runtime/vm/dart_api_message.cc (right): https://codereview.chromium.org/11280150/diff/5001/runtime/vm/dart_api_message.cc#newcode397 runtime/vm/dart_api_message.cc:397: Utf16::CodePointIterator it(utf16, len); If you get invalid characters here ...
8 years ago (2012-11-27 03:00:25 UTC) #5
Søren Gjesse
Thanks for the review, please take another look. https://codereview.chromium.org/11280150/diff/5001/runtime/vm/dart_api_message.cc File runtime/vm/dart_api_message.cc (right): https://codereview.chromium.org/11280150/diff/5001/runtime/vm/dart_api_message.cc#newcode397 runtime/vm/dart_api_message.cc:397: Utf16::CodePointIterator ...
8 years ago (2012-11-27 11:35:54 UTC) #6
siva
https://codereview.chromium.org/11280150/diff/5001/runtime/vm/dart_api_message.cc File runtime/vm/dart_api_message.cc (right): https://codereview.chromium.org/11280150/diff/5001/runtime/vm/dart_api_message.cc#newcode795 runtime/vm/dart_api_message.cc:795: if (!Utf8::IsValidAllowSurrogates(utf8_str, utf8_len)) { I was under the impression ...
8 years ago (2012-11-28 03:28:23 UTC) #7
Søren Gjesse
PTAL Changed the Unicode library to always accept Utf8 encoded surrogate code units. Added and ...
8 years ago (2012-11-28 15:23:18 UTC) #8
siva
lgtm https://codereview.chromium.org/11280150/diff/13002/runtime/vm/dart_api_impl_test.cc File runtime/vm/dart_api_impl_test.cc (right): https://codereview.chromium.org/11280150/diff/13002/runtime/vm/dart_api_impl_test.cc#newcode591 runtime/vm/dart_api_impl_test.cc:591: } This test and the one above seem ...
8 years ago (2012-11-28 18:22:46 UTC) #9
siva
I chatted with Carl regarding Utf8::IsValid and Utf8::Decode, he says it is incorrect to see ...
8 years ago (2012-11-28 20:46:56 UTC) #10
erikcorry
On 2012/11/28 20:46:56, siva wrote: > I chatted with Carl regarding > Utf8::IsValid and Utf8::Decode, ...
8 years ago (2012-11-28 20:47:59 UTC) #11
Søren Gjesse
On 2012/11/28 20:47:59, erikcorry wrote: > On 2012/11/28 20:46:56, siva wrote: > > I chatted ...
8 years ago (2012-11-28 21:06:28 UTC) #12
siva
https://codereview.chromium.org/11280150/diff/13002/runtime/vm/dart_api_message.cc File runtime/vm/dart_api_message.cc (right): https://codereview.chromium.org/11280150/diff/13002/runtime/vm/dart_api_message.cc#newcode407 runtime/vm/dart_api_message.cc:407: } At this point here we could state that ...
8 years ago (2012-11-28 22:02:24 UTC) #13
siva
8 years ago (2012-11-28 22:17:15 UTC) #14
cshapiro
> Also with String.fromCharCodes you can create any sequence of UTF-16 code points > (see ...
8 years ago (2012-11-29 02:14:22 UTC) #15
Søren Gjesse
On 2012/11/29 02:14:22, cshapiro wrote: > > Also with String.fromCharCodes you can create any sequence ...
8 years ago (2012-11-29 08:23:33 UTC) #16
erikcorry
On 2012/11/29 08:23:33, Søren Gjesse wrote: > My personal opinion here is that just relaxing ...
8 years ago (2012-11-29 08:53:31 UTC) #17
Søren Gjesse
PTA(final)L The UTF-8 encodings used are now always fully legal. If a string which cannot ...
8 years ago (2012-11-29 09:06:14 UTC) #18
siva
lgtm
8 years ago (2012-11-30 02:04:33 UTC) #19
cshapiro
https://codereview.chromium.org/11280150/diff/13004/runtime/vm/object.h File runtime/vm/object.h (right): https://codereview.chromium.org/11280150/diff/13004/runtime/vm/object.h#newcode3746 runtime/vm/object.h:3746: void Reset() { I would prefer that this functionality ...
8 years ago (2012-11-30 02:49:07 UTC) #20
Søren Gjesse
https://codereview.chromium.org/11280150/diff/13004/runtime/vm/object.h File runtime/vm/object.h (right): https://codereview.chromium.org/11280150/diff/13004/runtime/vm/object.h#newcode3746 runtime/vm/object.h:3746: void Reset() { On 2012/11/30 02:49:08, cshapiro wrote: > ...
8 years ago (2012-11-30 12:23:07 UTC) #21
Søren Gjesse
Committing. https://codereview.chromium.org/11280150/diff/13004/runtime/vm/unicode.h File runtime/vm/unicode.h (right): https://codereview.chromium.org/11280150/diff/13004/runtime/vm/unicode.h#newcode76 runtime/vm/unicode.h:76: class CodePointIterator { On 2012/11/30 02:49:08, cshapiro wrote: ...
8 years ago (2012-11-30 13:06:03 UTC) #22
cshapiro
8 years ago (2012-11-30 18:08:22 UTC) #23
Message was sent while issue was closed.
Thanks!

Powered by Google App Engine
This is Rietveld 408576698