/src/mozilla-central/docshell/base/nsRefreshTimer.cpp
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 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/. */ |
6 | | |
7 | | #include "nsRefreshTimer.h" |
8 | | |
9 | | #include "nsIURI.h" |
10 | | #include "nsIPrincipal.h" |
11 | | |
12 | | #include "nsDocShell.h" |
13 | | |
14 | | NS_IMPL_ADDREF(nsRefreshTimer) |
15 | | NS_IMPL_RELEASE(nsRefreshTimer) |
16 | | |
17 | 0 | NS_INTERFACE_MAP_BEGIN(nsRefreshTimer) |
18 | 0 | NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsITimerCallback) |
19 | 0 | NS_INTERFACE_MAP_ENTRY(nsITimerCallback) |
20 | 0 | NS_INTERFACE_MAP_ENTRY(nsINamed) |
21 | 0 | NS_INTERFACE_MAP_END |
22 | | |
23 | | nsRefreshTimer::nsRefreshTimer(nsDocShell* aDocShell, |
24 | | nsIURI* aURI, |
25 | | nsIPrincipal* aPrincipal, |
26 | | int32_t aDelay, bool aRepeat, bool aMetaRefresh) |
27 | | : mDocShell(aDocShell), mURI(aURI), mPrincipal(aPrincipal), |
28 | | mDelay(aDelay), mRepeat(aRepeat), |
29 | | mMetaRefresh(aMetaRefresh) |
30 | 0 | { |
31 | 0 | } |
32 | | |
33 | | nsRefreshTimer::~nsRefreshTimer() |
34 | 0 | { |
35 | 0 | } |
36 | | |
37 | | NS_IMETHODIMP |
38 | | nsRefreshTimer::Notify(nsITimer* aTimer) |
39 | 0 | { |
40 | 0 | NS_ASSERTION(mDocShell, "DocShell is somehow null"); |
41 | 0 |
|
42 | 0 | if (mDocShell && aTimer) { |
43 | 0 | // Get the delay count to determine load type |
44 | 0 | uint32_t delay = 0; |
45 | 0 | aTimer->GetDelay(&delay); |
46 | 0 | mDocShell->ForceRefreshURIFromTimer(mURI, mPrincipal, delay, mMetaRefresh, aTimer); |
47 | 0 | } |
48 | 0 | return NS_OK; |
49 | 0 | } |
50 | | |
51 | | NS_IMETHODIMP |
52 | | nsRefreshTimer::GetName(nsACString& aName) |
53 | 0 | { |
54 | 0 | aName.AssignLiteral("nsRefreshTimer"); |
55 | 0 | return NS_OK; |
56 | 0 | } |