LCOV - code coverage report
Current view: top level - dom/file - nsHostObjectURI.h (source / functions) Hit Total Coverage
Test: output.info Lines: 0 10 0.0 %
Date: 2017-07-14 16:53:18 Functions: 0 5 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             : #ifndef nsHostObjectURI_h
       8             : #define nsHostObjectURI_h
       9             : 
      10             : #include "mozilla/Attributes.h"
      11             : #include "mozilla/dom/File.h"
      12             : #include "nsCOMPtr.h"
      13             : #include "nsIClassInfo.h"
      14             : #include "nsIPrincipal.h"
      15             : #include "nsISerializable.h"
      16             : #include "nsIURIWithBlobImpl.h"
      17             : #include "nsIURIWithPrincipal.h"
      18             : #include "nsSimpleURI.h"
      19             : #include "nsIIPCSerializableURI.h"
      20             : #include "nsWeakReference.h"
      21             : 
      22             : 
      23             : /**
      24             :  * These URIs refer to host objects: Blobs, with scheme "blob",
      25             :  * MediaStreams, with scheme "mediastream", and MediaSources, with scheme
      26             :  * "mediasource".
      27             :  */
      28             : class nsHostObjectURI : public mozilla::net::nsSimpleURI
      29             :                       , public nsIURIWithPrincipal
      30             :                       , public nsIURIWithBlobImpl
      31             :                       , public nsSupportsWeakReference
      32             : {
      33             : public:
      34           0 :   nsHostObjectURI(nsIPrincipal* aPrincipal,
      35             :                   mozilla::dom::BlobImpl* aBlobImpl)
      36           0 :     : mozilla::net::nsSimpleURI()
      37             :     , mPrincipal(aPrincipal)
      38           0 :     , mBlobImpl(aBlobImpl)
      39           0 :   {}
      40             : 
      41             :   // For use only from deserialization
      42           0 :   nsHostObjectURI() : mozilla::net::nsSimpleURI() {}
      43             : 
      44             :   NS_DECL_ISUPPORTS_INHERITED
      45             :   NS_DECL_NSIURIWITHBLOBIMPL
      46             :   NS_DECL_NSIURIWITHPRINCIPAL
      47             :   NS_DECL_NSISERIALIZABLE
      48             :   NS_DECL_NSICLASSINFO
      49             :   NS_DECL_NSIIPCSERIALIZABLEURI
      50             : 
      51             :   NS_IMETHOD SetScheme(const nsACString &aProtocol) override;
      52             : 
      53             :   // Override CloneInternal() and EqualsInternal()
      54             :   virtual nsresult CloneInternal(RefHandlingEnum aRefHandlingMode,
      55             :                                  const nsACString& newRef,
      56             :                                  nsIURI** aClone) override;
      57             :   virtual nsresult EqualsInternal(nsIURI* aOther,
      58             :                                   RefHandlingEnum aRefHandlingMode,
      59             :                                   bool* aResult) override;
      60             : 
      61             :   // Override StartClone to hand back a nsHostObjectURI
      62           0 :   virtual mozilla::net::nsSimpleURI* StartClone(RefHandlingEnum refHandlingMode,
      63             :                                                 const nsACString& newRef) override
      64             :   {
      65           0 :     nsHostObjectURI* url = new nsHostObjectURI();
      66           0 :     SetRefOnClone(url, refHandlingMode, newRef);
      67           0 :     return url;
      68             :   }
      69             : 
      70             :   void ForgetBlobImpl();
      71             : 
      72             :   nsCOMPtr<nsIPrincipal> mPrincipal;
      73             :   RefPtr<mozilla::dom::BlobImpl> mBlobImpl;
      74             : 
      75             : protected:
      76           0 :   virtual ~nsHostObjectURI() {}
      77             : };
      78             : 
      79             : #define NS_HOSTOBJECTURI_CID \
      80             : { 0xf5475c51, 0x59a7, 0x4757, \
      81             :   { 0xb3, 0xd9, 0xe2, 0x11, 0xa9, 0x41, 0x08, 0x72 } }
      82             : 
      83             : #endif /* nsHostObjectURI_h */

Generated by: LCOV version 1.13