• 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.SharedBufferHandle;
8 
9 import java.nio.ByteBuffer;
10 
11 /**
12  * Implementation of {@link SharedBufferHandle}.
13  */
14 class SharedBufferHandleImpl extends HandleBase implements SharedBufferHandle {
15 
16     /**
17      * @see HandleBase#HandleBase(CoreImpl, int)
18      */
SharedBufferHandleImpl(CoreImpl core, int mojoHandle)19     SharedBufferHandleImpl(CoreImpl core, int mojoHandle) {
20         super(core, mojoHandle);
21     }
22 
23     /**
24      * @see HandleBase#HandleBase(HandleBase)
25      */
SharedBufferHandleImpl(HandleBase handle)26     SharedBufferHandleImpl(HandleBase handle) {
27         super(handle);
28     }
29 
30     /**
31      * @see org.chromium.mojo.system.SharedBufferHandle#pass()
32      */
33     @Override
pass()34     public SharedBufferHandle pass() {
35         return new SharedBufferHandleImpl(this);
36     }
37 
38     /**
39      * @see SharedBufferHandle#duplicate(DuplicateOptions)
40      */
41     @Override
duplicate(DuplicateOptions options)42     public SharedBufferHandle duplicate(DuplicateOptions options) {
43         return mCore.duplicate(this, options);
44     }
45 
46     /**
47      * @see SharedBufferHandle#map(long, long, MapFlags)
48      */
49     @Override
map(long offset, long numBytes, MapFlags flags)50     public ByteBuffer map(long offset, long numBytes, MapFlags flags) {
51         return mCore.map(this, offset, numBytes, flags);
52     }
53 
54     /**
55      * @see SharedBufferHandle#unmap(ByteBuffer)
56      */
57     @Override
unmap(ByteBuffer buffer)58     public void unmap(ByteBuffer buffer) {
59         mCore.unmap(buffer);
60     }
61 
62 }
63