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

Unified Diff: runtime/vm/service.cc

Issue 1400393002: Use offset and count to request slices of lists, maps, and typed_data. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: pre review tidy Created 5 years, 2 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
Index: runtime/vm/service.cc
diff --git a/runtime/vm/service.cc b/runtime/vm/service.cc
index b2205cf48ddb80c0cb4e50e6a013315580e0e8c0..9761106e8cc48e540ccf602b6347e5fa7b59242f 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -2830,6 +2830,8 @@ static bool RespondWithMalformedObject(Isolate* isolate,
static const MethodParameter* get_object_params[] = {
ISOLATE_PARAMETER,
+ new UIntParameter("offset", false),
+ new UIntParameter("count", false),
NULL,
};
@@ -2840,6 +2842,22 @@ static bool GetObject(Isolate* isolate, JSONStream* js) {
PrintMissingParamError(js, "objectId");
return true;
}
+ if (js->HasParam("offset")) {
+ intptr_t value = UIntParameter::Parse(js->LookupParam("offset"));
+ if (value < 0) {
+ PrintInvalidParamError(js, "offset");
+ return true;
+ }
+ js->set_offset(value);
+ }
+ if (js->HasParam("count")) {
+ intptr_t value = UIntParameter::Parse(js->LookupParam("count"));
+ if (value < 1) {
Cutch 2015/10/14 17:58:09 Consider allowing queries of the container with a
turnidge 2015/10/14 18:02:42 Done.
+ PrintInvalidParamError(js, "count");
+ return true;
+ }
+ js->set_count(value);
+ }
// Handle heap objects.
ObjectIdRing::LookupResult lookup_result;

Powered by Google App Engine
This is Rietveld 408576698