• Istiaque Ahmed's avatar
    [Extensions] Fix couple of ProcessManager UaF issues · 43949bf7
    Istiaque Ahmed authored
    Worker can legitimately fail to start, this CL clears worker's
    PendingTasks when that happens.
    
    In addition to this, this CL makes ServiceWorkerTaskQueue
    factory dependent on ProcessManager factory as pending tasks
    can call out to ProcessManager
    (courtesy of https://crbug.com/1019161#c16) upon
    ServiceWorkerTaskQueue's destruction.
    
    This CL adds a test for this ensuring a worker's pending_tasks_
    is cleared when start worker failure is seen. The test rejects a
    service worker's install event to trigger the failure.
    
    Bug: 1019161
    Test: See bug description for repro steps
    Change-Id: I384ec0d2830f07fb3b50632ee806e77fd33b7dcb
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2103306
    Commit-Queue: Istiaque Ahmed <lazyboy@chromium.org>
    Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#751925}
    43949bf7
service_worker_task_queue.cc 22.9 KB