Line data Source code
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
5 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 :
7 : #include "PerformanceEntry.h"
8 : #include "MainThreadUtils.h"
9 : #include "mozilla/dom/PerformanceEntryBinding.h"
10 : #include "nsIURI.h"
11 :
12 : using namespace mozilla::dom;
13 :
14 0 : NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(PerformanceEntry, mParent)
15 :
16 4 : NS_IMPL_CYCLE_COLLECTING_ADDREF(PerformanceEntry)
17 2 : NS_IMPL_CYCLE_COLLECTING_RELEASE(PerformanceEntry)
18 :
19 0 : NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(PerformanceEntry)
20 0 : NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
21 0 : NS_INTERFACE_MAP_ENTRY(nsISupports)
22 0 : NS_INTERFACE_MAP_END
23 :
24 2 : PerformanceEntry::PerformanceEntry(nsISupports* aParent,
25 : const nsAString& aName,
26 2 : const nsAString& aEntryType)
27 : : mParent(aParent),
28 : mName(aName),
29 2 : mEntryType(aEntryType)
30 : {
31 : // mParent is null in workers.
32 2 : MOZ_ASSERT(mParent || !NS_IsMainThread());
33 2 : }
34 :
35 0 : PerformanceEntry::~PerformanceEntry()
36 : {
37 0 : }
38 :
39 : JSObject*
40 0 : PerformanceEntry::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
41 : {
42 0 : return mozilla::dom::PerformanceEntryBinding::Wrap(aCx, this, aGivenProto);
43 : }
|