1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "mozilla/dom/PlacesEvent.h"
9 #include "mozilla/HoldDropJSObjects.h"
11 namespace mozilla::dom
{
13 NS_IMPL_CYCLE_COLLECTION_CLASS(PlacesEvent
)
15 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(PlacesEvent
)
16 NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER
17 NS_IMPL_CYCLE_COLLECTION_UNLINK_END
19 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(PlacesEvent
)
20 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
22 NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN(PlacesEvent
)
23 NS_IMPL_CYCLE_COLLECTION_TRACE_PRESERVED_WRAPPER
24 NS_IMPL_CYCLE_COLLECTION_TRACE_END
26 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(PlacesEvent
, AddRef
)
27 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(PlacesEvent
, Release
)
29 already_AddRefed
<PlacesEvent
> PlacesEvent::Constructor(
30 const GlobalObject
& aGlobal
, PlacesEventType aType
, ErrorResult
& rv
) {
31 RefPtr
<PlacesEvent
> event
= new PlacesEvent(aType
);
32 return event
.forget();
35 nsISupports
* PlacesEvent::GetParentObject() const { return nullptr; }
37 JSObject
* PlacesEvent::WrapObject(JSContext
* aCx
,
38 JS::Handle
<JSObject
*> aGivenProto
) {
39 return PlacesEvent_Binding::Wrap(aCx
, this, aGivenProto
);
42 } // namespace mozilla::dom