| Summary: | [GTK] Add API to set the maximum number of web processes per WebKitWebContext | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Carlos Garcia Campos <cgarcia> | ||||||
| Component: | WebKitGTK | Assignee: | Nobody <webkit-unassigned> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | agomez, gustavo, mcatanzaro, mrobinson, svillar | ||||||
| Priority: | P2 | Keywords: | Gtk | ||||||
| Version: | 528+ (Nightly build) | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Attachments: |
|
||||||||
|
Description
Carlos Garcia Campos
2015-07-20 06:13:01 PDT
Created attachment 257090 [details]
Patch
Comment on attachment 257090 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=257090&action=review > Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp:1208 > + * This method **must be called before any other functions**, > + * as early as possible in your application. Calling it later will make > + * your application crash. Woh, isn't there a way to prevent this crash at all? Can't we guard the contents of the method call somehow? The crash is good; it prevents programmers from screwing up and calling it too late. This isn't the only place we do that (I think for set process model, for example). (In reply to comment #3) > The crash is good; it prevents programmers from screwing up and calling it > too late. This isn't the only place we do that (I think for set process > model, for example). How about a warning or a GLib failure though? I guess "This method **must be called before any other functions**, as early as possible in your application. Calling it later will make your application crash." is not quite right; it implies you cannot use both webkit_web_context_set_process_model and this function, since the documentation is the same on both functions. Can you not use the function on a non-default WebKitWebContext? And of course you must call a function to get the WebKitWebContext in the first place. (In reply to comment #3) > The crash is good; it prevents programmers from screwing up and calling it > too late. This isn't the only place we do that (I think for set process > model, for example). Right, we (WebProcessPool actually) has some CRASH calls in setProcessModel and setMaximumNumberOfProcesses. We can prevent this by making process model and web process count limit construct-only properties, but that makes the API less convenient and doesn't allow to change them for the default context. (In reply to comment #5) > I guess > > "This method **must be called before any other functions**, as early as > possible in your application. Calling it later will make your application > crash." > > is not quite right; it implies you cannot use both > webkit_web_context_set_process_model and this function, since the > documentation is the same on both functions. Can you not use the function on > a non-default WebKitWebContext? And of course you must call a function to > get the WebKitWebContext in the first place. I agree the documentation is not accurate Created attachment 257257 [details]
Updated patch
Updated the docs
ping Comment on attachment 257257 [details]
Updated patch
I am not so sure about the word 'count', but I did not manage to come up with a suggestion either, so it looks good to me.
Committed r187543: <http://trac.webkit.org/changeset/187543> |