Refactor ProcessSingleton to allow a Desktop process to activate Metro Chrome...
Refactor ProcessSingleton to allow a Desktop process to activate Metro Chrome instead of grabbing the singleton (while making sure it simply RDVs if there already is an existing Chrome). Use a Windows event to let the Metro process notify the Desktop process once it grabbed the singleton (no more Sleep()). The idea is the following: 0) Any process always tries to rendez-vous before anything else. 1) A Metro process can always try to grab the singleton. 2) A Desktop process might wait if: a) The metro activation event exists b) The metro activation event doesn't exist, but ShouldActivate() returns true - In which case it creates the metro activation event and activates Metro Chrome (which will notify this process via the event once it grabbed the singleton; at which point this process should rendez-vous with it). All of this is done while holding a global mutex (only releasing it while waiting and re-acquiring it before continuing when notified). The process singleton acquiring logic has also been moved from the constructor to Create(). BUG=155585, 159869 TEST=Process singleton works as before (and better in tricky corner cases -- see http://crbug.com/159869) on Win8. Review URL: https://chromiumcodereview.appspot.com/11099053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171105 0039d316-1c4b-4281-b951-d872f2087c98
Showing
This diff is collapsed.
Please register or sign in to comment