Bug 105521 - [chromium] don't use WebString for WebPreferences
Summary: [chromium] don't use WebString for WebPreferences
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: jochen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-20 02:56 PST by jochen
Modified: 2012-12-21 07:02 PST (History)
6 users (show)

See Also:


Attachments
Patch (7.68 KB, patch)
2012-12-20 02:58 PST, jochen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jochen 2012-12-20 02:56:42 PST
[chromium] don't use WebString for WebPreferences
Comment 1 jochen 2012-12-20 02:58:03 PST
Created attachment 180311 [details]
Patch
Comment 2 WebKit Review Bot 2012-12-20 03:01:19 PST
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
Comment 3 Darin Fisher (:fishd, Google) 2012-12-20 13:31:21 PST
Comment on attachment 180311 [details]
Patch

Are you sure this is a good idea?  I think we should basically forbid using any code from svn.webkit.org in Chromium's browser process.  It is too easy to introduce dependencies on WebString.  How will you maintain the requirement that we not use WebString?

Can we solve the core issue some other way?
Comment 4 Darin Fisher (:fishd, Google) 2012-12-20 13:31:55 PST
(In reply to comment #3)
> (From update of attachment 180311 [details])
> Are you sure this is a good idea?  I think we should basically forbid using any code from svn.webkit.org in Chromium's browser process.

**code** != enums and POD types :)
Comment 5 jochen 2012-12-20 13:38:51 PST
(In reply to comment #3)
> (From update of attachment 180311 [details])
> Are you sure this is a good idea?  I think we should basically forbid using any code from svn.webkit.org in Chromium's browser process.  It is too easy to introduce dependencies on WebString.  How will you maintain the requirement that we not use WebString?

The reason this only breaks in single process mode is that in single process mode, we don't initialize WebKit in the browser process during early startup. Remember, there's in_process_webkit/...

As soon as somebody adds a WebString on a codepath before the WebKit initialization, chrome crashes in debug mode, so it's rather easy to catch :)

Anyway, this change turns WebPreferences into POD, so it would be safe to be used.

> 
> Can we solve the core issue some other way?

The core issue is that the browser process specifies the websettings before the renderer is started.

I could also copy the default settings to content/shell and add some DCHECK()s to the renderer that the default settings match the ones from WebPreferences.
Comment 6 Darin Fisher (:fishd, Google) 2012-12-20 13:45:31 PST
(In reply to comment #5)
> (In reply to comment #3)
> > (From update of attachment 180311 [details] [details])
> > Are you sure this is a good idea?  I think we should basically forbid using any code from svn.webkit.org in Chromium's browser process.  It is too easy to introduce dependencies on WebString.  How will you maintain the requirement that we not use WebString?
> 
> The reason this only breaks in single process mode is that in single process mode, we don't initialize WebKit in the browser process during early startup. Remember, there's in_process_webkit/...
> 
> As soon as somebody adds a WebString on a codepath before the WebKit initialization, chrome crashes in debug mode, so it's rather easy to catch :)
> 
> Anyway, this change turns WebPreferences into POD, so it would be safe to be used.

It's not really POD if it has std::string :)

My point is that this'll introduce land mines in WebKit, where you will have to magically know that WebString is forbidden.  That doesn't scale, and it creates more entropy / maintenance burden.


> > Can we solve the core issue some other way?
> 
> The core issue is that the browser process specifies the websettings before the renderer is started.
> 
> I could also copy the default settings to content/shell and add some DCHECK()s to the renderer that the default settings match the ones from WebPreferences.

How about if we just expose the default settings as constants / literals?