Bug 1279273 - Use correct synchronization object for session data parsing. r=sebastian, a=lizzard
authorJan Henning <jh+bugzilla@buttercookie.de>
Sun, 12 Jun 2016 19:45:50 +0200
changeset 339753 c83de296c78d277a35e67cdc950162ee8e75bf39
parent 339752 df92cb65023ba9c46beae00e98d6da882471b231
child 339754 54a76ec78ed88c8b75d0cf7b12fbd23314e94ae2
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssebastian, lizzard
bugs1279273
milestone49.0a2
Bug 1279273 - Use correct synchronization object for session data parsing. r=sebastian, a=lizzard If the main thread has to wait for the session data parsing to finish - which is more likely when you've got many tabs open, meaning a large sessionstore.js file - it does so on "this", i.e. GeckoApp. The session data parsing itself is done from within a Runnable, so we need to qualify "this" there if we want it to refer to GeckoApp itself, so we can successfully release any waiting threads through notifyAll(). MozReview-Commit-ID: 3LhJsI5rNU3
mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
--- a/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
+++ b/mobile/android/base/java/org/mozilla/gecko/GeckoApp.java
@@ -1294,19 +1294,19 @@ public abstract class GeckoApp
                         restoreMessage = restoreSessionTabs(invokedWithExternalURL(getIntentURI(intent)));
                     } catch (SessionRestoreException e) {
                         // If restore failed, do a normal startup
                         Log.e(LOGTAG, "An error occurred during restore", e);
                         mShouldRestore = false;
                     }
                 }
 
-                synchronized (this) {
+                synchronized (GeckoApp.this) {
                     mSessionRestoreParsingFinished = true;
-                    notifyAll();
+                    GeckoApp.this.notifyAll();
                 }
 
                 // If we are doing a restore, send the parsed session data to Gecko.
                 if (!mIsRestoringActivity) {
                     GeckoAppShell.notifyObservers("Session:Restore", restoreMessage);
                 }
 
                 // Make sure sessionstore.bak is either updated or deleted as necessary.