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

Issue 1287543003: Refactor Dart_TimelineGetTrace to use a StreamConsumer callback (Closed)

Created:
5 years, 4 months ago by Cutch
Modified:
5 years, 4 months ago
Reviewers:
siva
CC:
reviews_dartlang.org, vm-dev_dartlang.org
Base URL:
git@github.com:dart-lang/sdk.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Refactor Dart_TimelineGetTrace to use a StreamConsumer callback BUG= R=asiva@google.com Committed: https://github.com/dart-lang/sdk/commit/8be0e8a9c578b658408da39079a91b294863e34c

Patch Set 1 #

Total comments: 14
Unified diffs Side-by-side diffs Delta from patch set Stats (+135 lines, -17 lines) Patch
M runtime/include/dart_tools_api.h View 1 chunk +40 lines, -7 lines 10 comments Download
M runtime/vm/dart_api_impl.cc View 2 chunks +53 lines, -7 lines 4 comments Download
M runtime/vm/dart_api_impl_test.cc View 2 chunks +42 lines, -3 lines 0 comments Download

Messages

Total messages: 5 (1 generated)
Cutch
5 years, 4 months ago (2015-08-11 16:08:13 UTC) #2
siva
LGTM with some comments. https://codereview.chromium.org/1287543003/diff/1/runtime/include/dart_tools_api.h File runtime/include/dart_tools_api.h (right): https://codereview.chromium.org/1287543003/diff/1/runtime/include/dart_tools_api.h#newcode916 runtime/include/dart_tools_api.h:916: * stream. Should this be: ...
5 years, 4 months ago (2015-08-11 16:54:33 UTC) #3
Cutch
Committed patchset #1 (id:1) manually as 8be0e8a9c578b658408da39079a91b294863e34c (presubmit successful).
5 years, 4 months ago (2015-08-11 17:08:39 UTC) #4
Cutch
5 years, 4 months ago (2015-08-11 17:08:56 UTC) #5
Message was sent while issue was closed.
https://codereview.chromium.org/1287543003/diff/1/runtime/include/dart_tools_...
File runtime/include/dart_tools_api.h (right):

https://codereview.chromium.org/1287543003/diff/1/runtime/include/dart_tools_...
runtime/include/dart_tools_api.h:916: * stream.
On 2015/08/11 16:54:33, siva wrote:
> Should this be:
> until there is no more data in a stream and there are no more streams ?

Done.

https://codereview.chromium.org/1287543003/diff/1/runtime/include/dart_tools_...
runtime/include/dart_tools_api.h:920: * \param buffer A pointer to data from the
stream.
On 2015/08/11 16:54:33, siva wrote:
> "A pointer to the stream data" maybe?

Done.

https://codereview.chromium.org/1287543003/diff/1/runtime/include/dart_tools_...
runtime/include/dart_tools_api.h:922: * \param user_data The user data pointer
passed in when requesting the stream.
On 2015/08/11 16:54:33, siva wrote:
> instead of user_data maybe name it stream_callback_data to be consistent with
> some of the callback data we have elsewhere in this file.

Done.

https://codereview.chromium.org/1287543003/diff/1/runtime/include/dart_tools_...
runtime/include/dart_tools_api.h:934: intptr_t state,
On 2015/08/11 16:54:33, siva wrote:
> Dart_StreamConsumer_State state,
> 
> (see below).

Done.

https://codereview.chromium.org/1287543003/diff/1/runtime/include/dart_tools_...
runtime/include/dart_tools_api.h:945: #define DART_STREAM_CONSUMER_STATE_FINISH
2
On 2015/08/11 16:54:33, siva wrote:
> why not use a enum here:
> 
> typedef enum {
>   Dart_StreamConsumer_kStart = 0,
>   ...
>   ...
> } Dart_StreamConsumer_State;

Done.

https://codereview.chromium.org/1287543003/diff/1/runtime/vm/dart_api_impl.cc
File runtime/vm/dart_api_impl.cc (right):

https://codereview.chromium.org/1287543003/diff/1/runtime/vm/dart_api_impl.cc...
runtime/vm/dart_api_impl.cc:5826: intptr_t remaining = output_length - cursor;
On 2015/08/11 16:54:33, siva wrote:
> intptr_t remaining = output_length;

Done.

https://codereview.chromium.org/1287543003/diff/1/runtime/vm/dart_api_impl.cc...
runtime/vm/dart_api_impl.cc:5854: user_data);
On 2015/08/11 16:54:33, siva wrote:
> Why does start and end have to have a NULL buffer why can't they have a buffer
> too (would reduce the number of callback calls to be made).

I find this API simpler to work with.

Powered by Google App Engine
This is Rietveld 408576698