uriloader/exthandler/ExternalHelperAppChild.h
author Gijs Kruitbosch <gijskruitbosch@gmail.com>
Thu, 13 Aug 2015 23:09:47 +0100
changeset 257792 404d17fdf3b2f4e136b3a0c3ca7c8dc6a450a267
parent 234933 ac4464790ec4896a5188fa50cfc69ae0ffeddc08
child 266353 91d4539e00cecb658604e021675a923c60ef3235
permissions -rw-r--r--
Bug 1192032 - followup followup because I accidentally committed extraneous stuff, rs=me

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_dom_ExternalHelperAppChild_h
#define mozilla_dom_ExternalHelperAppChild_h

#include "mozilla/dom/PExternalHelperAppChild.h"
#include "nsExternalHelperAppService.h"
#include "nsIStreamListener.h"

class nsIDivertableChannel;

namespace mozilla {
namespace dom {

class ExternalHelperAppChild : public PExternalHelperAppChild
                             , public nsIStreamListener
{
public:
    NS_DECL_ISUPPORTS
    NS_DECL_NSISTREAMLISTENER
    NS_DECL_NSIREQUESTOBSERVER

    ExternalHelperAppChild();

    // Give the listener a real nsExternalAppHandler to complete processing on
    // the child.
    void SetHandler(nsExternalAppHandler *handler) { mHandler = handler; }

    virtual bool RecvCancel(const nsresult& aStatus) override;
private:
    virtual ~ExternalHelperAppChild();
    nsresult DivertToParent(nsIDivertableChannel *divertable, nsIRequest *request);

    nsRefPtr<nsExternalAppHandler> mHandler;
    nsresult mStatus;
};

} // namespace dom
} // namespace mozilla

#endif // mozilla_dom_ExternalHelperAppChild_h