Ewk_Settings are not preserved after domain change
authorGrzegorz Czajkowski <g.czajkowski@samsung.com>
Fri, 6 Nov 2015 12:04:53 +0000 (13:04 +0100)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 07:55:23 +0000 (07:55 +0000)
commit7945eecc379adfc824c90fc55e378bee64eccd71
treef7874cd34387e04f09a7ff6787065a61cbc9eda6
parentd3f33f16892acf85f1018d1f27054067429be79a
Ewk_Settings are not preserved after domain change

By default, Chromium creates a renderer process for each
instance of a site the user visits [1]. This result in
creating a new instance of |content::WebPreferences|.
Those preferences are mostly determined on command switches:

WebPreferences RenderViewHostImpl::ComputeWebkitPrefs() {
WebPreferences prefs;
prefs.web_security_enabled =
!command_line.HasSwitch(switches::kDisableWebSecurity);
...
GetContentClient()->browser()->OverrideWebkitPrefs(this, &prefs);
return prefs;
}
After that, newly determined |prefs| are sent to renderer.

The problem is that |Ewk_Settings| has own instance of
|content::WebPreferences| which client (through ewk_settings* API)
is able to change. Once renderer gets changed, RVHImpl calls
ComputeWebkitPrefs() not including client changes at all.
In consequence, settings are not sync between Browser and Renderer.

This patch ensures creation of Ewk_Settings during EWebView
initializaion. First call to ContentBrowserClientEfl::OverrideWebkitPrefs
allows using default WebPreferences values which are computed
based on command line switches. Successive, override RHVImpl's prefs
in favour of Ewk_Settings.

Since Ewk_Setings has own store for EFL specific prefs [2]
there is a need to handle them separately when renderer (RenderView)
is created. What's crucial there, is to send the message to proper
|RVH| which is passed via RenderViewCreated. Using |RVH| from
EWebView/WebContents at that time would result in sending message
to outgoing process.

[1] https://www.chromium.org/developers/design-documents/process-models
[2] http://165.213.202.130/gerrit/#/c/92971/

Bug: http://web.sec.samsung.net/bugzilla/show_bug.cgi?id=14661

Reviewed by: a1.gomes, d.waslicki, sns.park

Change-Id: I53f42080243ae6087c05435d586862c2022f7575
Signed-off-by: Grzegorz Czajkowski <g.czajkowski@samsung.com>
tizen_src/ewk/efl_integration/content_browser_client_efl.cc
tizen_src/ewk/efl_integration/eweb_view.cc
tizen_src/ewk/efl_integration/eweb_view.h
tizen_src/ewk/efl_integration/renderer/render_view_observer_efl.cc