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

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

Issue 322253002: Allow "freezing" NativePages to spare up memory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: removed assert false from updateForUrl() Created 6 years, 6 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 | « chrome/android/java/src/org/chromium/chrome/browser/FrozenNativePage.java ('k') | no next file » | 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/Tab.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/Tab.java b/chrome/android/java/src/org/chromium/chrome/browser/Tab.java
index b5f61272ab0b41250125609c70240133a214827a..8707776759627e50639af48b1200224616730c53 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/Tab.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/Tab.java
@@ -707,6 +707,16 @@ public class Tab implements NavigationClient {
}
/**
+ * Replaces the current NativePage with a empty stand-in for a NativePage. This can be used
+ * to reduce memory pressure.
+ */
+ public void freezeNativePage() {
+ if (mNativePage == null || mNativePage instanceof FrozenNativePage) return;
+ assert mNativePage.getView().getParent() == null : "Cannot freeze visible native page";
+ mNativePage = FrozenNativePage.freeze(mNativePage);
+ }
+
+ /**
* Hides the current {@link NativePage}, if any, and shows the {@link ContentViewCore}'s view.
*/
protected void showRenderedPage() {
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/FrozenNativePage.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698