diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /netwerk/base/CaptivePortalService.h | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'netwerk/base/CaptivePortalService.h')
-rw-r--r-- | netwerk/base/CaptivePortalService.h | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/netwerk/base/CaptivePortalService.h b/netwerk/base/CaptivePortalService.h new file mode 100644 index 000000000..dd15450dc --- /dev/null +++ b/netwerk/base/CaptivePortalService.h @@ -0,0 +1,70 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef CaptivePortalService_h_ +#define CaptivePortalService_h_ + +#include "nsICaptivePortalService.h" +#include "nsICaptivePortalDetector.h" +#include "nsIObserver.h" +#include "nsWeakReference.h" +#include "nsITimer.h" +#include "nsCOMArray.h" +#include "mozilla/TimeStamp.h" + +namespace mozilla { +namespace net { + +class CaptivePortalService + : public nsICaptivePortalService + , public nsIObserver + , public nsSupportsWeakReference + , public nsITimerCallback + , public nsICaptivePortalCallback +{ +public: + NS_DECL_ISUPPORTS + NS_DECL_NSICAPTIVEPORTALSERVICE + NS_DECL_NSIOBSERVER + NS_DECL_NSITIMERCALLBACK + NS_DECL_NSICAPTIVEPORTALCALLBACK + + CaptivePortalService(); + nsresult Initialize(); + nsresult Start(); + nsresult Stop(); + + // This method is only called in the content process, in order to mirror + // the captive portal state in the parent process. + void SetStateInChild(int32_t aState); +private: + virtual ~CaptivePortalService(); + nsresult PerformCheck(); + nsresult RearmTimer(); + + nsCOMPtr<nsICaptivePortalDetector> mCaptivePortalDetector; + int32_t mState; + + nsCOMPtr<nsITimer> mTimer; + bool mStarted; + bool mInitialized; + bool mRequestInProgress; + bool mEverBeenCaptive; + + uint32_t mDelay; + int32_t mSlackCount; + + uint32_t mMinInterval; + uint32_t mMaxInterval; + float mBackoffFactor; + + // This holds a timestamp when the last time when the captive portal check + // has changed state. + mozilla::TimeStamp mLastChecked; +}; + +} // namespace net +} // namespace mozilla + +#endif // CaptivePortalService_h_ |