LCOV - code coverage report
Current view: top level - dom/base - DOMError.h (source / functions) Hit Total Coverage
Test: output.info Lines: 0 9 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 10 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 file,
       5             :  * You can obtain one at http://mozilla.org/MPL/2.0/. */
       6             : 
       7             : #ifndef mozilla_dom_domerror_h__
       8             : #define mozilla_dom_domerror_h__
       9             : 
      10             : #include "mozilla/Attributes.h"
      11             : #include "nsWrapperCache.h"
      12             : #include "nsCOMPtr.h"
      13             : #include "nsString.h"
      14             : 
      15             : #define DOMERROR_IID \
      16             : { 0x220cb63f, 0xa37d, 0x4ba4, \
      17             :  { 0x8e, 0x31, 0xfc, 0xde, 0xec, 0x48, 0xe1, 0x66 } }
      18             : 
      19             : class nsPIDOMWindowInner;
      20             : 
      21             : namespace mozilla {
      22             : 
      23             : class ErrorResult;
      24             : 
      25             : namespace dom {
      26             : 
      27             : class GlobalObject;
      28             : 
      29             : class DOMError : public nsISupports,
      30             :                  public nsWrapperCache
      31             : {
      32             :   nsCOMPtr<nsPIDOMWindowInner> mWindow;
      33             :   nsString mName;
      34             :   nsString mMessage;
      35             : 
      36             : protected:
      37             :   virtual ~DOMError();
      38             : 
      39             : public:
      40             :   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
      41           0 :   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMError)
      42             : 
      43             :   NS_DECLARE_STATIC_IID_ACCESSOR(DOMERROR_IID)
      44             : 
      45             :   // aWindow can be null if this DOMError is not associated with a particular
      46             :   // window.
      47             : 
      48             :   explicit DOMError(nsPIDOMWindowInner* aWindow);
      49             : 
      50             :   DOMError(nsPIDOMWindowInner* aWindow, nsresult aValue);
      51             : 
      52             :   DOMError(nsPIDOMWindowInner* aWindow, const nsAString& aName);
      53             : 
      54             :   DOMError(nsPIDOMWindowInner* aWindow, const nsAString& aName,
      55             :            const nsAString& aMessage);
      56             : 
      57           0 :   nsPIDOMWindowInner* GetParentObject() const
      58             :   {
      59           0 :     return mWindow;
      60             :   }
      61             : 
      62             :   virtual JSObject*
      63             :   WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
      64             : 
      65             :   static already_AddRefed<DOMError>
      66             :   Constructor(const GlobalObject& global, const nsAString& name,
      67             :               const nsAString& message, ErrorResult& aRv);
      68             : 
      69           0 :   void GetName(nsString& aRetval) const
      70             :   {
      71           0 :     aRetval = mName;
      72           0 :   }
      73             : 
      74           0 :   void GetMessage(nsString& aRetval) const
      75             :   {
      76           0 :     aRetval = mMessage;
      77           0 :   }
      78             : };
      79             : 
      80             : NS_DEFINE_STATIC_IID_ACCESSOR(DOMError, DOMERROR_IID)
      81             : 
      82             : } // namespace dom
      83             : } // namespace mozilla
      84             : 
      85             : #endif // mozilla_dom_domerror_h__

Generated by: LCOV version 1.13