1 | // Copyright (c) 2013 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.chrome.browser.profiles; |
6 | |
7 | import org.chromium.base.CalledByNative; |
8 | |
9 | /** |
10 | * Wrapper that allows passing a Profile reference around in the Java layer. |
11 | */ |
12 | public class Profile { |
13 | |
14 | private int mNativeProfileAndroid; |
15 | |
16 | private Profile(int nativeProfileAndroid) { |
17 | mNativeProfileAndroid = nativeProfileAndroid; |
18 | } |
19 | |
20 | @CalledByNative |
21 | private static Profile create(int nativeProfileAndroid) { |
22 | return new Profile(nativeProfileAndroid); |
23 | } |
24 | |
25 | @CalledByNative |
26 | private void destroy() { |
27 | mNativeProfileAndroid = 0; |
28 | } |
29 | |
30 | @CalledByNative |
31 | private int getNativePointer() { |
32 | return mNativeProfileAndroid; |
33 | } |
34 | } |