Bug 1210517 - Create nsVariant directly rather than via do_CreateInstance(). r=froydnj
The goal here is to leave creation stuff mostly for JS, so we can convert it entirely over to a non-threadsafe cycle-collected version without breaking any existing C++ users. I didn't do this for a remaining use in nsGlobalWindow.h to avoid including nsVariant.h all over the place.
This commit is contained in:
@@ -63,6 +63,7 @@
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsVariant.h"
|
||||
|
||||
#include "nsIDOMMutationEvent.h"
|
||||
#include "mozilla/ContentEvents.h"
|
||||
@@ -807,9 +808,7 @@ UploadLastDir::StoreLastUsedDirectory(nsIDocument* aDoc, nsIFile* aDir)
|
||||
aDir->GetPath(unicodePath);
|
||||
if (unicodePath.IsEmpty()) // nothing to do
|
||||
return NS_OK;
|
||||
nsCOMPtr<nsIWritableVariant> prefValue = do_CreateInstance(NS_VARIANT_CONTRACTID);
|
||||
if (!prefValue)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
nsRefPtr<nsVariant> prefValue = new nsVariant();
|
||||
prefValue->SetAsAString(unicodePath);
|
||||
|
||||
// Use the document's current load context to ensure that the content pref
|
||||
|
||||
Reference in New Issue
Block a user