image/decoders/icon/android/nsIconChannel.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/image/decoders/icon/android/nsIconChannel.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,44 @@
     1.4 +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef nsIconChannel_h_
    1.10 +#define nsIconChannel_h_
    1.11 +
    1.12 +#include "mozilla/Attributes.h"
    1.13 +
    1.14 +#include "nsIChannel.h"
    1.15 +#include "nsIURI.h"
    1.16 +#include "nsIIconURI.h"
    1.17 +#include "nsCOMPtr.h"
    1.18 +
    1.19 +/**
    1.20 + * This class is the Android implementation of nsIconChannel.
    1.21 + * It asks Android for an icon, and creates a new channel for
    1.22 + * that file to which all calls will be proxied.
    1.23 + */
    1.24 +class nsIconChannel MOZ_FINAL : public nsIChannel {
    1.25 +  public:
    1.26 +    NS_DECL_ISUPPORTS
    1.27 +    NS_FORWARD_NSIREQUEST(mRealChannel->)
    1.28 +    NS_FORWARD_NSICHANNEL(mRealChannel->)
    1.29 +
    1.30 +    nsIconChannel() {}
    1.31 +    ~nsIconChannel() {}
    1.32 +
    1.33 +    /**
    1.34 +     * Called by nsIconProtocolHandler after it creates this channel.
    1.35 +     * Must be called before calling any other function on this object.
    1.36 +     * If this method fails, no other function must be called on this object.
    1.37 +     */
    1.38 +    NS_HIDDEN_(nsresult) Init(nsIURI* aURI);
    1.39 +  private:
    1.40 +    /**
    1.41 +     * The channel to the temp icon file (e.g. to /tmp/2qy9wjqw.html).
    1.42 +     * Will always be non-null after a successful Init.
    1.43 +     */
    1.44 +    nsCOMPtr<nsIChannel> mRealChannel;
    1.45 +};
    1.46 +
    1.47 +#endif

mercurial