webkitpy: Notify parent process when a worker is spawned
authorjbedard@apple.com <jbedard@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Sep 2017 18:58:57 +0000 (18:58 +0000)
committerjbedard@apple.com <jbedard@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 26 Sep 2017 18:58:57 +0000 (18:58 +0000)
commit40d7d0f25c37693fc52f84f665d06502dcd810ff
treecdaec4c7bacfe0707da39c0ecf9531a0f63b20bf
parent4c2d7377448a76842aa227b24bd0f5364818f9c5
webkitpy: Notify parent process when a worker is spawned
https://bugs.webkit.org/show_bug.cgi?id=177467
<rdar://problem/34660194>

Reviewed by Daniel Bates.

When we fork the parent process, there may be resources in that process
which workers will take ownership of. Notify ports when a new worker is created
so that these resources can be correctly managed.

* Scripts/webkitpy/common/message_pool.py:
(_MessagePool._start_workers): After all workers are started, notify the caller
that a worker has been created, unless we are running inline, in which case the
parent process is still the worker.
* Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py:
(LayoutTestRunner._handle_did_spawn_worker): Notify the port that a worker process
has been created.
* Scripts/webkitpy/port/base.py:
(Port.did_spawn_worker): Add function so that ports may manage any
resources created on the parent process but managed by the provided worker.
* Scripts/webkitpy/port/device.py:
(Device.release_worker_resources): Call release_worker_resources on the
platform_device if such a function is defined.
* Scripts/webkitpy/port/ios.py:
(IOSPort.did_spawn_worker): Release any worker resources on the iOS
device object associated with the spawned worker.
* Scripts/webkitpy/test/runner.py:
(Runner.handle): Ignore the did_spawn_worker message during testing.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222510 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tools/ChangeLog
Tools/Scripts/webkitpy/common/message_pool.py
Tools/Scripts/webkitpy/layout_tests/controllers/layout_test_runner.py
Tools/Scripts/webkitpy/port/base.py
Tools/Scripts/webkitpy/port/device.py
Tools/Scripts/webkitpy/port/ios.py
Tools/Scripts/webkitpy/test/runner.py