[M108 Migration] Add back MaybeCheckCSP() method which was removed in upstream 97/287597/4
authorv-saha <v.saha@samsung.com>
Wed, 1 Feb 2023 06:04:24 +0000 (11:34 +0530)
committerBot Blink <blinkbot@samsung.com>
Thu, 2 Feb 2023 02:17:21 +0000 (02:17 +0000)
commitc8cd7f2ced975811ad6841ac09114ac07082a7d1
tree33e761a9b444e0e372f722de35be1c737e89e417
parent08c11ef5ab26f9aeb7d6ec407235dd9ddd46e786
[M108 Migration] Add back MaybeCheckCSP() method which was removed in upstream

In M63, MaybeCheckCSP() method was used to decide navigation policy
by checking CSP rules. After M63, the method was removed in upstream
patches [1] & [2] which caused the navigation policy to be decided
by ContentRendererClient. For WebApps, it is routed to WRTRenderClient.
In WRT, the navigation policy is decided but also requests app_control
to the refused URL to support backward compatibility which can't be
avoided, thus resulting in unexpected launch of VD Browser.

[1] https://chromium-review.googlesource.com/c/chromium/src/+/1037804
[2] https://chromium-review.googlesource.com/c/chromium/src/+/1083825

This patch adds back MaybeCheckCSP() to decide the policy at blink side
itself, so that the request doesn't reach WRT.

References:
https://review.tizen.org/gerrit/279285

Change-Id: I32ee8fe2f1d833aa945fa1ab9b5e86b7a179f372
Signed-off-by: v-saha <v.saha@samsung.com>
third_party/blink/public/web/web_navigation_policy.h
third_party/blink/renderer/core/dom/document.cc
third_party/blink/renderer/core/dom/document.h
third_party/blink/renderer/core/frame/csp/content_security_policy.cc
third_party/blink/renderer/core/frame/csp/content_security_policy.h
third_party/blink/renderer/core/loader/frame_loader.cc
third_party/blink/renderer/core/loader/navigation_policy.cc
third_party/blink/renderer/core/loader/navigation_policy.h