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

Unified Diff: runtime/vm/isolate.h

Issue 1299493007: Rework service extensions to be safe (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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/isolate.h
diff --git a/runtime/vm/isolate.h b/runtime/vm/isolate.h
index 3a42366f3dba9df165d9fff1d6a917e96e72cb45..66b7517f93c1b6c1e1b1d5cb849db9b6c64b3535 100644
--- a/runtime/vm/isolate.h
+++ b/runtime/vm/isolate.h
@@ -702,6 +702,16 @@ class Isolate : public BaseIsolate {
compilation_allowed_ = allowed;
}
+ RawObject* InvokePendingExtensionCalls();
+ void AppendExtensionCall(const Instance& closure,
+ const String& method_name,
+ const Array& parameter_keys,
+ const Array& parameter_values,
+ const Instance& reply_port,
+ const Instance& id);
+ void RegisterExtensionHandler(const String& name, const Instance& closure);
+ RawInstance* LookupExtensionHandler(const String& name);
+
#if defined(DEBUG)
#define REUSABLE_HANDLE_SCOPE_ACCESSORS(object) \
void set_reusable_##object##_handle_scope_active(bool value) { \
@@ -765,6 +775,16 @@ class Isolate : public BaseIsolate {
user_tag_ = tag;
}
+ RawGrowableObjectArray* GetAndClearPendingExtensionCalls();
+ RawGrowableObjectArray* pending_extension_calls() const {
+ return pending_extension_calls_;
+ }
+ void set_pending_extension_calls(const GrowableObjectArray& value);
+ RawGrowableObjectArray* registered_extension_handlers() const {
+ return registered_extension_handlers_;
+ }
+ void set_registered_extension_handlers(const GrowableObjectArray& value);
+
void ClearMutatorThread() {
mutator_thread_ = NULL;
}
@@ -856,6 +876,26 @@ class Isolate : public BaseIsolate {
RawGrowableObjectArray* collected_closures_;
RawGrowableObjectArray* deoptimized_code_array_;
+ // We use 6 list entries for each pending service extension calls.
+ enum {
+ kPendingHandlerIndex = 0,
+ kPendingMethodNameIndex,
+ kPendingKeysIndex,
+ kPendingValuesIndex,
+ kPendingReplyPortIndex,
+ kPendingIdIndex,
+ kPendingEntrySize
+ };
+ RawGrowableObjectArray* pending_extension_calls_;
+
+ // We use 2 list entries for each registered extension handler.
+ enum {
+ kRegisteredNameIndex = 0,
+ kRegisteredHandlerIndex,
+ kRegisteredEntrySize
+ };
+ RawGrowableObjectArray* registered_extension_handlers_;
+
Metric* metrics_list_head_;
Counters counters_;
« no previous file with comments | « runtime/vm/dart_entry.cc ('k') | runtime/vm/isolate.cc » ('j') | runtime/vm/isolate.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698