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

Unified Diff: sky/specs/apis.md

Issue 687353003: Specs: Add a way for the inspector to see the registered event listeners (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 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 | « sky/specs/README.md ('k') | sky/specs/modules.md » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/specs/apis.md
diff --git a/sky/specs/apis.md b/sky/specs/apis.md
index a335a5eaec9c1b51b6b1cfd645e18fc67c5b469d..3808659f5dafd621268179b145e9cdaf4c5d6491 100644
--- a/sky/specs/apis.md
+++ b/sky/specs/apis.md
@@ -1,4 +1,4 @@
-APIS
+APIs
====
The Sky core API
@@ -29,6 +29,8 @@ module 'sky:core' {
any dispatchEvent(Event event); // O(N) in total number of listeners for this type in the chain // returns Event.result
void addEventListener(String type, EventListener listener); // O(1)
void removeEventListener(String type, EventListener listener); // O(N) in event listeners with that type
+ private Array<String> getRegisteredEventListenerTypes(); // O(N)
+ private Array<EventListener> getRegisteredEventListenersForType(String type); // O(N)
}
interface CustomEventTarget : EventTarget {
@@ -255,6 +257,9 @@ module 'sky:modulename' {
// The default implementations of 'virtual' methods all end by calling the identically named method
// on the superclass, if there is such a method.
+ // private APIs - see below
+ private void method();
+
// arguments and overloading are done as follows
// note that the argument names are only for documentation purposes
ReturnType method(ArgumentType argumentName1, ArgumentType argumentName2);
@@ -269,6 +274,33 @@ module 'sky:modulename' {
}
```
+### Private APIs ###
+
+Private APIs are only accessible via Symbol objects, which are then
+exposed on the sky:debug module's exports object as the name of the
+member given in the IDL.
+
+For example, consider:
+
+```javascript
+interface Foo {
+ private void Bar();
+}
+```
+
+In a script with a ``foo`` object of type ``Foo``, ``foo.Bar`` is
+undefined. However, it can be obtained as follows:
+
+```html
+<import src="sky:debug" as="debug"/>
+<!-- ... import whatever defines 'foo' ... -->
+<script>
+ foo[debug.Bar]
+</script>
+```
+
+### Types ###
+
The following types are available:
* ``Integer`` - WebIDL ``long long``
@@ -291,6 +323,7 @@ TODO(ianh): Figure out what should happen with omitted and extraneous parameters
TODO(ianh): Define in detail how this actually works
+
Mojom IDL
---------
@@ -313,6 +346,7 @@ magical imports:
the asyncWait/cancelWait mojo fabric JS API (interface to IPC thread) sky:mojo:fabric:ipc
the mojom for the shell, proxying through C++ so that the shell pipe isn't exposed sky:mojo:shell
the sky API sky:core
+ the sky debug symbols for private APIs sky:debug
```
TODO(ianh): determine if we want to separate the "this" from the
« no previous file with comments | « sky/specs/README.md ('k') | sky/specs/modules.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698