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/. */
10 #include "nsIDOMLocation.h"
12 #include "nsWeakReference.h"
13 #include "nsWrapperCache.h"
14 #include "nsCycleCollectionParticipant.h"
20 class nsIDocShellLoadInfo
;
22 //*****************************************************************************
23 // nsLocation: Script "location" object
24 //*****************************************************************************
26 class nsLocation
: public nsIDOMLocation
27 , public nsWrapperCache
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();
40 NS_DECL_NSIDOMLOCATION
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
,
51 nsresult
SetHrefWithContext(JSContext
* cx
, const nsAString
& aHref
,
54 nsresult
GetSourceBaseURL(JSContext
* cx
, nsIURI
** sourceURL
);
55 nsresult
CheckURL(nsIURI
*url
, nsIDocShellLoadInfo
** aLoadInfo
);
56 bool CallerSubsumes();
63 #endif // nsLocation_h__