angler-fishThe Vulnerability History Project

Begin to enable extension APIs in Extension Service Worker.

      This CL adds &quottabs&quot API support in extension SW and adds an end-to-end
test for it.
This CL also puts the feature behind a runtime flag which is disabled for non trunk builds by default.

Some known issues:
1) Lifetime improvement of UIThreadWorkerResponseCallbackWrapper is missing.
I am currently cleaning up on RPH shutdown, but this is not idea, we should
be cleaning up on worker thread shutdown.

2) IPC send<->receive from/to Worker Thread can be made better, see
comment above WorkerThreadDispatcher in patch set #1.

3) Currently if an extension is not &quotactive&quot in a process, then API calls
from that process is not classified correctly. I'm using
&quotextension_service_worker&quot context, which allows running tabs API. In
theory since a worker cannot be spawned from outside of the extension
process (TODO: Verify this), we can <fingers_crossed>safely</fingers_crossed>
classify this as a blessed context.

BUG=602442
Test=Register an extension with &quottabs&quot permission, register a service
worker from the extension and call chrome.tabs.create() from SW code!
Expect it to work

Review-Url: https://codereview.chromium.org/1880933002
Cr-Commit-Position: refs/heads/master@{#395494}
    
commit ee4adef0b70f13cb80a886ef639fc910c0b5ce6f
-6
+7 -5
-23
-10
-1
+1 -1
-5
-1
+8 -12
-2
-5
-1
-30
-17
-5
-2
-5
-4
-2
+2 -3
-3
+35 -174
+1 -21
-48
-50
+1 -2
-27
-4
-7
-5
+1 -2
-8
-7
+13 -62
+7 -13
+1 -5
+1 -19
+1 -13
+3 -13
+1 -5
-21
-40
-33
-33
-105
-64
-1
+1 -12
-1
expand_less