Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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.blimp; | |
| 6 | |
| 7 import org.chromium.base.annotations.CalledByNative; | |
| 8 import org.chromium.base.annotations.JNINamespace; | |
| 9 import org.chromium.chrome.browser.profiles.Profile; | |
| 10 | |
| 11 /** | |
| 12 * The ChromeBlimpClientContextDelegate for //chrome which provides the necessar y functionality | |
| 13 * required to run Blimp. This is the Java counterparty to the C++ | |
| 14 * ChromeBlimpClientContextDelegateAndroid. | |
| 15 */ | |
| 16 @JNINamespace("chrome") | |
| 17 public class ChromeBlimpClientContextDelegate { | |
| 18 public static ChromeBlimpClientContextDelegate createAndSetDelegateForContex t(Profile profile) { | |
|
David Trainor- moved to gerrit
2016/07/14 19:07:13
Javadoc? Explain a bit taht only one of these can
nyquist
2016/07/14 22:56:50
Yeah, that'd be cool, but the constructor of the C
| |
| 19 return new ChromeBlimpClientContextDelegate(profile); | |
| 20 } | |
| 21 | |
| 22 /** | |
| 23 * The pointer to the ChromeBlimpClientContextDelegateAndroid JNI bridge. | |
| 24 */ | |
| 25 private long mNativeChromeBlimpClientContextDelegateAndroid; | |
| 26 | |
| 27 private ChromeBlimpClientContextDelegate(Profile profile) { | |
| 28 mNativeChromeBlimpClientContextDelegateAndroid = nativeInit(profile); | |
| 29 } | |
| 30 | |
| 31 @CalledByNative | |
| 32 private void clearNativePtr() { | |
| 33 mNativeChromeBlimpClientContextDelegateAndroid = 0; | |
| 34 } | |
| 35 | |
| 36 public void destroy() { | |
| 37 assert mNativeChromeBlimpClientContextDelegateAndroid != 0; | |
| 38 nativeDestroy(mNativeChromeBlimpClientContextDelegateAndroid); | |
| 39 } | |
| 40 | |
| 41 private native long nativeInit(Profile profile); | |
| 42 private native void nativeDestroy(long nativeChromeBlimpClientContextDelegat eAndroid); | |
| 43 } | |
| OLD | NEW |