Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef mozilla_dom_time_TimeManager_h
6 #define mozilla_dom_time_TimeManager_h
8 #include "mozilla/Attributes.h"
9 #include "nsISupports.h"
10 #include "nsPIDOMWindow.h"
11 #include "nsWrapperCache.h"
13 namespace mozilla {
14 namespace dom {
16 class Date;
18 namespace time {
20 class TimeManager MOZ_FINAL : public nsISupports
21 , public nsWrapperCache
22 {
23 public:
24 static bool PrefEnabled(JSContext* aCx, JSObject* aGlobal)
25 {
26 #ifdef MOZ_TIME_MANAGER
27 return true;
28 #else
29 return false;
30 #endif
31 }
33 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
34 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TimeManager)
36 explicit TimeManager(nsPIDOMWindow* aWindow)
37 : mWindow(aWindow)
38 {
39 SetIsDOMBinding();
40 }
42 nsPIDOMWindow* GetParentObject() const
43 {
44 return mWindow;
45 }
46 JSObject* WrapObject(JSContext* aCx);
48 void Set(Date& aDate);
49 void Set(double aTime);
51 private:
52 nsCOMPtr<nsPIDOMWindow> mWindow;
53 };
55 } // namespace time
56 } // namespace dom
57 } // namespace mozilla
59 #endif //mozilla_dom_time_TimeManager_h