uriloader/prefetch/OfflineCacheUpdateParent.h
author Masayuki Nakano <masayuki@d-toybox.com>
Sat, 29 Aug 2015 08:58:27 +0900
changeset 259923 83b87aa188ab9c744697b87eb0c47c8a13d5babc
parent 240465 60a2001adf9acc476ecb1ceb5652618c70e56f50
child 264428 86a7be21dfc8ef0a3c3080d58ef508732ce2d154
permissions -rw-r--r--
Bug 895274 part.10 Rename NS_KEY_UP to eKeyUp r=smaug

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* 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 nsOfflineCacheUpdateParent_h
#define nsOfflineCacheUpdateParent_h

#include "mozilla/docshell/POfflineCacheUpdateParent.h"
#include "nsIOfflineCacheUpdate.h"

#include "nsString.h"
#include "nsILoadContext.h"

namespace mozilla {

namespace ipc {
class URIParams;
} // namespace ipc

namespace docshell {

class OfflineCacheUpdateParent : public POfflineCacheUpdateParent
                               , public nsIOfflineCacheUpdateObserver
                               , public nsILoadContext
{
    typedef mozilla::ipc::URIParams URIParams;

public:
    NS_DECL_ISUPPORTS
    NS_DECL_NSIOFFLINECACHEUPDATEOBSERVER
    NS_DECL_NSILOADCONTEXT

    nsresult
    Schedule(const URIParams& manifestURI,
             const URIParams& documentURI,
             const bool& stickDocument);

    void
    StopSendingMessagesToChild()
    {
      mIPCClosed = true;
    }

    OfflineCacheUpdateParent(uint32_t aAppId, bool aIsInBrowser);

    virtual void ActorDestroy(ActorDestroyReason aWhy) override;

private:
    ~OfflineCacheUpdateParent();

    bool mIPCClosed;

    bool     mIsInBrowserElement;
    uint32_t mAppId;
};

} // namespace docshell
} // namespace mozilla

#endif