Backed out changeset 4beec31b9ea9 for increasing frequency of intermittent orange bug 618052
This commit is contained in:
@@ -79,13 +79,11 @@
|
||||
#include "prproces.h"
|
||||
#include "nsITimelineService.h"
|
||||
|
||||
#include "mozilla/Mutex.h"
|
||||
#include "nsAutoLock.h"
|
||||
#include "SpecialSystemDirectory.h"
|
||||
|
||||
#include "nsTraceRefcntImpl.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
#define CHECK_mWorkingPath() \
|
||||
PR_BEGIN_MACRO \
|
||||
if (mWorkingPath.IsEmpty()) \
|
||||
@@ -161,20 +159,24 @@ public:
|
||||
nsresult Resolve(const WCHAR* in, WCHAR* out);
|
||||
|
||||
private:
|
||||
Mutex mLock;
|
||||
PRLock* mLock;
|
||||
IPersistFile* mPersistFile;
|
||||
// Win 95 and 98 don't have IShellLinkW
|
||||
IShellLinkW* mShellLink;
|
||||
};
|
||||
|
||||
ShortcutResolver::ShortcutResolver() : mLock("ShortcutResolver.mLock")
|
||||
ShortcutResolver::ShortcutResolver()
|
||||
{
|
||||
mLock = nsnull;
|
||||
mPersistFile = nsnull;
|
||||
mShellLink = nsnull;
|
||||
}
|
||||
|
||||
ShortcutResolver::~ShortcutResolver()
|
||||
{
|
||||
if (mLock)
|
||||
nsAutoLock::DestroyLock(mLock);
|
||||
|
||||
// Release the pointer to the IPersistFile interface.
|
||||
if (mPersistFile)
|
||||
mPersistFile->Release();
|
||||
@@ -191,6 +193,10 @@ ShortcutResolver::Init()
|
||||
{
|
||||
CoInitialize(NULL); // FIX: we should probably move somewhere higher up during startup
|
||||
|
||||
mLock = nsAutoLock::NewLock("ShortcutResolver::mLock");
|
||||
if (!mLock)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
HRESULT hres;
|
||||
hres = CoCreateInstance(CLSID_ShellLink,
|
||||
NULL,
|
||||
@@ -214,7 +220,7 @@ ShortcutResolver::Init()
|
||||
nsresult
|
||||
ShortcutResolver::Resolve(const WCHAR* in, WCHAR* out)
|
||||
{
|
||||
MutexAutoLock lock(mLock);
|
||||
nsAutoLock lock(mLock);
|
||||
|
||||
// see if we can Load the path.
|
||||
HRESULT hres = mPersistFile->Load(in, STGM_READ);
|
||||
|
||||
Reference in New Issue
Block a user