Commit 4f2c6dff authored by Ian Hickson's avatar Ian Hickson Committed by GitHub

Add annotations to the foundation Binding (#7214)

parent c677e80c
...@@ -72,6 +72,8 @@ abstract class BindingBase { ...@@ -72,6 +72,8 @@ abstract class BindingBase {
/// be exposed as `MixinClassName.instance`, a static getter that returns /// be exposed as `MixinClassName.instance`, a static getter that returns
/// `MixinClassName._instance`, a static field that is set by /// `MixinClassName._instance`, a static field that is set by
/// `initInstances()`. /// `initInstances()`.
@protected
@mustCallSuper
void initInstances() { void initInstances() {
assert(!_debugInitialized); assert(!_debugInitialized);
assert(() { _debugInitialized = true; return true; }); assert(() { _debugInitialized = true; return true; });
...@@ -97,6 +99,8 @@ abstract class BindingBase { ...@@ -97,6 +99,8 @@ abstract class BindingBase {
/// See also: /// See also:
/// ///
/// * <https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#rpcs-requests-and-responses> /// * <https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#rpcs-requests-and-responses>
@protected
@mustCallSuper
void initServiceExtensions() { void initServiceExtensions() {
assert(!_debugServiceExtensionsRegistered); assert(!_debugServiceExtensionsRegistered);
registerSignalServiceExtension( registerSignalServiceExtension(
...@@ -134,6 +138,7 @@ abstract class BindingBase { ...@@ -134,6 +138,7 @@ abstract class BindingBase {
/// no value. /// no value.
/// ///
/// Calls the `callback` callback when the service extension is called. /// Calls the `callback` callback when the service extension is called.
@protected
void registerSignalServiceExtension({ void registerSignalServiceExtension({
@required String name, @required String name,
@required VoidCallback callback @required VoidCallback callback
...@@ -161,6 +166,7 @@ abstract class BindingBase { ...@@ -161,6 +166,7 @@ abstract class BindingBase {
/// ///
/// Calls the `setter` callback with the new value when the /// Calls the `setter` callback with the new value when the
/// service extension method is called with a new value. /// service extension method is called with a new value.
@protected
void registerBoolServiceExtension({ void registerBoolServiceExtension({
String name, String name,
@required ValueGetter<bool> getter, @required ValueGetter<bool> getter,
...@@ -190,6 +196,7 @@ abstract class BindingBase { ...@@ -190,6 +196,7 @@ abstract class BindingBase {
/// ///
/// Calls the `setter` callback with the new value when the /// Calls the `setter` callback with the new value when the
/// service extension method is called with a new value. /// service extension method is called with a new value.
@protected
void registerNumericServiceExtension({ void registerNumericServiceExtension({
@required String name, @required String name,
@required ValueGetter<double> getter, @required ValueGetter<double> getter,
...@@ -218,6 +225,7 @@ abstract class BindingBase { ...@@ -218,6 +225,7 @@ abstract class BindingBase {
/// ///
/// Calls the `setter` callback with the new value when the /// Calls the `setter` callback with the new value when the
/// service extension method is called with a new value. /// service extension method is called with a new value.
@protected
void registerStringServiceExtension({ void registerStringServiceExtension({
@required String name, @required String name,
@required ValueGetter<String> getter, @required ValueGetter<String> getter,
...@@ -246,6 +254,7 @@ abstract class BindingBase { ...@@ -246,6 +254,7 @@ abstract class BindingBase {
/// logs. /// logs.
/// ///
/// The returned map will be mutated. /// The returned map will be mutated.
@protected
void registerServiceExtension({ void registerServiceExtension({
@required String name, @required String name,
@required ServiceExtensionCallback callback @required ServiceExtensionCallback callback
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment