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

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

Issue 1539673003: Generate Mojom Types in Dart (Take 2) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Merge with master Created 4 years, 10 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 gpu_mojom; 5 library gpu_mojom;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:mojo/bindings.dart' as bindings; 9 import 'package:mojo/bindings.dart' as bindings;
10 import 'package:mojo/core.dart' as core; 10 import 'package:mojo/core.dart' as core;
11 import 'package:mojo/mojo/bindings/types/mojom_types.mojom.dart' as mojom_types;
12 import 'package:mojo/mojo/bindings/types/service_describer.mojom.dart' as servic e_describer;
11 import 'package:mojo_services/mojo/command_buffer.mojom.dart' as command_buffer_ mojom; 13 import 'package:mojo_services/mojo/command_buffer.mojom.dart' as command_buffer_ mojom;
12 14
13 15
14 16
15 class _GpuCreateOffscreenGles2ContextParams extends bindings.Struct { 17 class _GpuCreateOffscreenGles2ContextParams extends bindings.Struct {
16 static const List<bindings.StructDataHeader> kVersions = const [ 18 static const List<bindings.StructDataHeader> kVersions = const [
17 const bindings.StructDataHeader(16, 0) 19 const bindings.StructDataHeader(16, 0)
18 ]; 20 ];
19 Object gles2Client = null; 21 Object gles2Client = null;
20 22
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 return "_GpuCreateOffscreenGles2ContextParams(" 72 return "_GpuCreateOffscreenGles2ContextParams("
71 "gles2Client: $gles2Client" ")"; 73 "gles2Client: $gles2Client" ")";
72 } 74 }
73 75
74 Map toJson() { 76 Map toJson() {
75 throw new bindings.MojoCodecError( 77 throw new bindings.MojoCodecError(
76 'Object containing handles cannot be encoded to JSON.'); 78 'Object containing handles cannot be encoded to JSON.');
77 } 79 }
78 } 80 }
79 81
82
83
84
80 const int _Gpu_createOffscreenGles2ContextName = 0; 85 const int _Gpu_createOffscreenGles2ContextName = 0;
81 86
87
88
89 class _GpuServiceDescription implements service_describer.ServiceDescription {
90 dynamic getTopLevelInterface([Function responseFactory]) => null;
91
92 dynamic getTypeDefinition(String typeKey, [Function responseFactory]) => null;
93
94 dynamic getAllTypeDefinitions([Function responseFactory]) => null;
95 }
96
82 abstract class Gpu { 97 abstract class Gpu {
83 static const String serviceName = "mojo::Gpu"; 98 static const String serviceName = "mojo::Gpu";
84 void createOffscreenGles2Context(Object gles2Client); 99 void createOffscreenGles2Context(Object gles2Client);
85 } 100 }
86 101
87 102
88 class _GpuProxyImpl extends bindings.Proxy { 103 class _GpuProxyImpl extends bindings.Proxy {
89 _GpuProxyImpl.fromEndpoint( 104 _GpuProxyImpl.fromEndpoint(
90 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint); 105 core.MojoMessagePipeEndpoint endpoint) : super.fromEndpoint(endpoint);
91 106
92 _GpuProxyImpl.fromHandle(core.MojoHandle handle) : 107 _GpuProxyImpl.fromHandle(core.MojoHandle handle) :
93 super.fromHandle(handle); 108 super.fromHandle(handle);
94 109
95 _GpuProxyImpl.unbound() : super.unbound(); 110 _GpuProxyImpl.unbound() : super.unbound();
96 111
97 static _GpuProxyImpl newFromEndpoint( 112 static _GpuProxyImpl newFromEndpoint(
98 core.MojoMessagePipeEndpoint endpoint) { 113 core.MojoMessagePipeEndpoint endpoint) {
99 assert(endpoint.setDescription("For _GpuProxyImpl")); 114 assert(endpoint.setDescription("For _GpuProxyImpl"));
100 return new _GpuProxyImpl.fromEndpoint(endpoint); 115 return new _GpuProxyImpl.fromEndpoint(endpoint);
101 } 116 }
102 117
118 service_describer.ServiceDescription get serviceDescription =>
119 new _GpuServiceDescription();
120
103 void handleResponse(bindings.ServiceMessage message) { 121 void handleResponse(bindings.ServiceMessage message) {
104 switch (message.header.type) { 122 switch (message.header.type) {
105 default: 123 default:
106 proxyError("Unexpected message type: ${message.header.type}"); 124 proxyError("Unexpected message type: ${message.header.type}");
107 close(immediate: true); 125 close(immediate: true);
108 break; 126 break;
109 } 127 }
110 } 128 }
111 129
112 String toString() { 130 String toString() {
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 assert(_impl == null); 254 assert(_impl == null);
237 _impl = d; 255 _impl = d;
238 } 256 }
239 257
240 String toString() { 258 String toString() {
241 var superString = super.toString(); 259 var superString = super.toString();
242 return "GpuStub($superString)"; 260 return "GpuStub($superString)";
243 } 261 }
244 262
245 int get version => 0; 263 int get version => 0;
264
265 service_describer.ServiceDescription get serviceDescription =>
266 new _GpuServiceDescription();
246 } 267 }
247 268
248 269
270
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698