Bug 147108

Summary: [GTK] Add API to set the maximum number of web processes per WebKitWebContext
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKitGTKAssignee: 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 Flags
Patch
none
Updated patch gustavo: review+

Carlos Garcia Campos
Reported 2015-07-20 06:13:01 PDT
This is useful for limited resources systems.
Attachments
Patch (6.60 KB, patch)
2015-07-20 06:16 PDT, Carlos Garcia Campos
no flags
Updated patch (7.03 KB, patch)
2015-07-22 02:46 PDT, Carlos Garcia Campos
gustavo: review+
Carlos Garcia Campos
Comment 1 2015-07-20 06:16:52 PDT
Martin Robinson
Comment 2 2015-07-20 08:08:34 PDT
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?
Michael Catanzaro
Comment 3 2015-07-20 08:12:39 PDT
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).
Martin Robinson
Comment 4 2015-07-20 08:24:12 PDT
(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?
Michael Catanzaro
Comment 5 2015-07-20 08:34:09 PDT
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.
Carlos Garcia Campos
Comment 6 2015-07-20 09:52:45 PDT
(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.
Carlos Garcia Campos
Comment 7 2015-07-20 09:53:05 PDT
(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
Carlos Garcia Campos
Comment 8 2015-07-22 02:46:20 PDT
Created attachment 257257 [details] Updated patch Updated the docs
Carlos Garcia Campos
Comment 9 2015-07-27 06:01:14 PDT
ping
Gustavo Noronha (kov)
Comment 10 2015-07-27 07:46:23 PDT
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.
Carlos Garcia Campos
Comment 11 2015-07-28 23:52:24 PDT
Note You need to log in before you can comment on or make changes to this bug.