Reviewers: turnidge
CL: https://codereview.chromium.org/1692743003/
Message:
TBR
Description:
Fix windows build by not using strcasestr
- Also fix no_support_timeline test.
Base URL: g...@github.com:dart-lang/sdk.git@master
Affected files (+18, -6 lines):
M runtime/vm/service.cc
M runtime/vm/timeline.cc
Index: runtime/vm/service.cc
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index ed5e89da31614cc00b06de8bfdcb0d31a1dd32db..c8912eb48c240e41cc2a646e40a21cbc6536d69c 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -2878,8 +2878,8 @@ static const MethodParameter* set_vm_timeline_flags_params[] = {
static bool HasStream(const char** recorded_streams, const char* stream) {
while (*recorded_streams != NULL) {
- if ((strcasestr(*recorded_streams, "all") != NULL) ||
- (strcasestr(*recorded_streams, stream) != NULL)) {
+ if ((strstr(*recorded_streams, "all") != NULL) ||
+ (strstr(*recorded_streams, stream) != NULL)) {
return true;
}
recorded_streams++;
@@ -2889,6 +2889,10 @@ static bool HasStream(const char** recorded_streams, const char* stream) {
static bool SetVMTimelineFlags(Thread* thread, JSONStream* js) {
+ if (!FLAG_support_timeline) {
+ PrintSuccess(js);
+ return true;
+ }
Isolate* isolate = thread->isolate();
ASSERT(isolate != NULL);
StackZone zone(thread);
@@ -2919,6 +2923,11 @@ static const MethodParameter* get_vm_timeline_flags_params[] = {
static bool GetVMTimelineFlags(Thread* thread, JSONStream* js) {
+ if (!FLAG_support_timeline) {
+ JSONObject obj(js);
+ obj.AddProperty("type", "TimelineFlags");
+ return true;
+ }
Isolate* isolate = thread->isolate();
ASSERT(isolate != NULL);
StackZone zone(thread);
Index: runtime/vm/timeline.cc
diff --git a/runtime/vm/timeline.cc b/runtime/vm/timeline.cc
index 43dd5656747684370b791bced2d27e2e3159fa23..be86154914c57b0f843030abd81bd19e5abb0456 100644
--- a/runtime/vm/timeline.cc
+++ b/runtime/vm/timeline.cc
@@ -29,8 +29,8 @@ DEFINE_FLAG(charp, timeline_dir, NULL,
"into specified directory.");
DEFINE_FLAG(charp, timeline_streams, NULL,
"Comma separated list of timeline streams to record. "
- "Valid values: all, api, compiler, dart, debugger, embedder, "
- "gc, isolate, and vm.");
+ "Valid values: all, API, Compiler, Dart, Debugger, Embedder, "
+ "GC, Isolate, and VM.");
// Implementation notes:
//
@@ -115,8 +115,8 @@ static bool HasStream(MallocGrowableArray<char*>* streams, const char* stream) {
}
for (intptr_t i = 0; i < streams->length(); i++) {
const char* checked_stream = (*streams)[i];
- if ((strcasestr(checked_stream, "all") != NULL) ||
- (strcasestr(checked_stream, stream) != NULL)) {
+ if ((strstr(checked_stream, "all") != NULL) ||
+ (strstr(checked_stream, stream) != NULL)) {
return true;
}
}
@@ -181,6 +181,9 @@ TimelineEventRecorder* Timeline::recorder() {
void Timeline::SetupIsolateStreams(Isolate* isolate) {
+ if (!FLAG_support_timeline) {
+ return;
+ }
#define ISOLATE_TIMELINE_STREAM_INIT(name, enabled_by_default) \
isolate->Get##name##Stream()->Init( \
#name, \