commit | 7031e8b8346db6c33a2f6a592fd7f6eaeec82e3a | [log] [tgz] |
---|---|---|
author | Matt Falkenhagen <falken@chromium.org> | Tue Feb 20 03:30:33 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Tue Feb 20 03:30:33 2018 |
tree | 89780c936c9a73d90bb0133137ce985f4ddc5d64 | |
parent | 06bafdfb50ee7ede3709742290c256e60ad50bdb [diff] |
service worker: Skip service worker for all Pepper plugins. Back in issue 413094, we decided to skip service worker for fetches from Pepper plugins with "private permission" for security purposes. The motivation was that Pepper plugins without "private permission" could be assumed to enfore the same-origin policy. However, the spec has since mandated skipping service workers for the request for the plugin itself, i.e., the target URL of an EMBED or OBJECT element. This patch makes two changes: 1) Requests *for* the target URL of EMBED or OBJECT element that load a Pepper plugin skip service workers. This aligns with recent patches to skip all EMBED or OBJECT element requests: r537245 skipped them for embedded HTML content, and r537386 skipped them for MIME handler plugins. The code change is in ppb_nacl_private_impl.cc::CreateWebURLRequest. This stops the requests for the manifest and pexe from being intercepted by the service worker. 2) Requests *from* any Pepper plugin skip service workers. Previously, we only skipped if the plugin had private permission, now we skip regardless of permission. The code change is in url_request_info_util.cc::CreateWebURLRequest. One thing I'm not so sure about is PepperPluginInstanceImpl::Navigate which apparently does a navigation in a frame. This is also changed to to skip service workers (by changing the utility function CreateWebURLRequest), but it's unclear whether that's needed. You might ask why we don't change the service worker interception code to just skip plugins, instead of changing the plugin callsites. This is because at the SW interception site, we don't know whether the request came from a plugin or not: for the manifest request, the RequestContextType is "INTERNAL", and the ResourceType is "SUBRESOURCE". It's also worth nothing that NetworkService/S13nServiceWorker already skip the service worker for all these requests, since we don't hook in at the URLRequestJob level anymore. In NS/S13nSW, we likely won't need to set skip service worker at these callsites. R=kinuko TBR=bradnelson Bug: 771933,413094 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo Change-Id: I09db0eda46f2e7d9372495a6205f5cb0026de6c7 Reviewed-on: https://chromium-review.googlesource.com/923663 Commit-Queue: Matt Falkenhagen <falken@chromium.org> Reviewed-by: Kinuko Yasuda <kinuko@chromium.org> Reviewed-by: Tsuyoshi Horo <horo@chromium.org> Reviewed-by: Raymes Khoury <raymes@chromium.org> Cr-Commit-Position: refs/heads/master@{#537706}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .