Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef nsAutoConfig_h
7 #define nsAutoConfig_h
9 #include "nsIAutoConfig.h"
10 #include "nsITimer.h"
11 #include "nsIFile.h"
12 #include "nsIObserver.h"
13 #include "nsNetUtil.h"
14 #include "nsIPrefService.h"
15 #include "nsIPrefBranch.h"
16 #include "nsWeakReference.h"
18 class nsAutoConfig : public nsIAutoConfig,
19 public nsITimerCallback,
20 public nsIStreamListener,
21 public nsIObserver,
22 public nsSupportsWeakReference
24 {
25 public:
27 NS_DECL_THREADSAFE_ISUPPORTS
28 NS_DECL_NSIAUTOCONFIG
29 NS_DECL_NSIREQUESTOBSERVER
30 NS_DECL_NSISTREAMLISTENER
31 NS_DECL_NSIOBSERVER
32 NS_DECL_NSITIMERCALLBACK
34 nsAutoConfig();
35 virtual ~nsAutoConfig();
36 nsresult Init();
38 protected:
40 nsresult downloadAutoConfig();
41 nsresult readOfflineFile();
42 nsresult evaluateLocalFile(nsIFile *file);
43 nsresult writeFailoverFile();
44 nsresult getEmailAddr(nsACString & emailAddr);
45 nsresult PromptForEMailAddress(nsACString &emailAddress);
46 nsCString mBuf;
47 nsCOMPtr<nsIPrefBranch> mPrefBranch;
48 bool mLoaded;
49 nsCOMPtr<nsITimer> mTimer;
50 nsCString mConfigURL;
51 };
53 #endif