LCOV - code coverage report
Current view: top level - dom/permission - PermissionStatus.h (source / functions) Hit Total Coverage
Test: output.info Lines: 0 2 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 3 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_PermissionStatus_h_
       8             : #define mozilla_dom_PermissionStatus_h_
       9             : 
      10             : #include "mozilla/dom/PermissionsBinding.h"
      11             : #include "mozilla/dom/PermissionStatusBinding.h"
      12             : #include "mozilla/DOMEventTargetHelper.h"
      13             : 
      14             : namespace mozilla {
      15             : namespace dom {
      16             : 
      17             : class PermissionObserver;
      18             : 
      19             : class PermissionStatus final
      20             :   : public DOMEventTargetHelper
      21             : {
      22             :   friend class PermissionObserver;
      23             : 
      24             : public:
      25             :   static already_AddRefed<PermissionStatus> Create(nsPIDOMWindowInner* aWindow,
      26             :                                                    PermissionName aName,
      27             :                                                    ErrorResult& aRv);
      28             : 
      29             :   JSObject* WrapObject(JSContext* aCx,
      30             :                        JS::Handle<JSObject*> aGivenProto) override;
      31             : 
      32           0 :   PermissionState State() const { return mState; }
      33             : 
      34           0 :   IMPL_EVENT_HANDLER(change)
      35             : 
      36             : private:
      37             :   ~PermissionStatus();
      38             : 
      39             :   PermissionStatus(nsPIDOMWindowInner* aWindow, PermissionName aName);
      40             : 
      41             :   nsresult Init();
      42             : 
      43             :   nsresult UpdateState();
      44             : 
      45             :   already_AddRefed<nsIPrincipal> GetPrincipal() const;
      46             : 
      47             :   void PermissionChanged();
      48             : 
      49             :   PermissionName mName;
      50             :   PermissionState mState;
      51             : 
      52             :   RefPtr<PermissionObserver> mObserver;
      53             : };
      54             : 
      55             : } // namespace dom
      56             : } // namespace mozilla
      57             : 
      58             : #endif // mozilla_dom_permissionstatus_h_

Generated by: LCOV version 1.13