• 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     /**
19      * @see HandleBase#HandleBase(CoreImpl, int)
20      */
UntypedHandleImpl(CoreImpl core, int mojoHandle)21     UntypedHandleImpl(CoreImpl core, int mojoHandle) {
22         super(core, mojoHandle);
23     }
24 
25     /**
26      * @see HandleBase#HandleBase(HandleBase)
27      */
UntypedHandleImpl(HandleBase handle)28     UntypedHandleImpl(HandleBase handle) {
29         super(handle);
30     }
31 
32     /**
33      * @see org.chromium.mojo.system.UntypedHandle#pass()
34      */
35     @Override
pass()36     public UntypedHandle pass() {
37         return new UntypedHandleImpl(this);
38     }
39 
40     /**
41      * @see org.chromium.mojo.system.UntypedHandle#toMessagePipeHandle()
42      */
43     @Override
toMessagePipeHandle()44     public MessagePipeHandle toMessagePipeHandle() {
45         return new MessagePipeHandleImpl(this);
46     }
47 
48     /**
49      * @see org.chromium.mojo.system.UntypedHandle#toDataPipeConsumerHandle()
50      */
51     @Override
toDataPipeConsumerHandle()52     public ConsumerHandle toDataPipeConsumerHandle() {
53         return new DataPipeConsumerHandleImpl(this);
54     }
55 
56     /**
57      * @see org.chromium.mojo.system.UntypedHandle#toDataPipeProducerHandle()
58      */
59     @Override
toDataPipeProducerHandle()60     public ProducerHandle toDataPipeProducerHandle() {
61         return new DataPipeProducerHandleImpl(this);
62     }
63 
64     /**
65      * @see org.chromium.mojo.system.UntypedHandle#toSharedBufferHandle()
66      */
67     @Override
toSharedBufferHandle()68     public SharedBufferHandle toSharedBufferHandle() {
69         return new SharedBufferHandleImpl(this);
70     }
71 
72 }
73