gecko-dev/mobile
Michael Comella 3b46934fc2 Bug 1255657 - Write client ID file before Gecko starts to prevent race. r=rnewman
As best as I can tell, this code runs before Gecko is initialized. via
bug 1255657 comment 8:

To confirm this, GeckoProfile is created before the GeckoThread is
finished launching but it seems almost coincidental:
 GeckoApp.onCreate
  GeckoThread.launch
   GeckoThread.start
...
 GeckoThread.run
  GeckoThread.getGeckoArgs (notably before GeckoLader.nativeRun)
   GeckoThread.addCustomProfileArg
    (if GAP.getGeckoInterface != null, which is set earlier in GeckoApp.onCreate)
     EITHER
     GeckoProfile.getDir() (if in guest mode)
      GeckoProfile.forceCreate
     GeckoProfile.forceCreate (if not in guest mode)

forceCreate opens the times.json file.

That being said, if this code path changes, forceCreate is also called
when the GeckoView is initialized (which occurs after the GeckoThread.launch
call, but is likely to happen before Gecko finishes launching).
---

If we wanted GeckoProfile initialization timing to be seem less coincidental,
we should consider initializing the profile non-lazily: bug 1262625.

MozReview-Commit-ID: LGluC021CTg

--HG--
extra : rebase_source : 7d1ff8a354accfaae0dc3f2d222ed32f6aa8cbf6
2016-04-06 15:07:01 -07:00
..
android Bug 1255657 - Write client ID file before Gecko starts to prevent race. r=rnewman 2016-04-06 15:07:01 -07:00
locales Bug 682294 - Add an error page for file access denied. r=bz 2016-04-06 08:18:00 +02:00