Bug 861529 - Remove nsDOMEventTargetHelper::Init, ,r=khuey

--HG--
extra : rebase_source : 3c2e2d6511c26f41428399fc3622c30c4ea7ff6b
This commit is contained in:
Olli Pettay 2013-04-22 20:24:48 +03:00
Родитель 42cef9be70
Коммит b8de0b576d
4 изменённых файлов: 13 добавлений и 36 удалений

Просмотреть файл

@ -142,8 +142,6 @@ nsDOMDataChannel::Init(nsPIDOMWindow* aDOMWindow)
nsresult rv;
nsAutoString urlParam;
nsDOMEventTargetHelper::Init();
MOZ_ASSERT(mDataChannel);
mDataChannel->SetListener(this, nullptr);

Просмотреть файл

@ -118,20 +118,25 @@ nsDOMFileReader::~nsDOMFileReader()
nsLayoutStatics::Release();
}
/**
* This Init method is called from the factory constructor.
*/
nsresult
nsDOMFileReader::Init()
{
nsDOMEventTargetHelper::Init();
nsIScriptSecurityManager *secMan = nsContentUtils::GetSecurityManager();
nsCOMPtr<nsIPrincipal> subjectPrincipal;
nsIScriptSecurityManager* secMan = nsContentUtils::GetSecurityManager();
nsCOMPtr<nsIPrincipal> principal;
if (secMan) {
nsresult rv = secMan->GetSubjectPrincipal(getter_AddRefs(subjectPrincipal));
NS_ENSURE_SUCCESS(rv, rv);
secMan->GetSystemPrincipal(getter_AddRefs(principal));
}
NS_ENSURE_STATE(subjectPrincipal);
mPrincipal.swap(subjectPrincipal);
NS_ENSURE_STATE(principal);
mPrincipal.swap(principal);
// Instead of grabbing some random global from the context stack,
// let's use the default one (junk drawer) for now.
// We should move away from this Init...
BindToOwner(xpc::GetNativeForGlobal(xpc::GetJunkScope()));
return NS_OK;
}

Просмотреть файл

@ -363,27 +363,3 @@ nsDOMEventTargetHelper::GetContextForEventHandlers(nsresult* aRv)
: nullptr;
}
void
nsDOMEventTargetHelper::Init(JSContext* aCx)
{
JSContext* cx = aCx;
if (!cx) {
nsIJSContextStack* stack = nsContentUtils::ThreadJSContextStack();
if (!stack)
return;
if (NS_FAILED(stack->Peek(&cx)) || !cx)
return;
}
NS_ASSERTION(cx, "Should have returned earlier ...");
nsIScriptContext* context = GetScriptContextFromJSContext(cx);
if (context) {
nsCOMPtr<nsPIDOMWindow> window =
do_QueryInterface(context->GetGlobalObject());
if (window) {
BindToOwner(window->GetCurrentInnerWindow());
}
}
}

Просмотреть файл

@ -68,8 +68,6 @@ public:
return static_cast<nsDOMEventTargetHelper*>(target);
}
void Init(JSContext* aCx = nullptr);
bool HasListenersFor(nsIAtom* aTypeWithOn)
{
return mListenerManager && mListenerManager->HasListenersFor(aTypeWithOn);