Sat, 03 Jan 2015 20:18:00 +0100
Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.
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 #include "TimeManager.h"
7 #include "mozilla/dom/Date.h"
8 #include "mozilla/dom/MozTimeManagerBinding.h"
9 #include "nsITimeService.h"
10 #include "nsServiceManagerUtils.h"
12 namespace mozilla {
13 namespace dom {
14 namespace time {
16 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TimeManager)
17 NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
18 NS_INTERFACE_MAP_ENTRY(nsISupports)
19 NS_INTERFACE_MAP_END
21 NS_IMPL_CYCLE_COLLECTING_ADDREF(TimeManager)
22 NS_IMPL_CYCLE_COLLECTING_RELEASE(TimeManager)
24 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_1(TimeManager, mWindow)
26 JSObject*
27 TimeManager::WrapObject(JSContext* aCx)
28 {
29 return MozTimeManagerBinding::Wrap(aCx, this);
30 }
32 void
33 TimeManager::Set(Date& aDate)
34 {
35 Set(aDate.TimeStamp());
36 }
38 void
39 TimeManager::Set(double aTime)
40 {
41 nsCOMPtr<nsITimeService> timeService = do_GetService(TIMESERVICE_CONTRACTID);
42 if (timeService) {
43 timeService->Set(aTime);
44 }
45 }
47 } // namespace time
48 } // namespace dom
49 } // namespace mozilla