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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabModelBase.java

Issue 511903002: Clearing Tabs and Observer list when TabModelBase is destroyed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.tabmodel; 5 package org.chromium.chrome.browser.tabmodel;
6 6
7 import org.chromium.base.CalledByNative; 7 import org.chromium.base.CalledByNative;
8 import org.chromium.base.ObserverList; 8 import org.chromium.base.ObserverList;
9 import org.chromium.base.TraceEvent; 9 import org.chromium.base.TraceEvent;
10 import org.chromium.chrome.browser.Tab; 10 import org.chromium.chrome.browser.Tab;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 for (Tab tab : mTabs) { 78 for (Tab tab : mTabs) {
79 if (tab.isInitialized()) tab.destroy(); 79 if (tab.isInitialized()) tab.destroy();
80 } 80 }
81 81
82 mRewoundList.destroy(); 82 mRewoundList.destroy();
83 83
84 if (mNativeTabModelImpl != 0) { 84 if (mNativeTabModelImpl != 0) {
85 nativeDestroy(mNativeTabModelImpl); 85 nativeDestroy(mNativeTabModelImpl);
86 mNativeTabModelImpl = 0; 86 mNativeTabModelImpl = 0;
87 } 87 }
88
89 mTabs.clear();
90 mObservers.clear();
88 } 91 }
89 92
90 @Override 93 @Override
91 public void addObserver(TabModelObserver observer) { 94 public void addObserver(TabModelObserver observer) {
92 mObservers.addObserver(observer); 95 mObservers.addObserver(observer);
93 } 96 }
94 97
95 @Override 98 @Override
96 public void removeObserver(TabModelObserver observer) { 99 public void removeObserver(TabModelObserver observer) {
97 mObservers.removeObserver(observer); 100 mObservers.removeObserver(observer);
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 private boolean isSessionRestoreInProgress() { 626 private boolean isSessionRestoreInProgress() {
624 return mModelDelegate.isSessionRestoreInProgress(); 627 return mModelDelegate.isSessionRestoreInProgress();
625 } 628 }
626 629
627 private native long nativeInit(boolean isIncognito); 630 private native long nativeInit(boolean isIncognito);
628 private native void nativeDestroy(long nativeTabModelBase); 631 private native void nativeDestroy(long nativeTabModelBase);
629 private native void nativeBroadcastSessionRestoreComplete(long nativeTabMode lBase); 632 private native void nativeBroadcastSessionRestoreComplete(long nativeTabMode lBase);
630 private native Profile nativeGetProfileAndroid(long nativeTabModelBase); 633 private native Profile nativeGetProfileAndroid(long nativeTabModelBase);
631 private native void nativeTabAddedToModel(long nativeTabModelBase, Tab tab); 634 private native void nativeTabAddedToModel(long nativeTabModelBase, Tab tab);
632 } 635 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698