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

Side by Side Diff: mojo/dart/packages/mojo_services/lib/activity/activity.mojom.dart

Issue 1964193002: Dart: Refactors Proxies (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Address comments Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 library activity_mojom; 5 library activity_mojom;
6 import 'dart:async'; 6 import 'dart:async';
7 import 'package:mojo/bindings.dart' as bindings; 7 import 'package:mojo/bindings.dart' as bindings;
8 import 'package:mojo/core.dart' as core; 8 import 'package:mojo/core.dart' as core;
9 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic e_describer; 9 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic e_describer;
10 10
(...skipping 1672 matching lines...) Expand 10 before | Expand all | Expand 10 after
1683 static const String serviceName = "activity::Activity"; 1683 static const String serviceName = "activity::Activity";
1684 void getUserFeedback(Object userFeedback); 1684 void getUserFeedback(Object userFeedback);
1685 void startActivity(Intent intent); 1685 void startActivity(Intent intent);
1686 void finishCurrentActivity(); 1686 void finishCurrentActivity();
1687 void setTaskDescription(TaskDescription description); 1687 void setTaskDescription(TaskDescription description);
1688 void setSystemUiVisibility(SystemUiVisibility visibility); 1688 void setSystemUiVisibility(SystemUiVisibility visibility);
1689 void setRequestedOrientation(ScreenOrientation orientation); 1689 void setRequestedOrientation(ScreenOrientation orientation);
1690 } 1690 }
1691 1691
1692 1692
1693 class _ActivityProxyImpl extends bindings.Proxy { 1693 class _ActivityProxyControl extends bindings.ProxyMessageHandler
1694 _ActivityProxyImpl.fromEndpoint( 1694 implements bindings.ProxyControl {
1695 _ActivityProxyControl.fromEndpoint(
1695 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 1696 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
1696 1697
1697 _ActivityProxyImpl.fromHandle(core.MojoHandle handle) : 1698 _ActivityProxyControl.fromHandle(
1698 super.fromHandle(handle); 1699 core.MojoHandle handle) : super.fromHandle(handle);
1699 1700
1700 _ActivityProxyImpl.unbound() : super.unbound(); 1701 _ActivityProxyControl.unbound() : super.unbound();
1701
1702 static _ActivityProxyImpl newFromEndpoint(
1703 core.MojoMessagePipeEndpoint endpoint) {
1704 assert(endpoint.setDescription("For _ActivityProxyImpl"));
1705 return new _ActivityProxyImpl.fromEndpoint(endpoint);
1706 }
1707 1702
1708 service_describer.ServiceDescription get serviceDescription => 1703 service_describer.ServiceDescription get serviceDescription =>
1709 new _ActivityServiceDescription(); 1704 new _ActivityServiceDescription();
1710 1705
1706 String get serviceName => Activity.serviceName;
1707
1708 @override
1711 void handleResponse(bindings.ServiceMessage message) { 1709 void handleResponse(bindings.ServiceMessage message) {
1712 switch (message.header.type) { 1710 switch (message.header.type) {
1713 default: 1711 default:
1714 proxyError("Unexpected message type: ${message.header.type}"); 1712 proxyError("Unexpected message type: ${message.header.type}");
1715 close(immediate: true); 1713 close(immediate: true);
1716 break; 1714 break;
1717 } 1715 }
1718 } 1716 }
1719 1717
1718 @override
1720 String toString() { 1719 String toString() {
1721 var superString = super.toString(); 1720 var superString = super.toString();
1722 return "_ActivityProxyImpl($superString)"; 1721 return "_ActivityProxyControl($superString)";
1723 } 1722 }
1724 } 1723 }
1725 1724
1726 1725
1727 class _ActivityProxyCalls implements Activity { 1726 class ActivityProxy extends bindings.Proxy
1728 _ActivityProxyImpl _proxyImpl; 1727 implements Activity {
1728 ActivityProxy.fromEndpoint(
1729 core.MojoMessagePipeEndpoint endpoint)
1730 : super(new _ActivityProxyControl.fromEndpoint(endpoint));
1729 1731
1730 _ActivityProxyCalls(this._proxyImpl); 1732 ActivityProxy.fromHandle(core.MojoHandle handle)
1731 void getUserFeedback(Object userFeedback) { 1733 : super(new _ActivityProxyControl.fromHandle(handle));
1732 if (!_proxyImpl.isBound) {
1733 _proxyImpl.proxyError("The Proxy is closed.");
1734 return;
1735 }
1736 var params = new _ActivityGetUserFeedbackParams();
1737 params.userFeedback = userFeedback;
1738 _proxyImpl.sendMessage(params, _activityMethodGetUserFeedbackName);
1739 }
1740 void startActivity(Intent intent) {
1741 if (!_proxyImpl.isBound) {
1742 _proxyImpl.proxyError("The Proxy is closed.");
1743 return;
1744 }
1745 var params = new _ActivityStartActivityParams();
1746 params.intent = intent;
1747 _proxyImpl.sendMessage(params, _activityMethodStartActivityName);
1748 }
1749 void finishCurrentActivity() {
1750 if (!_proxyImpl.isBound) {
1751 _proxyImpl.proxyError("The Proxy is closed.");
1752 return;
1753 }
1754 var params = new _ActivityFinishCurrentActivityParams();
1755 _proxyImpl.sendMessage(params, _activityMethodFinishCurrentActivityName);
1756 }
1757 void setTaskDescription(TaskDescription description) {
1758 if (!_proxyImpl.isBound) {
1759 _proxyImpl.proxyError("The Proxy is closed.");
1760 return;
1761 }
1762 var params = new _ActivitySetTaskDescriptionParams();
1763 params.description = description;
1764 _proxyImpl.sendMessage(params, _activityMethodSetTaskDescriptionName);
1765 }
1766 void setSystemUiVisibility(SystemUiVisibility visibility) {
1767 if (!_proxyImpl.isBound) {
1768 _proxyImpl.proxyError("The Proxy is closed.");
1769 return;
1770 }
1771 var params = new _ActivitySetSystemUiVisibilityParams();
1772 params.visibility = visibility;
1773 _proxyImpl.sendMessage(params, _activityMethodSetSystemUiVisibilityName);
1774 }
1775 void setRequestedOrientation(ScreenOrientation orientation) {
1776 if (!_proxyImpl.isBound) {
1777 _proxyImpl.proxyError("The Proxy is closed.");
1778 return;
1779 }
1780 var params = new _ActivitySetRequestedOrientationParams();
1781 params.orientation = orientation;
1782 _proxyImpl.sendMessage(params, _activityMethodSetRequestedOrientationName) ;
1783 }
1784 }
1785 1734
1735 ActivityProxy.unbound()
1736 : super(new _ActivityProxyControl.unbound());
1786 1737
1787 class ActivityProxy implements bindings.ProxyBase { 1738 static ActivityProxy newFromEndpoint(
1788 final bindings.Proxy impl; 1739 core.MojoMessagePipeEndpoint endpoint) {
1789 Activity ptr; 1740 assert(endpoint.setDescription("For ActivityProxy"));
1790 1741 return new ActivityProxy.fromEndpoint(endpoint);
1791 ActivityProxy(_ActivityProxyImpl proxyImpl) :
1792 impl = proxyImpl,
1793 ptr = new _ActivityProxyCalls(proxyImpl);
1794
1795 ActivityProxy.fromEndpoint(
1796 core.MojoMessagePipeEndpoint endpoint) :
1797 impl = new _ActivityProxyImpl.fromEndpoint(endpoint) {
1798 ptr = new _ActivityProxyCalls(impl);
1799 }
1800
1801 ActivityProxy.fromHandle(core.MojoHandle handle) :
1802 impl = new _ActivityProxyImpl.fromHandle(handle) {
1803 ptr = new _ActivityProxyCalls(impl);
1804 }
1805
1806 ActivityProxy.unbound() :
1807 impl = new _ActivityProxyImpl.unbound() {
1808 ptr = new _ActivityProxyCalls(impl);
1809 } 1742 }
1810 1743
1811 factory ActivityProxy.connectToService( 1744 factory ActivityProxy.connectToService(
1812 bindings.ServiceConnector s, String url, [String serviceName]) { 1745 bindings.ServiceConnector s, String url, [String serviceName]) {
1813 ActivityProxy p = new ActivityProxy.unbound(); 1746 ActivityProxy p = new ActivityProxy.unbound();
1814 s.connectToService(url, p, serviceName); 1747 s.connectToService(url, p, serviceName);
1815 return p; 1748 return p;
1816 } 1749 }
1817 1750
1818 static ActivityProxy newFromEndpoint( 1751
1819 core.MojoMessagePipeEndpoint endpoint) { 1752 void getUserFeedback(Object userFeedback) {
1820 assert(endpoint.setDescription("For ActivityProxy")); 1753 if (!ctrl.isBound) {
1821 return new ActivityProxy.fromEndpoint(endpoint); 1754 ctrl.proxyError("The Proxy is closed.");
1755 return;
1756 }
1757 var params = new _ActivityGetUserFeedbackParams();
1758 params.userFeedback = userFeedback;
1759 ctrl.sendMessage(params,
1760 _activityMethodGetUserFeedbackName);
1822 } 1761 }
1823 1762 void startActivity(Intent intent) {
1824 String get serviceName => Activity.serviceName; 1763 if (!ctrl.isBound) {
1825 1764 ctrl.proxyError("The Proxy is closed.");
1826 Future close({bool immediate: false}) => impl.close(immediate: immediate); 1765 return;
1827 1766 }
1828 Future responseOrError(Future f) => impl.responseOrError(f); 1767 var params = new _ActivityStartActivityParams();
1829 1768 params.intent = intent;
1830 Future get errorFuture => impl.errorFuture; 1769 ctrl.sendMessage(params,
1831 1770 _activityMethodStartActivityName);
1832 int get version => impl.version;
1833
1834 Future<int> queryVersion() => impl.queryVersion();
1835
1836 void requireVersion(int requiredVersion) {
1837 impl.requireVersion(requiredVersion);
1838 } 1771 }
1839 1772 void finishCurrentActivity() {
1840 String toString() { 1773 if (!ctrl.isBound) {
1841 return "ActivityProxy($impl)"; 1774 ctrl.proxyError("The Proxy is closed.");
1775 return;
1776 }
1777 var params = new _ActivityFinishCurrentActivityParams();
1778 ctrl.sendMessage(params,
1779 _activityMethodFinishCurrentActivityName);
1780 }
1781 void setTaskDescription(TaskDescription description) {
1782 if (!ctrl.isBound) {
1783 ctrl.proxyError("The Proxy is closed.");
1784 return;
1785 }
1786 var params = new _ActivitySetTaskDescriptionParams();
1787 params.description = description;
1788 ctrl.sendMessage(params,
1789 _activityMethodSetTaskDescriptionName);
1790 }
1791 void setSystemUiVisibility(SystemUiVisibility visibility) {
1792 if (!ctrl.isBound) {
1793 ctrl.proxyError("The Proxy is closed.");
1794 return;
1795 }
1796 var params = new _ActivitySetSystemUiVisibilityParams();
1797 params.visibility = visibility;
1798 ctrl.sendMessage(params,
1799 _activityMethodSetSystemUiVisibilityName);
1800 }
1801 void setRequestedOrientation(ScreenOrientation orientation) {
1802 if (!ctrl.isBound) {
1803 ctrl.proxyError("The Proxy is closed.");
1804 return;
1805 }
1806 var params = new _ActivitySetRequestedOrientationParams();
1807 params.orientation = orientation;
1808 ctrl.sendMessage(params,
1809 _activityMethodSetRequestedOrientationName);
1842 } 1810 }
1843 } 1811 }
1844 1812
1845 1813
1846 class ActivityStub extends bindings.Stub { 1814 class ActivityStub extends bindings.Stub {
1847 Activity _impl; 1815 Activity _impl;
1848 1816
1849 ActivityStub.fromEndpoint( 1817 ActivityStub.fromEndpoint(
1850 core.MojoMessagePipeEndpoint endpoint, [Activity impl]) 1818 core.MojoMessagePipeEndpoint endpoint, [Activity impl])
1851 : super.fromEndpoint(endpoint, autoBegin: impl != null) { 1819 : super.fromEndpoint(endpoint, autoBegin: impl != null) {
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
1964 } 1932 }
1965 1933
1966 abstract class PathService { 1934 abstract class PathService {
1967 static const String serviceName = "activity::PathService"; 1935 static const String serviceName = "activity::PathService";
1968 dynamic getAppDataDir([Function responseFactory = null]); 1936 dynamic getAppDataDir([Function responseFactory = null]);
1969 dynamic getFilesDir([Function responseFactory = null]); 1937 dynamic getFilesDir([Function responseFactory = null]);
1970 dynamic getCacheDir([Function responseFactory = null]); 1938 dynamic getCacheDir([Function responseFactory = null]);
1971 } 1939 }
1972 1940
1973 1941
1974 class _PathServiceProxyImpl extends bindings.Proxy { 1942 class _PathServiceProxyControl extends bindings.ProxyMessageHandler
1975 _PathServiceProxyImpl.fromEndpoint( 1943 implements bindings.ProxyControl {
1944 _PathServiceProxyControl.fromEndpoint(
1976 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 1945 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
1977 1946
1978 _PathServiceProxyImpl.fromHandle(core.MojoHandle handle) : 1947 _PathServiceProxyControl.fromHandle(
1979 super.fromHandle(handle); 1948 core.MojoHandle handle) : super.fromHandle(handle);
1980 1949
1981 _PathServiceProxyImpl.unbound() : super.unbound(); 1950 _PathServiceProxyControl.unbound() : super.unbound();
1982
1983 static _PathServiceProxyImpl newFromEndpoint(
1984 core.MojoMessagePipeEndpoint endpoint) {
1985 assert(endpoint.setDescription("For _PathServiceProxyImpl"));
1986 return new _PathServiceProxyImpl.fromEndpoint(endpoint);
1987 }
1988 1951
1989 service_describer.ServiceDescription get serviceDescription => 1952 service_describer.ServiceDescription get serviceDescription =>
1990 new _PathServiceServiceDescription(); 1953 new _PathServiceServiceDescription();
1991 1954
1955 String get serviceName => PathService.serviceName;
1956
1957 @override
1992 void handleResponse(bindings.ServiceMessage message) { 1958 void handleResponse(bindings.ServiceMessage message) {
1993 switch (message.header.type) { 1959 switch (message.header.type) {
1994 case _pathServiceMethodGetAppDataDirName: 1960 case _pathServiceMethodGetAppDataDirName:
1995 var r = PathServiceGetAppDataDirResponseParams.deserialize( 1961 var r = PathServiceGetAppDataDirResponseParams.deserialize(
1996 message.payload); 1962 message.payload);
1997 if (!message.header.hasRequestId) { 1963 if (!message.header.hasRequestId) {
1998 proxyError("Expected a message with a valid request Id."); 1964 proxyError("Expected a message with a valid request Id.");
1999 return; 1965 return;
2000 } 1966 }
2001 Completer c = completerMap[message.header.requestId]; 1967 Completer c = completerMap[message.header.requestId];
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
2051 } 2017 }
2052 c.complete(r); 2018 c.complete(r);
2053 break; 2019 break;
2054 default: 2020 default:
2055 proxyError("Unexpected message type: ${message.header.type}"); 2021 proxyError("Unexpected message type: ${message.header.type}");
2056 close(immediate: true); 2022 close(immediate: true);
2057 break; 2023 break;
2058 } 2024 }
2059 } 2025 }
2060 2026
2027 @override
2061 String toString() { 2028 String toString() {
2062 var superString = super.toString(); 2029 var superString = super.toString();
2063 return "_PathServiceProxyImpl($superString)"; 2030 return "_PathServiceProxyControl($superString)";
2064 } 2031 }
2065 } 2032 }
2066 2033
2067 2034
2068 class _PathServiceProxyCalls implements PathService { 2035 class PathServiceProxy extends bindings.Proxy
2069 _PathServiceProxyImpl _proxyImpl; 2036 implements PathService {
2037 PathServiceProxy.fromEndpoint(
2038 core.MojoMessagePipeEndpoint endpoint)
2039 : super(new _PathServiceProxyControl.fromEndpoint(endpoint));
2070 2040
2071 _PathServiceProxyCalls(this._proxyImpl); 2041 PathServiceProxy.fromHandle(core.MojoHandle handle)
2072 dynamic getAppDataDir([Function responseFactory = null]) { 2042 : super(new _PathServiceProxyControl.fromHandle(handle));
2073 var params = new _PathServiceGetAppDataDirParams();
2074 return _proxyImpl.sendMessageWithRequestId(
2075 params,
2076 _pathServiceMethodGetAppDataDirName,
2077 -1,
2078 bindings.MessageHeader.kMessageExpectsResponse);
2079 }
2080 dynamic getFilesDir([Function responseFactory = null]) {
2081 var params = new _PathServiceGetFilesDirParams();
2082 return _proxyImpl.sendMessageWithRequestId(
2083 params,
2084 _pathServiceMethodGetFilesDirName,
2085 -1,
2086 bindings.MessageHeader.kMessageExpectsResponse);
2087 }
2088 dynamic getCacheDir([Function responseFactory = null]) {
2089 var params = new _PathServiceGetCacheDirParams();
2090 return _proxyImpl.sendMessageWithRequestId(
2091 params,
2092 _pathServiceMethodGetCacheDirName,
2093 -1,
2094 bindings.MessageHeader.kMessageExpectsResponse);
2095 }
2096 }
2097 2043
2044 PathServiceProxy.unbound()
2045 : super(new _PathServiceProxyControl.unbound());
2098 2046
2099 class PathServiceProxy implements bindings.ProxyBase { 2047 static PathServiceProxy newFromEndpoint(
2100 final bindings.Proxy impl; 2048 core.MojoMessagePipeEndpoint endpoint) {
2101 PathService ptr; 2049 assert(endpoint.setDescription("For PathServiceProxy"));
2102 2050 return new PathServiceProxy.fromEndpoint(endpoint);
2103 PathServiceProxy(_PathServiceProxyImpl proxyImpl) :
2104 impl = proxyImpl,
2105 ptr = new _PathServiceProxyCalls(proxyImpl);
2106
2107 PathServiceProxy.fromEndpoint(
2108 core.MojoMessagePipeEndpoint endpoint) :
2109 impl = new _PathServiceProxyImpl.fromEndpoint(endpoint) {
2110 ptr = new _PathServiceProxyCalls(impl);
2111 }
2112
2113 PathServiceProxy.fromHandle(core.MojoHandle handle) :
2114 impl = new _PathServiceProxyImpl.fromHandle(handle) {
2115 ptr = new _PathServiceProxyCalls(impl);
2116 }
2117
2118 PathServiceProxy.unbound() :
2119 impl = new _PathServiceProxyImpl.unbound() {
2120 ptr = new _PathServiceProxyCalls(impl);
2121 } 2051 }
2122 2052
2123 factory PathServiceProxy.connectToService( 2053 factory PathServiceProxy.connectToService(
2124 bindings.ServiceConnector s, String url, [String serviceName]) { 2054 bindings.ServiceConnector s, String url, [String serviceName]) {
2125 PathServiceProxy p = new PathServiceProxy.unbound(); 2055 PathServiceProxy p = new PathServiceProxy.unbound();
2126 s.connectToService(url, p, serviceName); 2056 s.connectToService(url, p, serviceName);
2127 return p; 2057 return p;
2128 } 2058 }
2129 2059
2130 static PathServiceProxy newFromEndpoint( 2060
2131 core.MojoMessagePipeEndpoint endpoint) { 2061 dynamic getAppDataDir([Function responseFactory = null]) {
2132 assert(endpoint.setDescription("For PathServiceProxy")); 2062 var params = new _PathServiceGetAppDataDirParams();
2133 return new PathServiceProxy.fromEndpoint(endpoint); 2063 return ctrl.sendMessageWithRequestId(
2064 params,
2065 _pathServiceMethodGetAppDataDirName,
2066 -1,
2067 bindings.MessageHeader.kMessageExpectsResponse);
2134 } 2068 }
2135 2069 dynamic getFilesDir([Function responseFactory = null]) {
2136 String get serviceName => PathService.serviceName; 2070 var params = new _PathServiceGetFilesDirParams();
2137 2071 return ctrl.sendMessageWithRequestId(
2138 Future close({bool immediate: false}) => impl.close(immediate: immediate); 2072 params,
2139 2073 _pathServiceMethodGetFilesDirName,
2140 Future responseOrError(Future f) => impl.responseOrError(f); 2074 -1,
2141 2075 bindings.MessageHeader.kMessageExpectsResponse);
2142 Future get errorFuture => impl.errorFuture;
2143
2144 int get version => impl.version;
2145
2146 Future<int> queryVersion() => impl.queryVersion();
2147
2148 void requireVersion(int requiredVersion) {
2149 impl.requireVersion(requiredVersion);
2150 } 2076 }
2151 2077 dynamic getCacheDir([Function responseFactory = null]) {
2152 String toString() { 2078 var params = new _PathServiceGetCacheDirParams();
2153 return "PathServiceProxy($impl)"; 2079 return ctrl.sendMessageWithRequestId(
2080 params,
2081 _pathServiceMethodGetCacheDirName,
2082 -1,
2083 bindings.MessageHeader.kMessageExpectsResponse);
2154 } 2084 }
2155 } 2085 }
2156 2086
2157 2087
2158 class PathServiceStub extends bindings.Stub { 2088 class PathServiceStub extends bindings.Stub {
2159 PathService _impl; 2089 PathService _impl;
2160 2090
2161 PathServiceStub.fromEndpoint( 2091 PathServiceStub.fromEndpoint(
2162 core.MojoMessagePipeEndpoint endpoint, [PathService impl]) 2092 core.MojoMessagePipeEndpoint endpoint, [PathService impl])
2163 : super.fromEndpoint(endpoint, autoBegin: impl != null) { 2093 : super.fromEndpoint(endpoint, autoBegin: impl != null) {
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
2321 responseFactory(null); 2251 responseFactory(null);
2322 } 2252 }
2323 2253
2324 abstract class UserFeedback { 2254 abstract class UserFeedback {
2325 static const String serviceName = null; 2255 static const String serviceName = null;
2326 void performHapticFeedback(HapticFeedbackType type); 2256 void performHapticFeedback(HapticFeedbackType type);
2327 void performAuralFeedback(AuralFeedbackType type); 2257 void performAuralFeedback(AuralFeedbackType type);
2328 } 2258 }
2329 2259
2330 2260
2331 class _UserFeedbackProxyImpl extends bindings.Proxy { 2261 class _UserFeedbackProxyControl extends bindings.ProxyMessageHandler
2332 _UserFeedbackProxyImpl.fromEndpoint( 2262 implements bindings.ProxyControl {
2263 _UserFeedbackProxyControl.fromEndpoint(
2333 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 2264 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
2334 2265
2335 _UserFeedbackProxyImpl.fromHandle(core.MojoHandle handle) : 2266 _UserFeedbackProxyControl.fromHandle(
2336 super.fromHandle(handle); 2267 core.MojoHandle handle) : super.fromHandle(handle);
2337 2268
2338 _UserFeedbackProxyImpl.unbound() : super.unbound(); 2269 _UserFeedbackProxyControl.unbound() : super.unbound();
2339
2340 static _UserFeedbackProxyImpl newFromEndpoint(
2341 core.MojoMessagePipeEndpoint endpoint) {
2342 assert(endpoint.setDescription("For _UserFeedbackProxyImpl"));
2343 return new _UserFeedbackProxyImpl.fromEndpoint(endpoint);
2344 }
2345 2270
2346 service_describer.ServiceDescription get serviceDescription => 2271 service_describer.ServiceDescription get serviceDescription =>
2347 new _UserFeedbackServiceDescription(); 2272 new _UserFeedbackServiceDescription();
2348 2273
2274 String get serviceName => UserFeedback.serviceName;
2275
2276 @override
2349 void handleResponse(bindings.ServiceMessage message) { 2277 void handleResponse(bindings.ServiceMessage message) {
2350 switch (message.header.type) { 2278 switch (message.header.type) {
2351 default: 2279 default:
2352 proxyError("Unexpected message type: ${message.header.type}"); 2280 proxyError("Unexpected message type: ${message.header.type}");
2353 close(immediate: true); 2281 close(immediate: true);
2354 break; 2282 break;
2355 } 2283 }
2356 } 2284 }
2357 2285
2286 @override
2358 String toString() { 2287 String toString() {
2359 var superString = super.toString(); 2288 var superString = super.toString();
2360 return "_UserFeedbackProxyImpl($superString)"; 2289 return "_UserFeedbackProxyControl($superString)";
2361 } 2290 }
2362 } 2291 }
2363 2292
2364 2293
2365 class _UserFeedbackProxyCalls implements UserFeedback { 2294 class UserFeedbackProxy extends bindings.Proxy
2366 _UserFeedbackProxyImpl _proxyImpl; 2295 implements UserFeedback {
2296 UserFeedbackProxy.fromEndpoint(
2297 core.MojoMessagePipeEndpoint endpoint)
2298 : super(new _UserFeedbackProxyControl.fromEndpoint(endpoint));
2367 2299
2368 _UserFeedbackProxyCalls(this._proxyImpl); 2300 UserFeedbackProxy.fromHandle(core.MojoHandle handle)
2369 void performHapticFeedback(HapticFeedbackType type) { 2301 : super(new _UserFeedbackProxyControl.fromHandle(handle));
2370 if (!_proxyImpl.isBound) {
2371 _proxyImpl.proxyError("The Proxy is closed.");
2372 return;
2373 }
2374 var params = new _UserFeedbackPerformHapticFeedbackParams();
2375 params.type = type;
2376 _proxyImpl.sendMessage(params, _userFeedbackMethodPerformHapticFeedbackNam e);
2377 }
2378 void performAuralFeedback(AuralFeedbackType type) {
2379 if (!_proxyImpl.isBound) {
2380 _proxyImpl.proxyError("The Proxy is closed.");
2381 return;
2382 }
2383 var params = new _UserFeedbackPerformAuralFeedbackParams();
2384 params.type = type;
2385 _proxyImpl.sendMessage(params, _userFeedbackMethodPerformAuralFeedbackName );
2386 }
2387 }
2388 2302
2303 UserFeedbackProxy.unbound()
2304 : super(new _UserFeedbackProxyControl.unbound());
2389 2305
2390 class UserFeedbackProxy implements bindings.ProxyBase { 2306 static UserFeedbackProxy newFromEndpoint(
2391 final bindings.Proxy impl; 2307 core.MojoMessagePipeEndpoint endpoint) {
2392 UserFeedback ptr; 2308 assert(endpoint.setDescription("For UserFeedbackProxy"));
2393 2309 return new UserFeedbackProxy.fromEndpoint(endpoint);
2394 UserFeedbackProxy(_UserFeedbackProxyImpl proxyImpl) :
2395 impl = proxyImpl,
2396 ptr = new _UserFeedbackProxyCalls(proxyImpl);
2397
2398 UserFeedbackProxy.fromEndpoint(
2399 core.MojoMessagePipeEndpoint endpoint) :
2400 impl = new _UserFeedbackProxyImpl.fromEndpoint(endpoint) {
2401 ptr = new _UserFeedbackProxyCalls(impl);
2402 }
2403
2404 UserFeedbackProxy.fromHandle(core.MojoHandle handle) :
2405 impl = new _UserFeedbackProxyImpl.fromHandle(handle) {
2406 ptr = new _UserFeedbackProxyCalls(impl);
2407 }
2408
2409 UserFeedbackProxy.unbound() :
2410 impl = new _UserFeedbackProxyImpl.unbound() {
2411 ptr = new _UserFeedbackProxyCalls(impl);
2412 } 2310 }
2413 2311
2414 factory UserFeedbackProxy.connectToService( 2312 factory UserFeedbackProxy.connectToService(
2415 bindings.ServiceConnector s, String url, [String serviceName]) { 2313 bindings.ServiceConnector s, String url, [String serviceName]) {
2416 UserFeedbackProxy p = new UserFeedbackProxy.unbound(); 2314 UserFeedbackProxy p = new UserFeedbackProxy.unbound();
2417 s.connectToService(url, p, serviceName); 2315 s.connectToService(url, p, serviceName);
2418 return p; 2316 return p;
2419 } 2317 }
2420 2318
2421 static UserFeedbackProxy newFromEndpoint( 2319
2422 core.MojoMessagePipeEndpoint endpoint) { 2320 void performHapticFeedback(HapticFeedbackType type) {
2423 assert(endpoint.setDescription("For UserFeedbackProxy")); 2321 if (!ctrl.isBound) {
2424 return new UserFeedbackProxy.fromEndpoint(endpoint); 2322 ctrl.proxyError("The Proxy is closed.");
2323 return;
2324 }
2325 var params = new _UserFeedbackPerformHapticFeedbackParams();
2326 params.type = type;
2327 ctrl.sendMessage(params,
2328 _userFeedbackMethodPerformHapticFeedbackName);
2425 } 2329 }
2426 2330 void performAuralFeedback(AuralFeedbackType type) {
2427 String get serviceName => UserFeedback.serviceName; 2331 if (!ctrl.isBound) {
2428 2332 ctrl.proxyError("The Proxy is closed.");
2429 Future close({bool immediate: false}) => impl.close(immediate: immediate); 2333 return;
2430 2334 }
2431 Future responseOrError(Future f) => impl.responseOrError(f); 2335 var params = new _UserFeedbackPerformAuralFeedbackParams();
2432 2336 params.type = type;
2433 Future get errorFuture => impl.errorFuture; 2337 ctrl.sendMessage(params,
2434 2338 _userFeedbackMethodPerformAuralFeedbackName);
2435 int get version => impl.version;
2436
2437 Future<int> queryVersion() => impl.queryVersion();
2438
2439 void requireVersion(int requiredVersion) {
2440 impl.requireVersion(requiredVersion);
2441 }
2442
2443 String toString() {
2444 return "UserFeedbackProxy($impl)";
2445 } 2339 }
2446 } 2340 }
2447 2341
2448 2342
2449 class UserFeedbackStub extends bindings.Stub { 2343 class UserFeedbackStub extends bindings.Stub {
2450 UserFeedback _impl; 2344 UserFeedback _impl;
2451 2345
2452 UserFeedbackStub.fromEndpoint( 2346 UserFeedbackStub.fromEndpoint(
2453 core.MojoMessagePipeEndpoint endpoint, [UserFeedback impl]) 2347 core.MojoMessagePipeEndpoint endpoint, [UserFeedback impl])
2454 : super.fromEndpoint(endpoint, autoBegin: impl != null) { 2348 : super.fromEndpoint(endpoint, autoBegin: impl != null) {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
2528 static service_describer.ServiceDescription get serviceDescription { 2422 static service_describer.ServiceDescription get serviceDescription {
2529 if (_cachedServiceDescription == null) { 2423 if (_cachedServiceDescription == null) {
2530 _cachedServiceDescription = new _UserFeedbackServiceDescription(); 2424 _cachedServiceDescription = new _UserFeedbackServiceDescription();
2531 } 2425 }
2532 return _cachedServiceDescription; 2426 return _cachedServiceDescription;
2533 } 2427 }
2534 } 2428 }
2535 2429
2536 2430
2537 2431
OLDNEW
« no previous file with comments | « mojo/dart/packages/mojo/sources.gni ('k') | mojo/dart/packages/mojo_services/lib/authentication/authentication.mojom.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698