Bug 891986 - Keep the source ArrayBuffer to a decodeAudioData call alive until the...
[gecko.git] / dom / base / nsLocation.h
blob41bf0edb0f9d2c9dfea24293ddcc4cdec861a98f
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=2 sw=2 et tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef nsLocation_h__
8 #define nsLocation_h__
10 #include "nsIDOMLocation.h"
11 #include "nsString.h"
12 #include "nsWeakReference.h"
13 #include "nsWrapperCache.h"
14 #include "nsCycleCollectionParticipant.h"
16 class nsIURI;
17 class nsIDocShell;
18 struct JSContext;
19 class nsIDocument;
20 class nsIDocShellLoadInfo;
22 //*****************************************************************************
23 // nsLocation: Script "location" object
24 //*****************************************************************************
26 class nsLocation : public nsIDOMLocation
27 , public nsWrapperCache
29 public:
30 nsLocation(nsIDocShell *aDocShell);
31 virtual ~nsLocation();
33 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
34 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsLocation)
36 void SetDocShell(nsIDocShell *aDocShell);
37 nsIDocShell *GetDocShell();
39 // nsIDOMLocation
40 NS_DECL_NSIDOMLOCATION
42 protected:
43 // In the case of jar: uris, we sometimes want the place the jar was
44 // fetched from as the URI instead of the jar: uri itself. Pass in
45 // true for aGetInnermostURI when that's the case.
46 nsresult GetURI(nsIURI** aURL, bool aGetInnermostURI = false);
47 nsresult GetWritableURI(nsIURI** aURL);
48 nsresult SetURI(nsIURI* aURL, bool aReplace = false);
49 nsresult SetHrefWithBase(const nsAString& aHref, nsIURI* aBase,
50 bool aReplace);
51 nsresult SetHrefWithContext(JSContext* cx, const nsAString& aHref,
52 bool aReplace);
54 nsresult GetSourceBaseURL(JSContext* cx, nsIURI** sourceURL);
55 nsresult CheckURL(nsIURI *url, nsIDocShellLoadInfo** aLoadInfo);
56 bool CallerSubsumes();
58 nsString mCachedHash;
59 nsWeakPtr mDocShell;
60 nsWeakPtr mOuter;
63 #endif // nsLocation_h__