#include "third_party/blink/renderer/modules/permissions/permissions.h"
#include <memory>
#include <utility>
#include "base/metrics/histogram_functions.h"
#include "base/time/time.h"
#include "third_party/blink/public/common/permissions/permission_utils.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise_resolver.h"
#include "third_party/blink/renderer/bindings/core/v8/script_value.h"
#include "third_party/blink/renderer/bindings/modules/v8/v8_permission_descriptor.h"
#include "third_party/blink/renderer/core/dom/dom_exception.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/execution_context/navigator_base.h"
#include "third_party/blink/renderer/core/frame/frame.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "third_party/blink/renderer/modules/permissions/permission_status.h"
#include "third_party/blink/renderer/modules/permissions/permission_utils.h"
#include "third_party/blink/renderer/platform/bindings/exception_code.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
#include "third_party/blink/renderer/platform/wtf/vector.h"
#include "third_party/blink/renderer/platform/wtf/wtf_size_t.h"
namespace blink {
PermissionDescriptorPtr;
PermissionName;
PermissionService;
const char Permissions::kSupplementName[] = …;
Permissions* Permissions::permissions(NavigatorBase& navigator) { … }
Permissions::Permissions(NavigatorBase& navigator)
: … { … }
ScriptPromise<PermissionStatus> Permissions::query(
ScriptState* script_state,
const ScriptValue& raw_permission,
ExceptionState& exception_state) { … }
ScriptPromise<PermissionStatus> Permissions::request(
ScriptState* script_state,
const ScriptValue& raw_permission,
ExceptionState& exception_state) { … }
ScriptPromise<PermissionStatus> Permissions::revoke(
ScriptState* script_state,
const ScriptValue& raw_permission,
ExceptionState& exception_state) { … }
ScriptPromise<IDLSequence<PermissionStatus>> Permissions::requestAll(
ScriptState* script_state,
const HeapVector<ScriptValue>& raw_permissions,
ExceptionState& exception_state) { … }
void Permissions::ContextDestroyed() { … }
void Permissions::Trace(Visitor* visitor) const { … }
PermissionService* Permissions::GetService(
ExecutionContext* execution_context) { … }
void Permissions::ServiceConnectionError() { … }
void Permissions::QueryTaskComplete(
ScriptPromiseResolver<PermissionStatus>* resolver,
mojom::blink::PermissionDescriptorPtr descriptor,
base::TimeTicks query_start_time,
mojom::blink::PermissionStatus result) { … }
void Permissions::TaskComplete(
ScriptPromiseResolver<PermissionStatus>* resolver,
mojom::blink::PermissionDescriptorPtr descriptor,
mojom::blink::PermissionStatus result) { … }
void Permissions::VerifyPermissionAndReturnStatus(
ScriptPromiseResolverBase* resolver,
mojom::blink::PermissionDescriptorPtr descriptor,
mojom::blink::PermissionStatus result) { … }
void Permissions::VerifyPermissionsAndReturnStatus(
ScriptPromiseResolverBase* resolver,
Vector<mojom::blink::PermissionDescriptorPtr> descriptors,
Vector<int> caller_index_to_internal_index,
int last_verified_permission_index,
bool is_bulk_request,
const Vector<mojom::blink::PermissionStatus>& results) { … }
void Permissions::PermissionVerificationComplete(
ScriptPromiseResolverBase* resolver,
Vector<mojom::blink::PermissionDescriptorPtr> descriptors,
Vector<int> caller_index_to_internal_index,
const Vector<mojom::blink::PermissionStatus>& results,
mojom::blink::PermissionDescriptorPtr verification_descriptor,
int internal_index_to_verify,
bool is_bulk_request,
mojom::blink::PermissionStatus verification_result) { … }
PermissionStatusListener* Permissions::GetOrCreatePermissionStatusListener(
mojom::blink::PermissionStatus status,
mojom::blink::PermissionDescriptorPtr descriptor) { … }
std::optional<PermissionType> Permissions::GetPermissionType(
const mojom::blink::PermissionDescriptor& descriptor) { … }
mojom::blink::PermissionDescriptorPtr
Permissions::CreatePermissionVerificationDescriptor(
PermissionType descriptor_type) { … }
}