LCOV - code coverage report
Current view: directory - dom/indexedDB - IDBWrapperCache.h (source / functions) Found Hit Coverage
Test: app.info Lines: 1 0 0.0 %
Date: 2012-06-02 Functions: 2 0 0.0 %

       1                 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
       2                 : /* vim: set ts=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/. */
       6                 : 
       7                 : #ifndef mozilla_dom_indexeddb_idbwrappercache_h__
       8                 : #define mozilla_dom_indexeddb_idbwrappercache_h__
       9                 : 
      10                 : #include "mozilla/dom/indexedDB/IndexedDatabase.h"
      11                 : 
      12                 : #include "nsDOMEventTargetHelper.h"
      13                 : 
      14                 : BEGIN_INDEXEDDB_NAMESPACE
      15                 : 
      16                 : class IDBWrapperCache : public nsDOMEventTargetHelper
      17                 : {
      18                 : public:
      19                 :   NS_DECL_ISUPPORTS_INHERITED
      20               0 :   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(
      21                 :                                                    IDBWrapperCache,
      22                 :                                                    nsDOMEventTargetHelper)
      23                 : 
      24                 :   JSObject* GetScriptOwner() const
      25                 :   {
      26                 :     return mScriptOwner;
      27                 :   }
      28                 :   bool SetScriptOwner(JSObject* aScriptOwner);
      29                 : 
      30                 :   JSObject* GetParentObject()
      31                 :   {
      32                 :     if (mScriptOwner) {
      33                 :       return mScriptOwner;
      34                 :     }
      35                 : 
      36                 :     // Do what nsEventTargetSH::PreCreate does.
      37                 :     nsCOMPtr<nsIScriptGlobalObject> parent;
      38                 :     nsDOMEventTargetHelper::GetParentObject(getter_AddRefs(parent));
      39                 : 
      40                 :     return parent ? parent->GetGlobalJSObject() : nsnull;
      41                 :   }
      42                 : 
      43                 :   static IDBWrapperCache* FromSupports(nsISupports* aSupports)
      44                 :   {
      45                 :     return static_cast<IDBWrapperCache*>(
      46                 :       nsDOMEventTargetHelper::FromSupports(aSupports));
      47                 :   }
      48                 : 
      49                 : protected:
      50                 :   IDBWrapperCache()
      51                 :   : mScriptOwner(nsnull)
      52                 :   { }
      53                 : 
      54                 :   virtual ~IDBWrapperCache();
      55                 : 
      56                 : private:
      57                 :   JSObject* mScriptOwner;
      58                 : };
      59                 : 
      60                 : END_INDEXEDDB_NAMESPACE
      61                 : 
      62                 : #endif // mozilla_dom_indexeddb_idbwrappercache_h__

Generated by: LCOV version 1.7