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:
@@ -13,6 +13,7 @@
|
||||
#include "mozilla/dom/Event.h"
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsVariant.h"
|
||||
#include "nsVideoFrame.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsTArrayHelpers.h"
|
||||
@@ -214,8 +215,7 @@ TextTrackManager::UpdateCueDisplay()
|
||||
mTextTracks->UpdateAndGetShowingCues(activeCues);
|
||||
|
||||
if (activeCues.Length() > 0) {
|
||||
nsCOMPtr<nsIWritableVariant> jsCues =
|
||||
do_CreateInstance("@mozilla.org/variant;1");
|
||||
nsRefPtr<nsVariant> jsCues = new nsVariant();
|
||||
|
||||
jsCues->SetAsArray(nsIDataType::VTYPE_INTERFACE,
|
||||
&NS_GET_IID(nsIDOMEventTarget),
|
||||
|
||||
Reference in New Issue
Block a user