diff options
author | benm@chromium.org <benm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-07 19:55:28 +0000 |
---|---|---|
committer | benm@chromium.org <benm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-07 19:55:28 +0000 |
commit | 470c296f68391e8d81744c19124f9d7bd73024b7 (patch) | |
tree | ad711b8e113b124196a53b1fe494b578b08afbe8 /android_webview | |
parent | 51c65abd5c743b221445c4d2698afc69fa2250ea (diff) | |
download | chromium_src-470c296f68391e8d81744c19124f9d7bd73024b7.zip chromium_src-470c296f68391e8d81744c19124f9d7bd73024b7.tar.gz chromium_src-470c296f68391e8d81744c19124f9d7bd73024b7.tar.bz2 |
[Android WebView] Fix Android WebView tests.
Changes in https://codereview.chromium.org/11363100/ futzed with
the ordering of some calls in a bad way. We also don't need to
null out our ContentViewCore reference as ContentViewCore already
takes care of it being used after destroy is called (and it means
we then do not require embedders to null check the return of
AwContents.getContentViewCore().
Android only change and Android bots are happy.
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/11361128
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@166501 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview')
-rw-r--r-- | android_webview/java/src/org/chromium/android_webview/AwContents.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/android_webview/java/src/org/chromium/android_webview/AwContents.java b/android_webview/java/src/org/chromium/android_webview/AwContents.java index f16f0ca..e8dd5e9 100644 --- a/android_webview/java/src/org/chromium/android_webview/AwContents.java +++ b/android_webview/java/src/org/chromium/android_webview/AwContents.java @@ -154,9 +154,11 @@ public class AwContents { AwContentsClient contentsClient, NativeWindow nativeWindow, boolean privateBrowsing, boolean isAccessFromFileURLsGrantedByDefault) { - mNativeAwContents = nativeInit(contentsClient.getWebContentsDelegate(), privateBrowsing); + // Note that ContentViewCore must be set up before AwContents, as ContentViewCore + // setup performs process initialisation work needed by AwContents. mContentViewCore = new ContentViewCore(containerView.getContext(), ContentViewCore.PERSONALITY_VIEW); + mNativeAwContents = nativeInit(contentsClient.getWebContentsDelegate(), privateBrowsing); mContentsClient = contentsClient; mCleanupReference = new CleanupReference(this, new DestroyRunnable(mNativeAwContents)); mIoThreadClientHandler = new IoThreadClientHandler(); @@ -192,10 +194,11 @@ public class AwContents { } public void destroy() { - if (mContentViewCore != null) { - mContentViewCore.destroy(); - mContentViewCore = null; - } + mContentViewCore.destroy(); + // We explicitly do not null out the mContentViewCore reference here + // because ContentViewCore already has code to deal with the case + // methods are called on it after it's been destroyed, and other + // code relies on AwContents.getContentViewCore to return non-null. mCleanupReference.cleanupNow(); } |