Changeset 163698 in webkit
- Timestamp:
- Feb 8, 2014 12:25:22 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r163696 r163698 1 2014-02-08 Adrian Perez de Castro <aperez@igalia.com> 2 3 [GTK] Make process model names properly meaningful 4 https://bugs.webkit.org/show_bug.cgi?id=128389 5 6 Reviewed by Carlos Garcia Campos. 7 8 The name WEBKIT_PROCESS_MODEL_ONE_SECONDARY_PROCESS_PER_WEB_VIEW 9 is misleading because there are situations in which web views may 10 share the same web process even when multi-process mode is enabled; 11 for example when opening a related view and both interact using JS. 12 13 * UIProcess/API/gtk/WebKitWebContext.cpp: 14 (webkit_web_context_set_process_model): 15 (webkit_web_context_get_process_model): 16 Update names of WebKitProcessModel enum values. 17 * UIProcess/API/gtk/WebKitWebContext.h: 18 Ditto. 19 1 20 2014-02-08 Piotr Grad <p.grad@samsung.com> 2 21 -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp
r163433 r163698 164 164 static guint signals[LAST_SIGNAL] = { 0, }; 165 165 166 COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS, ProcessModelSharedSecondaryProcess);167 COMPILE_ASSERT_MATCHING_ENUM(WEBKIT_PROCESS_MODEL_ONE_SECONDARY_PROCESS_PER_WEB_VIEW, ProcessModelMultipleSecondaryProcesses);168 169 166 WEBKIT_DEFINE_TYPE(WebKitWebContext, webkit_web_context, G_TYPE_OBJECT) 170 167 … … 899 896 * (%WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS) is suitable for most 900 897 * applications which embed a small amount of WebViews, or are used to 901 * display documents which are considered safe -- like local files. 902 * 903 * Applications which may potentially use a large amount of WebViews --for 904 * example a multi-tabbed web browser-- may want to use 905 * %WEBKIT_PROCESS_MODEL_ONE_SECONDARY_PROCESS_PER_WEB_VIEW to use one 906 * process per view. Using this model, when a WebView hangs or crashes, 907 * the rest of the WebViews in the application will still work normally. 908 * 909 * This method <strong>must be called before any other functions</strong>, 898 * display documents which are considered safe — like local files. 899 * 900 * Applications which may potentially use a large amount of WebViews 901 * —for example a multi-tabbed web browser— may want to use 902 * %WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES, which will use 903 * one process per view most of the time, while still allowing for web 904 * views to share a process when needed (for example when different 905 * views interact with each other). Using this model, when a process 906 * hangs or crashes, only the WebViews using it stop working, while 907 * the rest of the WebViews in the application will still function 908 * normally. 909 * 910 * This method **must be called before any other functions**, 910 911 * as early as possible in your application. Calling it later will make 911 912 * your application crash. … … 917 918 g_return_if_fail(WEBKIT_IS_WEB_CONTEXT(context)); 918 919 919 if (processModel != context->priv->context->processModel()) { 920 context->priv->context->setUsesNetworkProcess(processModel == ProcessModelMultipleSecondaryProcesses); 921 context->priv->context->setProcessModel(static_cast<ProcessModel>(processModel)); 920 ProcessModel newProcessModel; 921 922 switch (processModel) { 923 case WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS: 924 newProcessModel = ProcessModelSharedSecondaryProcess; 925 break; 926 case WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES: 927 newProcessModel = ProcessModelMultipleSecondaryProcesses; 928 break; 929 default: 930 g_assert_not_reached(); 922 931 } 932 933 if (newProcessModel == context->priv->context->processModel()) 934 return; 935 936 context->priv->context->setUsesNetworkProcess(newProcessModel == ProcessModelMultipleSecondaryProcesses); 937 context->priv->context->setProcessModel(newProcessModel); 923 938 } 924 939 … … 937 952 { 938 953 g_return_val_if_fail(WEBKIT_IS_WEB_CONTEXT(context), WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS); 939 return static_cast<WebKitProcessModel>(context->priv->context->processModel()); 954 955 switch (context->priv->context->processModel()) { 956 case ProcessModelSharedSecondaryProcess: 957 return WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS; 958 case ProcessModelMultipleSecondaryProcesses: 959 return WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES; 960 default: 961 g_assert_not_reached(); 962 } 940 963 } 941 964 -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h
r162928 r163698 70 70 * hangs or crashes all the web views in the application will be affected. 71 71 * This is the default process model, and it should suffice for most cases. 72 * @WEBKIT_PROCESS_MODEL_ONE_SECONDARY_PROCESS_PER_WEB_VIEW: Use one process 73 * for each #WebKitWebView. The main advantage of this process model is that 74 * the rendering process for a web view can crash while the rest of the 75 * views keep working normally. This process model is indicated for 76 * applications which may use a number of web views and the content of 77 * in each must not interfere with the rest -- for example a full-fledged 78 * web browser with support for multiple tabs. 72 * @WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES: Use one process 73 * for each #WebKitWebView, while still allowing for some of them to 74 * share a process in certain situations. The main advantage 75 * of this process model is that the rendering process for a web view 76 * can crash while the rest of the views keep working normally. This 77 * process model is indicated for applications which may use a number 78 * of web views and the content of in each must not interfere with the 79 * rest — for example a full-fledged web browser with support for 80 * multiple tabs. 79 81 * 80 82 * Enum values used for determining the #WebKitWebContext process model. … … 84 86 typedef enum { 85 87 WEBKIT_PROCESS_MODEL_SHARED_SECONDARY_PROCESS, 86 WEBKIT_PROCESS_MODEL_ ONE_SECONDARY_PROCESS_PER_WEB_VIEW,88 WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES, 87 89 } WebKitProcessModel; 88 90 -
trunk/Tools/ChangeLog
r163697 r163698 1 2014-02-08 Adrian Perez de Castro <aperez@igalia.com> 2 3 [GTK] Make process model names properly meaningful 4 https://bugs.webkit.org/show_bug.cgi?id=128389 5 6 Reviewed by Carlos Garcia Campos. 7 8 The name WEBKIT_PROCESS_MODEL_ONE_SECONDARY_PROCESS_PER_WEB_VIEW 9 is misleading because there are situations in which web views may 10 share the same web process even when multi-process mode is enabled; 11 for example when opening a related view and both interact using JS. 12 13 * MiniBrowser/gtk/main.c: 14 (main): 15 Update usage of WebKitProcessModel enum values. 16 * TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp: 17 (beforeAll): 18 Ditto. 19 1 20 2014-02-08 Diego Pino Garcia <dpino@igalia.com> 2 21 -
trunk/Tools/MiniBrowser/gtk/main.c
r162928 r163698 245 245 if (multiprocess && *multiprocess) { 246 246 webkit_web_context_set_process_model(webkit_web_context_get_default(), 247 WEBKIT_PROCESS_MODEL_ ONE_SECONDARY_PROCESS_PER_WEB_VIEW);247 WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES); 248 248 } 249 249 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp
r162928 r163698 123 123 124 124 webkit_web_context_set_process_model(webkit_web_context_get_default(), 125 WEBKIT_PROCESS_MODEL_ ONE_SECONDARY_PROCESS_PER_WEB_VIEW);125 WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES); 126 126 127 127 // Check that the getter returns the newly-set value 128 128 g_assert_cmpuint(webkit_web_context_get_process_model(webkit_web_context_get_default()), 129 ==, WEBKIT_PROCESS_MODEL_ ONE_SECONDARY_PROCESS_PER_WEB_VIEW);129 ==, WEBKIT_PROCESS_MODEL_MULTIPLE_SECONDARY_PROCESSES); 130 130 131 131 bus = new WebKitTestBus();
Note: See TracChangeset
for help on using the changeset viewer.