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

Side by Side Diff: mojo/public/dart/src/struct.dart

Issue 814543006: Move //mojo/{public, edk} underneath //third_party (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 11 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
« no previous file with comments | « mojo/public/dart/src/message_pipe.dart ('k') | mojo/public/dart/src/timer_impl.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 part of bindings;
6
7 class DataHeader {
8 static const int kHeaderSize = 8;
9 static const int kSizeOffset = 0;
10 static const int kNumFieldsOffset = 4;
11 final int size;
12 final int numFields;
13
14 const DataHeader(this.size, this.numFields);
15
16 String toString() => "DataHeader($size, $numFields)";
17 }
18
19 abstract class Struct {
20 final int encodedSize;
21
22 Struct(this.encodedSize);
23
24 void encode(Encoder encoder);
25
26 Message serialize() {
27 var encoder = new Encoder(encodedSize);
28 encode(encoder);
29 return encoder.message;
30 }
31
32 ServiceMessage serializeWithHeader(MessageHeader header) {
33 var encoder = new Encoder(encodedSize + header.size);
34 header.encode(encoder);
35 encode(encoder);
36 return new ServiceMessage(encoder.message, header);
37 }
38 }
OLDNEW
« no previous file with comments | « mojo/public/dart/src/message_pipe.dart ('k') | mojo/public/dart/src/timer_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698