blob: c768d7800c4a85fc73badac9db5f0708bd90c311 [file] [log] [blame]
Avi Drissman4e1b7bc32022-09-15 14:03:501// Copyright 2019 The Chromium Authors
Francois Dorayfd823bb12019-10-04 18:03:052// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5'use strict';
6
7self.onmessage = function(e) {
8 // Acquire the lock.
9 navigator.locks.request('worker_lock', {}, lock => {
10 // Lock was acquired and will be released at the end of this scope.
11 self.postMessage({rqid: e.data.rqid});
12 });
13};