1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
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 #include "CookieNotification.h"
7 #include "mozilla/dom/BrowsingContext.h"
8 #include "nsICookieNotification.h"
10 namespace mozilla::net
{
13 CookieNotification::GetAction(nsICookieNotification::Action
* aResult
) {
19 CookieNotification::GetCookie(nsICookie
** aResult
) {
20 NS_ENSURE_ARG_POINTER(aResult
);
23 NS_IF_ADDREF(*aResult
);
28 NS_IMETHODIMP
CookieNotification::GetBaseDomain(nsACString
& aBaseDomain
) {
29 aBaseDomain
= mBaseDomain
;
35 CookieNotification::GetBatchDeletedCookies(nsIArray
** aResult
) {
36 NS_ENSURE_ARG_POINTER(aResult
);
37 NS_ENSURE_TRUE(mAction
== nsICookieNotification::COOKIES_BATCH_DELETED
,
38 NS_ERROR_NOT_AVAILABLE
);
40 *aResult
= mBatchDeletedCookies
;
41 NS_IF_ADDREF(*aResult
);
47 CookieNotification::GetBrowsingContextId(uint64_t* aResult
) {
48 *aResult
= mBrowsingContextId
;
53 CookieNotification::GetBrowsingContext(dom::BrowsingContext
** aResult
) {
54 *aResult
= dom::BrowsingContext::Get(mBrowsingContextId
).take();
58 NS_IMPL_ISUPPORTS(CookieNotification
, nsICookieNotification
)
60 } // namespace mozilla::net