LCOV - code coverage report
Current view: top level - dom/smil - TimeEvent.cpp (source / functions) Hit Total Coverage
Test: output.info Lines: 0 29 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 9 0.0 %
Legend: Lines: hit not hit

          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 "mozilla/ContentEvents.h"
       8             : #include "mozilla/dom/TimeEvent.h"
       9             : #include "nsIDocShell.h"
      10             : #include "nsIInterfaceRequestorUtils.h"
      11             : #include "nsPresContext.h"
      12             : #include "nsGlobalWindow.h"
      13             : 
      14             : namespace mozilla {
      15             : namespace dom {
      16             : 
      17           0 : TimeEvent::TimeEvent(EventTarget* aOwner,
      18             :                      nsPresContext* aPresContext,
      19           0 :                      InternalSMILTimeEvent* aEvent)
      20             :   : Event(aOwner, aPresContext,
      21           0 :           aEvent ? aEvent : new InternalSMILTimeEvent(false, eVoidEvent))
      22           0 :   , mDetail(mEvent->AsSMILTimeEvent()->mDetail)
      23             : {
      24           0 :   if (aEvent) {
      25           0 :     mEventIsInternal = false;
      26             :   } else {
      27           0 :     mEventIsInternal = true;
      28             :   }
      29             : 
      30           0 :   if (mPresContext) {
      31           0 :     nsCOMPtr<nsIDocShell> docShell = mPresContext->GetDocShell();
      32           0 :     if (docShell) {
      33           0 :       mView = docShell->GetWindow();
      34             :     }
      35             :   }
      36           0 : }
      37             : 
      38           0 : NS_IMPL_CYCLE_COLLECTION_INHERITED(TimeEvent, Event,
      39             :                                    mView)
      40             : 
      41           0 : NS_IMPL_ADDREF_INHERITED(TimeEvent, Event)
      42           0 : NS_IMPL_RELEASE_INHERITED(TimeEvent, Event)
      43             : 
      44           0 : NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(TimeEvent)
      45           0 :   NS_INTERFACE_MAP_ENTRY(nsIDOMTimeEvent)
      46           0 : NS_INTERFACE_MAP_END_INHERITING(Event)
      47             : 
      48             : NS_IMETHODIMP
      49           0 : TimeEvent::GetDetail(int32_t* aDetail)
      50             : {
      51           0 :   *aDetail = mDetail;
      52           0 :   return NS_OK;
      53             : }
      54             : 
      55             : void
      56           0 : TimeEvent::InitTimeEvent(const nsAString& aType, nsGlobalWindow* aView,
      57             :                          int32_t aDetail)
      58             : {
      59           0 :   NS_ENSURE_TRUE_VOID(!mEvent->mFlags.mIsBeingDispatched);
      60             : 
      61           0 :   Event::InitEvent(aType, false /*doesn't bubble*/, false /*can't cancel*/);
      62           0 :   mDetail = aDetail;
      63           0 :   mView = aView ? aView->GetOuterWindow() : nullptr;
      64             : }
      65             : 
      66             : } // namespace dom
      67             : } // namespace mozilla
      68             : 
      69             : using namespace mozilla;
      70             : using namespace mozilla::dom;
      71             : 
      72             : already_AddRefed<TimeEvent>
      73           0 : NS_NewDOMTimeEvent(EventTarget* aOwner,
      74             :                    nsPresContext* aPresContext,
      75             :                    InternalSMILTimeEvent* aEvent)
      76             : {
      77           0 :   RefPtr<TimeEvent> it = new TimeEvent(aOwner, aPresContext, aEvent);
      78           0 :   return it.forget();
      79             : }

Generated by: LCOV version 1.13