Bug 1845134 - Part 2: Import the new acorn-icons r=android-reviewers,007
[gecko.git] / netwerk / cookie / CookieNotification.cpp
blob43e7364a38b87f6a57c89c113f695ee32ceb07df
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 {
12 NS_IMETHODIMP
13 CookieNotification::GetAction(nsICookieNotification::Action* aResult) {
14 *aResult = mAction;
15 return NS_OK;
18 NS_IMETHODIMP
19 CookieNotification::GetCookie(nsICookie** aResult) {
20 NS_ENSURE_ARG_POINTER(aResult);
22 *aResult = mCookie;
23 NS_IF_ADDREF(*aResult);
25 return NS_OK;
28 NS_IMETHODIMP CookieNotification::GetBaseDomain(nsACString& aBaseDomain) {
29 aBaseDomain = mBaseDomain;
31 return NS_OK;
34 NS_IMETHODIMP
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);
43 return NS_OK;
46 NS_IMETHODIMP
47 CookieNotification::GetBrowsingContextId(uint64_t* aResult) {
48 *aResult = mBrowsingContextId;
49 return NS_OK;
52 NS_IMETHODIMP
53 CookieNotification::GetBrowsingContext(dom::BrowsingContext** aResult) {
54 *aResult = dom::BrowsingContext::Get(mBrowsingContextId).take();
55 return NS_OK;
58 NS_IMPL_ISUPPORTS(CookieNotification, nsICookieNotification)
60 } // namespace mozilla::net