Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4045)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/offline_pages/OfflinePageBridge.java

Issue 1232843003: [Offline Pages] Stub of offline pages bridge (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing feedback Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/android/chrome_jni_registrar.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/java/src/org/chromium/chrome/browser/offline_pages/OfflinePageBridge.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/offline_pages/OfflinePageBridge.java b/chrome/android/java/src/org/chromium/chrome/browser/offline_pages/OfflinePageBridge.java
new file mode 100644
index 0000000000000000000000000000000000000000..d4c66402fb53b7044edef9f609bec666a0084eea
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/offline_pages/OfflinePageBridge.java
@@ -0,0 +1,37 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.chrome.browser.offline_pages;
+
+import org.chromium.base.JNINamespace;
+import org.chromium.chrome.browser.profiles.Profile;
+
+/**
+ * Access gate to C++ side offline pages functionalities.
+ */
+@JNINamespace("offline_pages::android")
+public final class OfflinePageBridge {
+
+ private long mNativeOfflinePageBridge;
+
+ /**
+ * Creates offline pages bridge for a given profile.
+ */
+ public OfflinePageBridge(Profile profile) {
+ mNativeOfflinePageBridge = nativeInit(profile);
+ }
+
+ /**
+ * Destroys native offline pages bridge. It should be called during
+ * destruction to ensure proper cleanup.
+ */
+ public void destroy() {
+ assert mNativeOfflinePageBridge != 0;
+ nativeDestroy(mNativeOfflinePageBridge);
+ mNativeOfflinePageBridge = 0;
+ }
+
+ private native long nativeInit(Profile profile);
+ private native void nativeDestroy(long nativeOfflinePageBridge);
+}
« no previous file with comments | « no previous file | chrome/browser/android/chrome_jni_registrar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698