• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 package org.chromium.mojo.system.impl;
6 
7 import org.chromium.mojo.system.DataPipe.ConsumerHandle;
8 import org.chromium.mojo.system.DataPipe.ProducerHandle;
9 import org.chromium.mojo.system.MessagePipeHandle;
10 import org.chromium.mojo.system.SharedBufferHandle;
11 import org.chromium.mojo.system.UntypedHandle;
12 
13 /**
14  * Implementation of {@link UntypedHandle}.
15  */
16 class UntypedHandleImpl extends HandleBase implements UntypedHandle {
17     /**
18      * @see HandleBase#HandleBase(CoreImpl, int)
19      */
UntypedHandleImpl(CoreImpl core, int mojoHandle)20     UntypedHandleImpl(CoreImpl core, int mojoHandle) {
21         super(core, mojoHandle);
22     }
23 
24     /**
25      * @see HandleBase#HandleBase(HandleBase)
26      */
UntypedHandleImpl(HandleBase handle)27     UntypedHandleImpl(HandleBase handle) {
28         super(handle);
29     }
30 
31     /**
32      * @see org.chromium.mojo.system.UntypedHandle#pass()
33      */
34     @Override
pass()35     public UntypedHandle pass() {
36         return new UntypedHandleImpl(this);
37     }
38 
39     /**
40      * @see org.chromium.mojo.system.UntypedHandle#toMessagePipeHandle()
41      */
42     @Override
toMessagePipeHandle()43     public MessagePipeHandle toMessagePipeHandle() {
44         return new MessagePipeHandleImpl(this);
45     }
46 
47     /**
48      * @see org.chromium.mojo.system.UntypedHandle#toDataPipeConsumerHandle()
49      */
50     @Override
toDataPipeConsumerHandle()51     public ConsumerHandle toDataPipeConsumerHandle() {
52         return new DataPipeConsumerHandleImpl(this);
53     }
54 
55     /**
56      * @see org.chromium.mojo.system.UntypedHandle#toDataPipeProducerHandle()
57      */
58     @Override
toDataPipeProducerHandle()59     public ProducerHandle toDataPipeProducerHandle() {
60         return new DataPipeProducerHandleImpl(this);
61     }
62 
63     /**
64      * @see org.chromium.mojo.system.UntypedHandle#toSharedBufferHandle()
65      */
66     @Override
toSharedBufferHandle()67     public SharedBufferHandle toSharedBufferHandle() {
68         return new SharedBufferHandleImpl(this);
69     }
70 }
71