提交 3e159351 编写于 作者: J John McCutchan 提交者: GitHub

Add 'ext.ui.window.scheduleFrame' service protocol extension (#3030)

上级 edcb3aa4
......@@ -13,10 +13,28 @@ class _Logger {
static void _printString(String s) native "Logger_PrintString";
}
// A service protocol extension to schedule a frame to be rendered into the
// window.
Future<developer.ServiceExtensionResponse> _scheduleFrame(
String method,
Map<String, String> parameters
) async {
// Schedule the frame.
window.scheduleFrame();
// Always succeed.
return new developer.ServiceExtensionResponse.result(JSON.encode({
'type': 'Success',
}));
}
void _setupHooks() {
// Wire up timer implementation that is driven by MojoHandleWatcher.
VMLibraryHooks.eventHandlerSendData = MojoHandleWatcher.timer;
VMLibraryHooks.timerMillisecondClock = MojoCoreNatives.timerMillisecondClock;
assert(() {
// In debug mode, register the schedule frame extension.
developer.registerExtension('ext.ui.window.scheduleFrame', _scheduleFrame);
});
}
void _scheduleMicrotask(void callback()) native "ScheduleMicrotask";
......
......@@ -14,6 +14,9 @@
library dart_ui;
import 'dart:_internal';
import 'dart:async';
import 'dart:convert';
import 'dart:developer' as developer;
import 'dart:math' as math;
import 'dart:mojo.internal';
import 'dart:nativewrappers';
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册