#include "third_party/blink/renderer/modules/service_worker/wait_until_observer.h"
#include "third_party/blink/public/mojom/service_worker/service_worker_event_status.mojom-blink.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/renderer/bindings/core/v8/script_function.h"
#include "third_party/blink/renderer/bindings/core/v8/script_promise.h"
#include "third_party/blink/renderer/bindings/core/v8/script_value.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"
#include "third_party/blink/renderer/core/execution_context/agent.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/modules/service_worker/service_worker_global_scope.h"
#include "third_party/blink/renderer/platform/scheduler/public/event_loop.h"
#include "third_party/blink/renderer/platform/scheduler/public/thread.h"
#include "third_party/blink/renderer/platform/web_test_support.h"
#include "v8/include/v8.h"
namespace blink {
namespace {
const unsigned kWindowInteractionTimeout = …;
const unsigned kWindowInteractionTimeoutForTest = …;
base::TimeDelta WindowInteractionTimeout() { … }
}
class WaitUntilObserver::ThenFunction final : public ScriptFunction::Callable { … };
void WaitUntilObserver::WillDispatchEvent() { … }
void WaitUntilObserver::DidDispatchEvent(bool event_dispatch_failed) { … }
bool WaitUntilObserver::WaitUntil(ScriptState* script_state,
ScriptPromiseUntyped script_promise,
ExceptionState& exception_state,
PromiseSettledCallback on_promise_fulfilled,
PromiseSettledCallback on_promise_rejected) { … }
bool WaitUntilObserver::IsEventActive() const { … }
bool WaitUntilObserver::IsDispatchingEvent() const { … }
WaitUntilObserver::WaitUntilObserver(ExecutionContext* context,
EventType type,
int event_id)
: … { … }
void WaitUntilObserver::OnPromiseFulfilled() { … }
void WaitUntilObserver::OnPromiseRejected() { … }
void WaitUntilObserver::IncrementPendingPromiseCount() { … }
void WaitUntilObserver::DecrementPendingPromiseCount() { … }
void WaitUntilObserver::MaybeCompleteEvent() { … }
void WaitUntilObserver::ConsumeWindowInteraction(TimerBase*) { … }
void WaitUntilObserver::Trace(Visitor* visitor) const { … }
}