Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 part of core; | 5 part of core; |
| 6 | 6 |
| 7 class MojoSharedBuffer { | 7 class MojoSharedBuffer { |
| 8 static const int createFlagNone = 0; | 8 static const int createFlagNone = MojoConstants.kNone; |
|
zra
2016/02/16 16:58:26
This indirection increases the amount of compilati
floitsch
2016/02/16 17:03:54
The constants are defined by the internal library
| |
| 9 static const int duplicateFlagNone = 0; | 9 static const int duplicateFlagNone = MojoConstants.kNone; |
| 10 static const int mapFlagNone = 0; | 10 static const int mapFlagNone = MojoConstants.kNone; |
| 11 | 11 |
| 12 MojoHandle _handle; | 12 MojoHandle _handle; |
| 13 int _status = MojoResult.kOk; | 13 int _status = MojoResult.kOk; |
| 14 | 14 |
| 15 MojoHandle get handle => _handle; | 15 MojoHandle get handle => _handle; |
| 16 int get status => _status; | 16 int get status => _status; |
| 17 | 17 |
| 18 MojoSharedBuffer(this._handle, [this._status = MojoResult.kOk]); | 18 MojoSharedBuffer(this._handle, [this._status = MojoResult.kOk]); |
| 19 | 19 |
| 20 factory MojoSharedBuffer.create(int numBytes, [int flags = createFlagNone]) { | 20 factory MojoSharedBuffer.create(int numBytes, [int flags = createFlagNone]) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 List result = | 64 List result = |
| 65 MojoSharedBufferNatives.Map(handle.h, offset, numBytes, flags); | 65 MojoSharedBufferNatives.Map(handle.h, offset, numBytes, flags); |
| 66 if (result == null) { | 66 if (result == null) { |
| 67 _status = MojoResult.kInvalidArgument; | 67 _status = MojoResult.kInvalidArgument; |
| 68 return null; | 68 return null; |
| 69 } | 69 } |
| 70 _status = result[0]; | 70 _status = result[0]; |
| 71 return result[1]; | 71 return result[1]; |
| 72 } | 72 } |
| 73 } | 73 } |
| OLD | NEW |