Quelle DebuggerNotificationObserver.cpp
Sprache: C
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
static already_AddRefed<DebuggerNotificationManager> GetManager(
JSContext* aCx, JS::Handle<JSObject*> aDebuggeeGlobal) { // The debuggee global here is likely a debugger-compartment cross-compartment // wrapper for the debuggee global object, so we need to unwrap it to get // the real debuggee-compartment global object.
JS::Rooted<JSObject*> debuggeeGlobalRooted(
aCx, js::UncheckedUnwrap(aDebuggeeGlobal, false));
if (!debuggeeGlobalRooted) { return nullptr;
}
nsCOMPtr<nsIGlobalObject> debuggeeGlobalObject(
xpc::NativeGlobal(debuggeeGlobalRooted)); if (!debuggeeGlobalObject) { return nullptr;
}
void DebuggerNotificationObserver::NotifyListeners(
DebuggerNotification* aNotification) { if (!HasListeners()) { return;
}
// Since we want the notification objects to live in the same compartment // as the observer, we create a new instance of the notification before // an observer dispatches the event listeners.
RefPtr<DebuggerNotification> debuggerNotification(
aNotification->CloneInto(mOwnerGlobal));
for (RefPtr<DebuggerNotificationCallback> callback :
mEventListenerCallbacks.ForwardRange()) {
callback->Call(*debuggerNotification);
}
}
} // namespace mozilla::dom
¤ Dauer der Verarbeitung: 0.19 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.