Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/image/decoders/icon/gtk/nsIconChannel.h
Line
Count
Source (jump to first uncovered line)
1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
 * License, v. 2.0. If a copy of the MPL was not distributed with this
3
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5
#ifndef mozilla_image_decoders_icon_gtk_nsIconChannel_h
6
#define mozilla_image_decoders_icon_gtk_nsIconChannel_h
7
8
#include "mozilla/Attributes.h"
9
10
#include "nsIChannel.h"
11
#include "nsIStreamListener.h"
12
#include "nsIURI.h"
13
#include "nsIIconURI.h"
14
#include "nsCOMPtr.h"
15
16
/// This class is the gnome implementation of nsIconChannel. It basically asks
17
/// gtk/gnome for an icon, saves it as a tmp icon, and creates a new channel for
18
/// that file to which all calls will be proxied.
19
class nsIconChannel final : public nsIChannel
20
{
21
  public:
22
    NS_DECL_ISUPPORTS
23
    NS_FORWARD_NSIREQUEST(mRealChannel->)
24
    NS_FORWARD_NSICHANNEL(mRealChannel->)
25
26
0
    nsIconChannel() { }
27
28
    static void Shutdown();
29
30
    /// Called by nsIconProtocolHandler after it creates this channel.
31
    /// Must be called before calling any other function on this object.
32
    /// If this method fails, no other function must be called on this object.
33
    nsresult Init(nsIURI* aURI);
34
  private:
35
0
    ~nsIconChannel() { }
36
    /// The channel to the temp icon file (e.g. to /tmp/2qy9wjqw.html).
37
    /// Will always be non-null after a successful Init.
38
    nsCOMPtr<nsIChannel> mRealChannel;
39
40
    nsresult InitWithGIO(nsIMozIconURI* aIconURI);
41
};
42
43
#endif // mozilla_image_decoders_icon_gtk_nsIconChannel_h