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

Unified Diff: runtime/lib/developer.cc

Issue 1660063002: Remove many features when building product mode (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/lib/vmservice.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/developer.cc
diff --git a/runtime/lib/developer.cc b/runtime/lib/developer.cc
index ead1de126a4dbf794a2913358b4f6021b64186bb..e47e8effdfd5b13433a3cf72c77d4baf6e9ae9c1 100644
--- a/runtime/lib/developer.cc
+++ b/runtime/lib/developer.cc
@@ -8,6 +8,7 @@
#include "vm/debugger.h"
#include "vm/exceptions.h"
+#include "vm/flags.h"
#include "vm/native_entry.h"
#include "vm/object.h"
#include "vm/object_store.h"
@@ -21,7 +22,7 @@ DEFINE_NATIVE_ENTRY(Developer_debugger, 2) {
GET_NON_NULL_NATIVE_ARGUMENT(Bool, when, arguments->NativeArgAt(0));
GET_NATIVE_ARGUMENT(String, msg, arguments->NativeArgAt(1));
Debugger* debugger = isolate->debugger();
- if (!debugger) {
+ if (!FLAG_support_debugger || !debugger) {
return when.raw();
}
if (when.value()) {
@@ -33,12 +34,17 @@ DEFINE_NATIVE_ENTRY(Developer_debugger, 2) {
DEFINE_NATIVE_ENTRY(Developer_inspect, 1) {
GET_NATIVE_ARGUMENT(Instance, inspectee, arguments->NativeArgAt(0));
- Service::SendInspectEvent(isolate, inspectee);
+ if (FLAG_support_service) {
+ Service::SendInspectEvent(isolate, inspectee);
+ }
return inspectee.raw();
}
DEFINE_NATIVE_ENTRY(Developer_log, 8) {
+ if (!FLAG_support_service) {
+ return Object::null();
+ }
GET_NON_NULL_NATIVE_ARGUMENT(String, message, arguments->NativeArgAt(0));
GET_NON_NULL_NATIVE_ARGUMENT(Integer, timestamp, arguments->NativeArgAt(1));
GET_NON_NULL_NATIVE_ARGUMENT(Integer, sequence, arguments->NativeArgAt(2));
@@ -61,6 +67,9 @@ DEFINE_NATIVE_ENTRY(Developer_log, 8) {
DEFINE_NATIVE_ENTRY(Developer_postEvent, 2) {
+ if (!FLAG_support_service) {
+ return Object::null();
+ }
GET_NON_NULL_NATIVE_ARGUMENT(String, event_kind, arguments->NativeArgAt(0));
GET_NON_NULL_NATIVE_ARGUMENT(String, event_data, arguments->NativeArgAt(1));
Service::SendExtensionEvent(isolate, event_kind, event_data);
@@ -69,12 +78,18 @@ DEFINE_NATIVE_ENTRY(Developer_postEvent, 2) {
DEFINE_NATIVE_ENTRY(Developer_lookupExtension, 1) {
+ if (!FLAG_support_service) {
+ return Object::null();
+ }
GET_NON_NULL_NATIVE_ARGUMENT(String, name, arguments->NativeArgAt(0));
return isolate->LookupServiceExtensionHandler(name);
}
DEFINE_NATIVE_ENTRY(Developer_registerExtension, 2) {
+ if (!FLAG_support_service) {
+ return Object::null();
+ }
GET_NON_NULL_NATIVE_ARGUMENT(String, name, arguments->NativeArgAt(0));
GET_NON_NULL_NATIVE_ARGUMENT(Instance, handler, arguments->NativeArgAt(1));
isolate->RegisterServiceExtensionHandler(name, handler);
« no previous file with comments | « no previous file | runtime/lib/vmservice.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698