author | Jim Mathies <jmathies@mozilla.com> |
Sat, 01 Feb 2014 08:03:11 -0600 | |
changeset 166434 | d09f9a9f81ae8cba40ac5a65ca0ef86d428ff802 |
parent 166433 | 7fb9722bd187e866b6de5b674cd26275919096ec |
child 166445 | f66e1ff54609fcb5386be739c8fe9017d27f270e |
push id | 26124 |
push user | jmathies@mozilla.com |
push date | Sat, 01 Feb 2014 14:07:34 +0000 |
treeherder | mozilla-central@d09f9a9f81ae [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | bbondy |
bugs | 966626, 950241 |
milestone | 29.0a1 |
first release with | nightly linux32
d09f9a9f81ae
/
29.0a1
/
20140201074923
/
files
nightly linux64
d09f9a9f81ae
/
29.0a1
/
20140201074923
/
files
nightly mac
d09f9a9f81ae
/
29.0a1
/
20140201074923
/
files
nightly win32
d09f9a9f81ae
/
29.0a1
/
20140201074923
/
files
nightly win64
d09f9a9f81ae
/
29.0a1
/
20140201074923
/
files
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
releases | nightly linux32
29.0a1
/
20140201074923
/
pushlog to previous
nightly linux64
29.0a1
/
20140201074923
/
pushlog to previous
nightly mac
29.0a1
/
20140201074923
/
pushlog to previous
nightly win32
29.0a1
/
20140201074923
/
pushlog to previous
nightly win64
29.0a1
/
20140201074923
/
pushlog to previous
|
browser/metro/shell/commandexecutehandler/CommandExecuteHandler.cpp | file | annotate | diff | comparison | revisions |
--- a/browser/metro/shell/commandexecutehandler/CommandExecuteHandler.cpp +++ b/browser/metro/shell/commandexecutehandler/CommandExecuteHandler.cpp @@ -98,16 +98,17 @@ public: mRequestType(DEFAULT_LAUNCH), mRequestMet(false), mDelayedLaunchType(NONE), mVerb(L"open") { } bool RequestMet() { return mRequestMet; } + void SetRequestMet(); long RefCount() { return mRef; } void HeartBeat(); // IUnknown IFACEMETHODIMP QueryInterface(REFIID aRefID, void **aInt) { static const QITAB qit[] = { QITABENT(CExecuteCommandVerb, IExecuteCommand), @@ -381,18 +382,16 @@ public: CStringW browserPath; GetDefaultBrowserPath(browserPath); return !selfPath.CompareNoCase(browserPath); } private: ~CExecuteCommandVerb() { - SafeRelease(&mShellItemArray); - SafeRelease(&mUnkSite); } void LaunchDesktopBrowser(); bool LaunchMetroBrowser(); bool SetTargetPath(IShellItem* aItem); bool TestForUpdateLock(); /* @@ -660,22 +659,22 @@ CExecuteCommandVerb::LaunchDesktopBrowse void CExecuteCommandVerb::HeartBeat() { if (mRequestType == METRO_UPDATE && mDelayedLaunchType == DESKTOP && !IsMetroProcessRunning()) { mDelayedLaunchType = NONE; LaunchDesktopBrowser(); - mRequestMet = true; + SetRequestMet(); } if (mDelayedLaunchType == METRO && !TestForUpdateLock()) { mDelayedLaunchType = NONE; LaunchMetroBrowser(); - mRequestMet = true; + SetRequestMet(); } } static bool PrepareActivationManager(CComPtr<IApplicationActivationManager> &activateMgr) { HRESULT hr = activateMgr.CoCreateInstance(CLSID_ApplicationActivationManager, nullptr, CLSCTX_LOCAL_SERVER); @@ -743,33 +742,31 @@ CExecuteCommandVerb::LaunchMetroBrowser( // protocols } else { hr = activateMgr->ActivateForProtocol(appModelID, mShellItemArray, &processID); Log(L"ActivateForProtocol result %X", hr); } return true; } -class AutoSetRequestMet +void CExecuteCommandVerb::SetRequestMet() { -public: - explicit AutoSetRequestMet(bool* aFlag) : - mFlag(aFlag) {} - ~AutoSetRequestMet() { if (mFlag) *mFlag = true; } -private: - bool* mFlag; -}; + SafeRelease(&mShellItemArray); + SafeRelease(&mUnkSite); + mRequestMet = true; + Log(L"Request met, exiting."); +} IFACEMETHODIMP CExecuteCommandVerb::Execute() { Log(L"Execute()"); if (!mTarget.GetLength()) { // We shut down when this flips to true - mRequestMet = true; + SetRequestMet(); return E_FAIL; } // Deal with metro restart for an update - launch desktop with a command // that tells it to run updater then launch the metro browser. if (mRequestType == METRO_UPDATE) { // We'll complete this in the heart beat callback from the main msg loop. // We do this because the last browser instance makes this call to Execute @@ -779,29 +776,29 @@ IFACEMETHODIMP CExecuteCommandVerb::Exec mDelayedLaunchType = DESKTOP; return S_OK; } // Launch on the desktop if (mRequestType == DESKTOP_RESTART || (mRequestType == DEFAULT_LAUNCH && DefaultLaunchIsDesktop())) { LaunchDesktopBrowser(); - mRequestMet = true; + SetRequestMet(); return S_OK; } // If we have an update in the works, don't try to activate yet, // delay until the lock is removed. if (TestForUpdateLock()) { mDelayedLaunchType = METRO; return S_OK; } LaunchMetroBrowser(); - mRequestMet = true; + SetRequestMet(); return S_OK; } class ClassFactory : public IClassFactory { public: ClassFactory(IUnknown *punkObject); ~ClassFactory();