- use = default when relevant - use = delete on public method instead of unimplemented private - use range-based loop This matches the clang-tidy rules: - https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-equals-default.html - https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-equals-delete.html - https://clang.llvm.org/extra/clang-tidy/checks/modernize/loop-convert.html That we already use on source files Differential Revision: https://phabricator.services.mozilla.com/D296618
49 lines
1.6 KiB
C++
49 lines
1.6 KiB
C++
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#ifndef MOZILLA_IDENTITYCREDENTIALREQUESTMANAGER_H_
|
|
#define MOZILLA_IDENTITYCREDENTIALREQUESTMANAGER_H_
|
|
|
|
#include "mozilla/dom/IdentityCredentialBinding.h"
|
|
#include "mozilla/dom/WebIdentityParent.h"
|
|
#include "nsISupports.h"
|
|
#include "nsIURI.h"
|
|
|
|
namespace mozilla {
|
|
|
|
class IdentityCredentialRequestManager final : nsISupports {
|
|
public:
|
|
NS_DECL_ISUPPORTS
|
|
|
|
static IdentityCredentialRequestManager* GetInstance();
|
|
|
|
IdentityCredentialRequestManager(IdentityCredentialRequestManager& other) =
|
|
delete;
|
|
void operator=(const IdentityCredentialRequestManager&) = delete;
|
|
|
|
RefPtr<MozPromise<std::tuple<nsCString, Maybe<nsCString>>, nsresult, true>>
|
|
GetTokenFromPopup(dom::WebIdentityParent* aRelyingPartyWindow,
|
|
nsIURI* aURLToOpen);
|
|
|
|
nsresult MaybeResolvePopup(dom::WebIdentityParent* aPopupWindow,
|
|
const nsCString& aToken,
|
|
const dom::IdentityResolveOptions& aOptions);
|
|
|
|
bool IsActivePopup(dom::WebIdentityParent* aPopupWindow);
|
|
|
|
private:
|
|
static StaticRefPtr<IdentityCredentialRequestManager> sSingleton;
|
|
IdentityCredentialRequestManager() = default;
|
|
~IdentityCredentialRequestManager() = default;
|
|
|
|
nsTHashMap<uint64_t,
|
|
RefPtr<MozPromise<std::tuple<nsCString, Maybe<nsCString>>,
|
|
nsresult, true>::Private>>
|
|
mPendingTokenRequests;
|
|
};
|
|
|
|
} // namespace mozilla
|
|
|
|
#endif /* MOZILLA_IDENTITYCREDENTIALSTORAGESERVICE_H_ */
|