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

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: code review 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
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/service/service.md » ('j') | 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 450aadca337dfd81609374a3ad182e15da6986e8..42e50a4a108e610df1af186d91eedd4259bedc8f 100644
--- a/runtime/vm/service.cc
+++ b/runtime/vm/service.cc
@@ -2848,6 +2848,8 @@ static bool RespondWithMalformedObject(Isolate* isolate,
static const MethodParameter* get_object_params[] = {
ISOLATE_PARAMETER,
+ new UIntParameter("offset", false),
+ new UIntParameter("count", false),
NULL,
};
@@ -2858,6 +2860,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 < 0) {
+ PrintInvalidParamError(js, "count");
+ return true;
+ }
+ js->set_count(value);
+ }
// Handle heap objects.
ObjectIdRing::LookupResult lookup_result;
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/service/service.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698