LCOV - code coverage report
Current view: top level - dom/cache - ActorChild.cpp (source / functions) Hit Total Coverage
Test: output.info Lines: 0 22 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 6 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/dom/cache/ActorChild.h"
       8             : 
       9             : #include "mozilla/dom/cache/CacheWorkerHolder.h"
      10             : #include "nsThreadUtils.h"
      11             : 
      12             : namespace mozilla {
      13             : namespace dom {
      14             : namespace cache {
      15             : 
      16             : void
      17           0 : ActorChild::SetWorkerHolder(CacheWorkerHolder* aWorkerHolder)
      18             : {
      19             :   // Some of the Cache actors can have multiple DOM objects associated with
      20             :   // them.  In this case the workerHolder will be added multiple times.  This is
      21             :   // permitted, but the workerHolder should be the same each time.
      22           0 :   if (mWorkerHolder) {
      23           0 :     MOZ_DIAGNOSTIC_ASSERT(mWorkerHolder == aWorkerHolder);
      24           0 :     return;
      25             :   }
      26             : 
      27           0 :   mWorkerHolder = aWorkerHolder;
      28           0 :   if (mWorkerHolder) {
      29           0 :     mWorkerHolder->AddActor(this);
      30             :   }
      31             : }
      32             : 
      33             : void
      34           0 : ActorChild::RemoveWorkerHolder()
      35             : {
      36           0 :   MOZ_ASSERT_IF(!NS_IsMainThread(), mWorkerHolder);
      37           0 :   if (mWorkerHolder) {
      38           0 :     mWorkerHolder->RemoveActor(this);
      39           0 :     mWorkerHolder = nullptr;
      40             :   }
      41           0 : }
      42             : 
      43             : CacheWorkerHolder*
      44           0 : ActorChild::GetWorkerHolder() const
      45             : {
      46           0 :   return mWorkerHolder;
      47             : }
      48             : 
      49             : bool
      50           0 : ActorChild::WorkerHolderNotified() const
      51             : {
      52           0 :   return mWorkerHolder && mWorkerHolder->Notified();
      53             : }
      54             : 
      55           0 : ActorChild::ActorChild()
      56             : {
      57           0 : }
      58             : 
      59           0 : ActorChild::~ActorChild()
      60             : {
      61           0 :   MOZ_DIAGNOSTIC_ASSERT(!mWorkerHolder);
      62           0 : }
      63             : 
      64             : } // namespace cache
      65             : } // namespace dom
      66             : } // namespace mozilla

Generated by: LCOV version 1.13