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

Unified Diff: runtime/vm/dart_api_state.h

Issue 1719313002: Add persistent handles to service protocol and Observatory UI (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 | « runtime/observatory/observatory_sources.gypi ('k') | runtime/vm/service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/dart_api_state.h
diff --git a/runtime/vm/dart_api_state.h b/runtime/vm/dart_api_state.h
index 3c7d3165adb4f23f98945c5165af4b371623f7b2..b510377352cdc294d017c4922a86bd2e052e0c5f 100644
--- a/runtime/vm/dart_api_state.h
+++ b/runtime/vm/dart_api_state.h
@@ -213,6 +213,10 @@ class FinalizablePersistentHandle {
return reinterpret_cast<Dart_WeakPersistentHandle>(this);
}
+ intptr_t external_size() const {
+ return ExternalSizeBits::decode(external_data_);
+ }
+
void SetExternalSize(intptr_t size, Isolate* isolate) {
ASSERT(size >= 0);
set_external_size(Utils::RoundUp(size, kObjectAlignment));
@@ -305,10 +309,6 @@ class FinalizablePersistentHandle {
callback_ = callback;
}
- intptr_t external_size() const {
- return ExternalSizeBits::decode(external_data_);
- }
-
void set_external_size(intptr_t size) {
ASSERT(ExternalSizeBits::is_valid(size));
external_data_ = ExternalSizeBits::update(size, external_data_);
@@ -445,6 +445,13 @@ class PersistentHandles : Handles<kPersistentHandleSizeInWords,
kOffsetOfRawPtrInPersistentHandle>::VisitObjectPointers(visitor);
}
+ // Visit all the handles.
+ void Visit(HandleVisitor* visitor) {
+ Handles<kPersistentHandleSizeInWords,
+ kPersistentHandlesPerChunk,
+ kOffsetOfRawPtrInPersistentHandle>::Visit(visitor);
+ }
+
// Allocates a persistent handle, these have to be destroyed explicitly
// by calling FreeHandle.
PersistentHandle* AllocateHandle() {
« no previous file with comments | « runtime/observatory/observatory_sources.gypi ('k') | runtime/vm/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698