| 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 package org.chromium.mojo; | 5 package org.chromium.mojo; |
| 6 | 6 |
| 7 import org.chromium.mojo.system.Core; | 7 import org.chromium.mojo.system.Core; |
| 8 import org.chromium.mojo.system.Core.HandleSignalsState; | 8 import org.chromium.mojo.system.Core.WaitResult; |
| 9 import org.chromium.mojo.system.DataPipe; | 9 import org.chromium.mojo.system.DataPipe; |
| 10 import org.chromium.mojo.system.DataPipe.ConsumerHandle; | 10 import org.chromium.mojo.system.DataPipe.ConsumerHandle; |
| 11 import org.chromium.mojo.system.DataPipe.ProducerHandle; | 11 import org.chromium.mojo.system.DataPipe.ProducerHandle; |
| 12 import org.chromium.mojo.system.Handle; | 12 import org.chromium.mojo.system.Handle; |
| 13 import org.chromium.mojo.system.MessagePipeHandle; | 13 import org.chromium.mojo.system.MessagePipeHandle; |
| 14 import org.chromium.mojo.system.MojoResult; | 14 import org.chromium.mojo.system.MojoResult; |
| 15 import org.chromium.mojo.system.ResultAnd; | 15 import org.chromium.mojo.system.ResultAnd; |
| 16 import org.chromium.mojo.system.SharedBufferHandle; | 16 import org.chromium.mojo.system.SharedBufferHandle; |
| 17 import org.chromium.mojo.system.UntypedHandle; | 17 import org.chromium.mojo.system.UntypedHandle; |
| 18 import org.chromium.mojo.system.impl.CoreImpl; | 18 import org.chromium.mojo.system.impl.CoreImpl; |
| 19 | 19 |
| 20 import java.nio.ByteBuffer; | 20 import java.nio.ByteBuffer; |
| 21 import java.util.List; | 21 import java.util.List; |
| 22 | 22 |
| 23 /** | 23 /** |
| 24 * A mock handle, that does nothing. | 24 * A mock handle, that does nothing. |
| 25 */ | 25 */ |
| 26 public class HandleMock implements UntypedHandle, MessagePipeHandle, | 26 public class HandleMock implements UntypedHandle, MessagePipeHandle, |
| 27 ProducerHandle, ConsumerHandle, SharedBufferHandle { | 27 ProducerHandle, ConsumerHandle, SharedBufferHandle { |
| 28 | 28 |
| 29 /** | 29 /** |
| 30 * @see Handle#close() | 30 * @see Handle#close() |
| 31 */ | 31 */ |
| 32 @Override | 32 @Override |
| 33 public void close() { | 33 public void close() { |
| 34 // Do nothing. | 34 // Do nothing. |
| 35 } | 35 } |
| 36 | 36 |
| 37 /** | 37 /** |
| 38 * @see Handle#querySignalsState() | 38 * @see Handle#wait(Core.HandleSignals, long) |
| 39 */ | 39 */ |
| 40 @Override | 40 @Override |
| 41 public HandleSignalsState querySignalsState() { | 41 public WaitResult wait(Core.HandleSignals signals, long deadline) { |
| 42 return null; | 42 // Do nothing. |
| 43 WaitResult result = new WaitResult(); |
| 44 result.setMojoResult(MojoResult.OK); |
| 45 return result; |
| 43 } | 46 } |
| 44 | 47 |
| 45 /** | 48 /** |
| 46 * @see Handle#isValid() | 49 * @see Handle#isValid() |
| 47 */ | 50 */ |
| 48 @Override | 51 @Override |
| 49 public boolean isValid() { | 52 public boolean isValid() { |
| 50 return true; | 53 return true; |
| 51 } | 54 } |
| 52 | 55 |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 220 |
| 218 /** | 221 /** |
| 219 * @see SharedBufferHandle#unmap(java.nio.ByteBuffer) | 222 * @see SharedBufferHandle#unmap(java.nio.ByteBuffer) |
| 220 */ | 223 */ |
| 221 @Override | 224 @Override |
| 222 public void unmap(ByteBuffer buffer) { | 225 public void unmap(ByteBuffer buffer) { |
| 223 // Do nothing. | 226 // Do nothing. |
| 224 } | 227 } |
| 225 | 228 |
| 226 } | 229 } |
| OLD | NEW |