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

Unified Diff: runtime/vm/service.cc

Issue 2361183002: Respect setLibraryDebuggable (Closed)
Patch Set: Respect setLibraryDebuggable Created 4 years, 3 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 | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/service.cc
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index d35f0e147f42af9a33dac52f31623cf8d6a56f6c..efc5c24b304a3a46a81b962b952b86f92593ea3f 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -241,6 +241,14 @@ static void PrintInvalidParamError(JSONStream* js,
}
+static void PrintIllegalParamError(JSONStream* js,
+ const char* param) {
+ js->PrintError(kInvalidParams,
+ "%s: illegal '%s' parameter: %s",
+ js->method(), param, js->LookupParam(param));
+}
+
+
static void PrintUnrecognizedMethodError(JSONStream* js) {
js->PrintError(kMethodNotFound, NULL);
}
@@ -3977,6 +3985,13 @@ static bool SetLibraryDebuggable(Thread* thread, JSONStream* js) {
BoolParameter::Parse(js->LookupParam("isDebuggable"), false);
if (obj.IsLibrary()) {
const Library& lib = Library::Cast(obj);
+ if (lib.is_dart_scheme()) {
+ const String& url = String::Handle(lib.url());
+ if (url.StartsWith(Symbols::DartSchemePrivate())) {
+ PrintIllegalParamError(js, "libraryId");
+ return true;
+ }
+ }
lib.set_debuggable(is_debuggable);
PrintSuccess(js);
return true;
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698