LCOV - code coverage report
Current view: top level - dom/base - DOMError.cpp (source / functions) Hit Total Coverage
Test: output.info Lines: 0 33 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 15 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             : #include "mozilla/dom/DOMError.h"
       8             : #include "mozilla/dom/DOMErrorBinding.h"
       9             : #include "mozilla/dom/DOMException.h"
      10             : #include "nsPIDOMWindow.h"
      11             : 
      12             : namespace mozilla {
      13             : namespace dom {
      14             : 
      15           0 : NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(DOMError, mWindow)
      16           0 : NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMError)
      17           0 : NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMError)
      18           0 : NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMError)
      19           0 :   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
      20           0 :   NS_INTERFACE_MAP_ENTRY(DOMError)
      21           0 :   NS_INTERFACE_MAP_ENTRY(nsISupports)
      22           0 : NS_INTERFACE_MAP_END
      23             : 
      24           0 : DOMError::DOMError(nsPIDOMWindowInner* aWindow)
      25           0 :   : mWindow(aWindow)
      26             : {
      27           0 : }
      28             : 
      29           0 : DOMError::DOMError(nsPIDOMWindowInner* aWindow, nsresult aValue)
      30           0 :   : mWindow(aWindow)
      31             : {
      32           0 :   nsCString name, message;
      33           0 :   NS_GetNameAndMessageForDOMNSResult(aValue, name, message);
      34             : 
      35           0 :   CopyUTF8toUTF16(name, mName);
      36           0 :   CopyUTF8toUTF16(message, mMessage);
      37           0 : }
      38             : 
      39           0 : DOMError::DOMError(nsPIDOMWindowInner* aWindow, const nsAString& aName)
      40             :   : mWindow(aWindow)
      41           0 :   , mName(aName)
      42             : {
      43           0 : }
      44             : 
      45           0 : DOMError::DOMError(nsPIDOMWindowInner* aWindow, const nsAString& aName,
      46           0 :                    const nsAString& aMessage)
      47             :   : mWindow(aWindow)
      48             :   , mName(aName)
      49           0 :   , mMessage(aMessage)
      50             : {
      51           0 : }
      52             : 
      53           0 : DOMError::~DOMError()
      54             : {
      55           0 : }
      56             : 
      57             : JSObject*
      58           0 : DOMError::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
      59             : {
      60           0 :   return DOMErrorBinding::Wrap(aCx, this, aGivenProto);
      61             : }
      62             : 
      63             : /* static */ already_AddRefed<DOMError>
      64           0 : DOMError::Constructor(const GlobalObject& aGlobal,
      65             :                       const nsAString& aName, const nsAString& aMessage,
      66             :                       ErrorResult& aRv)
      67             : {
      68           0 :   nsCOMPtr<nsPIDOMWindowInner> window = do_QueryInterface(aGlobal.GetAsSupports());
      69             : 
      70             :   // Window is null for chrome code.
      71             : 
      72           0 :   RefPtr<DOMError> ret = new DOMError(window, aName, aMessage);
      73           0 :   return ret.forget();
      74             : }
      75             : 
      76             : } // namespace dom
      77             : } // namespace mozilla

Generated by: LCOV version 1.13