1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/base/nsLocation.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,63 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* vim: set ts=2 sw=2 et tw=80: */ 1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#ifndef nsLocation_h__ 1.11 +#define nsLocation_h__ 1.12 + 1.13 +#include "nsIDOMLocation.h" 1.14 +#include "nsString.h" 1.15 +#include "nsIWeakReferenceUtils.h" 1.16 +#include "nsWrapperCache.h" 1.17 +#include "nsCycleCollectionParticipant.h" 1.18 +#include "js/TypeDecls.h" 1.19 + 1.20 +class nsIURI; 1.21 +class nsIDocShell; 1.22 +class nsIDocShellLoadInfo; 1.23 + 1.24 +//***************************************************************************** 1.25 +// nsLocation: Script "location" object 1.26 +//***************************************************************************** 1.27 + 1.28 +class nsLocation : public nsIDOMLocation 1.29 + , public nsWrapperCache 1.30 +{ 1.31 +public: 1.32 + nsLocation(nsIDocShell *aDocShell); 1.33 + virtual ~nsLocation(); 1.34 + 1.35 + NS_DECL_CYCLE_COLLECTING_ISUPPORTS 1.36 + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsLocation) 1.37 + 1.38 + void SetDocShell(nsIDocShell *aDocShell); 1.39 + nsIDocShell *GetDocShell(); 1.40 + 1.41 + // nsIDOMLocation 1.42 + NS_DECL_NSIDOMLOCATION 1.43 + 1.44 +protected: 1.45 + // In the case of jar: uris, we sometimes want the place the jar was 1.46 + // fetched from as the URI instead of the jar: uri itself. Pass in 1.47 + // true for aGetInnermostURI when that's the case. 1.48 + nsresult GetURI(nsIURI** aURL, bool aGetInnermostURI = false); 1.49 + nsresult GetWritableURI(nsIURI** aURL); 1.50 + nsresult SetURI(nsIURI* aURL, bool aReplace = false); 1.51 + nsresult SetHrefWithBase(const nsAString& aHref, nsIURI* aBase, 1.52 + bool aReplace); 1.53 + nsresult SetHrefWithContext(JSContext* cx, const nsAString& aHref, 1.54 + bool aReplace); 1.55 + 1.56 + nsresult GetSourceBaseURL(JSContext* cx, nsIURI** sourceURL); 1.57 + nsresult CheckURL(nsIURI *url, nsIDocShellLoadInfo** aLoadInfo); 1.58 + bool CallerSubsumes(); 1.59 + 1.60 + nsString mCachedHash; 1.61 + nsWeakPtr mDocShell; 1.62 + nsWeakPtr mOuter; 1.63 +}; 1.64 + 1.65 +#endif // nsLocation_h__ 1.66 +