Changeset 187543 in webkit
- Timestamp:
- Jul 28, 2015, 11:50:50 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
Source/WebKit2/ChangeLog (modified) (1 diff)
-
Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp (modified) (2 diffs)
-
Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h (modified) (1 diff)
-
Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt (modified) (1 diff)
-
Tools/ChangeLog (modified) (1 diff)
-
Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r187542 r187543 1 2015-07-28 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Add API to set the maximum number of web processes per WebKitWebContext 4 https://bugs.webkit.org/show_bug.cgi?id=147108 5 6 Reviewed by Gustavo Noronha Silva. 7 8 * UIProcess/API/gtk/WebKitWebContext.cpp: 9 (webkit_web_context_set_web_process_count_limit): 10 (webkit_web_context_get_web_process_count_limit): 11 * UIProcess/API/gtk/WebKitWebContext.h: 12 * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: 13 1 14 2015-07-28 Carlos Garcia Campos <cgarcia@igalia.com> 2 15 -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.cpp
r186861 r187543 1159 1159 * normally. 1160 1160 * 1161 * This method **must be called before any other functions**,1161 * This method **must be called before any web process has been created**, 1162 1162 * as early as possible in your application. Calling it later will make 1163 1163 * your application crash. … … 1194 1194 1195 1195 return toWebKitProcessModel(context->priv->context->processModel()); 1196 } 1197 1198 /** 1199 * webkit_web_context_set_web_process_count_limit: 1200 * @context: the #WebKitWebContext 1201 * @limit: the maximum number of web processes 1202 * 1203 * Sets the maximum number of web processes that can be created at the same time for the @context. 1204 * The default value is 0 and means no limit. 1205 * 1206 * This method **must be called before any web process has been created**, 1207 * as early as possible in your application. Calling it later will make 1208 * your application crash. 1209 * 1210 * Since: 2.10 1211 */ 1212 void webkit_web_context_set_web_process_count_limit(WebKitWebContext* context, guint limit) 1213 { 1214 g_return_if_fail(WEBKIT_IS_WEB_CONTEXT(context)); 1215 1216 if (limit == context->priv->context->configuration().maximumProcessCount()) 1217 return; 1218 1219 context->priv->context->setMaximumNumberOfProcesses(limit); 1220 } 1221 1222 /** 1223 * webkit_web_context_get_web_process_count_limit: 1224 * @context: the #WebKitWebContext 1225 * 1226 * Gets the maximum number of web processes that can be created at the same time for the @context. 1227 * 1228 * Returns: the maximum limit of web processes, or 0 if there isn't a limit. 1229 * 1230 * Since: 2.10 1231 */ 1232 guint webkit_web_context_get_web_process_count_limit(WebKitWebContext* context) 1233 { 1234 g_return_val_if_fail(WEBKIT_IS_WEB_CONTEXT(context), 0); 1235 1236 return context->priv->context->configuration().maximumProcessCount(); 1196 1237 } 1197 1238 -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebContext.h
r185950 r187543 163 163 164 164 WEBKIT_API void 165 webkit_web_context_set_web_process_count_limit (WebKitWebContext *context, 166 guint limit); 167 168 WEBKIT_API guint 169 webkit_web_context_get_web_process_count_limit (WebKitWebContext *context); 170 171 WEBKIT_API void 165 172 webkit_web_context_clear_cache (WebKitWebContext *context); 166 173 -
trunk/Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt
r187220 r187543 34 34 webkit_web_context_get_cache_model 35 35 webkit_web_context_set_cache_model 36 webkit_web_context_get_web_process_count_limit 37 webkit_web_context_set_web_process_count_limit 36 38 webkit_web_context_clear_cache 37 39 webkit_web_context_download_uri -
trunk/Tools/ChangeLog
r187541 r187543 1 2015-07-28 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Add API to set the maximum number of web processes per WebKitWebContext 4 https://bugs.webkit.org/show_bug.cgi?id=147108 5 6 Reviewed by Gustavo Noronha Silva. 7 8 Add test case to check the web process limit. 9 10 * TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp: 11 (testWebProcessLimit): 12 (beforeAll): 13 1 14 2015-07-28 Michael Catanzaro <mcatanzaro@igalia.com> 2 15 -
trunk/Tools/TestWebKitAPI/Tests/WebKit2Gtk/TestMultiprocess.cpp
r176256 r187543 241 241 } 242 242 243 static void testWebProcessLimit(MultiprocessTest* test, gconstpointer) 244 { 245 g_assert_cmpuint(webkit_web_context_get_web_process_count_limit(test->m_webContext.get()), ==, 0); 246 247 webkit_web_context_set_web_process_count_limit(test->m_webContext.get(), 1); 248 g_assert_cmpuint(webkit_web_context_get_web_process_count_limit(test->m_webContext.get()), ==, 1); 249 250 // Create two web views but there should be only one web process. 251 for (unsigned i = 0; i < numViews; i++) { 252 test->loadWebViewAndWaitUntilLoaded(i); 253 g_assert(WEBKIT_IS_WEB_VIEW(test->m_webViews[i].get())); 254 } 255 256 g_assert_cmpuint(test->m_initializeWebExtensionsSignalCount, ==, 1); 257 } 258 243 259 void beforeAll() 244 260 { … … 260 276 MultiprocessTest::add("WebKitWebContext", "process-per-web-view", testProcessPerWebView); 261 277 UIClientMultiprocessTest::add("WebKitWebView", "multiprocess-create-ready-close", testMultiprocessWebViewCreateReadyClose); 278 MultiprocessTest::add("WebKitWebContext", "web-process-limit", testWebProcessLimit); 262 279 } 263 280
Note:
See TracChangeset
for help on using the changeset viewer.