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 /* -*- 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 /*
7 * Base implementation for console messages.
8 */
10 #include "nsConsoleMessage.h"
11 #include "jsapi.h"
13 NS_IMPL_ISUPPORTS(nsConsoleMessage, nsIConsoleMessage)
15 nsConsoleMessage::nsConsoleMessage()
16 : mTimeStamp(0),
17 mMessage()
18 {
19 }
21 nsConsoleMessage::nsConsoleMessage(const char16_t *message)
22 {
23 mTimeStamp = JS_Now() / 1000;
24 mMessage.Assign(message);
25 }
27 NS_IMETHODIMP
28 nsConsoleMessage::GetMessageMoz(char16_t **result)
29 {
30 *result = ToNewUnicode(mMessage);
32 return NS_OK;
33 }
35 NS_IMETHODIMP
36 nsConsoleMessage::GetTimeStamp(int64_t *aTimeStamp)
37 {
38 *aTimeStamp = mTimeStamp;
39 return NS_OK;
40 }
42 NS_IMETHODIMP
43 nsConsoleMessage::ToString(nsACString& /*UTF8*/ aResult)
44 {
45 CopyUTF16toUTF8(mMessage, aResult);
47 return NS_OK;
48 }