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

Side by Side Diff: runtime/vm/service.cc

Issue 1692743003: Fix windows build by not using strcasestr (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | runtime/vm/timeline.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/service.h" 5 #include "vm/service.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "include/dart_native_api.h" 8 #include "include/dart_native_api.h"
9 #include "platform/globals.h" 9 #include "platform/globals.h"
10 10
(...skipping 2860 matching lines...) Expand 10 before | Expand all | Expand 10 after
2871 NO_ISOLATE_PARAMETER, 2871 NO_ISOLATE_PARAMETER,
2872 new EnumListParameter("recordedStreams", 2872 new EnumListParameter("recordedStreams",
2873 false, 2873 false,
2874 timeline_streams_enum_names), 2874 timeline_streams_enum_names),
2875 NULL, 2875 NULL,
2876 }; 2876 };
2877 2877
2878 2878
2879 static bool HasStream(const char** recorded_streams, const char* stream) { 2879 static bool HasStream(const char** recorded_streams, const char* stream) {
2880 while (*recorded_streams != NULL) { 2880 while (*recorded_streams != NULL) {
2881 if ((strcasestr(*recorded_streams, "all") != NULL) || 2881 if ((strstr(*recorded_streams, "all") != NULL) ||
2882 (strcasestr(*recorded_streams, stream) != NULL)) { 2882 (strstr(*recorded_streams, stream) != NULL)) {
2883 return true; 2883 return true;
2884 } 2884 }
2885 recorded_streams++; 2885 recorded_streams++;
2886 } 2886 }
2887 return false; 2887 return false;
2888 } 2888 }
2889 2889
2890 2890
2891 static bool SetVMTimelineFlags(Thread* thread, JSONStream* js) { 2891 static bool SetVMTimelineFlags(Thread* thread, JSONStream* js) {
2892 if (!FLAG_support_timeline) {
2893 PrintSuccess(js);
2894 return true;
2895 }
2892 Isolate* isolate = thread->isolate(); 2896 Isolate* isolate = thread->isolate();
2893 ASSERT(isolate != NULL); 2897 ASSERT(isolate != NULL);
2894 StackZone zone(thread); 2898 StackZone zone(thread);
2895 2899
2896 const EnumListParameter* recorded_streams_param = 2900 const EnumListParameter* recorded_streams_param =
2897 static_cast<const EnumListParameter*>(set_vm_timeline_flags_params[1]); 2901 static_cast<const EnumListParameter*>(set_vm_timeline_flags_params[1]);
2898 2902
2899 const char* recorded_streams_str = js->LookupParam("recordedStreams"); 2903 const char* recorded_streams_str = js->LookupParam("recordedStreams");
2900 const char** recorded_streams = 2904 const char** recorded_streams =
2901 recorded_streams_param->Parse(thread->zone(), recorded_streams_str); 2905 recorded_streams_param->Parse(thread->zone(), recorded_streams_str);
(...skipping 10 matching lines...) Expand all
2912 } 2916 }
2913 2917
2914 2918
2915 static const MethodParameter* get_vm_timeline_flags_params[] = { 2919 static const MethodParameter* get_vm_timeline_flags_params[] = {
2916 NO_ISOLATE_PARAMETER, 2920 NO_ISOLATE_PARAMETER,
2917 NULL, 2921 NULL,
2918 }; 2922 };
2919 2923
2920 2924
2921 static bool GetVMTimelineFlags(Thread* thread, JSONStream* js) { 2925 static bool GetVMTimelineFlags(Thread* thread, JSONStream* js) {
2926 if (!FLAG_support_timeline) {
2927 JSONObject obj(js);
2928 obj.AddProperty("type", "TimelineFlags");
2929 return true;
2930 }
2922 Isolate* isolate = thread->isolate(); 2931 Isolate* isolate = thread->isolate();
2923 ASSERT(isolate != NULL); 2932 ASSERT(isolate != NULL);
2924 StackZone zone(thread); 2933 StackZone zone(thread);
2925 Timeline::PrintFlagsToJSON(js); 2934 Timeline::PrintFlagsToJSON(js);
2926 return true; 2935 return true;
2927 } 2936 }
2928 2937
2929 2938
2930 static const MethodParameter* clear_vm_timeline_params[] = { 2939 static const MethodParameter* clear_vm_timeline_params[] = {
2931 NO_ISOLATE_PARAMETER, 2940 NO_ISOLATE_PARAMETER,
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after
3977 if (strcmp(method_name, method.name) == 0) { 3986 if (strcmp(method_name, method.name) == 0) {
3978 return &method; 3987 return &method;
3979 } 3988 }
3980 } 3989 }
3981 return NULL; 3990 return NULL;
3982 } 3991 }
3983 3992
3984 #endif // !PRODUCT 3993 #endif // !PRODUCT
3985 3994
3986 } // namespace dart 3995 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/timeline.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698