uriloader/prefetch/OfflineCacheUpdateParent.h

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #ifndef nsOfflineCacheUpdateParent_h
     7 #define nsOfflineCacheUpdateParent_h
     9 #include "mozilla/docshell/POfflineCacheUpdateParent.h"
    10 #include "nsIOfflineCacheUpdate.h"
    12 #include "nsString.h"
    13 #include "nsILoadContext.h"
    15 namespace mozilla {
    17 namespace dom {
    18 class TabParent;
    19 }
    21 namespace ipc {
    22 class URIParams;
    23 } // namespace ipc
    25 namespace docshell {
    27 class OfflineCacheUpdateParent : public POfflineCacheUpdateParent
    28                                , public nsIOfflineCacheUpdateObserver
    29                                , public nsILoadContext
    30 {
    31     typedef mozilla::ipc::URIParams URIParams;
    33 public:
    34     NS_DECL_ISUPPORTS
    35     NS_DECL_NSIOFFLINECACHEUPDATEOBSERVER
    36     NS_DECL_NSILOADCONTEXT
    38     nsresult
    39     Schedule(const URIParams& manifestURI,
    40              const URIParams& documentURI,
    41              const bool& stickDocument);
    43     void
    44     StopSendingMessagesToChild()
    45     {
    46       mIPCClosed = true;
    47     }
    49     OfflineCacheUpdateParent(uint32_t aAppId, bool aIsInBrowser);
    50     ~OfflineCacheUpdateParent();
    52     virtual void ActorDestroy(ActorDestroyReason aWhy) MOZ_OVERRIDE;
    54 private:
    55     bool mIPCClosed;
    57     bool     mIsInBrowserElement;
    58     uint32_t mAppId;
    59 };
    61 } // namespace docshell
    62 } // namespace mozilla
    64 #endif

mercurial