Line data Source code
1 : /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* vim:set ts=2 sw=2 sts=2 et cindent: */
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/. */
6 :
7 : #include "nsRedirectHistoryEntry.h"
8 : #include "nsCOMPtr.h"
9 : #include "nsIURI.h"
10 : #include "nsIPrincipal.h"
11 :
12 : namespace mozilla {
13 : namespace net {
14 :
15 0 : NS_IMPL_ISUPPORTS(nsRedirectHistoryEntry, nsIRedirectHistoryEntry)
16 :
17 0 : nsRedirectHistoryEntry::nsRedirectHistoryEntry(nsIPrincipal* aPrincipal,
18 : nsIURI* aReferrer,
19 0 : const nsACString& aRemoteAddress)
20 : : mPrincipal(aPrincipal)
21 : , mReferrer(aReferrer)
22 0 : , mRemoteAddress(aRemoteAddress)
23 : {
24 0 : }
25 :
26 0 : nsRedirectHistoryEntry::~nsRedirectHistoryEntry()
27 : {
28 0 : }
29 :
30 : NS_IMETHODIMP
31 0 : nsRedirectHistoryEntry::GetRemoteAddress(nsACString &result)
32 : {
33 0 : result = mRemoteAddress;
34 0 : return NS_OK;
35 : }
36 :
37 : NS_IMETHODIMP
38 0 : nsRedirectHistoryEntry::GetReferrerURI(nsIURI** referrer)
39 : {
40 0 : NS_IF_ADDREF(*referrer = mReferrer);
41 0 : return NS_OK;
42 : }
43 :
44 : NS_IMETHODIMP
45 0 : nsRedirectHistoryEntry::GetPrincipal(nsIPrincipal** principal)
46 : {
47 0 : NS_IF_ADDREF(*principal = mPrincipal);
48 0 : return NS_OK;
49 : }
50 :
51 : } // namespace net
52 : } // namespace mozilla
|