30e3ca12dcea8275c91a8bd2f24cf446ba85c34a
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-06-18  Antti Koivisto  <antti@apple.com>
2
3         ~4% Membuster regression after WebKit r185452
4         https://bugs.webkit.org/show_bug.cgi?id=146112
5         rdar://problem/21406677
6
7         Reviewed by Chris Dumez.
8
9         Clear the cache write queue on critical memory pressure. There can be substantial amount of memory there and we
10         don't know how long writing it out will take. System is often under I/O pressure too in low memory situations.
11
12         This also makes sense for process suspension where we send simulated critical memory event.
13
14         * NetworkProcess/NetworkProcess.cpp:
15         (WebKit::NetworkProcess::lowMemoryHandler):
16         * NetworkProcess/cache/NetworkCache.cpp:
17         (WebKit::NetworkCache::Cache::handleMemoryPressureNotification):
18         * NetworkProcess/cache/NetworkCache.h:
19         * NetworkProcess/cache/NetworkCacheStorage.cpp:
20         (WebKit::NetworkCache::Storage::clearWriteQueue):
21         * NetworkProcess/cache/NetworkCacheStorage.h:
22
23 2015-06-18  Csaba Osztrogonác  <ossy@webkit.org>
24
25         Fix missing braces and deprecated declarations warnings in WebKitNotificationProvider.cpp
26         https://bugs.webkit.org/show_bug.cgi?id=145921
27
28         Reviewed by Carlos Garcia Campos.
29
30         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
31         (WebKitNotificationProvider::WebKitNotificationProvider):
32
33 2015-06-18  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
34
35         [EFL] test_ewk2_context has been failed since r185529
36         https://bugs.webkit.org/show_bug.cgi?id=146046
37
38         Reviewed by Csaba Osztrogonác.
39
40         ewk_context_network_process_model test has been failed since r185529.
41         This patch modifies the test which is similar to ewk_context_network_process_model
42         based on multiple process model to fix the failure. Besides ewk_context_network_process_model
43         seems to be fixed indirectly. So we enable it again.
44
45         * UIProcess/API/efl/tests/test_ewk2_context.cpp:
46         (TEST_F):
47
48 2015-06-17  Yongjun Zhang  <yongjun_zhang@apple.com>
49
50         Also turn off long press on link preview.
51         https://bugs.webkit.org/show_bug.cgi?id=146084
52
53         Also turn off long presss gesture when previewing. Turn that back on when preview is completed.
54
55         Reviewed by Tim Horton.
56
57         * UIProcess/ios/WKContentViewInteraction.mm:
58         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]):
59         (-[WKContentView didDismissPreviewViewController:committing:]):
60
61 2015-06-17  Brent Fulgham  <bfulgham@apple.com>
62
63         Overflow regions with scroll snap points are not reliably rubber banding
64         https://bugs.webkit.org/show_bug.cgi?id=142522
65         <rdar://problem/20100726>
66
67         Reviewed by Darin Adler.
68
69         Make sure we don't block rubberbanding behavior when a scroll gesture should take us past
70         the end of the scroll container.
71
72         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
73         (-[WKOverflowScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Don't adjust
74         target point if we were going to scroll past the edges of the scroll container.
75
76 2015-06-17  Anders Carlsson  <andersca@apple.com>
77
78         Would like a way, in the API, to get notified about a web process crash
79         https://bugs.webkit.org/show_bug.cgi?id=146085
80         rdar://problem/17358828
81
82         Reviewed by Darin Adler.
83
84         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
85         * UIProcess/Cocoa/NavigationState.h:
86         * UIProcess/Cocoa/NavigationState.mm:
87         (WebKit::NavigationState::setNavigationDelegate):
88         (WebKit::NavigationState::NavigationClient::processDidCrash):
89
90 2015-06-17  Tim Horton  <timothy_horton@apple.com>
91
92         Swipe gesture can get stuck, preventing scrolling and other gestures
93         https://bugs.webkit.org/show_bug.cgi?id=146088
94         <rdar://problem/16056087>
95
96         Reviewed by Darin Adler.
97
98         * UIProcess/mac/ViewGestureControllerMac.mm:
99         (WebKit::ViewGestureController::trackSwipeGesture):
100         Ignore mouse events that come in while we're doing a swipe.
101         This prevents potentially problematic mouse events (especially context menus)
102         won't be processed during a swipe, avoiding situations that can cause
103         the swipe gesture to get stuck.
104
105 2015-06-17  Sungmann Cho  <sungmann.cho@navercorp.com>
106
107         Remove willSendEventToPlugin() from PluginController.h.
108         https://bugs.webkit.org/show_bug.cgi?id=146054
109
110         Reviewed by Darin Adler.
111
112         PluginController::willSendEventToPlugin() was introduced by http://webkit.org/b/59124.
113         This method had been used only for WebKit2 on Windows, and no one uses it now.
114         So we can remove it.
115
116         No new tests, no behavior change.
117
118         * PluginProcess/PluginControllerProxy.cpp:
119         (WebKit::PluginControllerProxy::willSendEventToPlugin): Deleted.
120         * PluginProcess/PluginControllerProxy.h:
121         * WebProcess/Plugins/PluginController.h:
122         * WebProcess/Plugins/PluginView.cpp:
123         (WebKit::PluginView::willSendEventToPlugin): Deleted.
124         * WebProcess/Plugins/PluginView.h:
125
126 2015-06-17  Tim Horton  <timothy_horton@apple.com>
127
128         Repro crash when swiping back from a NY Times article @ WebPageProxy::navigationGestureDidEnd
129         https://bugs.webkit.org/show_bug.cgi?id=146083
130         <rdar://problem/20974232>
131
132         Reviewed by Darin Adler.
133
134         * UIProcess/ios/ViewGestureControllerIOS.mm:
135         (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
136         (WebKit::ViewGestureController::activeLoadMonitoringTimerFired):
137         It is possible to get didSameDocumentNavigationForMainFrame *before*
138         endSwipeGesture, while the user is still interactively swiping. We
139         cannot remove the snapshot in this case, nor should we start the active
140         load monitoring timer; all of these things should happen only after the
141         swipe is completed and we've performed the navigation.
142
143         This was particularly bad (a crash instead of just a disappearing snapshot)
144         because removing the snapshot also causes m_webPageProxyForBackForwardListForCurrentSwipe
145         to be nulled out, but then it is dereferenced during endSwipeGesture.
146
147         Make sure that we never call removeSwipeSnapshotIfReady unless we were actually
148         waiting to remove the swipe snapshot (because the gesture had completed).
149         Most callers already did ensure this, but these two did not.
150
151 2015-06-17  Joseph Pecoraro  <pecoraro@apple.com>
152
153         Web Inspector: Improve Full Screen support for Web Inspector windows
154         https://bugs.webkit.org/show_bug.cgi?id=146036
155
156         Reviewed by Timothy Hatcher.
157
158         * UIProcess/WebInspectorProxy.h:
159         * UIProcess/mac/WebInspectorProxyMac.mm:
160         (-[WKWebInspectorProxyObjCAdapter windowDidEnterFullScreen:]):
161         (-[WKWebInspectorProxyObjCAdapter windowDidExitFullScreen:]):
162         (WebKit::WebInspectorProxy::platformCanAttach):
163         (WebKit::WebInspectorProxy::windowFullScreenDidChange):
164         When entering / leaving full screen update attach availability to
165         potentially show / hide the frontend's docking buttons.
166
167         (WebKit::WebInspectorProxy::createInspectorWindow):
168         Allow a Web Inspector window to be a full screen auxillary window,
169         so that if the application with a WebView opens a detached inspector
170         window it can be shown on the same desktop as the full screen app.
171         Also, reduce the minimum window size requirements for full screen tiling.
172
173 2015-06-17  Tim Horton  <timothy_horton@apple.com>
174
175         Safari tabs still have shrunken content after coming out of fullscreen
176         https://bugs.webkit.org/show_bug.cgi?id=146037
177         <rdar://problem/21105960>
178
179         Reviewed by Simon Fraser and Darin Adler.
180
181         * UIProcess/WebPageProxy.h:
182         (WebKit::WebPageProxy::useFixedLayoutDidChange):
183         (WebKit::WebPageProxy::fixedLayoutSizeDidChange):
184         * UIProcess/WebPageProxy.messages.in:
185         * WebProcess/WebPage/WebPage.cpp:
186         (WebKit::WebPage::setUseFixedLayout):
187         (WebKit::WebPage::setFixedLayoutSize):
188         Keep the UI process up-to-date when fixed layout is enabled or the size changes.
189         This is important because these things can change from the Web process side too,
190         and the UI process uses its (potentially stale) version to do some short-circuiting.
191         This was causing us to fail to turn off fixed layout when it was turned
192         on from the Web process side (by TiledCoreAnimationDrawingArea).
193
194         * UIProcess/mac/WKViewLayoutStrategy.mm:
195         (-[WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy willChangeLayoutStrategy]):
196         Reset the view scale, which WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy
197         makes heavy use of, just like the others.
198
199 2015-06-17  Dan Bernstein  <mitz@apple.com>
200
201         [Cocoa] Expose UIDelegate::UIClient::close via WKUIDelegate
202         https://bugs.webkit.org/show_bug.cgi?id=145957
203
204         Reviewed by Darin Adler.
205
206         * UIProcess/API/Cocoa/WKUIDelegate.h: Added -webViewDidClose: to the protocol.
207         * UIProcess/Cocoa/UIDelegate.h: Added a webViewDidClose boolean to the delegate methods struct.
208         * UIProcess/Cocoa/UIDelegate.mm:
209         (WebKit::UIDelegate::setDelegate): Initialize the webViewDidClose boolean.
210         (WebKit::UIDelegate::UIClient::close): Changed to call the new delegate method. Left behind
211         code that calls the old private method if it’s implemented.
212
213 2015-06-17  Carlos Garcia Campos  <cgarcia@igalia.com>
214
215         [GTK] WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER doesn't disable memory cache when set before the web process is launched
216         https://bugs.webkit.org/show_bug.cgi?id=146053
217
218         Reviewed by Martin Robinson.
219
220         The cache is disabled in WebProcess::platformSetCacheModel() when
221         the cache model is CacheModelDocumentViewer, but it's enabled
222         again by WebProcess::setMemoryCacheDisabled() when
223         memoryCacheDisabled creation parameter is processed. We need to
224         make sure the cache model and memoryCacheDisabled parameters are consistent.
225
226         * UIProcess/gtk/WebProcessPoolGtk.cpp:
227         (WebKit::WebProcessPool::platformInitializeWebProcess): Initialize
228         memoryCacheDisabled parameter to true if memory cache was
229         explicitly disabled or cache model is CacheModelDocumentViewer.
230
231 2015-06-17  Zan Dobersek  <zdobersek@igalia.com>
232
233         [WK2] valueForKey() shouldn't copy the defaults map
234         https://bugs.webkit.org/show_bug.cgi?id=146050
235
236         Reviewed by Sam Weinig.
237
238         * Shared/WebPreferencesStore.cpp:
239         (WebKit::valueForKey): Avoid copying the defaults HashMap by binding the return value to a reference.
240
241 2015-06-16  Carlos Garcia Campos  <cgarcia@igalia.com>
242
243         [GTK] Inhibit screen saver when playing full screen video
244         https://bugs.webkit.org/show_bug.cgi?id=145795
245
246         Reviewed by Gustavo Noronha Silva.
247
248         Use Freedesktop.org DBus API to inhibit/unhinibit the screen saver
249         when entering/leaving fullscreen.
250
251         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
252         (screenSaverInhibitedCallback):
253         (webkitWebViewBaseSendInhibitMessageToScreenSaver):
254         (screenSaverProxyCreatedCallback):
255         (webkitWebViewBaseInhibitScreenSaver):
256         (webkitWebViewBaseUninhibitScreenSaver):
257         (webkitWebViewBaseEnterFullScreen):
258         (webkitWebViewBaseExitFullScreen):
259
260 2015-06-16  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
261
262         Purge PassRefPtr with Ref or RefPtr
263         https://bugs.webkit.org/show_bug.cgi?id=146001
264
265         Reviewed by Darin Adler.
266
267         As step to remove PassRefPtr, this patch reduces use of PassRefPtr in WebKit2.
268         If function can't return nullptr, PassRefPtr is changed with Ref. If not, the function
269         returns RefPtr.
270
271         * DatabaseProcess/DatabaseToWebProcessConnection.cpp:
272         (WebKit::DatabaseToWebProcessConnection::create):
273         * DatabaseProcess/DatabaseToWebProcessConnection.h:
274         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:
275         (WebKit::DatabaseProcessIDBConnection::create):
276         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
277         (WebKit::UniqueIDBDatabase::create):
278         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:
279         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
280         (WebKit::NetworkConnectionToWebProcess::create):
281         * NetworkProcess/NetworkConnectionToWebProcess.h:
282         * NetworkProcess/RemoteNetworkingContext.h:
283         * PluginProcess/WebProcessConnection.cpp:
284         (WebKit::WebProcessConnection::create):
285         * PluginProcess/WebProcessConnection.h:
286         * Shared/API/APINumber.h:
287         (API::Number::create):
288         * Shared/API/APISecurityOrigin.h:
289         (API::SecurityOrigin::createFromString):
290         (API::SecurityOrigin::create):
291         * Shared/API/APISerializedScriptValue.h:
292         (API::SerializedScriptValue::create):
293         (API::SerializedScriptValue::adopt):
294         * Shared/APIWebArchive.h:
295         * Shared/APIWebArchive.mm:
296         (API::WebArchive::create):
297         * Shared/APIWebArchiveResource.h:
298         * Shared/APIWebArchiveResource.mm:
299         (API::WebArchiveResource::create):
300         * Shared/AsyncRequest.h:
301         * UIProcess/API/efl/ewk_url_request_private.h:
302         (EwkUrlRequest::create):
303         * UIProcess/API/efl/ewk_url_response_private.h:
304         (EwkUrlResponse::create):
305         * UIProcess/API/efl/ewk_url_scheme_request_private.h:
306         (EwkUrlSchemeRequest::create):
307         * UIProcess/API/efl/ewk_window_features_private.h:
308         (EwkWindowFeatures::create):
309         * UIProcess/API/efl/tests/test_ewk2_object.cpp:
310         (TestEwkObject1::create):
311         (TestEwkObject2::create):
312         * UIProcess/API/gtk/WebKitBatteryProvider.cpp:
313         (WebKitBatteryProvider::create):
314         * UIProcess/API/gtk/WebKitBatteryProvider.h:
315         * UIProcess/API/gtk/WebKitColorChooser.cpp:
316         (WebKit::WebKitColorChooser::create):
317         * UIProcess/API/gtk/WebKitGeolocationProvider.cpp:
318         (WebKitGeolocationProvider::create):
319         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
320         (WebKitNotificationProvider::create):
321         * UIProcess/API/gtk/WebKitNotificationProvider.h:
322         * UIProcess/GeolocationPermissionRequestProxy.h:
323         (WebKit::GeolocationPermissionRequestProxy::create):
324         * UIProcess/InspectorServer/HTTPRequest.h:
325         (WebKit::HTTPRequest::create):
326         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp:
327         (WebKit::WebSoupCustomProtocolRequestManager::create):
328         * UIProcess/Network/NetworkProcessProxy.cpp:
329         (WebKit::NetworkProcessProxy::create):
330         * UIProcess/Network/NetworkProcessProxy.h:
331         * UIProcess/Notifications/NotificationPermissionRequest.cpp:
332         (WebKit::NotificationPermissionRequest::create):
333         * UIProcess/Notifications/NotificationPermissionRequest.h:
334         * UIProcess/Notifications/WebNotification.h:
335         (WebKit::WebNotification::create):
336         * UIProcess/WebPageProxy.cpp:
337         (WebKit::WebPageProxy::scriptValueCallback):
338         * UIProcess/WebVibrationProxy.cpp:
339         (WebKit::WebVibrationProxy::create):
340         * UIProcess/WebVibrationProxy.h:
341         * UIProcess/WebViewportAttributes.h:
342         (WebKit::WebViewportAttributes::create):
343         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
344         (WebKit::WebsiteDataStore::createNonPersistent):
345         (WebKit::WebsiteDataStore::create):
346         * UIProcess/WebsiteData/WebsiteDataStore.h:
347         * UIProcess/gtk/WebColorPickerGtk.cpp:
348         (WebKit::WebColorPickerGtk::create):
349         * UIProcess/gtk/WebColorPickerGtk.h:
350         * UIProcess/gtk/WebContextMenuProxyGtk.h:
351         (WebKit::WebContextMenuProxyGtk::create):
352         * UIProcess/gtk/WebPopupMenuProxyGtk.h:
353         (WebKit::WebPopupMenuProxyGtk::create):
354         * UIProcess/mac/ViewSnapshotStore.h:
355         * UIProcess/mac/ViewSnapshotStore.mm:
356         (WebKit::ViewSnapshot::create):
357         * UIProcess/mac/WebColorPickerMac.h:
358         * UIProcess/mac/WebColorPickerMac.mm:
359         (WebKit::WebColorPickerMac::create):
360         * UIProcess/mac/WebContextMenuProxyMac.h:
361         (WebKit::WebContextMenuProxyMac::create):
362         * UIProcess/mac/WebPopupMenuProxyMac.h:
363         (WebKit::WebPopupMenuProxyMac::create):
364         * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.h:
365         * WebProcess/Databases/WebToDatabaseProcessConnection.h:
366         (WebKit::WebToDatabaseProcessConnection::create):
367         * WebProcess/FullScreen/WebFullScreenManager.cpp:
368         (WebKit::WebFullScreenManager::create):
369         * WebProcess/FullScreen/WebFullScreenManager.h:
370         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
371         (WebKit::InjectedBundleRangeHandle::create):
372         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h:
373         * WebProcess/InjectedBundle/InjectedBundleBackForwardList.h:
374         (WebKit::InjectedBundleBackForwardList::create):
375
376 2015-06-16  Carlos Alberto Lopez Perez  <clopez@igalia.com>
377
378         Unreviewed build fix after r185615.
379
380         * UIProcess/API/gtk/WebKitWebContext.cpp:
381         (webkit_web_context_clear_cache): Comment the call to the code
382         removed and write down the bugzilla link for reimplementation.
383
384 2015-06-16  Anders Carlsson  <andersca@apple.com>
385
386         Get rid of performAPICallbackWithSecurityOriginDataVector
387         https://bugs.webkit.org/show_bug.cgi?id=146039
388
389         Reviewed by Andreas Kling.
390
391         Get rid of performAPICallbackWithSecurityOriginDataVector since it's now no longer used
392         and add a bunch of includes to make up for SecurityOriginData.h no longer including GenericCallback.h.
393         * DatabaseProcess/DatabaseProcess.cpp:
394         * DatabaseProcess/DatabaseProcess.h:
395         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
396         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
397         * Shared/SecurityOriginData.cpp:
398         (WebKit::performAPICallbackWithSecurityOriginDataVector): Deleted.
399         * Shared/SecurityOriginData.h:
400         * Shared/WebsiteData/WebsiteData.cpp:
401         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
402         * WebProcess/MediaCache/WebMediaKeyStorageManager.cpp:
403
404 2015-06-16  Ryuan Choi  <ryuan.choi@navercorp.com>
405
406         Unreviewed build fix attempt on CMake based port after r185623.
407
408         * CMakeLists.txt:
409
410 2015-06-16  Anders Carlsson  <andersca@apple.com>
411
412         Move LocalStorageDetails into the local storage database tracker
413         https://bugs.webkit.org/show_bug.cgi?id=146034
414
415         Reviewed by Andreas Kling.
416
417         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
418         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
419         (WKKeyValueStorageManagerDeleteAllEntries):
420         * UIProcess/LocalStorageDetails.h: Removed.
421         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
422         (WebKit::LocalStorageDatabaseTracker::originDetails):
423         (WebKit::LocalStorageDatabaseTracker::details): Deleted.
424         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
425         * UIProcess/Storage/StorageManager.cpp:
426         (WebKit::StorageManager::getLocalStorageOriginDetails):
427         (WebKit::StorageManager::getLocalStorageDetailsByOrigin): Deleted.
428         (WebKit::StorageManager::deleteAllLocalStorageEntries): Deleted.
429         * UIProcess/Storage/StorageManager.h:
430         * WebKit2.xcodeproj/project.pbxproj:
431
432 2015-06-16  Dan Bernstein  <mitz@apple.com>
433
434         Removed the WebKit2SandboxProfiles target.
435
436         Rubber-stamped by Anders Carlsson.
437
438         WebKit2SandboxProfiles was just an alias for the Sandbox Profiles target, and it’s not
439         needed anymore.
440
441         * WebKit2.xcodeproj/project.pbxproj:
442
443 2015-06-16  Anders Carlsson  <andersca@apple.com>
444
445         Fold WebKeyValueStorageManager into WKKeyValueStorageManager
446         https://bugs.webkit.org/show_bug.cgi?id=146030
447
448         Reviewed by Andreas Kling.
449
450         * UIProcess/API/C/WKAPICast.h:
451         * UIProcess/API/C/WKContext.cpp:
452         (WKContextGetKeyValueStorageManager):
453         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
454         (WKKeyValueStorageManagerGetTypeID):
455         (WKKeyValueStorageManagerGetOriginKey):
456         (WKKeyValueStorageManagerGetCreationTimeKey):
457         (WKKeyValueStorageManagerGetModificationTimeKey):
458         (WKKeyValueStorageManagerGetKeyValueStorageOrigins):
459         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
460         (WKKeyValueStorageManagerDeleteEntriesForOrigin):
461         (WKKeyValueStorageManagerDeleteAllEntries):
462         * UIProcess/WebKeyValueStorageManager.cpp: Removed.
463         (WebKit::WebKeyValueStorageManager::supplementName): Deleted.
464         (WebKit::WebKeyValueStorageManager::originKey): Deleted.
465         (WebKit::WebKeyValueStorageManager::creationTimeKey): Deleted.
466         (WebKit::WebKeyValueStorageManager::modificationTimeKey): Deleted.
467         (WebKit::WebKeyValueStorageManager::create): Deleted.
468         (WebKit::WebKeyValueStorageManager::WebKeyValueStorageManager): Deleted.
469         (WebKit::WebKeyValueStorageManager::~WebKeyValueStorageManager): Deleted.
470         (WebKit::WebKeyValueStorageManager::refWebContextSupplement): Deleted.
471         (WebKit::WebKeyValueStorageManager::derefWebContextSupplement): Deleted.
472         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins): Deleted.
473         (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin): Deleted.
474         (WebKit::WebKeyValueStorageManager::deleteEntriesForOrigin): Deleted.
475         (WebKit::WebKeyValueStorageManager::deleteAllEntries): Deleted.
476         * UIProcess/WebKeyValueStorageManager.h: Removed.
477         * UIProcess/WebProcessPool.cpp:
478         * WebKit2.xcodeproj/project.pbxproj:
479
480 2015-06-16  Alex Christensen  <achristensen@webkit.org>
481
482         CMake build fix after r185615.
483
484         * CMakeLists.txt:
485         Remove WebResourceCacheManager from CMake build system.
486
487 2015-06-16  Alex Christensen  <achristensen@webkit.org>
488
489         [Content Extensions] Implement branch compaction for DFA bytecode.
490         https://bugs.webkit.org/show_bug.cgi?id=145619
491
492         Reviewed by Benjamin Poulain.
493
494         * UIProcess/API/APIUserContentExtensionStore.h:
495         Increment version number to reflect changes to bytecode.
496
497 2015-06-16  Anders Carlsson  <andersca@apple.com>
498
499         WebResourceCacheManager is unused, get rid of it
500         https://bugs.webkit.org/show_bug.cgi?id=146027
501
502         Reviewed by Sam Weinig.
503
504         * DerivedSources.make:
505         * UIProcess/API/C/WKAPICast.h:
506         * UIProcess/API/C/WKContext.cpp:
507         * UIProcess/WebProcessPool.cpp:
508         * UIProcess/WebResourceCacheManagerProxy.cpp: Removed.
509         (WebKit::WebResourceCacheManagerProxy::supplementName): Deleted.
510         (WebKit::WebResourceCacheManagerProxy::create): Deleted.
511         (WebKit::WebResourceCacheManagerProxy::WebResourceCacheManagerProxy): Deleted.
512         (WebKit::WebResourceCacheManagerProxy::~WebResourceCacheManagerProxy): Deleted.
513         (WebKit::WebResourceCacheManagerProxy::processPoolDestroyed): Deleted.
514         (WebKit::WebResourceCacheManagerProxy::processDidClose): Deleted.
515         (WebKit::WebResourceCacheManagerProxy::shouldTerminate): Deleted.
516         (WebKit::WebResourceCacheManagerProxy::refWebContextSupplement): Deleted.
517         (WebKit::WebResourceCacheManagerProxy::derefWebContextSupplement): Deleted.
518         (WebKit::WebResourceCacheManagerProxy::getCacheOrigins): Deleted.
519         (WebKit::WebResourceCacheManagerProxy::didGetCacheOrigins): Deleted.
520         (WebKit::WebResourceCacheManagerProxy::clearCacheForOrigin): Deleted.
521         (WebKit::WebResourceCacheManagerProxy::clearCacheForAllOrigins): Deleted.
522         * UIProcess/WebResourceCacheManagerProxy.h: Removed.
523         * UIProcess/WebResourceCacheManagerProxy.messages.in: Removed.
524         * WebKit2.xcodeproj/project.pbxproj:
525         * WebProcess/ResourceCache/WebResourceCacheManager.cpp: Removed.
526         (WebKit::WebResourceCacheManager::supplementName): Deleted.
527         (WebKit::WebResourceCacheManager::WebResourceCacheManager): Deleted.
528         (WebKit::WebResourceCacheManager::getCacheOrigins): Deleted.
529         (WebKit::WebResourceCacheManager::returnCacheOrigins): Deleted.
530         (WebKit::WebResourceCacheManager::clearCacheForOrigin): Deleted.
531         (WebKit::WebResourceCacheManager::clearCacheForAllOrigins): Deleted.
532         * WebProcess/ResourceCache/WebResourceCacheManager.h: Removed.
533         * WebProcess/ResourceCache/WebResourceCacheManager.messages.in: Removed.
534         * WebProcess/ResourceCache/cf/WebResourceCacheManagerCFNet.mm: Removed.
535         (WebKit::partitionName): Deleted.
536         (WebKit::WebResourceCacheManager::cfURLCacheHostNamesWithCallback): Deleted.
537         (WebKit::WebResourceCacheManager::clearCFURLCacheForHostNames): Deleted.
538         * WebProcess/WebProcess.cpp:
539         (WebKit::WebProcess::WebProcess): Deleted.
540
541 2015-06-16  Alex Christensen  <achristensen@webkit.org>
542
543         CMake build fix after r185601.
544
545         * CMakeLists.txt:
546         Remove application cache manager classes.
547
548 2015-06-16  Anders Carlsson  <andersca@apple.com>
549
550         Stop calling into WebResourceCacheManager
551         https://bugs.webkit.org/show_bug.cgi?id=146026
552
553         Reviewed by Andreas Kling.
554
555         Copy the cache clearing code into NetworkProcessCocoa in preparation of getting rid of
556         the WebResourceCacheManager code.
557
558         * NetworkProcess/NetworkProcess.cpp:
559         (WebKit::fetchDiskCacheEntries):
560         (WebKit::clearDiskCacheEntries):
561         (WebKit::cfURLCacheOrigins): Deleted.
562         * NetworkProcess/NetworkProcess.h:
563         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
564         (WebKit::partitionName):
565         (WebKit::NetworkProcess::cfURLCacheOrigins):
566         (WebKit::NetworkProcess::clearCFURLCacheForOrigins):
567
568 2015-06-16  Anders Carlsson  <andersca@apple.com>
569
570         Get rid of the application cache manager classes, they are no longer used
571         https://bugs.webkit.org/show_bug.cgi?id=146024
572
573         Reviewed by Sam Weinig.
574
575         * DerivedSources.make:
576         * UIProcess/API/C/WKAPICast.h:
577         * UIProcess/API/C/WKContext.cpp:
578         * UIProcess/WebApplicationCacheManagerProxy.cpp: Removed.
579         (WebKit::WebApplicationCacheManagerProxy::supplementName): Deleted.
580         (WebKit::WebApplicationCacheManagerProxy::create): Deleted.
581         (WebKit::WebApplicationCacheManagerProxy::WebApplicationCacheManagerProxy): Deleted.
582         (WebKit::WebApplicationCacheManagerProxy::~WebApplicationCacheManagerProxy): Deleted.
583         (WebKit::WebApplicationCacheManagerProxy::processPoolDestroyed): Deleted.
584         (WebKit::WebApplicationCacheManagerProxy::processDidClose): Deleted.
585         (WebKit::WebApplicationCacheManagerProxy::shouldTerminate): Deleted.
586         (WebKit::WebApplicationCacheManagerProxy::refWebContextSupplement): Deleted.
587         (WebKit::WebApplicationCacheManagerProxy::derefWebContextSupplement): Deleted.
588         (WebKit::WebApplicationCacheManagerProxy::getApplicationCacheOrigins): Deleted.
589         (WebKit::WebApplicationCacheManagerProxy::didGetApplicationCacheOrigins): Deleted.
590         (WebKit::WebApplicationCacheManagerProxy::deleteEntriesForOrigin): Deleted.
591         (WebKit::WebApplicationCacheManagerProxy::deleteAllEntries): Deleted.
592         * UIProcess/WebApplicationCacheManagerProxy.h: Removed.
593         * UIProcess/WebApplicationCacheManagerProxy.messages.in: Removed.
594         * UIProcess/WebProcessPool.cpp:
595         * WebKit2.xcodeproj/project.pbxproj:
596         * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp: Removed.
597         (WebKit::WebApplicationCacheManager::supplementName): Deleted.
598         (WebKit::WebApplicationCacheManager::WebApplicationCacheManager): Deleted.
599         (WebKit::WebApplicationCacheManager::getApplicationCacheOrigins): Deleted.
600         (WebKit::WebApplicationCacheManager::deleteEntriesForOrigin): Deleted.
601         (WebKit::WebApplicationCacheManager::deleteAllEntries): Deleted.
602         (WebKit::WebApplicationCacheManager::setAppCacheMaximumSize): Deleted.
603         * WebProcess/ApplicationCache/WebApplicationCacheManager.h: Removed.
604         * WebProcess/ApplicationCache/WebApplicationCacheManager.messages.in: Removed.
605         * WebProcess/InjectedBundle/InjectedBundle.cpp:
606         (WebKit::InjectedBundle::clearApplicationCache):
607         (WebKit::InjectedBundle::setAppCacheMaximumSize):
608         * WebProcess/WebProcess.cpp:
609         (WebKit::WebProcess::WebProcess): Deleted.
610
611 2015-06-16  Brady Eidson  <beidson@apple.com>
612
613         IDB: Records table migration doesn't work with all versions of SQLite.
614         https://bugs.webkit.org/show_bug.cgi?id=145993
615
616         Reviewed by Darin Adler, provisionally reviewed by Jon Lee.
617
618         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
619         (WebKit::v1RecordsTableSchema):
620         (WebKit::v1RecordsTableSchemaAlternate):
621         (WebKit::v2RecordsTableSchema):
622         (WebKit::v2RecordsTableSchemaAlternate):
623         (WebKit::createOrMigrateRecordsTableIfNecessary): Check both v1 and v1 Alternate whenever we check for the v1 schema.
624           Ditto for the v2 schema. Crash all builds if the current schema is none of these.
625
626 2015-06-16  Dan Bernstein  <mitz@apple.com>
627
628         Build fix.
629
630         * mac/postprocess-framework-headers.sh:
631
632 2015-06-16  Commit Queue  <commit-queue@webkit.org>
633
634         Unreviewed, rolling out r185552.
635         https://bugs.webkit.org/show_bug.cgi?id=146015
636
637          It broke some WK2 API tests on EFL bots (Requested by
638         gyuyoung on #webkit).
639
640         Reverted changeset:
641
642         "[EFL] Make send/receive messages to communicate the Web and
643         UI Processes using Injected Bundle."
644         https://bugs.webkit.org/show_bug.cgi?id=145685
645         http://trac.webkit.org/changeset/185552
646
647 2015-06-16  Ryuan Choi  <ryuan.choi@navercorp.com>
648
649         [EFL] Add API tests for ewk_page
650         https://bugs.webkit.org/show_bug.cgi?id=146004
651
652         Reviewed by Gyuyoung Kim.
653
654         Add unit test for load_started/load_finished callbacks of ewk_page.
655
656         * PlatformEfl.cmake:
657         * UIProcess/API/efl/tests/extensions/extension_sample.cpp:
658         * UIProcess/API/efl/tests/test_ewk2_page.cpp: Added.
659         (EWK2PageTest::messageReceivedCallback):
660         (EWK2PageTest::EWK2PageTest):
661         (TEST_F):
662
663 2015-06-15  Simon Fraser  <simon.fraser@apple.com>
664
665         [iOS WK2] position:fixed elements sometimes truncated on scroll view bouncing
666         https://bugs.webkit.org/show_bug.cgi?id=146000
667         rdar://problem/19448439
668
669         Reviewed by Benjamin Poulain.
670         
671         When in the middle of a rubber-band (UIScrollView bounce), we could send a bad 
672         fixed position rect down to WebCore, causing 100% height elements to get laid out
673         at the wrong height, possible too short. This occurred when -_updateVisibleContentRects
674         said we were in a stable state, but the rubber-band offset caused WebPageProxy::computeCustomFixedPositionRect()
675         to compute a bad rect via constrainedUnobscuredRect.intersect(documentRect).
676         
677         Fix by not claiming to be in a stable state during rubber-banding. Added _scrollViewIsRubberBanding
678         to compute that, taking care with floating point comparisons for 3x devices.
679
680         * UIProcess/API/Cocoa/WKWebView.mm:
681         (isGreaterInDevicePixels):
682         (-[WKWebView _scrollViewIsRubberBanding]):
683         (-[WKWebView _updateVisibleContentRects]):
684
685 2015-06-15  Ryuan Choi  <ryuan.choi@navercorp.com>
686
687         Fix build break when ENABLE_SECCOMP_FILTERS is ON
688         https://bugs.webkit.org/show_bug.cgi?id=145967
689
690         Reviewed by Carlos Garcia Campos.
691
692         Since r183189, ArgumentEncoder::addAttachment requires rvalue reference.
693
694         * Shared/linux/SeccompFilters/OpenSyscall.cpp:
695         (WebKit::OpenSyscallResult::encode): Use WTF::move().
696
697 2015-06-15  Chris Dumez  <cdumez@apple.com>
698
699         [WK2] BrowsingContextController.loadData API is leaking Navigation objects
700         https://bugs.webkit.org/show_bug.cgi?id=145977
701         <rdar://problem/21305706>
702
703         Reviewed by Darin Adler.
704
705         BrowsingContextController.loadData API was leaking Navigation objects.
706         The issue was due to WebPageProxy::loadData() creating a Navigation
707         object but not passing along the navigationID to the WebProcess when
708         sending the Messages::WebPage::LoadData IPC. As a result, the
709         WebProcess would use 0 as navigationID and we would end up creating a
710         new Navigation object later on for the same navigation.
711
712         * UIProcess/WebPageProxy.cpp:
713         (WebKit::WebPageProxy::loadData):
714         * WebProcess/WebPage/WebPage.cpp:
715         (WebKit::WebPage::loadData):
716         * WebProcess/WebPage/WebPage.h:
717         * WebProcess/WebPage/WebPage.messages.in:
718
719 2015-06-15  Dan Bernstein  <mitz@apple.com>
720
721         REGRESSION (r185298): Databases service has Web Content service’s entitlements
722         https://bugs.webkit.org/show_bug.cgi?id=145980
723
724         Reviewed by Darin Adler.
725
726         * Configurations/DatabaseService.xcconfig: Set WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE to
727         Databases-iOS.
728
729 2015-06-11  Jon Lee  <jonlee@apple.com>
730
731         [WK2] Add allowsPictureInPictureMediaPlayback
732         https://bugs.webkit.org/show_bug.cgi?id=145901
733         rdar://problem/21349851
734
735         Reviewed by Anders Carlsson.
736
737         Replace _allowsAlternateFullscreen with allowsPictureInPictureMediaPlayback.
738
739         * UIProcess/API/Cocoa/WKWebViewConfiguration.h: Add allowsPictureInPictureMediaPlayback.
740         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
741         (-[WKWebViewConfiguration init]): Remove _allowsAlternateFullscreen.
742         (-[WKWebViewConfiguration copyWithZone:]): Replace the variable.
743         (-[WKWebViewConfiguration _allowsAlternateFullscreen]): Deleted.
744         (-[WKWebViewConfiguration _setAllowsAlternateFullscreen:]): Deleted.
745         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h: Remove the SPI.
746
747         * UIProcess/API/Cocoa/WKWebView.mm:
748         (-[WKWebView initWithFrame:configuration:]): Update to use the new API.
749
750 2015-06-12  Alexey Proskuryakov  <ap@apple.com>
751
752         -[WKWebView evaluateJavaScript] provides a misleading error when the return cannot be serialized
753         https://bugs.webkit.org/show_bug.cgi?id=145900
754
755         Reviewed by Sam Weinig.
756
757         We used to conflate to cases: (1) when there was a JavaScript exception, and
758         (2) when the result could not be serialized for IPC. Turns out that it was quite
759         misleading!
760
761         * UIProcess/API/C/WKPage.cpp:
762         (WKPageRunJavaScriptInMainFrame):
763         * UIProcess/API/Cocoa/WKError.h:
764         * UIProcess/API/Cocoa/WKError.mm:
765         (localizedDescriptionForErrorCode):
766         * UIProcess/API/Cocoa/WKWebView.mm:
767         (-[WKWebView evaluateJavaScript:completionHandler:]):
768         * UIProcess/WebPageProxy.cpp:
769         (WebKit::WebPageProxy::runJavaScriptInMainFrame):
770         (WebKit::WebPageProxy::scriptValueCallback):
771         * UIProcess/WebPageProxy.h:
772         * UIProcess/WebPageProxy.messages.in:
773         * WebProcess/WebPage/WebPage.cpp:
774         (WebKit::WebPage::runJavaScriptInMainFrame):
775         * UIProcess/API/gtk/WebKitWebView.cpp:
776         (webkit_web_view_run_javascript):
777         (resourcesStreamReadCallback):
778
779 2015-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
780
781         [SOUP] Custom URI schemes don't work for requests containing a fragment identifier
782         https://bugs.webkit.org/show_bug.cgi?id=145969
783
784         Reviewed by Sergio Villar Senin.
785
786         Use the WebKitSoupRequestGeneric request instead of creating a new one
787         from the SoupRequest URI, since that is the network one and doesn't
788         contain the fragment identifier part.
789
790         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.cpp:
791         (WebKit::CustomProtocolManagerImpl::start):
792
793 2015-06-15  Hyungwook Lee  <hyungwook.lee@navercorp.com>
794
795         [EFL] Make send/receive messages to communicate the Web and UI Processes using Injected Bundle.
796         https://bugs.webkit.org/show_bug.cgi?id=145685
797
798         Reviewed by Gyuyoung Kim.
799
800         To have extensible port specific API facility using Injected Bundle,
801         we need to load libewebkit_extension_manager.so in default that is same as what gtk port does.
802
803         * UIProcess/API/efl/ewk_context.cpp:
804         (EwkContext::EwkContext):
805         (EwkContext::~EwkContext):
806         (EwkContext::findOrCreateWrapper):
807         (bundlePathForExtension):
808         (EwkContext::create): Deleted.
809         * UIProcess/API/efl/ewk_context_private.h:
810         * WebProcess/efl/ExtensionManagerEfl.cpp:
811         (WebKit::ExtensionManagerEfl::initialize):
812
813 2015-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
814
815         [SOUP] Move WebKitSoupRequestGeneric to platform layer
816         https://bugs.webkit.org/show_bug.cgi?id=145968
817
818         Reviewed by Sergio Villar Senin.
819
820         * PlatformEfl.cmake: Remove WebKitSoupRequestGeneric.
821         * PlatformGTK.cmake: Ditto.
822         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.cpp:
823         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.h:
824
825 2015-06-15  Csaba Osztrogonác  <ossy@webkit.org>
826
827         Fix unused private field warning in PageBanner.h
828         https://bugs.webkit.org/show_bug.cgi?id=145925
829
830         Reviewed by Darin Adler.
831
832         * WebProcess/WebPage/PageBanner.cpp:
833         (WebKit::PageBanner::~PageBanner):
834         * WebProcess/WebPage/PageBanner.h: Initialize m_type, m_webPage, m_mouseDownInBanner, and m_isHidden here instead of in the constructor.
835         * WebProcess/WebPage/mac/PageBannerMac.mm: Use PLATFORM(MAC) instead of !PLATFORM(IOS), they are same in objc files.
836
837 2015-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
838
839         [SOUP] Make WebKitSoupRequestGeneric independent from CustomProtocolManagerImpl
840         https://bugs.webkit.org/show_bug.cgi?id=145966
841
842         Reviewed by Sergio Villar Senin.
843
844         Add WebKitSoupRequestGenericClient with start and finish methods,
845         that are implemented by WebKitSoupRequestGeneric.
846         This allows us to move WebKitSoupRequestGeneric to platform layer.
847
848         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.cpp:
849         (WebKit::CustomProtocolManagerImpl::registerScheme):
850         (WebKit::CustomProtocolManagerImpl::start):
851         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.h:
852         * WebProcess/soup/WebKitSoupRequestGeneric.cpp:
853         (webkitSoupRequestGenericSendAsync):
854         (webkitSoupRequestGenericSendFinish):
855         * WebProcess/soup/WebKitSoupRequestGeneric.h:
856         * WebProcess/soup/WebKitSoupRequestGenericClient.h: Added.
857
858 2015-06-14  Dan Bernstein  <mitz@apple.com>
859
860         Fixed the build.
861
862         * mac/postprocess-framework-headers.sh:
863
864 2015-06-14  Michael Catanzaro  <mcatanzaro@igalia.com>
865
866         Format string misuse in DatabaseProcessIDBConnection.cpp and UniqueIDBDatabaseBackingStoreSQLite.cpp
867         https://bugs.webkit.org/show_bug.cgi?id=145960
868
869         Reviewed by Darin Adler.
870
871         Use PRIu64 and PRIi64 to print uint64_t and int64_t, respectively. These things are
872         different types on x86_64 Linux (unsigned long) and on Mac (unsigned long long).
873
874         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
875         (WebKit::DatabaseProcessIDBConnection::getOrEstablishIDBDatabaseMetadata):
876         (WebKit::DatabaseProcessIDBConnection::deleteDatabase):
877         (WebKit::DatabaseProcessIDBConnection::openTransaction):
878         (WebKit::DatabaseProcessIDBConnection::beginTransaction):
879         (WebKit::DatabaseProcessIDBConnection::commitTransaction):
880         (WebKit::DatabaseProcessIDBConnection::resetTransaction):
881         (WebKit::DatabaseProcessIDBConnection::rollbackTransaction):
882         (WebKit::DatabaseProcessIDBConnection::changeDatabaseVersion):
883         (WebKit::DatabaseProcessIDBConnection::createObjectStore):
884         (WebKit::DatabaseProcessIDBConnection::deleteObjectStore):
885         (WebKit::DatabaseProcessIDBConnection::clearObjectStore):
886         (WebKit::DatabaseProcessIDBConnection::createIndex):
887         (WebKit::DatabaseProcessIDBConnection::deleteIndex):
888         (WebKit::DatabaseProcessIDBConnection::putRecord):
889         (WebKit::DatabaseProcessIDBConnection::getRecord):
890         (WebKit::DatabaseProcessIDBConnection::count):
891         (WebKit::DatabaseProcessIDBConnection::deleteRange):
892         (WebKit::DatabaseProcessIDBConnection::openCursor):
893         (WebKit::DatabaseProcessIDBConnection::cursorAdvance):
894         (WebKit::DatabaseProcessIDBConnection::cursorIterate):
895         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
896         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteObjectStore):
897         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::clearObjectStore):
898         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteIndex):
899         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::generateKeyNumber):
900         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::keyExistsInObjectStore):
901         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::putRecord):
902         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::uncheckedPutIndexRecord):
903         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteRecord):
904         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRecordFromObjectStore):
905         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRangeRecordFromObjectStore):
906         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::advanceCursor):
907
908 2015-06-14  Dan Bernstein  <mitz@apple.com>
909
910         [Cocoa] Clean up postprocess-framework-headers.sh
911         https://bugs.webkit.org/show_bug.cgi?id=145962
912
913         Reviewed by Darin Adler.
914
915         * mac/postprocess-framework-headers.sh: Gather all the sed options in a variable, and then
916         run sed only once on each header. Also, correctly exit with the sed return value if it
917         fails.
918
919 2015-06-13  Chris Dumez  <cdumez@apple.com>
920
921         [WK2] API::Navigation objects are leaked on history navigation to HistoryItems in PageCache
922         https://bugs.webkit.org/show_bug.cgi?id=145948
923
924         Reviewed by Darin Adler.
925
926         API::Navigation objects were leaked on history navigation to
927         HistoryItems in PageCache. In such case, we would create 2 Navigation
928         objects instead of 1 and the first one would be leaked. The reason
929         we create the second one is because we fail to pass along the
930         navigationID from the UIProcess to the WebProcess and then back to the
931         UIProcess. On the IPC back to the UIProcess, the navigationID ends up
932         being 0 so the UIProcess creates a new Navigation object, thinking that
933         the load was triggered by the WebContent process.
934
935         We now pass along the navigationID, even if the HistoryItem is in the
936         PageCache and we end up reusing the cached DocumentLoader, instead of
937         creating a new one. A new updateCachedDocumentLoader() delegate is
938         added to the FrameLoaderClient, similarly to the pre-existing
939         createDocumentLoader() but for the case where the DocumentLoader gets
940         reused.
941
942         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
943         (WebKit::WebFrameLoaderClient::updateCachedDocumentLoader):
944         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
945         * WebProcess/WebPage/WebPage.cpp:
946         (WebKit::WebPage::goForward):
947         (WebKit::WebPage::goBack):
948         (WebKit::WebPage::goToBackForwardItem):
949         (WebKit::WebPage::updateCachedDocumentLoader):
950         * WebProcess/WebPage/WebPage.h:
951
952 2015-06-12  Gavin Barraclough  <barraclough@apple.com>
953
954         Add private API to force page to always run at foreground priority
955         https://bugs.webkit.org/show_bug.cgi?id=145946
956         <rdar://problem/21267221>
957
958         Reviewed by Anders Carlsson.
959
960         * UIProcess/API/Cocoa/WKWebView.mm:
961         (-[WKWebView initWithFrame:configuration:]):
962             - copy _alwaysRunsAtForegroundPriority to WebPageConfiguration.
963         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
964         (-[WKWebViewConfiguration copyWithZone:]):
965         (-[WKWebViewConfiguration _alwaysRunsAtForegroundPriority]):
966         (-[WKWebViewConfiguration _setAlwaysRunsAtForegroundPriority:]):
967             - added _alwaysRunsAtForegroundPriority.
968         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
969             - added _alwaysRunsAtForegroundPriority.
970         * UIProcess/WebPageProxy.cpp:
971         (WebKit::WebPageProxy::WebPageProxy):
972             - initialize m_alwaysRunsAtForegroundPriority.
973         (WebKit::WebPageProxy::updateActivityToken):
974             - if m_alwaysRunsAtForegroundPriority is set always take the foreground activity token.
975         * UIProcess/WebPageProxy.h:
976             - added m_alwaysRunsAtForegroundPriority, alwaysRunsAtForegroundPriority.
977
978 2015-06-12  Anders Carlsson  <andersca@apple.com>
979
980         Reimplement WKResourceCacheManagerRef on top of WKWebsiteDataStoreRef
981         https://bugs.webkit.org/show_bug.cgi?id=145951
982
983         Reviewed by Darin Adler.
984
985         * UIProcess/API/C/WKContext.cpp:
986         (WKContextGetResourceCacheManager):
987         * UIProcess/API/C/WKResourceCacheManager.cpp:
988         (WKResourceCacheManagerGetTypeID):
989         (toWebsiteDataTypes):
990         (WKResourceCacheManagerGetCacheOrigins):
991         (WKResourceCacheManagerClearCacheForOrigin):
992         (WKResourceCacheManagerClearCacheForAllOrigins):
993
994 2015-06-12  Anders Carlsson  <andersca@apple.com>
995
996         Reimplement WKApplicationCacheManagerRef as WKWebsiteDataStoreRef
997         https://bugs.webkit.org/show_bug.cgi?id=145950
998
999         Reviewed by Dan Bernstein.
1000
1001         * UIProcess/API/C/WKAPICast.h:
1002         * UIProcess/API/C/WKApplicationCacheManager.cpp:
1003         (WKApplicationCacheManagerGetTypeID):
1004         (WKApplicationCacheManagerGetApplicationCacheOrigins):
1005         (WKApplicationCacheManagerDeleteEntriesForOrigin):
1006         (WKApplicationCacheManagerDeleteAllEntries):
1007         * UIProcess/API/C/WKContext.cpp:
1008         (WKContextGetApplicationCacheManager):
1009         (WKContextGetPluginSiteDataManager):
1010
1011 2015-06-12  Anders Carlsson  <andersca@apple.com>
1012
1013         Clean up IndexedDB website data retrieval and removal
1014         https://bugs.webkit.org/show_bug.cgi?id=145941
1015
1016         Reviewed by Andreas Kling.
1017
1018         - Use SecurityOrigin instead of SecurityOriginData; It's not possible to pass SecurityOriginData
1019         safely between threads.
1020         
1021         - Use std::chrono instead of double for modification times.
1022         
1023         - Get rid of endTime since it's not used.
1024         
1025         - Change deleteIndexedDatabaseEntriesForOrigin to deleteIndexedDatabaseEntriesForOrigins and make it take
1026         a vector of origins instead of a single one.
1027
1028         - Get rid of deleteAllIndexedDatabaseEntries.
1029
1030         - Change SecurityOriginData::securityOrigin to call isolatedCopy on the origin components, since it's common
1031         to pass origins to other threads and we want that to be safe.
1032
1033         * DatabaseProcess/DatabaseProcess.cpp:
1034         (WebKit::DatabaseProcess::fetchWebsiteData):
1035         (WebKit::DatabaseProcess::deleteWebsiteData):
1036         (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins):
1037         (WebKit::DatabaseProcess::indexedDatabaseOrigins):
1038         (WebKit::removeAllDatabasesForOriginPath):
1039         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigins):
1040         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesModifiedSince):
1041         (WebKit::DatabaseProcess::getIndexedDatabaseOrigins): Deleted.
1042         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigin): Deleted.
1043         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesModifiedBetweenDates): Deleted.
1044         (WebKit::DatabaseProcess::deleteAllIndexedDatabaseEntries): Deleted.
1045         * DatabaseProcess/DatabaseProcess.h:
1046         * Shared/SecurityOriginData.cpp:
1047         (WebKit::SecurityOriginData::securityOrigin):
1048
1049 2015-06-12  Antti Koivisto  <antti@apple.com>
1050
1051         Network Cache: Use SHA1 for header checksum
1052         https://bugs.webkit.org/show_bug.cgi?id=145928
1053
1054         Reviewed by Chris Dumez.
1055
1056         Use SHA1 everywhere for consistency and robustness.
1057
1058         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1059         (WebKit::NetworkCache::Storage::bodyPathForKey):
1060         (WebKit::NetworkCache::RecordMetaData::RecordMetaData):
1061         (WebKit::NetworkCache::decodeRecordMetaData):
1062         (WebKit::NetworkCache::decodeRecordHeader):
1063         (WebKit::NetworkCache::encodeRecordMetaData):
1064         (WebKit::NetworkCache::Storage::encodeRecord):
1065         (WebKit::NetworkCache::hashData): Deleted.
1066
1067             This was the last user of 32 bit hashes in cache code.
1068
1069         * NetworkProcess/cache/NetworkCacheStorage.h:
1070
1071             Also bump the cache version number as recent changes have changed the format.
1072             Old caches would transition fine but this makes it easier to identify which version user has.
1073
1074 2015-06-12  Simon Fraser  <simon.fraser@apple.com>
1075
1076         [iOS WK2] Video with reflection crashes WebKit and Safari
1077         https://bugs.webkit.org/show_bug.cgi?id=145905
1078         rdar://problem/18364939
1079
1080         Reviewed by Anders Carlsson.
1081         
1082         On iOS, AVPlayerLayers are contained inside a WebVideoContainerLayer, but
1083         the layer type is still LayerTypeAVPlayerLayer.
1084         
1085         Avoid throwing exceptions when cloning such layers by checking the layer class.
1086
1087         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
1088         (WebKit::PlatformCALayerRemoteCustom::clone):
1089
1090 2015-06-12  Csaba Osztrogonác  <ossy@webkit.org>
1091
1092         [EFL] Fix unused private field warning in WebContextMenuProxyEfl.cpp
1093         https://bugs.webkit.org/show_bug.cgi?id=145911
1094
1095         Reviewed by Darin Adler.
1096
1097         * UIProcess/efl/WebContextMenuProxyEfl.cpp:
1098         (WebKit::WebContextMenuProxyEfl::WebContextMenuProxyEfl): Deleted.
1099         * UIProcess/efl/WebContextMenuProxyEfl.h:
1100
1101 2015-06-12  Zan Dobersek  <zdobersek@igalia.com>
1102
1103         Unreviewed build fix after r185502.
1104
1105         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
1106         GRefPtr.h header has been moved to a different place.
1107
1108 2015-06-12  Zan Dobersek  <zdobersek@igalia.com>
1109
1110         [GLib] Move files under Source/WTF/wtf/gobject to Source/WTF/wtf/glib
1111         https://bugs.webkit.org/show_bug.cgi?id=145799
1112
1113         Reviewed by Carlos Garcia Campos.
1114
1115         Update header inclusions for headers that have been moved
1116         to Source/WTF/wtf/glib/.
1117
1118         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
1119         * NetworkProcess/cache/NetworkCacheIOChannel.h:
1120         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
1121         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1122         * PlatformEfl.cmake:
1123         * PlatformGTK.cmake:
1124         * Shared/Downloads/soup/DownloadSoup.cpp:
1125         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.h:
1126         * Shared/PrintInfo.h:
1127         * Shared/gtk/ArgumentCodersGtk.cpp:
1128         * Shared/gtk/ArgumentCodersGtk.h:
1129         * Shared/gtk/KeyedDecoder.h:
1130         * Shared/gtk/KeyedEncoder.h:
1131         * Shared/gtk/ProcessExecutablePathGtk.cpp:
1132         * UIProcess/API/gtk/WebKitBackForwardList.cpp:
1133         * UIProcess/API/gtk/WebKitBackForwardListItem.cpp:
1134         * UIProcess/API/gtk/WebKitColorChooser.h:
1135         * UIProcess/API/gtk/WebKitContextMenu.cpp:
1136         * UIProcess/API/gtk/WebKitContextMenuItem.cpp:
1137         * UIProcess/API/gtk/WebKitCookieManager.cpp:
1138         * UIProcess/API/gtk/WebKitDownload.cpp:
1139         * UIProcess/API/gtk/WebKitDownloadClient.cpp:
1140         * UIProcess/API/gtk/WebKitFaviconDatabase.cpp:
1141         * UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
1142         * UIProcess/API/gtk/WebKitFindController.cpp:
1143         * UIProcess/API/gtk/WebKitFormClient.cpp:
1144         * UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp:
1145         * UIProcess/API/gtk/WebKitInjectedBundleClient.cpp:
1146         * UIProcess/API/gtk/WebKitJavascriptResult.cpp:
1147         * UIProcess/API/gtk/WebKitLoaderClient.cpp:
1148         * UIProcess/API/gtk/WebKitMimeInfo.cpp:
1149         * UIProcess/API/gtk/WebKitNavigationAction.cpp:
1150         * UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp:
1151         * UIProcess/API/gtk/WebKitPolicyClient.cpp:
1152         * UIProcess/API/gtk/WebKitPrintOperation.cpp:
1153         * UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp:
1154         * UIProcess/API/gtk/WebKitUIClient.cpp:
1155         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
1156         * UIProcess/API/gtk/WebKitUserContentManager.cpp:
1157         * UIProcess/API/gtk/WebKitWebContext.cpp:
1158         * UIProcess/API/gtk/WebKitWebInspector.cpp:
1159         * UIProcess/API/gtk/WebKitWebResource.cpp:
1160         * UIProcess/API/gtk/WebKitWebView.cpp:
1161         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1162         * UIProcess/InspectorServer/WebSocketServer.h:
1163         * UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp:
1164         * UIProcess/InspectorServer/soup/WebSocketServerSoup.cpp:
1165         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
1166         * UIProcess/Plugins/gtk/PluginInfoCache.h:
1167         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
1168         * UIProcess/gtk/DragAndDropHandler.cpp:
1169         * UIProcess/gtk/GestureController.h:
1170         * UIProcess/gtk/InputMethodFilter.cpp:
1171         * UIProcess/gtk/InputMethodFilter.h:
1172         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
1173         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
1174         * UIProcess/gtk/WebPopupMenuProxyGtk.h:
1175         * UIProcess/gtk/WebProcessPoolGtk.cpp:
1176         * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
1177         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
1178         * WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.cpp:
1179         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
1180         * WebProcess/WebPage/WebPage.h:
1181         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
1182         * WebProcess/WebPage/gtk/PrinterListGtk.h:
1183         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
1184         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
1185         * WebProcess/WebPage/gtk/WebPrintOperationGtk.h:
1186         * WebProcess/gtk/WebGtkExtensionManager.h:
1187         * WebProcess/soup/WebKitSoupRequestInputStream.cpp:
1188         * WebProcess/soup/WebProcessSoup.cpp:
1189         * WebProcess/soup/WebSoupRequestManager.h:
1190
1191 2015-06-12  Antti Koivisto  <antti@apple.com>
1192
1193         Network Cache: Use SHA1 for key hash
1194         https://bugs.webkit.org/show_bug.cgi?id=143829
1195
1196         Reviewed by Anders Carlsson.
1197
1198         For consistency with blobs, use SHA1 instead of MD5.
1199
1200         * NetworkProcess/cache/NetworkCacheCoders.cpp:
1201         (WebKit::NetworkCache::Coder<MD5::Digest>::encode): Deleted.
1202         (WebKit::NetworkCache::Coder<MD5::Digest>::decode): Deleted.
1203
1204             No longer needed.
1205
1206         * NetworkProcess/cache/NetworkCacheCoders.h:
1207         * NetworkProcess/cache/NetworkCacheKey.cpp:
1208         (WebKit::NetworkCache::hashString):
1209         (WebKit::NetworkCache::Key::computeHash):
1210         * NetworkProcess/cache/NetworkCacheKey.h:
1211
1212 2015-06-12  Csaba Osztrogonác  <ossy@webkit.org>
1213
1214         Fix mismatched-tags warning in Source/WebKit2/UIProcess/gtk/InputMethodFilter.h
1215         https://bugs.webkit.org/show_bug.cgi?id=145923
1216
1217         Reviewed by Carlos Garcia Campos.
1218
1219         * UIProcess/gtk/InputMethodFilter.h:
1220
1221 2015-06-12  Antti Koivisto  <antti@apple.com>
1222
1223         Use SHA1 for cache coder checksums
1224         https://bugs.webkit.org/show_bug.cgi?id=145880
1225
1226         Reviewed by Anders Carlsson.
1227
1228         Make cache data error detection more robust by using SHA1 for checksums.
1229
1230         * NetworkProcess/cache/NetworkCacheDecoder.cpp:
1231         (WebKit::NetworkCache::Decoder::Decoder):
1232         (WebKit::NetworkCache::Decoder::decodeFixedLengthData):
1233         (WebKit::NetworkCache::Decoder::decodeNumber):
1234         (WebKit::NetworkCache::Decoder::verifyChecksum):
1235         * NetworkProcess/cache/NetworkCacheDecoder.h:
1236         * NetworkProcess/cache/NetworkCacheEncoder.cpp:
1237         (WebKit::NetworkCache::Encoder::Encoder):
1238         (WebKit::NetworkCache::Encoder::grow):
1239         (WebKit::NetworkCache::Encoder::updateChecksumForData):
1240         (WebKit::NetworkCache::Encoder::encodeFixedLengthData):
1241         (WebKit::NetworkCache::Encoder::encodeNumber):
1242         (WebKit::NetworkCache::Encoder::encodeChecksum):
1243         * NetworkProcess/cache/NetworkCacheEncoder.h:
1244         (WebKit::NetworkCache::Encoder::buffer):
1245         (WebKit::NetworkCache::Encoder::bufferSize):
1246         (WebKit::NetworkCache::Encoder::updateChecksumForNumber):
1247
1248 2015-06-12  Csaba Osztrogonác  <ossy@webkit.org>
1249
1250         [EFL] Fix deprecated declarations warnings related to WK2 versioned structs
1251         https://bugs.webkit.org/show_bug.cgi?id=145913
1252
1253         Reviewed by Gyuyoung Kim.
1254
1255         * UIProcess/API/efl/ewk_favicon_database.cpp:
1256         (EwkFaviconDatabase::EwkFaviconDatabase):
1257         * UIProcess/efl/ContextHistoryClientEfl.cpp:
1258         (WebKit::ContextHistoryClientEfl::ContextHistoryClientEfl):
1259         * UIProcess/efl/ContextMenuClientEfl.cpp:
1260         (ContextMenuClientEfl::ContextMenuClientEfl):
1261         * UIProcess/efl/DownloadManagerEfl.cpp:
1262         (WebKit::DownloadManagerEfl::DownloadManagerEfl):
1263         * UIProcess/efl/FindClientEfl.cpp:
1264         (WebKit::FindClientEfl::FindClientEfl):
1265         * UIProcess/efl/FormClientEfl.cpp:
1266         (WebKit::FormClientEfl::FormClientEfl):
1267         * UIProcess/efl/PageUIClientEfl.cpp:
1268         (WebKit::PageUIClientEfl::PageUIClientEfl):
1269
1270 2015-06-11  Mark Lam  <mark.lam@apple.com>
1271
1272         WebCore::reportException() needs to be able to accept a raw thrown value in addition to Exception objects.
1273         https://bugs.webkit.org/show_bug.cgi?id=145872
1274
1275         Reviewed by Michael Saboff.
1276
1277         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1278         (WebKit::InjectedBundle::reportException):
1279         - Don't assume we have an Exception object.  Let WebCore::reportException() take
1280           care of it.
1281
1282 2015-06-11  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1283
1284         [CMake] Unreviewed build fix after r185479.
1285
1286         * CMakeLists.txt: Unlist the files that r185479 deleted.
1287
1288 2015-06-11  Anders Carlsson  <andersca@apple.com>
1289
1290         Get rid of WebOriginDataManager
1291         https://bugs.webkit.org/show_bug.cgi?id=145896
1292
1293         Reviewed by Andreas Kling.
1294
1295         * DatabaseProcess/DatabaseProcess.cpp:
1296         (WebKit::DatabaseProcess::DatabaseProcess): Deleted.
1297         (WebKit::DatabaseProcess::getOrigins): Deleted.
1298         (WebKit::DatabaseProcess::deleteEntriesForOrigin): Deleted.
1299         (WebKit::DatabaseProcess::deleteEntriesModifiedBetweenDates): Deleted.
1300         (WebKit::DatabaseProcess::deleteAllEntries): Deleted.
1301         * DatabaseProcess/DatabaseProcess.h:
1302         * DerivedSources.make:
1303         * UIProcess/API/C/WKAPICast.h:
1304         * UIProcess/API/C/WKContext.cpp:
1305         * UIProcess/Databases/DatabaseProcessProxy.cpp:
1306         (WebKit::DatabaseProcessProxy::didReceiveMessage): Deleted.
1307         * UIProcess/WebOriginDataManagerProxy.cpp: Removed.
1308         (WebKit::WebOriginDataManagerProxy::supplementName): Deleted.
1309         (WebKit::WebOriginDataManagerProxy::create): Deleted.
1310         (WebKit::WebOriginDataManagerProxy::WebOriginDataManagerProxy): Deleted.
1311         (WebKit::WebOriginDataManagerProxy::~WebOriginDataManagerProxy): Deleted.
1312         (WebKit::WebOriginDataManagerProxy::processPoolDestroyed): Deleted.
1313         (WebKit::WebOriginDataManagerProxy::processDidClose): Deleted.
1314         (WebKit::WebOriginDataManagerProxy::shouldTerminate): Deleted.
1315         (WebKit::WebOriginDataManagerProxy::refWebContextSupplement): Deleted.
1316         (WebKit::WebOriginDataManagerProxy::derefWebContextSupplement): Deleted.
1317         (WebKit::CallbackSynchronizer::create): Deleted.
1318         (WebKit::CallbackSynchronizer::~CallbackSynchronizer): Deleted.
1319         (WebKit::CallbackSynchronizer::taskStarted): Deleted.
1320         (WebKit::CallbackSynchronizer::taskCompleted): Deleted.
1321         (WebKit::CallbackSynchronizer::CallbackSynchronizer): Deleted.
1322         (WebKit::createSynchronizedCallback): Deleted.
1323         (WebKit::sendMessageToAllProcessesInProcessPool): Deleted.
1324         (WebKit::WebOriginDataManagerProxy::getOrigins): Deleted.
1325         (WebKit::WebOriginDataManagerProxy::didGetOrigins): Deleted.
1326         (WebKit::WebOriginDataManagerProxy::deleteEntriesForOrigin): Deleted.
1327         (WebKit::WebOriginDataManagerProxy::deleteEntriesModifiedBetweenDates): Deleted.
1328         (WebKit::WebOriginDataManagerProxy::didDeleteEntries): Deleted.
1329         (WebKit::WebOriginDataManagerProxy::deleteAllEntries): Deleted.
1330         (WebKit::WebOriginDataManagerProxy::didDeleteAllEntries): Deleted.
1331         * UIProcess/WebOriginDataManagerProxy.h: Removed.
1332         * UIProcess/WebOriginDataManagerProxy.messages.in: Removed.
1333         * UIProcess/WebProcessPool.cpp:
1334         * WebKit2.xcodeproj/project.pbxproj:
1335         * WebProcess/OriginData/WebOriginDataManager.cpp: Removed.
1336         (WebKit::WebOriginDataManager::WebOriginDataManager): Deleted.
1337         (WebKit::WebOriginDataManager::getOrigins): Deleted.
1338         (WebKit::WebOriginDataManager::deleteEntriesForOrigin): Deleted.
1339         (WebKit::WebOriginDataManager::deleteEntriesModifiedBetweenDates): Deleted.
1340         (WebKit::WebOriginDataManager::deleteAllEntries): Deleted.
1341         * WebProcess/OriginData/WebOriginDataManager.h: Removed.
1342         * WebProcess/OriginData/WebOriginDataManager.messages.in: Removed.
1343         * WebProcess/OriginData/WebOriginDataManagerSupplement.h: Removed.
1344         (WebKit::WebOriginDataManagerSupplement::WebOriginDataManagerSupplement): Deleted.
1345         (WebKit::WebOriginDataManagerSupplement::~WebOriginDataManagerSupplement): Deleted.
1346         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1347         * WebProcess/WebPage/WebPage.cpp:
1348         * WebProcess/WebProcess.cpp:
1349         (WebKit::WebProcess::~WebProcess):
1350         (WebKit::WebProcess::WebProcess): Deleted.
1351         (WebKit::WebProcess::getOrigins): Deleted.
1352         (WebKit::WebProcess::deleteEntriesForOrigin): Deleted.
1353         (WebKit::WebProcess::deleteEntriesModifiedBetweenDates): Deleted.
1354         (WebKit::WebProcess::deleteAllEntries): Deleted.
1355         * WebProcess/WebProcess.h:
1356         * WebProcess/cocoa/WebProcessCocoa.mm:
1357
1358 2015-06-11  Matt Rajca  <mrajca@apple.com>
1359
1360         Media Session: Add plumbing for media control event delivery.
1361         https://bugs.webkit.org/show_bug.cgi?id=145859
1362
1363         Reviewed by Anders Carlsson.
1364
1365         * UIProcess/API/C/WKPage.cpp:
1366         (WKPageHandleMediaEvent):
1367         * UIProcess/API/C/WKPagePrivate.h:
1368         * UIProcess/WebPageProxy.cpp:
1369         (WebKit::WebPageProxy::handleMediaEvent):
1370         * UIProcess/WebPageProxy.h:
1371         * WebProcess/WebPage/WebPage.cpp:
1372         (WebKit::WebPage::handleMediaEvent):
1373         * WebProcess/WebPage/WebPage.h:
1374         * WebProcess/WebPage/WebPage.messages.in:
1375
1376 2015-06-11  Myles C. Maxfield  <mmaxfield@apple.com>
1377
1378         [OS X] Decoding fonts may return nil when using force click
1379         https://bugs.webkit.org/show_bug.cgi?id=145890
1380
1381         Reviewed by Beth Dakin.
1382
1383         [NSFontDescriptor fontDescriptorWithFontAttributes] might return nil, which
1384         causes the encoding of an NSFont to erroneously return true.
1385
1386         * Shared/mac/ArgumentCodersMac.mm:
1387         (IPC::decode):
1388
1389 2015-06-11  Anders Carlsson  <andersca@apple.com>
1390
1391         Reimplement WKOriginDataManager in terms of API::WebsiteDataStore
1392         https://bugs.webkit.org/show_bug.cgi?id=145889
1393
1394         Reviewed by Dan Bernstein.
1395
1396         * UIProcess/API/C/WKAPICast.h:
1397         * UIProcess/API/C/WKContext.cpp:
1398         (WKContextGetOriginDataManager):
1399         * UIProcess/API/C/WKOriginDataManager.cpp:
1400         (WKOriginDataManagerGetTypeID):
1401         (WKOriginDataManagerGetOrigins):
1402         (WKOriginDataManagerDeleteEntriesForOrigin):
1403         (WKOriginDataManagerDeleteEntriesModifiedBetweenDates):
1404         (WKOriginDataManagerDeleteAllEntries):
1405
1406 2015-06-11  Brent Fulgham  <bfulgham@apple.com>
1407
1408         Full screen video space can be resized to 1pt wide
1409         https://bugs.webkit.org/show_bug.cgi?id=145895
1410         <rdar://problem/20907914>
1411
1412         Reviewed by Simon Fraser.
1413
1414         Prior to the upcoming OS X, full screen mode was not resizable. Now that it is,
1415         we need to set a minimum window width that is large enough to hold the media
1416         controls. This makes our full-screen video behave the same as the QuickTimeX player.
1417
1418         * UIProcess/mac/WKFullScreenWindowController.mm:
1419         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Active that new
1420         kWKLayoutModeDynamicSizeWithMinimumViewSize style, and set the minimum view size to
1421         be the width of our media controls, with 20 pixels of padding on either side.
1422         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Set the layout
1423         mode back to the default style.
1424
1425 2015-06-11  Jon Lee  <jonlee@apple.com>
1426
1427         Update media controls JS and CSS to use picture-in-picture
1428         https://bugs.webkit.org/show_bug.cgi?id=145827
1429         <rdar://problem/21311576>
1430
1431         Reviewed by Dean Jackson.
1432
1433         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1434         (InitWebCoreSystemInterface): Deleted GetMediaUIImageData.
1435
1436 2015-06-11  Alex Christensen  <achristensen@webkit.org>
1437
1438         Speculative build fix for GTK after r185463.
1439
1440         * CMakeLists.txt:
1441         Remove WebPluginSiteDataManager.cpp from CMake build.
1442
1443 2015-06-11  Anders Carlsson  <andersca@apple.com>
1444
1445         Remove WebPluginSiteDataManager
1446         https://bugs.webkit.org/show_bug.cgi?id=145884
1447
1448         Reviewed by Andreas Kling.
1449
1450         * PluginProcess/PluginProcess.cpp:
1451         (WebKit::PluginProcess::clearSiteData): Deleted.
1452         * PluginProcess/PluginProcess.h:
1453         * PluginProcess/PluginProcess.messages.in:
1454         * UIProcess/API/C/WKAPICast.h:
1455         * UIProcess/API/C/WKContext.cpp:
1456         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
1457         * UIProcess/Plugins/PluginProcessManager.cpp:
1458         (WebKit::PluginProcessManager::clearSiteData): Deleted.
1459         * UIProcess/Plugins/PluginProcessManager.h:
1460         * UIProcess/Plugins/PluginProcessProxy.cpp:
1461         (WebKit::PluginProcessProxy::clearSiteData): Deleted.
1462         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch): Deleted.
1463         (WebKit::PluginProcessProxy::didFinishLaunching): Deleted.
1464         (WebKit::PluginProcessProxy::didClearSiteData): Deleted.
1465         * UIProcess/Plugins/PluginProcessProxy.h:
1466         * UIProcess/Plugins/PluginProcessProxy.messages.in:
1467         * UIProcess/Plugins/WebPluginSiteDataManager.cpp: Removed.
1468         (WebKit::WebPluginSiteDataManager::GetSitesWithDataState::GetSitesWithDataState): Deleted.
1469         (WebKit::WebPluginSiteDataManager::GetSitesWithDataState::getSitesWithDataForNextPlugin): Deleted.
1470         (WebKit::WebPluginSiteDataManager::GetSitesWithDataState::didGetSitesWithDataForSinglePlugin): Deleted.
1471         (WebKit::WebPluginSiteDataManager::ClearSiteDataState::ClearSiteDataState): Deleted.
1472         (WebKit::WebPluginSiteDataManager::ClearSiteDataState::clearSiteDataForNextPlugin): Deleted.
1473         (WebKit::WebPluginSiteDataManager::ClearSiteDataState::didClearSiteDataForSinglePlugin): Deleted.
1474         (WebKit::WebPluginSiteDataManager::create): Deleted.
1475         (WebKit::WebPluginSiteDataManager::WebPluginSiteDataManager): Deleted.
1476         (WebKit::WebPluginSiteDataManager::~WebPluginSiteDataManager): Deleted.
1477         (WebKit::WebPluginSiteDataManager::invalidate): Deleted.
1478         (WebKit::WebPluginSiteDataManager::getSitesWithData): Deleted.
1479         (WebKit::WebPluginSiteDataManager::didGetSitesWithData): Deleted.
1480         (WebKit::WebPluginSiteDataManager::clearSiteData): Deleted.
1481         (WebKit::WebPluginSiteDataManager::didClearSiteData): Deleted.
1482         (WebKit::WebPluginSiteDataManager::didGetSitesWithDataForSinglePlugin): Deleted.
1483         (WebKit::WebPluginSiteDataManager::didGetSitesWithDataForAllPlugins): Deleted.
1484         (WebKit::WebPluginSiteDataManager::didClearSiteDataForSinglePlugin): Deleted.
1485         (WebKit::WebPluginSiteDataManager::didClearSiteDataForAllPlugins): Deleted.
1486         * UIProcess/Plugins/WebPluginSiteDataManager.h: Removed.
1487         (WebKit::WebPluginSiteDataManager::processPool): Deleted.
1488         (WebKit::WebPluginSiteDataManager::clearProcessPool): Deleted.
1489         * UIProcess/WebProcessPool.cpp:
1490         (WebKit::WebProcessPool::~WebProcessPool): Deleted.
1491         * UIProcess/WebProcessPool.h:
1492         * UIProcess/WebProcessProxy.cpp:
1493         * WebKit2.xcodeproj/project.pbxproj:
1494
1495 2015-06-11  Anders Carlsson  <andersca@apple.com>
1496
1497         Make WKWebsiteDataStoreRef backed by an API::WebsiteDataStore
1498         https://bugs.webkit.org/show_bug.cgi?id=145882
1499
1500         Reviewed by Dan Bernstein.
1501
1502         * UIProcess/API/C/WKAPICast.h:
1503         * UIProcess/API/C/WKContext.cpp:
1504         (WKContextGetPluginSiteDataManager):
1505         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
1506         (WKPluginSiteDataManagerGetTypeID):
1507         (WKPluginSiteDataManagerGetSitesWithData):
1508         (WKPluginSiteDataManagerClearSiteData):
1509         (WKPluginSiteDataManagerClearAllSiteData):
1510
1511 2015-06-11  Antti Koivisto  <antti@apple.com>
1512
1513         Network process crashes decoding invalid cache entry on 32bit system
1514         https://bugs.webkit.org/show_bug.cgi?id=145842
1515         rdar://problem/21228334
1516
1517         Reviewed by Anders Carlsson.
1518
1519         After cache scheme changes we may end up decoding invalid cache entries. This is by design,
1520         we should just fail decoding and delete these entries.
1521
1522         However Decoder::bufferIsLargeEnoughToContain test in some cases would allow corrupted large
1523         sizes due to overflow in 32bit pointer math and we would crash when allocating a string.
1524
1525         * NetworkProcess/cache/NetworkCacheCoders.cpp:
1526         (WebKit::NetworkCache::Coder<CString>::decode):
1527         (WebKit::NetworkCache::decodeStringText):
1528         (WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::decode):
1529         (WebKit::NetworkCache::Coder<MD5::Digest>::encode):
1530         * NetworkProcess/cache/NetworkCacheCoders.h:
1531         * NetworkProcess/cache/NetworkCacheDecoder.cpp:
1532         (WebKit::NetworkCache::Decoder::Decoder):
1533         (WebKit::NetworkCache::Decoder::bufferIsLargeEnoughToContain):
1534
1535             Reshuffle to avoid sum.
1536
1537         (WebKit::NetworkCache::Decoder::decodeFixedLengthData):
1538         * NetworkProcess/cache/NetworkCacheDecoder.h:
1539         (WebKit::NetworkCache::Decoder::bufferSize):
1540         (WebKit::NetworkCache::Decoder::currentOffset):
1541         (WebKit::NetworkCache::Decoder::length): Deleted.
1542         (WebKit::NetworkCache::Decoder::isInvalid): Deleted.
1543         (WebKit::NetworkCache::Decoder::markInvalid): Deleted.
1544
1545             Remove these, they are not really used or needed.
1546
1547 2015-06-10  Anders Carlsson  <andersca@apple.com>
1548
1549         Rewrite WKPluginSiteDataManager using WebsiteDataStore functions
1550         https://bugs.webkit.org/show_bug.cgi?id=145868
1551
1552         Reviewed by Antti Koivisto.
1553
1554         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
1555         (WKPluginSiteDataManagerGetSitesWithData):
1556         (WKPluginSiteDataManagerClearSiteData):
1557         (WKPluginSiteDataManagerClearAllSiteData):
1558         (toNPClearSiteDataFlags): Deleted.
1559         * UIProcess/Plugins/WebPluginSiteDataManager.h:
1560         (WebKit::WebPluginSiteDataManager::processPool):
1561
1562 2015-06-11  Antti Koivisto  <antti@apple.com>
1563
1564         3% cold PLT regression from network cache on iOS
1565         https://bugs.webkit.org/show_bug.cgi?id=145694
1566         rdar://problem/21158245
1567
1568         Reviewed by Chris Dumez.
1569
1570         Cache does not help in cold page loads but it shouldn't' be hurting either. Write I/O needs to be toned down a bit.
1571
1572         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1573         (WebKit::NetworkCache::IOChannel::IOChannel):
1574         (WebKit::NetworkCache::IOChannel::open):
1575
1576             Dispatch channels inherit their I/O priority from the target queue. Use background queue for write I/O.
1577
1578         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1579         (WebKit::NetworkCache::Storage::Storage):
1580         (WebKit::NetworkCache::Storage::dispatchPendingReadOperations):
1581         (WebKit::NetworkCache::Storage::dispatchPendingWriteOperations):
1582
1583             Only write one file at a time instead of maximum of three.
1584
1585         (WebKit::NetworkCache::Storage::retrieve):
1586
1587             For consistency with store prepend new entries here too.
1588
1589         (WebKit::NetworkCache::Storage::store):
1590
1591             Delay start of the first write operation by 1s.
1592             Prepend instead of append to the pending write deque so retrieveFromMemory lookup finds newest entries first in case of duplicates
1593
1594         (WebKit::NetworkCache::Storage::traverse):
1595         * NetworkProcess/cache/NetworkCacheStorage.h:
1596
1597 2015-06-10  Yongjun Zhang  <yongjun_zhang@apple.com>
1598
1599         Don't send touch events on link preview.
1600         https://bugs.webkit.org/show_bug.cgi?id=145863
1601
1602         Disable web touch event recognizer on link preview. We do the same when finding nodes in inspector or when long press gesture
1603         is recognized (by _cancelAllTouches). 
1604
1605         Reviewed by Beth Dakin.
1606
1607         * UIProcess/ios/WKContentViewInteraction.mm:
1608         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]): Remove touch event gesture recognizer on preview start.
1609         (-[WKContentView didDismissPreviewViewController:committing:]): Add the gesture recognizer back on dismiss.
1610
1611 2015-06-10  Anders Carlsson  <andersca@apple.com>
1612
1613         WKWebsiteDataStore should handle removing plug-in data for individual records
1614         https://bugs.webkit.org/show_bug.cgi?id=145864
1615
1616         Reviewed by Beth Dakin.
1617
1618         * PluginProcess/PluginProcess.cpp:
1619         (WebKit::PluginProcess::deleteWebsiteDataForHostNames):
1620         * PluginProcess/PluginProcess.h:
1621         * PluginProcess/PluginProcess.messages.in:
1622         * UIProcess/Plugins/PluginProcessManager.cpp:
1623         (WebKit::PluginProcessManager::deleteWebsiteDataForHostNames):
1624         * UIProcess/Plugins/PluginProcessManager.h:
1625         * UIProcess/Plugins/PluginProcessProxy.cpp:
1626         (WebKit::PluginProcessProxy::deleteWebsiteDataForHostNames):
1627         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
1628         (WebKit::PluginProcessProxy::didFinishLaunching):
1629         (WebKit::PluginProcessProxy::didDeleteWebsiteDataForHostNames):
1630         * UIProcess/Plugins/PluginProcessProxy.h:
1631         * UIProcess/Plugins/PluginProcessProxy.messages.in:
1632         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1633         (WebKit::WebsiteDataStore::removeData):
1634
1635 2015-06-10  Anders Carlsson  <andersca@apple.com>
1636
1637         WKWebsiteDataStore should handle removing plug-in data
1638         https://bugs.webkit.org/show_bug.cgi?id=145862
1639
1640         Reviewed by Sam Weinig.
1641
1642         * PluginProcess/PluginProcess.cpp:
1643         (WebKit::PluginProcess::deleteWebsiteData):
1644         * PluginProcess/PluginProcess.h:
1645         * PluginProcess/PluginProcess.messages.in:
1646         * UIProcess/Plugins/PluginProcessManager.cpp:
1647         (WebKit::PluginProcessManager::deleteWebsiteData):
1648         * UIProcess/Plugins/PluginProcessManager.h:
1649         * UIProcess/Plugins/PluginProcessProxy.cpp:
1650         (WebKit::PluginProcessProxy::~PluginProcessProxy):
1651         (WebKit::PluginProcessProxy::deleteWebsiteData):
1652         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
1653         (WebKit::PluginProcessProxy::didFinishLaunching):
1654         (WebKit::PluginProcessProxy::didDeleteWebsiteData):
1655         * UIProcess/Plugins/PluginProcessProxy.h:
1656         * UIProcess/Plugins/PluginProcessProxy.messages.in:
1657         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1658         (WebKit::WebsiteDataStore::removeData):
1659
1660 2015-06-10  Brent Fulgham  <bfulgham@apple.com>
1661
1662         [WK2] Do not indicate Media Keys are present when they are not
1663         https://bugs.webkit.org/show_bug.cgi?id=145713
1664         <rdar://problem/19752566>
1665
1666         Reviewed by Dean Jackson.
1667
1668         Correct the reporting of Media Key presence by checking for the actual
1669         media key file, not just the directory. Sometimes the directory will exist
1670         with no media key files (e.g., if a user navigates to the directory using
1671         the Finder).
1672
1673         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1674         (WebKit::computeMediaKeyFile): Moved earlier in file so it could be used by
1675         the 'mediaKeyOrigins' method.
1676         (WebKit::WebsiteDataStore::mediaKeyOrigins): Only indicate we have a media key
1677         origin if the folder actually contains the media key file.
1678         (WebKit::WebsiteDataStore::removeMediaKeys): Use the existing 'computeMediaKeyFile',
1679         rather than manually building the file from strings.
1680
1681 2015-06-09  Anders Carlsson  <andersca@apple.com>
1682
1683         Support fetching website data
1684         https://bugs.webkit.org/show_bug.cgi?id=145828
1685
1686         Reviewed by Darin Adler.
1687
1688         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1689         (WebKit::WebsiteDataStore::fetchData):
1690         (WebKit::WebsiteDataStore::plugins):
1691         * UIProcess/WebsiteData/WebsiteDataStore.h:
1692
1693 2015-06-10  Zan Dobersek  <zdobersek@igalia.com>
1694
1695         Unreviewed. Fixing the build for the GTK port with Clang.
1696
1697         * UIProcess/gtk/InputMethodFilter.h: Add the <functional> header inclusion
1698         to avoid compilation errors due to missing std::function<>.
1699
1700 2015-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1701
1702         [GTK] Move KeyBindingTranslator from platform to WebKit2 layer
1703         https://bugs.webkit.org/show_bug.cgi?id=145840
1704
1705         Reviewed by Martin Robinson.
1706
1707         It's currently used only by WebKit2 in the UI process and it's
1708         another file built twice because of the GTK2 plugin process.
1709
1710         * PlatformGTK.cmake:
1711         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1712         * UIProcess/gtk/KeyBindingTranslator.cpp: Renamed from Source/WebCore/platform/gtk/KeyBindingTranslator.cpp.
1713         (WebKit::backspaceCallback):
1714         (WebKit::selectAllCallback):
1715         (WebKit::cutClipboardCallback):
1716         (WebKit::copyClipboardCallback):
1717         (WebKit::pasteClipboardCallback):
1718         (WebKit::toggleOverwriteCallback):
1719         (WebKit::popupMenuCallback):
1720         (WebKit::showHelpCallback):
1721         (WebKit::deleteFromCursorCallback):
1722         (WebKit::moveCursorCallback):
1723         (WebKit::KeyBindingTranslator::KeyBindingTranslator):
1724         (WebKit::KeyBindingTranslator::commandsForKeyEvent):
1725         * UIProcess/gtk/KeyBindingTranslator.h: Renamed from Source/WebCore/platform/gtk/KeyBindingTranslator.h.
1726         (WebKit::KeyBindingTranslator::addPendingEditorCommand):
1727
1728 2015-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1729
1730         [GTK] Get rid of GetEditorCommandsForKeyEvent sync message
1731         https://bugs.webkit.org/show_bug.cgi?id=145598
1732
1733         Reviewed by Žan Doberšek.
1734
1735         We are sending GetEditorCommandsForKeyEvent sync message from web
1736         process to the UI process for every key pressed. And if the
1737         keydown event doesn't handle the key, the message is sent again
1738         for the keypress event, so in many cases it happens twice per
1739         keypress. We can get the list of commands when the key press event
1740         happens in the web view, and send it to the web process as part of
1741         the keyboard event like mac port does. In the web process,
1742         commands not inserting text will be handled by keydown and the
1743         rest in keypress without having to use any other IPC message for that.
1744
1745         * Shared/NativeWebKeyboardEvent.h: Add command list parameter to
1746         the constructor.
1747         * Shared/WebEvent.h: Add GTK specific constructor that receives a
1748         list of commands and whether the event was handled by input methods.
1749         (WebKit::WebKeyboardEvent::commands): Returns the list of commands.
1750         * Shared/WebEventConversion.cpp:
1751         (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
1752         Also copy the commands and handledByInputMethod member.
1753         * Shared/WebKeyboardEvent.cpp:
1754         (WebKit::WebKeyboardEvent::WebKeyboardEvent): Implement GTK
1755         specific constructor that receives a list of commands and whether
1756         the event was handled by input methods.
1757         (WebKit::WebKeyboardEvent::encode): Encode commands and handledByInputMethod.
1758         (WebKit::WebKeyboardEvent::decode): Decode commands and handledByInputMethod.
1759         * Shared/gtk/NativeWebKeyboardEventGtk.cpp:
1760         (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): Add
1761         command list parameter to the constructor.
1762         * Shared/gtk/WebEventFactory.cpp:
1763         (WebKit::WebEventFactory::createWebKeyboardEvent): Use the new
1764         WebKeyboardEvent constructor and simplify the code. We don't need
1765         to explicitly set VK_PROCESSKEY as windows virtual key code when
1766         the event was handled by input methods. The WebCore event handler
1767         already does that.
1768         * Shared/gtk/WebEventFactory.h:
1769         * UIProcess/API/gtk/PageClientImpl.cpp:
1770         (WebKit::PageClientImpl::getEditorCommandsForKeyEvent): Deleted.
1771         * UIProcess/API/gtk/PageClientImpl.h:
1772         * UIProcess/API/gtk/WebKitWebViewBase.cpp: Add a
1773         KeyBindingTranslator member.
1774         (webkitWebViewBaseKeyPressEvent): Use the new
1775         InputMethodFilter::filterKeyEvent() API and get the list of
1776         commands for the key when events was not handled by input methods.
1777         (webkitWebViewBaseKeyReleaseEvent): Use the new
1778         InputMethodFilter::filterKeyEvent() API.
1779         * UIProcess/PageClient.h:
1780         * UIProcess/WebPageProxy.messages.in: Remove GetEditorCommandsForKeyEvent message.
1781         * UIProcess/gtk/InputMethodFilter.cpp:
1782         (WebKit::InputMethodFilter::handleKeyboardEvent): Call the
1783         completation handler.
1784         (WebKit::InputMethodFilter::handleKeyboardEventWithCompositionResults): Ditto.
1785         (WebKit::InputMethodFilter::filterKeyEvent): Use a completion
1786         handler for the task, so that the caller (the web view) can handle
1787         the keyboard event.
1788         * UIProcess/gtk/InputMethodFilter.h:
1789         * UIProcess/gtk/WebPageProxyGtk.cpp:
1790         (WebKit::WebPageProxy::getEditorCommandsForKeyEvent): Deleted.
1791         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
1792         (WebKit::WebEditorClient::handleKeyboardEvent): Return earlier if
1793         the event was handled by input methods. And get the list of
1794         commands from the PlatformKeyboardEvent instead of sending a sync
1795         message to the UI process.
1796         (WebKit::WebEditorClient::handleInputMethodKeydown): If the event
1797         was handled by inpout methods, set the event as default handled so
1798         that the WebCore event handler sets VK_PROCESSKEY as windows
1799         virtual key code.
1800         (WebKit::WebEditorClient::getEditorCommandsForKeyEvent): Deleted.
1801
1802 2015-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1803
1804         Unreviewed. Fix GTK build after r185412.
1805
1806         Add missing include.
1807
1808         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
1809
1810 2015-06-10  Antti Koivisto  <antti@apple.com>
1811
1812         NetworkCache: Delete old cache versions
1813         https://bugs.webkit.org/show_bug.cgi?id=145800
1814
1815         Reviewed by Darin Adler.
1816
1817         * CMakeLists.txt:
1818         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
1819         (WebKit::NetworkCache::BlobStorage::synchronize):
1820         * NetworkProcess/cache/NetworkCacheFileSystem.cpp: Added.
1821         (WebKit::NetworkCache::directoryEntryType):
1822         (WebKit::NetworkCache::traverseDirectory):
1823
1824             Pass entry type as callback argument.
1825
1826         (WebKit::NetworkCache::deleteDirectoryRecursively):
1827
1828             Add helper.
1829
1830         (WebKit::NetworkCache::fileTimes):
1831         (WebKit::NetworkCache::updateFileModificationTimeIfNeeded):
1832         * NetworkProcess/cache/NetworkCacheFileSystem.h: Copied from Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystemPosix.h.
1833
1834             Move code to cpp.
1835
1836         (WebKit::NetworkCache::traverseDirectory): Deleted.
1837         (WebKit::NetworkCache::traverseCacheFiles): Deleted.
1838         (WebKit::NetworkCache::fileTimes): Deleted.
1839         (WebKit::NetworkCache::updateFileModificationTimeIfNeeded): Deleted.
1840         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h: Removed.
1841         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1842         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
1843         (WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache):
1844         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1845         (WebKit::NetworkCache::makeBlobDirectoryPath):
1846         (WebKit::NetworkCache::traverseRecordsFiles):
1847
1848             Move cache hierarchy aware traversal code here from NetworkCacheFileSystem (for better layering).
1849             Rename for clarity.
1850
1851         (WebKit::NetworkCache::deleteEmptyRecordsDirectories):
1852
1853             Factor to a function.
1854
1855         (WebKit::NetworkCache::Storage::Storage):
1856         (WebKit::NetworkCache::Storage::synchronize):
1857         (WebKit::NetworkCache::Storage::traverse):
1858         (WebKit::NetworkCache::Storage::clear):
1859
1860             Use traverseRecordsFiles for traversal.
1861
1862         (WebKit::NetworkCache::Storage::shrink):
1863         (WebKit::NetworkCache::Storage::deleteOldVersions):
1864
1865             Delete version subdirectories with version number less than the current version.
1866             Remove code for clearing unversioned V1 caches. No one should have them.
1867
1868         * NetworkProcess/cache/NetworkCacheStorage.h:
1869         * UIProcess/API/APIUserContentExtensionStore.cpp:
1870         * WebKit2.xcodeproj/project.pbxproj:
1871
1872 2015-06-10  Zan Dobersek  <zdobersek@igalia.com>
1873
1874         [GTK] Web Inspector is broken
1875         https://bugs.webkit.org/show_bug.cgi?id=145836
1876
1877         Reviewed by Carlos Garcia Campos.
1878
1879         * PlatformGTK.cmake: Thread the InspectorBackendCommands.js file as a separate
1880         dependency of InspectorGResourceBundle.xml. It can't be listed under the InspectorFiles
1881         variable and then searched via the CMake glob command because it probably won't exist
1882         at the time the command is run (since it's copied into the specified path), so it won't
1883         be listed among the dependencies at all.
1884
1885 2015-06-09  Anders Carlsson  <andersca@apple.com>
1886
1887         Fix build.
1888
1889         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
1890         (WebKit::WebPluginSiteDataManager::GetSitesWithDataState::getSitesWithDataForNextPlugin):
1891
1892 2015-06-09  Anders Carlsson  <andersca@apple.com>
1893
1894         Change the PluginProcessManager data fetching function to take a completion handler
1895         https://bugs.webkit.org/show_bug.cgi?id=145821
1896
1897         Reviewed by Sam Weinig.
1898
1899         * UIProcess/Plugins/PluginProcessManager.cpp:
1900         (WebKit::PluginProcessManager::fetchWebsiteData):
1901         (WebKit::PluginProcessManager::getSitesWithData): Deleted.
1902         * UIProcess/Plugins/PluginProcessManager.h:
1903         * UIProcess/Plugins/PluginProcessProxy.cpp:
1904         (WebKit::generateCallbackID):
1905         (WebKit::PluginProcessProxy::~PluginProcessProxy):
1906         (WebKit::PluginProcessProxy::fetchWebsiteData):
1907         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
1908         (WebKit::PluginProcessProxy::didFinishLaunching):
1909         (WebKit::PluginProcessProxy::didGetSitesWithData):
1910         (WebKit::PluginProcessProxy::getSitesWithData): Deleted.
1911         * UIProcess/Plugins/PluginProcessProxy.h:
1912         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
1913         (WebKit::WebPluginSiteDataManager::GetSitesWithDataState::getSitesWithDataForNextPlugin):
1914
1915 2015-06-09  Anders Carlsson  <andersca@apple.com>
1916
1917         Add code to keep track of plug-in data host names in website data records
1918         https://bugs.webkit.org/show_bug.cgi?id=145818
1919
1920         Reviewed by Andreas Kling.
1921
1922         * Shared/WebsiteData/WebsiteData.cpp:
1923         (WebKit::WebsiteData::encode):
1924         (WebKit::WebsiteData::decode):
1925         * Shared/WebsiteData/WebsiteData.h:
1926         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
1927         (WebKit::WebsiteDataRecord::displayNameForPluginDataHostName):
1928         (WebKit::WebsiteDataRecord::addPluginDataHostName):
1929         (WebKit::WebsiteDataRecord::displayNameForCookieHostName): Deleted.
1930         * UIProcess/WebsiteData/WebsiteDataRecord.h:
1931         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1932         (WebKit::WebsiteDataStore::fetchData):
1933
1934 2015-06-09  Anders Carlsson  <andersca@apple.com>
1935
1936         Add Plug-in type declarations to WKWebsiteDataRecord and friends
1937         https://bugs.webkit.org/show_bug.cgi?id=145816
1938
1939         Reviewed by Andreas Kling.
1940
1941         * Shared/WebsiteData/WebsiteDataTypes.h:
1942         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
1943         (dataTypesToString):
1944         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
1945         (WebKit::toWebsiteDataTypes):
1946         (WebKit::toWKWebsiteDataTypes):
1947         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
1948
1949 2015-06-09  Antti Koivisto  <antti@apple.com>
1950
1951         REGRESSION(r185262): NetworkCache is in wrong location on OS X
1952         https://bugs.webkit.org/show_bug.cgi?id=145812
1953
1954         Reviewed by Anders Carlsson.
1955
1956         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1957         (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory):
1958         (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory):
1959         (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory):
1960         (WebKit::WebProcessPool::isNetworkCacheEnabled):
1961
1962             Make sure static functions that use NSUserDefaults call registerUserDefaultsIfNeeded() first.
1963
1964 2015-06-09  Yusuke Suzuki  <utatane.tea@gmail.com>
1965
1966         Crash when passing Symbol to NPAPI plugin objects
1967         https://bugs.webkit.org/show_bug.cgi?id=145798
1968
1969         Reviewed by Darin Adler.
1970
1971         When the symbol is passed, `propertyName.publicName()` becomes nullptr.
1972         So dereferencing it causes null dereference errors.
1973         At first, this bug appears in the https://bugs.webkit.org/show_bug.cgi?id=145556,
1974         plugin[@@toStringTag] ("string" + plugin) causes SEGV in plugins/embed-inside-object.html test.
1975
1976         This patch avoids it by early returning when the symbols are passed.
1977         Methods for symbols are not implemented in the NPObject side, so it works correctly.
1978
1979         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
1980         (WebKit::npIdentifierFromIdentifier):
1981         (WebKit::JSNPObject::callMethod):
1982         (WebKit::JSNPObject::getOwnPropertySlot):
1983         (WebKit::JSNPObject::put):
1984         (WebKit::JSNPObject::deleteProperty):
1985         (WebKit::JSNPObject::propertyGetter):
1986         (WebKit::JSNPObject::methodGetter):
1987
1988 2015-06-09  Carlos Garcia Campos  <cgarcia@igalia.com>
1989
1990         [SOUP] Network Cache: Give more priority to reads over writes in IO WorkQueue
1991         https://bugs.webkit.org/show_bug.cgi?id=145791
1992
1993         Reviewed by Sergio Villar Senin.
1994
1995         Keep using G_PRIORITY_DEFAULT for reads, but use
1996         G_PRIORITY_DEFAULT_IDLE for writes now.
1997
1998         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
1999         (WebKit::NetworkCache::outputStreamWriteReadyCallback): Use
2000         G_PRIORITY_DEFAULT_IDLE for write async operations.
2001         (WebKit::NetworkCache::IOChannel::write): Pass
2002         G_PRIORITY_DEFAULT_IDLE to runTaskInQueue().
2003
2004 2015-06-09  Carlos Garcia Campos  <cgarcia@igalia.com>
2005
2006         [SOUP] Network Cache: run the IO completion handler in the given queue instead of the whole operation
2007         https://bugs.webkit.org/show_bug.cgi?id=145797
2008
2009         Reviewed by Žan Doberšek.
2010
2011         I misunderstood what the WorkQueue parameter meant in the IO
2012         channel operations. It's the queue where the completion handler
2013         should be run, not the whole operation. Since our operations are
2014         already non-blocking, we can just run the read/writes in the main
2015         thread, and schedule the completion handler in the given work
2016         queue when the operation finishes.
2017
2018         * NetworkProcess/cache/NetworkCacheIOChannel.h:
2019         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
2020         (WebKit::NetworkCache::inputStreamReadReadyCallback):
2021         (WebKit::NetworkCache::IOChannel::read):
2022         (WebKit::NetworkCache::IOChannel::readSync):
2023         (WebKit::NetworkCache::outputStreamWriteReadyCallback):
2024         (WebKit::NetworkCache::IOChannel::write):
2025
2026 2015-06-09  David Kilzer  <ddkilzer@apple.com>
2027
2028         REGRESSION (r185357): Fix build for iOS 8.x
2029
2030         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2031         (fallbackIconForFile): Add cast prior to iOS 9.
2032
2033 2015-06-09  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2034
2035         [EFL] Fix a crash on MiniBrowser when running on debug mode
2036         https://bugs.webkit.org/show_bug.cgi?id=145793
2037
2038         Reviewed by Carlos Garcia Campos.
2039
2040         r185314 missed to initialize parameters.diskCacheDirectory with configuration's one.
2041
2042         * UIProcess/efl/WebProcessPoolEfl.cpp:
2043         (WebKit::WebProcessPool::platformInitializeWebProcess):
2044
2045 2015-06-09  Csaba Osztrogonác  <ossy@webkit.org>
2046
2047         [cmake] Fix the style issues in cmake project files
2048         https://bugs.webkit.org/show_bug.cgi?id=145755
2049
2050         Reviewed by Darin Adler.
2051
2052         * CMakeLists.txt:
2053         * PlatformGTK.cmake:
2054         * PlatformMac.cmake:
2055
2056 2015-06-02  Jon Honeycutt  <jhoneycutt@apple.com>
2057
2058         [iOS] UI process memory spike, hang when uploading a very large JPEG
2059
2060         <https://bugs.webkit.org/show_bug.cgi?id=145567>
2061         <rdar://problem/21206699>
2062
2063         When uploading an image, we generate a thumbnail to use for an icon
2064         that sits next to the control. To do this, we load the image and draw
2065         it into a thumbnail-sized canvas. This can be very expensive for large
2066         images.
2067
2068         To fix this, we'll use CGImageSource API, which will allow us to get
2069         any existing thumbnail that exists in the source file.
2070
2071         Reviewed by Darin Adler.
2072
2073         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2074         (squareCropRectForSize):
2075         Use std::round, based on Darin's review feedback that a) rintf is
2076         incorrect in 64-bit systems where CGFloat is a double, b) rintf uses a
2077         variable rounding mode, which is undesirable.
2078         (squareImage):
2079         Changed to take a CGImageRef.
2080         Use RetainPtr and +[UIImage imageWithCGImage:] to match other code in
2081         this file.
2082         (thumbnailSizedImageForImage):
2083         Changed to take a CGImageRef and to use iconSideLength.
2084         (iconForImageFile):
2085         Create an image source for the file, then use CGImageSource API to
2086         generate a thumbnail.
2087         (-[_WKImageFileUploadItem initWithFileURL:originalImage:]): Deleted.
2088         (-[_WKImageFileUploadItem displayImage]):
2089         Use iconForImageFile() rather than trying to generate an icon from the
2090         UIImage.
2091         (-[WKFileUploadPanel _uploadItemForImageData:imageName:successBlock:failureBlock:]):
2092         Removed originalImage parameter; _WKImageFileUploadItem no longer uses
2093         it.
2094         (-[WKFileUploadPanel _uploadItemForJPEGRepresentationOfImage:successBlock:failureBlock:]):
2095         (-[WKFileUploadPanel _uploadItemForImage:withAssetURL:successBlock:failureBlock:]):
2096
2097 2015-06-08  Dan Bernstein  <mitz@apple.com>
2098
2099         [Cocoa] Use generics in framework headers
2100         https://bugs.webkit.org/show_bug.cgi?id=145781
2101
2102         Reviewed by Sam Weinig.
2103
2104         * mac/postprocess-framework-headers.sh: Use the parameter to WK_ARRAY and WK_SET.
2105
2106 2015-06-08  Chris Dumez  <cdumez@apple.com>
2107
2108         Access GCController instance via GCController::singleton() instead of a free function
2109         https://bugs.webkit.org/show_bug.cgi?id=145776
2110
2111         Reviewed by Darin Adler.
2112
2113         Access GCController instance via GCController::singleton() instead of a
2114         free function as per coding style and for consistency with other
2115         singleton classes in the codebase.
2116
2117         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2118         (WebKit::InjectedBundle::garbageCollectJavaScriptObjects):
2119         (WebKit::InjectedBundle::garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging):
2120         * WebProcess/WebProcess.cpp:
2121         (WebKit::WebProcess::terminate):
2122         (WebKit::WebProcess::didClose):
2123         (WebKit::WebProcess::garbageCollectJavaScriptObjects):
2124         (WebKit::WebProcess::setJavaScriptGarbageCollectorTimerEnabled):
2125
2126 2015-06-08  Anders Carlsson  <andersca@apple.com>
2127
2128         Include IndexedDB databases in -[WKWebsiteDataStore allWebsiteDataTypes]
2129         https://bugs.webkit.org/show_bug.cgi?id=145775
2130
2131         Reviewed by Simon Fraser.
2132
2133         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
2134         (+[WKWebsiteDataStore allWebsiteDataTypes]):
2135
2136 2015-06-08  Anders Carlsson  <andersca@apple.com>
2137
2138         Move the snapshot layer contents SPI to the web view
2139         https://bugs.webkit.org/show_bug.cgi?id=145771
2140
2141         Reviewed by Geoffrey Garen.
2142
2143         We need to potentially ask the web page to take a snapshot of the current item,
2144         so move the SPI to WKWebView and name it appropriately.
2145
2146         * UIProcess/API/Cocoa/WKBackForwardListItem.mm:
2147         (-[WKBackForwardListItem _snapshotLayerContents]): Deleted.
2148         * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h: Removed.
2149         * UIProcess/API/Cocoa/WKWebView.mm:
2150         (-[WKWebView _snapshotLayerContentsForBackForwardListItem:]):
2151         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2152         * WebKit2.xcodeproj/project.pbxproj:
2153
2154 2015-06-08  Brady Eidson  <beidson@apple.com>
2155
2156         Completely remove all IDB properties/constructors when it is disabled at runtime.
2157         rdar://problem/18429374 and https://bugs.webkit.org/show_bug.cgi?id=137034
2158
2159         Reviewed by Geoffrey Garen.
2160
2161         * WebProcess/WebProcess.cpp:
2162         (WebKit::WebProcess::WebProcess): Enable IDB at runtime if it's enabled at compile time.
2163
2164 2015-06-08  Michael Catanzaro  <mcatanzaro@igalia.com>
2165
2166         [SOUP] Performs DNS prefetch when a proxy is configured (information leak)
2167         https://bugs.webkit.org/show_bug.cgi?id=145542
2168
2169         Reviewed by Alexey Proskuryakov.
2170
2171         Add documentation to webkit_web_context_prefetch_dns to indicate that the function does
2172         nothing if the system configuration indicates we should use a proxy to resolve the host.
2173
2174         * UIProcess/API/gtk/WebKitWebContext.cpp:
2175
2176 2015-06-08  Carlos Garcia Campos  <cgarcia@igalia.com>
2177
2178         REGRESSION(r185251): [GTK] webkit_web_context_set_disk_cache_directory() doesn't work when using shared secondary process model after r185251
2179         https://bugs.webkit.org/show_bug.cgi?id=145751
2180
2181         Reviewed by Darin Adler.
2182
2183         In r185251 the CFNetwork cache was disabled in the web process,
2184         but it also removed the disk cache directory web process
2185         initialization parameter. While we support networking in the web
2186         process when shared secondary process model is used, the network
2187         cache should still work. We can remove this if we eventually
2188         switch to use the network process unconditionally.
2189
2190         * Shared/WebProcessCreationParameters.cpp:
2191         (WebKit::WebProcessCreationParameters::encode): Encode disk cache directory.
2192         (WebKit::WebProcessCreationParameters::decode): Decode disk cache directory.
2193         * Shared/WebProcessCreationParameters.h: Bring back disk cache directory only for soup.
2194         * UIProcess/gtk/WebProcessPoolGtk.cpp:
2195         (WebKit::WebProcessPool::platformInitializeWebProcess): Initialize disk cache directory parameter.
2196         * WebProcess/soup/WebProcessSoup.cpp:
2197         (WebKit::WebProcess::platformInitializeWebProcess): Use the disck cache directory parameter again.
2198
2199 2015-06-08  Csaba Osztrogonác  <ossy@webkit.org>
2200
2201         [GTK] Remove the unused scroll function from WebPageGtk.cpp
2202         https://bugs.webkit.org/show_bug.cgi?id=145756
2203
2204         Reviewed by Carlos Garcia Campos.
2205
2206         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
2207         (WebKit::scroll): Deleted.
2208
2209 2015-06-08  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2210
2211         REGRESSION(r185262): [EFL] Modify legacyPlatformDefaultNetworkCacheDirectory() according to network cache
2212         https://bugs.webkit.org/show_bug.cgi?id=145752
2213
2214         Reviewed by Carlos Garcia Campos.
2215
2216         EFL port needs to add different prefix for network cache directory since r185262.
2217         Modify it basedon GTK port fix.
2218
2219         * UIProcess/efl/WebProcessPoolEfl.cpp:
2220         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
2221
2222 2015-06-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2223
2224         REGRESSION(r185262): [GTK] webkit_web_context_set_disk_cache_directory() doesn't work after r185262
2225         https://bugs.webkit.org/show_bug.cgi?id=145735
2226
2227         Reviewed by Darin Adler.
2228
2229         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2230         (WebKit::NetworkProcess::platformInitializeNetworkProcess): Use
2231         the directory name to clear the old cache, since the disk cache
2232         subdirectory is now added in the UI process.
2233         * UIProcess/API/gtk/WebKitWebContext.cpp:
2234         (webkit_web_context_set_disk_cache_directory): Update the
2235         WebProcessPool configuration to override the disk cache directory.
2236         * UIProcess/WebProcessPool.cpp:
2237         (WebKit::WebProcessPool::ensureNetworkProcess): Use the
2238         configuration to get the disk cache directory.
2239         (WebKit::WebProcessPool::WebProcessPool): Remove
2240         m_diskCacheDirectory member initialization.
2241         * UIProcess/WebProcessPool.h: Remove m_diskCacheDirectory member.
2242         * UIProcess/gtk/WebProcessPoolGtk.cpp:
2243         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
2244         Append the disk cache subdirectory.
2245
2246 2015-06-07  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2247
2248         [EFL][GTK] Fix build  break since r185262
2249         https://bugs.webkit.org/show_bug.cgi?id=145724
2250
2251         Unreviewed, fix build break for EFL and GTK ports.
2252
2253         * UIProcess/API/APIWebsiteDataStore.cpp:
2254         (API::WebsiteDataStore::defaultLocalStorageDirectory):
2255         (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
2256         (API::WebsiteDataStore::defaultNetworkCacheDirectory):
2257         (API::WebsiteDataStore::defaultApplicationCacheDirectory):
2258         (API::WebsiteDataStore::defaultMediaKeysStorageDirectory):
2259         (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
2260         * UIProcess/efl/WebProcessPoolEfl.cpp:
2261         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
2262         (WebKit::WebProcessPool::platformDefaultDiskCacheDirectory): Deleted.
2263         * WebProcess/soup/WebProcessSoup.cpp:
2264         (WebKit::WebProcess::platformInitializeWebProcess):
2265
2266 2015-06-06  Dan Bernstein  <mitz@apple.com>
2267
2268         Don’t enable manual sandboxing in the iOS Simulator. This should fix all the tests timing out.
2269
2270         * Configurations/DebugRelease.xcconfig:
2271
2272 2015-06-06  Dan Bernstein  <mitz@apple.com>
2273
2274         [iOS] Can’t debug with Development XPC services due to automatic sandboxing
2275         https://bugs.webkit.org/show_bug.cgi?id=145731
2276
2277         Rubber-stamped by Darin Adler.
2278
2279         In iOS, the XPC services are automatically sandboxed based on their entitlements. The
2280         sandbox doesn’t allow them to re-exec, which is necessary for linking against engineering
2281         builds of the WebKit frameworks placed in a non-system location.
2282
2283         The solution is to opt Engineering builds into manual sandboxing.
2284
2285         * Configurations/BaseTarget.xcconfig:
2286         - Add ENABLE_MANUAL_SANDBOXING to
2287           GCC_PREPROCESSOR_DEFINITIONS when WK_MANUAL_SANDBOXING_ENABLED is YES.
2288         - Set WK_MANUAL_SANDBOXING_ENABLED to YES for OS X, because we always use manual
2289           sandboxing on that platform.
2290
2291         * Configurations/DebugRelease.xcconfig: Removed unused definition of DEBUG_OR_RELEASE. Set
2292           WK_MANUAL_SANDBOXING_ENABLED to YES for all engineering builds.
2293
2294         * Configurations/BaseXPCService.xcconfig: Define CODE_SIGN_ENTITLEMENTS for iOS to be empty
2295           if the service is not installed; to use the base entitlements file from Configurations if
2296           manual sandboxing is not enabled; and to use a derived entitlements file, which doesn’t
2297           specify a sandbox profile, if manual sandboxing is enabled.
2298
2299         * Configurations/DatabaseService.Development.xcconfig: Define
2300           WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE and let BaseXPCService.xcconfig define
2301           CODE_SIGN_ENTITLEMENTS for iOS.
2302
2303         * Configurations/DatabaseService.xcconfig: Ditto.
2304         * Configurations/NetworkService.Development.xcconfig: Ditto.
2305         * Configurations/NetworkService.xcconfig: Ditto.
2306         * Configurations/WebContentService.Development.xcconfig: Ditto.
2307         * Configurations/WebContentService.xcconfig: Ditto.
2308
2309         * WebKit2.xcodeproj/project.pbxproj:
2310         - In the Derived Sources target, added a Derive Entitlements for Manual Sandboxing script
2311           build phase. When building for iOS with manual sandboxing enabled, it creates copies of
2312           the iOS entitlements files with a -no-sandbox suffix and the seatbelt-profiles key
2313           removed.
2314         - In the WebKit target, added a Copy iOS Sandbox Profiles for Manual Sandboxing script build
2315           phase. When building for iOS with manual sandboxing enabled, it copies the iOS sandbox
2316           profiles into the framework, so that the services can apply them to themselves at runtime.
2317
2318         * Shared/ios/ChildProcessIOS.mm:
2319         (WebKit::ChildProcess::initializeSandbox): Use ENABLE(MANUAL_SANDBOXING) and don’t define it
2320         here.
2321
2322         * WebProcess/cocoa/WebProcessCocoa.mm:
2323         (WebKit::WebProcess::initializeSandbox): Use ENABLE(MANUAL_SANDBOXING) instead of defining
2324         and using ENABLE_MANUAL_WEBPROCESS_SANDBOXING here.
2325
2326 2015-06-06  Anders Carlsson  <andersca@apple.com>
2327
2328         Remove support from getting plug-in information from Carbon resources
2329         https://bugs.webkit.org/show_bug.cgi?id=145730
2330
2331         Reviewed by Dan Bernstein.
2332
2333         No current plug-in versions use this feature, and both Chrome and Mozilla for
2334         Mac stopped looking at Carbon resources years ago.
2335
2336         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
2337         (WebKit::NetscapePluginModule::getPluginInfo):
2338         (WebKit::ResourceMap::ResourceMap): Deleted.
2339         (WebKit::ResourceMap::~ResourceMap): Deleted.
2340         (WebKit::ResourceMap::isValid): Deleted.
2341         (WebKit::getStringListResource): Deleted.
2342         (WebKit::getPluginInfoFromCarbonResources): Deleted.
2343
2344 2015-06-05  Anders Carlsson  <andersca@apple.com>
2345
2346         Only allow plug-ins to create custom MIME property lists on older versions of OS X
2347         https://bugs.webkit.org/show_bug.cgi?id=145716
2348
2349         Reviewed by Dan Bernstein.
2350
2351         * PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm:
2352         * Shared/Plugins/Netscape/NetscapePluginModule.h:
2353         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
2354         (WebKit::getMIMETypesFromPluginBundle):
2355         * UIProcess/Plugins/PluginProcessProxy.h:
2356         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
2357
2358 2015-06-05  Chris Dumez  <cdumez@apple.com>
2359
2360         [WK2][iOS] Limit the number of vnodes used by the WebContent processes
2361         https://bugs.webkit.org/show_bug.cgi?id=145672
2362         <rdar://problem/21126637>
2363
2364         Reviewed by Antti Koivisto.
2365
2366         Have the WebContent process register a vnode pressure handler on iOS,
2367         which calls the memory pressure handler.
2368
2369         On non-critical pressure, it will prune dead resources from the memory
2370         cache, which should free up some vnodes. On critical pressure, the
2371         handler will clear the PageCache and do a JS GC, which should free even
2372         more vnodes.
2373
2374         * WebProcess/cocoa/WebProcessCocoa.mm:
2375         (WebKit::WebProcess::platformInitializeWebProcess):
2376
2377 2015-06-05  Anders Carlsson  <andersca@apple.com>
2378
2379         Fix refacto, don't put IndexedDB databases in the cache directory
2380         https://bugs.webkit.org/show_bug.cgi?id=145714
2381
2382         Reviewed by Antti Koivisto.
2383
2384         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
2385         (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
2386
2387 2015-06-05  Anders Carlsson  <andersca@apple.com>
2388
2389         Make the network cache directory part of WKContextConfigurationRef
2390         https://bugs.webkit.org/show_bug.cgi?id=145711
2391
2392         Reviewed by Antti Koivisto.
2393
2394         Also, make the UI process be in control of where we place the new network cache.
2395         When using the Modern WebKit API, put the cache in ~/Library/Caches/<Bundle ID>/WebKit/NetworkCache,
2396         and put the cache in ~/Library/Caches/<Bundle ID>/WebKitCache otherwise (this is just for Safari).
2397
2398         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2399         (WebKit::NetworkCache::Storage::open):
2400         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2401         (API::ProcessPoolConfiguration::createWithLegacyOptions):
2402         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
2403         (API::ProcessPoolConfiguration::copy):
2404         * UIProcess/API/APIProcessPoolConfiguration.h:
2405         * UIProcess/API/C/WKContext.cpp:
2406         (WKContextSetDiskCacheDirectory): Deleted.
2407         * UIProcess/API/C/WKContextConfigurationRef.cpp:
2408         (WKContextConfigurationCopyDiskCacheDirectory):
2409         (WKContextConfigurationSetDiskCacheDirectory):
2410         * UIProcess/API/C/WKContextConfigurationRef.h:
2411         * UIProcess/API/C/WKContextPrivate.h:
2412         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2413         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2414         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
2415         (WebKit::WebProcessPool::isNetworkCacheEnabled):
2416         (WebKit::WebProcessPool::platformDefaultDiskCacheDirectory): Deleted.
2417         * UIProcess/WebProcessPool.cpp:
2418         (WebKit::legacyWebsiteDataStoreConfiguration):
2419         (WebKit::WebProcessPool::WebProcessPool):
2420         (WebKit::WebProcessPool::ensureNetworkProcess):
2421         (WebKit::WebProcessPool::diskCacheDirectory): Deleted.
2422         * UIProcess/WebProcessPool.h:
2423
2424 2015-06-05  Anders Carlsson  <andersca@apple.com>
2425
2426         Make the application cache directory part of WKContextConfigurationRef
2427         https://bugs.webkit.org/show_bug.cgi?id=145704
2428
2429         Reviewed by Geoffrey Garen.
2430
2431         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2432         (API::ProcessPoolConfiguration::createWithLegacyOptions):
2433         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
2434         (API::ProcessPoolConfiguration::copy):
2435         * UIProcess/API/APIProcessPoolConfiguration.h:
2436         * UIProcess/API/C/WKContext.cpp:
2437         (WKContextSetApplicationCacheDirectory): Deleted.
2438         * UIProcess/API/C/WKContextConfigurationRef.cpp:
2439         (WKContextConfigurationCopyApplicationCacheDirectory):
2440         (WKContextConfigurationSetApplicationCacheDirectory):
2441         * UIProcess/API/C/WKContextConfigurationRef.h:
2442         * UIProcess/API/C/WKContextPrivate.h:
2443         * UIProcess/WebProcessPool.cpp:
2444         (WebKit::WebProcessPool::WebProcessPool):
2445         (WebKit::WebProcessPool::createNewWebProcess):
2446         (WebKit::WebProcessPool::applicationCacheDirectory): Deleted.
2447         * UIProcess/WebProcessPool.h:
2448
2449 2015-06-05  Mark Lam  <mark.lam@apple.com>
2450
2451         finally blocks should not set the exception stack trace when re-throwing the exception.
2452         https://bugs.webkit.org/show_bug.cgi?id=145525
2453
2454         Reviewed by Geoffrey Garen.
2455
2456         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2457         (WebKit::InjectedBundle::reportException):
2458         - Changed to use the new Exception object.
2459
2460 2015-06-05  Anders Carlsson  <andersca@apple.com>
2461
2462         Disable the CFNetwork cache in the web process
2463         https://bugs.webkit.org/show_bug.cgi?id=145700
2464         rdar://problem/20243343
2465
2466         Reviewed by Geoffrey Garen.
2467
2468         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2469         (WebKit::NetworkCache::Storage::open):
2470         * Shared/WebProcessCreationParameters.cpp:
2471         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters): Deleted.
2472         (WebKit::WebProcessCreationParameters::encode): Deleted.
2473         (WebKit::WebProcessCreationParameters::decode): Deleted.
2474         * Shared/WebProcessCreationParameters.h:
2475         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2476         (WebKit::WebProcessPool::platformInitializeWebProcess): Deleted.
2477         * UIProcess/WebProcessPool.cpp:
2478         (WebKit::WebProcessPool::createNewWebProcess): Deleted.
2479         * WebProcess/WebProcess.cpp:
2480         (WebKit::WebProcess::WebProcess): Deleted.
2481         (WebKit::WebProcess::initializeWebProcess): Deleted.
2482         * WebProcess/WebProcess.h:
2483         * WebProcess/cocoa/WebProcessCocoa.mm:
2484         (WebKit::WebProcess::platformClearResourceCaches):
2485         (WebKit::WebProcess::platformInitializeWebProcess):
2486         (WebKit::WebProcess::platformSetCacheModel): Deleted.
2487         (WebKit::WebProcess::platformTerminate): Deleted.
2488
2489 2015-06-05  Anders Carlsson  <andersca@apple.com>
2490
2491         Consolidate default website data directory computations
2492         https://bugs.webkit.org/show_bug.cgi?id=145698
2493
2494         Reviewed by Andreas Kling.
2495
2496         * UIProcess/API/APIProcessPoolConfiguration.cpp:
2497         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
2498         * UIProcess/API/APIWebsiteDataStore.h:
2499         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
2500         (API::WebsiteDataStore::defaultApplicationCacheDirectory):
2501         (API::WebsiteDataStore::defaultNetworkCacheDirectory):
2502         (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
2503         (API::WebsiteDataStore::defaultLocalStorageDirectory):
2504         (API::WebsiteDataStore::defaultMediaKeysStorageDirectory):
2505         (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
2506         (API::WebsiteDataStore::defaultDataStoreConfiguration):
2507         (API::applicationCacheDirectory): Deleted.
2508
2509 2015-06-01  Jon Honeycutt  <jhoneycutt@apple.com>
2510
2511         [iOS] Uploading an animated GIF from the photo library uploads a JPEG
2512
2513         <https://bugs.webkit.org/show_bug.cgi?id=145539>
2514         <rdar://problem/19760877
2515
2516         Selecting a photo from the photo library using UIImagePickerController
2517         results in an NSDictionary with image info and a UIImage with the
2518         image. It's not possible to get the original image data from the
2519         UIImage, only a PNG or JPEG representation, so we were getting a JPEG
2520         representation and uploading that to the server. For animated GIFs,
2521         this meant a JPEG representation of the first frame.
2522
2523         To fix this, we'll get the asset URL, if available, and use the Photos
2524         API to query for the original image data.
2525
2526         Reviewed by Andy Estes and Joe Pecoraro.
2527
2528         * UIProcess/ios/forms/WKFileUploadPanel.mm:
2529         Soft link the Photos framework.
2530
2531         (-[WKFileUploadPanel _uploadItemForImageData:originalImage:imageName:successBlock:failureBlock:]):
2532         Save the image's data to a temporary location, and create a
2533         _WKImageFileUploadItem. Code moved from
2534         -_uploadItemFromMediaInfo:successBlock:failureBlock:.
2535
2536         (-[WKFileUploadPanel _uploadItemForJPEGRepresentationOfImage:successBlock:failureBlock:]):
2537         Get a JPEG representation of the UIImage, and create an upload item
2538         from that data.
2539
2540         (uploadImageNameFromUTI):
2541         Return a filename for the uploaded image based on the UTI.
2542
2543         (-[WKFileUploadPanel _uploadItemForImage:withAssetURL:successBlock:failureBlock:]):
2544         Fetch the photo asset with the given asset URL. Create an image manager
2545         object, and request the image data for the photo asset. Create an
2546         upload item from that data. If we fail, fall back to a JPEG
2547         representation.
2548
2549         (-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):
2550         Return early if the media item is not an image type. If it is, and we
2551         have an asset URL, try to create an upload item for the native image.
2552         If we don't have an asset URL, use a JPEG representation of the image.
2553
2554 2015-06-04  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2555
2556         REGRESSION(r185091): Crash happens on indexdb tests
2557         https://bugs.webkit.org/show_bug.cgi?id=145549
2558
2559         Reviewed by Darin Adler.
2560
2561         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp: Remove leakRef() use.
2562         (WebKit::WebIDBServerConnection::didCreateObjectStore):
2563         (WebKit::WebIDBServerConnection::didCreateIndex):
2564         (WebKit::WebIDBServerConnection::didDeleteIndex):
2565         (WebKit::WebIDBServerConnection::didPutRecord):
2566         (WebKit::WebIDBServerConnection::didGetRecord):
2567         (WebKit::WebIDBServerConnection::didOpenCursor):
2568         (WebKit::WebIDBServerConnection::didAdvanceCursor):
2569         (WebKit::WebIDBServerConnection::didIterateCursor):
2570         (WebKit::WebIDBServerConnection::didCount):
2571         (WebKit::WebIDBServerConnection::didDeleteRange):
2572         (WebKit::WebIDBServerConnection::didClearObjectStore):
2573         (WebKit::WebIDBServerConnection::didDeleteObjectStore):
2574         (WebKit::WebIDBServerConnection::didChangeDatabaseVersion):
2575
2576 2015-06-04  Joseph Pecoraro  <pecoraro@apple.com>
2577
2578         Web Inspector: REGRESSION: dragged node in the DOM Tree isn't positioned correctly
2579         https://bugs.webkit.org/show_bug.cgi?id=143912
2580
2581         Reviewed by Simon Fraser.
2582
2583         * UIProcess/mac/PageClientImpl.mm:
2584         (WebKit::PageClientImpl::setDragImage):
2585         When using the WKWebView, convert the position from the WKView's
2586         coordinate system to the WKWebView's.
2587
2588         * UIProcess/API/Cocoa/WKWebView.mm:
2589         (-[WKWebView draggingUpdated:]):
2590         * UIProcess/API/mac/WKView.mm:
2591         (-[WKView _dragImageForView:withImage:at:linkDrag:]):
2592         Whitespace cleanup in original drag code.
2593
2594 2015-06-04  Dan Bernstein  <mitz@apple.com>
2595
2596         Fixed the build.
2597
2598         * UIProcess/API/Cocoa/WKErrorPrivate.h:
2599
2600 2015-06-04  Dan Bernstein  <mitz@apple.com>
2601
2602         Renamed the WebKit2SandboxProfiles target to Sandbox Profiles.
2603
2604         Rubber-stamped by Anders Carlsson.
2605
2606         * WebKit2.xcodeproj/project.pbxproj: Renamed the target. For now, added an aggregate
2607         target with the old name that depends on the renamed target. We can remove it once the build
2608         system doesn’t reference to old name.
2609
2610 2015-06-03  Dan Bernstein  <mitz@apple.com>
2611
2612         [Cocoa] Expose interruptedForPolicyChangeError
2613         https://bugs.webkit.org/show_bug.cgi?id=145627
2614
2615         Reviewed by Anders Carlsson.
2616
2617         * UIProcess/API/Cocoa/WKErrorPrivate.h: Added WKErrorCodeFrameLoadInterruptedByPolicyChange with the same value as
2618         kWKErrorCodeFrameLoadInterruptedByPolicyChange.
2619
2620 2015-06-04  Chris Dumez  <cdumez@apple.com>
2621
2622         [WK2] Prune more resources from the MemoryCache before process suspension
2623         https://bugs.webkit.org/show_bug.cgi?id=145633
2624
2625         Reviewed by Andreas Kling.
2626
2627         * NetworkProcess/NetworkProcess.cpp:
2628         (WebKit::NetworkProcess::lowMemoryHandler):
2629         (WebKit::NetworkProcess::initializeNetworkProcess):
2630         (WebKit::NetworkProcess::processWillSuspendImminently):
2631         (WebKit::NetworkProcess::prepareToSuspend):
2632         * NetworkProcess/NetworkProcess.h:
2633         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
2634         (WebKit::NetworkProcess::platformLowMemoryHandler):
2635         * PluginProcess/PluginProcess.cpp:
2636         (WebKit::PluginProcess::initializeProcess):
2637
2638         Update low memory handler prototype to match WebCore changes.
2639
2640         * WebProcess/WebProcess.cpp:
2641         (WebKit::WebProcess::actualPrepareToSuspend):
2642
2643         Pass Synchronous::Yes argument to MemoryPressureHandler::releaseMemory()
2644         to request that the memory is free up synchronously (e.g. synchronous
2645         JS garbage collection) as the process is about to be suspended.
2646         Previously, the memory pressure handler was trying to detect this case
2647         by checking if the system was really under memory pressure but this was
2648         a bit hackish and it wouldn't work if the process happened to get
2649         suspended while the system was under memory pressure.
2650
2651 2015-06-03  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2652
2653         [GTK] [Wayland] Build is broken on trunk
2654         https://bugs.webkit.org/show_bug.cgi?id=142879
2655
2656         Reviewed by Carlos Garcia Campos.
2657
2658         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
2659         (WebKit::LayerTreeHostGtk::makeContextCurrent): When Wayland target
2660         is enabled GLNativeWindowType is not an u_int64 type.
2661         Cast contextID to avoid a build failure.
2662
2663 2015-06-03  Dan Bernstein  <mitz@apple.com>
2664
2665         Made WKBackForwardListItemPrivate.h a private header after it was added as internal in r185183.
2666
2667         * WebKit2.xcodeproj/project.pbxproj:
2668
2669 2015-06-03  Hyungwook Lee  <hyungwook.lee@navercorp.com>
2670
2671         [EFL] Implement window_object_cleared callback in EwkPageClient.
2672         https://bugs.webkit.org/show_bug.cgi?id=145603
2673
2674         Reviewed by Gyuyoung Kim.
2675
2676         We need to provide right timing for custom JS API that may need to work at the beginning of the page.
2677
2678         * UIProcess/API/efl/tests/extensions/extension_sample.cpp:
2679         * WebProcess/InjectedBundle/API/efl/ewk_page.cpp:
2680         (EwkPage::EwkPage):
2681         (EwkPage::didStartProvisionalLoadForFrame):
2682         (EwkPage::didClearWindowObjectForFrame):
2683         (EwkPage::didFinishDocumentLoadForFrame):
2684         * WebProcess/InjectedBundle/API/efl/ewk_page.h:
2685         * WebProcess/InjectedBundle/API/efl/ewk_page_private.h:
2686
2687 2015-06-03  Anders Carlsson  <andersca@apple.com>
2688
2689         Add SPI that returns the snapshot layer contents for a given back/forward list item
2690         https://bugs.webkit.org/show_bug.cgi?id=145621
2691
2692         Reviewed by Dan Bernstein.
2693
2694         * UIProcess/API/Cocoa/WKBackForwardListItem.mm:
2695         (-[WKBackForwardListItem _snapshotLayerContents]):
2696         * UIProcess/API/Cocoa/WKBackForwardListItemInternal.h:
2697         * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListItemInternal.h.
2698         * WebKit2.xcodeproj/project.pbxproj:
2699
2700 2015-06-02  Hyungwook Lee  <hyungwook.lee@navercorp.com>
2701
2702         [EFL] Implement load_started callback in EwkPageClient.
2703         https://bugs.webkit.org/show_bug.cgi?id=145545
2704
2705         Reviewed by Gyuyoung Kim.
2706
2707         We need to provide load_started callback to web extension module.
2708
2709         * UIProcess/API/efl/tests/extensions/extension_sample.cpp:
2710         * WebProcess/InjectedBundle/API/efl/ewk_page.cpp:
2711         (EwkPage::EwkPage):
2712         (EwkPage::remove):
2713         (EwkPage::didStartProvisionalLoadForFrame):
2714         (EwkPage::didFinishDocumentLoadForFrame):
2715         * WebProcess/InjectedBundle/API/efl/ewk_page.h:
2716         * WebProcess/InjectedBundle/API/efl/ewk_page_private.h:
2717
2718 2015-06-02  Gavin Barraclough  <barraclough@apple.com>
2719
2720         PDFs always think they're visible on iOS.
2721         https://bugs.webkit.org/show_bug.cgi?id=145493
2722         <rdar://problem/19668879>
2723
2724         Reviewed by Andreas Kling & Sam Weinig.
2725
2726         The problem here is that WKContentView is currently responsible for notifying the WebPageProxy
2727         that the visibility may have changed, but when a PDF isn't showing the WKContentView isn't in
2728         the view hierarchy and doesn't receive the didMoveToWindow notifications – and the WKPDFView
2729         (which is in the view hierarchy) does not listen for these events.
2730
2731         Visibility of the page should really just track the visibility of the WKWebView (and when
2732         actually assessing the visibility it largely does - the page client checks the web view's
2733         visibility, bar a FIXME, and the foreground/background check, which needs to change).
2734         So notifications should really just come from the WKWebView.
2735
2736         The WKWebView already listens for the didMoveToWindow notification, it just was only updating
2737         the IsInWindow flag. Instead just update all flags, and the call to viewStateDidChange from
2738         WKContentView can just be removed.
2739
2740         There is one problem with this in that it would reverse the order of the calls to
2741         viewStateDidChange & _updateForScreen:, which would mean the the view would become visible before
2742         updating the screen pixel density. To fix this, moving the call to _updateForScreen:
2743         to willMoveToWindow:, to ensure it occurs before the page becomes visible.
2744
2745         This will also change behavior on Mac for WKWebView clients, in coalescing all view state changes
2746         within the didMoveToWindow call. This is the direction we intended to go in anyway (the plan is
2747         to remove the mayHaveChanged argument from viewStateDidChange - we're currently adding unnecessary
2748         IPC traffic).
2749
2750         * UIProcess/API/Cocoa/WKWebView.mm:
2751         (-[WKWebView didMoveToWindow]):
2752             - should update all view state flags.
2753         * UIProcess/API/ios/WKViewIOS.mm:
2754         (-[WKView didMoveToWindow]):
2755             - added to match WKWebView.mm, for WebKitTestRunner.
2756         * UIProcess/ios/WKContentView.mm:
2757         (-[WKContentView willMoveToWindow:]):
2758             - should _updateForScreen:
2759         (-[WKContentView didMoveToWindow]): Deleted.
2760             - functionality moved to -[WKWebView didMoveToWindow], -[WKContentView didMoveToWindow].
2761
2762 2015-06-02  Chris Dumez  <cdumez@apple.com>
2763
2764         [iOS][WK2] Always mark layers as volatile for background pages
2765         https://bugs.webkit.org/show_bug.cgi?id=145547
2766         <rdar://problem/20663184>
2767
2768         Reviewed by Simon Fraser.
2769
2770         We previously marked layers as volatile when the WebProcess was about
2771         to be suspended. Most of the time the WebProcess gets suspended when a
2772         page goes into the background. However, it is not always true (see
2773         radar), in which case the layers won't be marked as volatile and use
2774         memory even though they are not visible.
2775
2776         We now mark layers as volatile as soon as the page goes into the
2777         background, instead of relying on the WebProcess suspension mechanism
2778         to do so.
2779
2780         A new ApplicationDidEnterBackground IPC message from the UIProcess to
2781         the WebProcess is added (in addition to the pre-existing
2782         ApplicationWillEnterForeground one). When the WebProcess receives this
2783         message, it will freeze the layer tree state and mark the layers as
2784         volatile (with a timer to keep retrying if needed), similarly to what
2785         is already done in WebProcess::actualPrepareToSuspend().
2786         When the ApplicationWillEnterForeground is received, we unfreeze the
2787         layer tree state. The layers' volatile state will be automatically
2788         updated when they are displayed (see setBufferVolatility() call in
2789         RemoteLayerBackingStore::display()).
2790
2791         * UIProcess/WebPageProxy.h:
2792         * UIProcess/ios/WKContentView.mm:
2793         (-[WKContentView _applicationDidEnterBackground:]):
2794         * UIProcess/ios/WebPageProxyIOS.mm:
2795         (WebKit::WebPageProxy::applicationDidEnterBackground):
2796         * WebProcess/WebPage/WebPage.cpp:
2797         (WebKit::WebPage::WebPage):
2798         (WebKit::WebPage::setLayerTreeStateIsFrozen):
2799         (WebKit::WebPage::markLayersVolatileImmediatelyIfPossible):
2800         * WebProcess/WebPage/WebPage.h:
2801         * WebProcess/WebPage/WebPage.messages.in:
2802         * WebProcess/WebPage/ios/WebPageIOS.mm:
2803         (WebKit::WebPage::volatilityTimerFired):
2804         (WebKit::WebPage::applicationDidEnterBackground):
2805         (WebKit::WebPage::applicationWillEnterForeground):
2806         * WebProcess/WebProcess.cpp:
2807         (WebKit::WebProcess::markAllLayersVolatileIfPossible):
2808         (WebKit::WebProcess::setAllLayerTreeStatesFrozen):
2809
2810 2015-06-02  Brady Eidson  <beidson@apple.com>
2811
2812         WebKit policy delegate should suggest if a navigation should be allowed to open URLs externally.
2813         rdar://problem/21025301 and https://bugs.webkit.org/show_bug.cgi?id=145280
2814         
2815         Reviewed by Alex Christensen.
2816
2817         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2818         (WebKit::PDFPlugin::clickedLink):
2819         
2820         * WebProcess/Plugins/PluginView.cpp:
2821         (WebKit::PluginView::performFrameLoadURLRequest):
2822         (WebKit::PluginView::loadURL):
2823         
2824         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
2825         (WebKit::WebContextMenuClient::searchWithGoogle):
2826         
2827         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2828         (WebKit::WebFrameLoaderClient::dispatchCreatePage):
2829         
2830         * WebProcess/WebPage/WebInspector.cpp:
2831         (WebKit::WebInspector::openInNewTab):
2832         
2833         * WebProcess/WebPage/WebPage.cpp:
2834         (WebKit::WebPage::loadURLInFrame):
2835         (WebKit::WebPage::loadRequest):
2836         (WebKit::WebPage::loadDataImpl):
2837         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
2838
2839 2015-06-02  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2840
2841         REGRESSION(r185091): Crash happens on indexdb tests
2842         https://bugs.webkit.org/show_bug.cgi?id=145549
2843
2844         Reviewed by Csaba Osztrogonác.
2845
2846         r185091 caused crash on some indexeddb tests. The crash happens because IDBDatabaseError::create() doesn't
2847         dereference count by using ptr(). It makes a crash when dereferencing on ~Ref() destructor. To fix this issue,
2848         this patch uses leakRef() instead of ptr().
2849
2850         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
2851         (WebKit::WebIDBServerConnection::didCreateObjectStore):
2852         (WebKit::WebIDBServerConnection::didCreateIndex):
2853         (WebKit::WebIDBServerConnection::didDeleteIndex):
2854         (WebKit::WebIDBServerConnection::didPutRecord):
2855         (WebKit::WebIDBServerConnection::didGetRecord):
2856         (WebKit::WebIDBServerConnection::didOpenCursor):
2857         (WebKit::WebIDBServerConnection::didAdvanceCursor):
2858         (WebKit::WebIDBServerConnection::didIterateCursor):
2859         (WebKit::WebIDBServerConnection::didCount):
2860         (WebKit::WebIDBServerConnection::didDeleteRange):
2861         (WebKit::WebIDBServerConnection::didClearObjectStore):
2862         (WebKit::WebIDBServerConnection::didDeleteObjectStore):
2863         (WebKit::WebIDBServerConnection::didChangeDatabaseVersion):
2864
2865 2015-06-01  Enrica Casucci  <enrica@apple.com>
2866
2867         [iOS] Hardware Keyboard: All combinations for arrow keys with Shift do not extend the selection.
2868         https://bugs.webkit.org/show_bug.cgi?id=145538
2869         rdar://problem/18504199
2870
2871         Reviewed by Darin Adler.
2872
2873         The extend parameter was ignored in all the functions below.
2874
2875         * UIProcess/ios/WKContentViewInteraction.mm:
2876         (-[WKContentView _moveUp:withHistory:]):
2877         (-[WKContentView _moveDown:withHistory:]):
2878         (-[WKContentView _moveLeft:withHistory:]):
2879         (-[WKContentView _moveRight:withHistory:]):
2880         (-[WKContentView _moveToStartOfWord:withHistory:]):
2881         (-[WKContentView _moveToStartOfParagraph:withHistory:]):
2882         (-[WKContentView _moveToStartOfLine:withHistory:]):
2883         (-[WKContentView _moveToStartOfDocument:withHistory:]):
2884         (-[WKContentView _moveToEndOfWord:withHistory:]):
2885         (-[WKContentView _moveToEndOfParagraph:withHistory:]):
2886         (-[WKContentView _moveToEndOfLine:withHistory:]):
2887         (-[WKContentView _moveToEndOfDocument:withHistory:]):
2888
2889 2015-06-01  Anders Carlsson  <andersca@apple.com>
2890
2891         Use xpc_connection_set_oneshot_instance where possible
2892         https://bugs.webkit.org/show_bug.cgi?id=145535
2893         rdar://problem/21109994
2894
2895         Reviewed by Sam Weinig.
2896
2897         Use xpc_connection_set_oneshot_instance where possible; this will make sure that the 
2898         web process instances go away when the web process exits.
2899
2900         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2901         (WebKit::connectToService):
2902         (WebKit::connectToReExecService):
2903
2904 2015-06-01  Enrica Casucci  <enrica@apple.com>
2905
2906         [iOS] Hardware Keyboard: Command + left arrow does not work.
2907         https://bugs.webkit.org/show_bug.cgi?id=145531
2908         rdar://problem/18576402
2909
2910         Reviewed by Anders Carlsson.
2911
2912         We were calling a non existent command (moveToStartOfLine) instead of
2913         moveToBeginningOfLine.
2914
2915         * UIProcess/ios/WKContentViewInteraction.mm:
2916         (-[WKContentView _moveToStartOfLine:withHistory:]):
2917
2918 2015-06-01  Brady Eidson  <beidson@apple.com>
2919
2920         Add WKTR support for "should open external URLs".
2921         https://bugs.webkit.org/show_bug.cgi?id=145505
2922
2923         Reviewed by Darin Adler.
2924
2925         Expose C-spi to allow WKTR to set this bit on new loads:
2926         * UIProcess/API/C/WKPage.cpp:
2927         (WKPageLoadURLWithShouldOpenExternalURLsPolicy):
2928         * UIProcess/API/C/WKPagePrivate.h:
2929         
2930         Expose the bit on NavigationAction for the policy delegate:        
2931         * WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp:
2932         (WKBundleNavigationActionGetShouldOpenExternalURLs):
2933         * WebProcess/InjectedBundle/API/c/WKBundleNavigationActionPrivate.h: Copied from Tools/WebKitTestRunner/WorkQueueManager.h.
2934
2935         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
2936         (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
2937         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
2938         (WebKit::InjectedBundleNavigationAction::shouldOpenExternalURLs):
2939     
2940         * WebKit2.xcodeproj/project.pbxproj:
2941
2942 2015-06-01  Gavin Barraclough  <barraclough@apple.com>
2943
2944         PDFs always think they're visible on iOS.
2945         https://bugs.webkit.org/show_bug.cgi?id=145493
2946         <rdar://problem/19668879>
2947
2948         Unreviewed roll-out.
2949
2950         Temporarily reverting this change – will need a workaround for test harness craziness.
2951
2952         * UIProcess/API/Cocoa/WKWebView.mm:
2953         (-[WKWebView didMoveToWindow]):
2954         (-[WKWebView setOpaque:]):
2955         * UIProcess/ios/WKContentView.mm:
2956         (-[WKContentView willMoveToWindow:]):
2957         (-[WKContentView didMoveToWindow]):
2958         (-[WKContentView browsingContextController]):
2959
2960 2015-06-01  Csaba Osztrogonác  <ossy@webkit.org>
2961
2962         [EFL] Remove unused const variable from EwkView.cpp
2963         https://bugs.webkit.org/show_bug.cgi?id=145512
2964
2965         Reviewed by Gyuyoung Kim.
2966
2967         * UIProcess/API/efl/EwkView.cpp:
2968
2969 2015-06-01  Csaba Osztrogonác  <ossy@webkit.org>
2970
2971         [cmake] Suppress unused parameter warnings in WebKit2 and TestNetscapePlugIn
2972         https://bugs.webkit.org/show_bug.cgi?id=145264
2973
2974         Reviewed by Carlos Garcia Campos.
2975
2976         * CMakeLists.txt: Use COMPILE_FLAGS instead of CMAKE_<C|CXX>_FLAGS to put -Wno-unused-parameter after -Wextra.
2977
2978 2015-05-31  Gavin Barraclough  <barraclough@apple.com>
2979
2980         PDFs always think they're visible on iOS.
2981         https://bugs.webkit.org/show_bug.cgi?id=145493
2982         <rdar://problem/19668879>
2983
2984         Reviewed by Andreas Kling.
2985
2986         The problem here is that WKContentView is currently responsible for notifying the WebPageProxy
2987         that the visibility may have changed, but when a PDF isn't showing the WKContentView isn't in
2988         the view hierarchy and doesn't receive the didMoveToWindow notifications – and the WKPDFView
2989         (which is in the view hierarchy) does not listen for these events.
2990
2991         Visibility of the page should really just track the visibility of the WKWebView (and when
2992         actually assessing the visibility it largely does - the page client checks the web view's
2993         visibility, bar a FIXME, and the foreground/background check, which needs to change).
2994         So notifications should really just come from the WKWebView.
2995
2996         The WKWebView already listens for the didMoveToWindow notification, it just was only updating
2997         the IsInWindow flag. Instead just update all flags, and the call to viewStateDidChange from
2998         WKContentView can just be removed.
2999
3000         There is one problem with this in that it would reverse the order of the calls to
3001         viewStateDidChange & _updateForScreen:, which would mean the the view would become visible before
3002         updating the screen pixel density. To fix this, move the call to _updateForScreen: to
3003         willMoveToWindow:, to ensure it occurs before the page becomes visible.
3004
3005         This will also change behavior on Mac for WKWebView clients, in coalescing all view state changes
3006         within the didMoveToWindow call. This is the direction we intended to go in anyway (the plan is
3007         to remove the mayHaveChanged argument from viewStateDidChange - we're currently adding unnecessary
3008         IPC traffic).
3009
3010         * UIProcess/API/Cocoa/WKWebView.mm:
3011         (-[WKWebView didMoveToWindow]):
3012             - should update all view state flags.
3013         * UIProcess/ios/WKContentView.mm:
3014         (-[WKContentView willMoveToWindow:]):
3015             - should _updateForScreen:
3016         (-[WKContentView didMoveToWindow]): Deleted.
3017             - functionality moved to -[WKWebView didMoveToWindow], -[WKContentView didMoveToWindow].
3018
3019 2015-05-30  Brady Eidson  <beidson@apple.com>
3020
3021         Make FrameLoader methods that take PassRefPtr<Event> take raw pointers instead.
3022         https://bugs.webkit.org/show_bug.cgi?id=145495
3023
3024         Reviewed by Alexey Proskuryakov.
3025
3026         * WebProcess/WebPage/WebPage.cpp:
3027         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
3028
3029 2015-05-29  Joseph Pecoraro  <pecoraro@apple.com>
3030
3031         Web Inspector: Crash closing a related tab with Web Inspector open while page is refreshing
3032         https://bugs.webkit.org/show_bug.cgi?id=145488
3033
3034         Reviewed by Alexey Proskuryakov.
3035
3036         * WebProcess/WebPage/WebInspector.h:
3037         * WebProcess/WebPage/WebInspector.cpp:
3038         (WebKit::WebInspector::~WebInspector):
3039         Ensure, no matter how we close, that we have invalidated the
3040         frontend connection of which we are the client.
3041
3042         (WebKit::WebInspector::createInspectorPage):
3043         This member variable will never be null.
3044
3045 2015-05-29  Andreas Kling  <akling@apple.com>
3046
3047         [iOS] When bouncing back from max pinch zoom scale, scaleChangeRate should be 0.
3048         <https://webkit.org/b/145487>
3049         <rdar://problem/20989389>
3050
3051         Reviewed by Benjamin Poulain.
3052
3053         Make sure we don't send WebCore some velocity data with non-zero scaleChangeRate
3054         when we bounce back from being pinch-zoomed past the maximum scale.
3055
3056         This fixes an issue where the bounce-back animation would cause a burst of
3057         unnecessary tile generation.
3058
3059         * WebProcess/WebPage/ios/WebPageIOS.mm:
3060         (WebKit::adjustVelocityDataForBoundedScale):
3061         (WebKit::WebPage::updateVisibleContentRects):
3062
3063 2015-05-29  Jon Lee  <jonlee@apple.com>
3064
3065         Fix preferences for wireless playback
3066         https://bugs.webkit.org/show_bug.cgi?id=145477
3067         rdar://problem/21166767
3068
3069         Reviewed by Anders Carlsson.
3070
3071         * UIProcess/API/C/WKPreferences.cpp: Add missing preference calls in C API.
3072         * UIProcess/API/C/WKPreferencesRef.h:
3073
3074 2015-05-29  Enrica Casucci  <enrica@apple.com>
3075
3076         [iOS] Cursor hidden in text area once it scrolls.
3077         https://bugs.webkit.org/show_bug.cgi?id=145451
3078         rdar://problem/20356413
3079
3080         Reviewed by Simon Fraser.
3081
3082         This patch fixes both the touch scrolling inside the
3083         overflow area as well as the programmatic scroll that
3084         occurs when inserting a new line. The first issue is fixed by
3085         implementing the chrome client methods didLayout,
3086         didStartOverflowScroll and didEndOverflowScroll. The second
3087         required changing the implementation of notifyRevealedSelectionByScrollingFrame.
3088         We not only need to notify the client to redraw the selection,
3089         but we also need to recompute the editorState, because scrolling
3090         might have occurred.
3091         I've removed the NotifyRevealedSelection message that was not needed
3092         any longer, since EditorStateChanged will do exactly what we want.
3093
3094         * UIProcess/WebPageProxy.h:
3095         * UIProcess/WebPageProxy.messages.in:
3096         * UIProcess/ios/WebPageProxyIOS.mm:
3097         (WebKit::WebPageProxy::editorStateChanged):
3098         (WebKit::WebPageProxy::notifyRevealedSelection): Deleted.
3099         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
3100         (WebKit::WebChromeClient::notifyRevealedSelectionByScrollingFrame):
3101         (WebKit::WebChromeClient::didLayout):
3102         (WebKit::WebChromeClient::didStartOverflowScroll):
3103         (WebKit::WebChromeClient::didEndOverflowScroll):
3104
3105 2015-05-29  Chris Dumez  <cdumez@apple.com>
3106
3107         [iOS] Update WebContent process sandbox profile for AWD logging
3108         https://bugs.webkit.org/show_bug.cgi?id=145473
3109         <rdar://problem/20543269>
3110
3111         Reviewed by Darin Adler.
3112
3113         Update WebContent process sandbox profile for AWD logging.
3114
3115         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3116
3117 2015-05-29  Anders Carlsson  <andersca@apple.com>
3118
3119         WebKit.framework installs or references Mac-only headers on iOS
3120         https://bugs.webkit.org/show_bug.cgi?id=145471
3121         rdar://problem/21161459
3122
3123         Reviewed by Dan Bernstein.
3124
3125         * UIProcess/API/C/mac/WKInspectorPrivateMac.h:
3126         Add an #if !TARGET_OS_IPHONE guard around the entire header.
3127
3128 2015-05-29  Anders Carlsson  <andersca@apple.com>
3129
3130         WKScriptMessageInternal.h should be a project header, not a private header
3131         https://bugs.webkit.org/show_bug.cgi?id=145464
3132         rdar://problem/21161639
3133
3134         Reviewed by Dan Bernstein.
3135
3136         * WebKit2.xcodeproj/project.pbxproj:
3137
3138 2015-05-28  Alexey Proskuryakov  <ap@apple.com>
3139
3140         Clean up VisitedLinkProvider teardown
3141         https://bugs.webkit.org/show_bug.cgi?id=145450
3142         rdar://problem/20244726
3143
3144         Reviewed by Brady Eidson.
3145
3146         * UIProcess/VisitedLinkProvider.cpp:
3147         (WebKit::VisitedLinkProvider::~VisitedLinkProvider):
3148
3149 2015-05-28  Brady Eidson  <beidson@apple.com>
3150
3151         Change method of signaling "should open external urls" to WebKit.
3152         https://bugs.webkit.org/show_bug.cgi?id=145454
3153
3154         Reviewed by Dan Bernstein.
3155
3156         Making this a property on the request was never a good idea.
3157
3158         Adding a new extensible load SPI seems much better.
3159
3160         * Shared/API/Cocoa/_WKNSURLRequestExtras.h: Removed.
3161         * Shared/API/Cocoa/_WKNSURLRequestExtras.mm: Removed.
3162
3163         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
3164         (-[WKBrowsingContextController loadRequest:userData:]): Since this API is deprecated,
3165           it always gets the default restrictive behavior.
3166
3167         * UIProcess/API/Cocoa/WKWebView.mm:
3168         (-[WKWebView loadRequest:]):
3169         (-[WKWebView loadRequest:withOptions:]): Take an options dictionary that, for now, 
3170           only supports one option.
3171         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3172
3173         * WebKit2.xcodeproj/project.pbxproj:
3174
3175 2015-05-28  Anders Carlsson  <andersca@apple.com>
3176
3177         Make sure that we create the private WebKit.framework symlinks last
3178         https://bugs.webkit.org/show_bug.cgi?id=145442
3179         <rdar://problem/21142213>
3180
3181         Reviewed by Dan Bernstein.
3182
3183         Move the "Add Symlinks in /System/Library/PrivateFrameworks/WebKit.framework" build phase to
3184         the "All" aggregate target. Also update the script now that INSTALL_PATH is different.
3185
3186         * WebKit2.xcodeproj/project.pbxproj:
3187
3188 2015-05-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
3189
3190         Code clean up for extracting information from the mix of WritingMode and TextDirection
3191         https://bugs.webkit.org/show_bug.cgi?id=143399
3192
3193         Reviewed by Darin Adler.
3194
3195         * Shared/WebPopupItem.h:
3196         * UIProcess/API/C/efl/WKAPICastEfl.h:
3197         * UIProcess/WebPopupMenuProxy.h:
3198         enum TextDirection is moved from TextFlags.h to WritingMode.h. So include
3199         WritingMode.h instead of including TextFlags.h.
3200
3201 2015-05-28  Antti Koivisto  <antti@apple.com>
3202
3203         Disable network cache for old clients
3204         https://bugs.webkit.org/show_bug.cgi?id=145418
3205
3206         Reviewed by Andreas Kling.
3207
3208         Follow-up: Don't do linked-on-or-after checks for iOS Safari.
3209
3210         * UIProcess/Cocoa/VersionChecks.mm:
3211         (WebKit::linkTimeVersion):
3212         (WebKit::linkedOnOrAfter):
3213
3214 2015-05-28  Matt Rajca  <mrajca@apple.com>
3215
3216         Add ENABLE_MEDIA_SESSION feature flag (which is off by default).
3217         https://bugs.webkit.org/show_bug.cgi?id=145415
3218
3219         Reviewed by Eric Carlson.
3220
3221         * Configurations/FeatureDefines.xcconfig:
3222
3223 2015-05-28  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3224
3225         Unreviewed, Fix build break since r184930.
3226
3227         * UIProcess/Storage/StorageManager.cpp:
3228         (WebKit::StorageManager::createTransientLocalStorageMap): Pass a pointer of SecurityOrigin
3229         in isSameSchemeHostPort().
3230
3231 2015-05-28  Zan Dobersek  <zdobersek@igalia.com>
3232
3233         Unreviewed. Fixing the build after r184950.
3234
3235         * UIProcess/Storage/StorageManager.cpp:
3236         (WebKit::StorageManager::createSessionStorageMap): getOrCreateStorageArea()
3237         now expects a Ref<WebCore::SecurityOrigin> object.
3238
3239 2015-05-28  Zan Dobersek  <zdobersek@igalia.com>
3240
3241         [WK2] Handle WebCore::SecurityOrigin objects through Ref<> where possible
3242         https://bugs.webkit.org/show_bug.cgi?id=145373
3243
3244         Reviewed by Andreas Kling.
3245
3246         WebCore::SecurityOrigin creation functions in most cases return a
3247         Ref<WebCore::SecurityOrigin> object. In the WebKit2 layer, those objects
3248         were still largely converted to RefPtr<>s.
3249
3250         This patch switches to using Ref<> where possible. The remaining uses of
3251         RefPtr<WebCore::SecurityOrigin> are present due to HashTables, to-be-copied
3252         Vectors, WebCore::DatabaseManager::origins() API and code where non-null
3253         WebCore::SecurityOrigin can't be guaranteed.
3254
3255         * DatabaseProcess/DatabaseProcess.cpp:
3256         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigin):
3257         * NetworkProcess/NetworkProcess.cpp:
3258         (WebKit::cfURLCacheOrigins):
3259         * UIProcess/Storage/LocalStorageDatabase.cpp:
3260         (WebKit::LocalStorageDatabase::create):
3261         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
3262         (WebKit::LocalStorageDatabase::openDatabase):
3263         (WebKit::LocalStorageDatabase::close):
3264         * UIProcess/Storage/LocalStorageDatabase.h:
3265         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
3266         (WebKit::LocalStorageDatabaseTracker::origins):
3267         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
3268         * UIProcess/Storage/StorageManager.cpp:
3269         (WebKit::StorageManager::StorageArea::securityOrigin):
3270         (WebKit::StorageManager::TransientLocalStorageNamespace::getOrCreateStorageArea):
3271         (WebKit::StorageManager::TransientLocalStorageNamespace::origins):
3272         (WebKit::StorageManager::TransientLocalStorageNamespace::clearStorageAreasMatchingOrigin):
3273         (WebKit::StorageManager::StorageArea::create):
3274         (WebKit::StorageManager::StorageArea::StorageArea):
3275         (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded):
3276         (WebKit::StorageManager::LocalStorageNamespace::getOrCreateStorageArea):
3277         (WebKit::StorageManager::LocalStorageNamespace::didDestroyStorageArea):
3278         (WebKit::StorageManager::SessionStorageNamespace::origins):
3279         (WebKit::StorageManager::SessionStorageNamespace::clearStorageAreasMatchingOrigin):
3280         (WebKit::StorageManager::SessionStorageNamespace::getOrCreateStorageArea):
3281         * UIProcess/WebPageProxy.cpp:
3282         (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota):
3283         * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp:
3284         (WebKit::WebApplicationCacheManager::getApplicationCacheOrigins):
3285         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3286         (WebKit::InjectedBundle::setApplicationCacheOriginQuota):
3287         (WebKit::InjectedBundle::resetApplicationCacheOriginQuota):
3288         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
3289         (WebKit::WebResourceCacheManager::returnCacheOrigins):
3290         (WebKit::WebResourceCacheManager::clearCacheForOrigin):
3291         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
3292         (WebKit::WebDatabaseManager::deleteDatabaseWithNameForOrigin):
3293         (WebKit::WebDatabaseManager::deleteDatabasesForOrigin):
3294         (WebKit::WebDatabaseManager::setQuotaForOrigin):
3295
3296 2015-05-19  Jon Honeycutt  <jhoneycutt@apple.com>
3297
3298         [iOS] When viewing an MJPEG stream as the main resource, only the first
3299         frame paints
3300
3301         <https://bugs.webkit.org/show_bug.cgi?id=145185>
3302         <rdar://problem/20124694>
3303
3304         Reviewed by Darin Adler.
3305
3306         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3307         (WebKit::WebFrameLoaderClient::willReplaceMultipartContent):
3308         Tell the WebPage that we will replace multipart content.
3309
3310         (WebKit::WebFrameLoaderClient::didReplaceMultipartContent):
3311         Tell the WebPage that we did replace multipart content.
3312
3313         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3314         * WebProcess/WebPage/DrawingArea.h:
3315
3316         * WebProcess/WebPage/WebPage.cpp:
3317         (WebKit::WebPage::willReplaceMultipartContent):
3318         Save the exposed content rect.
3319         (WebKit::WebPage::didReplaceMultipartContent):
3320         Restore the exposed content rect that was saved before this load. This
3321         fixes the issue for WK2.
3322
3323         * WebProcess/WebPage/WebPage.h:
3324
3325         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
3326         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3327         (WebKit::RemoteLayerTreeDrawingArea::exposedContentRect):
3328
3329 2015-05-22  Jon Lee  <jonlee@apple.com>
3330
3331         Fix macros for wireless playback
3332         https://bugs.webkit.org/show_bug.cgi?id=145239
3333         rdar://problem/21049541
3334
3335         Reviewed by Anders Carlsson.
3336
3337         Encompass the logic within ENABLE(WIRELESS_TARGET_PLAYBACK). Update property name.
3338
3339         * UIProcess/API/Cocoa/WKWebView.mm:
3340         (-[WKWebView initWithFrame:configuration:]):
3341         * UIProcess/API/Cocoa/WKWebViewConfiguration.h: Update names. Add a WKDeprecated
3342         category section.
3343         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3344         (-[WKWebViewConfiguration init]): Update name of variables to reflect new property names.
3345         (-[WKWebViewConfiguration copyWithZone:]): Ditto.
3346         (-[WKWebViewConfiguration mediaPlaybackAllowsAirPlay]): Get and set off of the new
3347         variable.
3348         (-[WKWebViewConfiguration setMediaPlaybackAllowsAirPlay:]): Ditto.
3349         (-[WKWebViewConfiguration mediaPlaybackRequiresUserAction]): Ditto.
3350         (-[WKWebViewConfiguration setMediaPlaybackRequiresUserAction:]): Ditto.
3351
3352 2015-05-27  Brady Eidson  <beidson@apple.com>
3353
3354         Add a "should open urls externally" flag to DocumentLoader.
3355         rdar://problem/21025301 and https://bugs.webkit.org/show_bug.cgi?id=145417
3356
3357         Reviewed by Geoff Garen.
3358
3359         Rename "user initiated" to "should open external URLs":
3360         * Shared/API/Cocoa/_WKNSURLRequestExtras.h:
3361         * Shared/API/Cocoa/_WKNSURLRequestExtras.mm:
3362         (-[NSURLRequest _web_shouldOpenExternalURLs]):
3363         (-[NSMutableURLRequest _web_setShouldOpenExternalURLs:]):
3364         (-[NSURLRequest _web_isUserInitiated]): Deleted.
3365         (-[NSMutableURLRequest _web_setIsUserInitiated:]): Deleted.
3366         
3367         Hold the new flag as a bool, and encode/decode it across IPC:
3368         * Shared/NavigationActionData.cpp:
3369         (WebKit::NavigationActionData::encode):
3370         (WebKit::NavigationActionData::decode):
3371         (WebKit::NavigationActionData::NavigationActionData): Deleted.
3372         * Shared/NavigationActionData.h:
3373
3374         * UIProcess/API/APINavigationAction.h: Add accessor for the bool flag.
3375
3376         * UIProcess/API/C/WKPage.cpp:
3377         (WKPageLoadURLWithUserData): Use "ShouldNotAllow" in the legacy C API for now.
3378         (WKPageLoadURLRequestWithUserData): Ditto.
3379
3380         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
3381         (-[WKBrowsingContextController loadRequest:userData:]): Set the value of the flag
3382           based on whether or not the initiating NSURLRequest was user initiated.
3383
3384         * UIProcess/API/Cocoa/WKNavigationAction.mm:
3385         (-[WKNavigationAction _shouldOpenExternalURLs]): Add accessor for the bool flag.
3386         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
3387
3388         * UIProcess/API/Cocoa/WKWebView.mm:
3389         (-[WKWebView loadRequest:]): Set the value of the flag based on whether or not the
3390           initiating NSURLRequest was user initiated.
3391
3392         * UIProcess/WebPageProxy.cpp:
3393         (WebKit::WebPageProxy::loadRequest): Pass the value down to the WebProcess to load.
3394         (WebKit::WebPageProxy::loadFile): Ditto, but always with "ShouldNotAllow".
3395         * UIProcess/WebPageProxy.h:
3396
3397         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3398         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Translate 
3399           the NavigationAction flag to a bool in the NavigationActionData object.
3400
3401         * WebProcess/WebPage/WebPage.cpp:
3402         (WebKit::WebPage::loadRequest): Set the value of the flag in the FrameLoadRequest that
3403           will be loaded.
3404         * WebProcess/WebPage/WebPage.h:
3405         * WebProcess/WebPage/WebPage.messages.in:
3406
3407 2015-05-27  Anders Carlsson  <andersca@apple.com>
3408
3409         Can't load local files in WKWebView from containerized app
3410         https://bugs.webkit.org/show_bug.cgi?id=145424
3411         rdar://problem/20831176
3412
3413         Reviewed by Dan Bernstein.
3414
3415         Allow the network process to load local files from its bundle as long as it has
3416         the sandbox extensions to do so.
3417
3418         This was originally added to only allow SSO to read the Info.plist inside its own application
3419         bundle, but being able to read the application bundle from within the network process should be OK.
3420
3421         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
3422
3423 2015-05-27  Andreas Kling  <akling@apple.com>
3424
3425         [WK2] Local storage areas should get torn down when they have no remaining references.
3426         <https://webkit.org/b/143339>
3427         <rdar://problem/20156436>
3428
3429         Reviewed by Darin Adler.
3430
3431         Let StorageNamespaceImpl own its StorageAreaMaps weakly instead of through RefPtr.
3432         Ownership is flipped so that StorageAreaMap refs the StorageNamespaceImpl instead.
3433         This allows the StorageAreaMaps to get destroyed once all of its clients are gone.
3434
3435         Practically speaking, this means that the garbage collector now decides when local
3436         storage databases can be closed, instead of us keeping them open for the lifetime
3437         of the web process.
3438
3439         For session storage, it works a bit differently. In the web process, they get torn
3440         down when their last client disappears, but they stay alive in the UI process.
3441         If/when the web process asks the UI process to open session storage for an origin,
3442         the UI process checks if one already exists, and if so, just updates the ID of the
3443         old storage with the new one provided by the web process.
3444
3445         * UIProcess/Storage/StorageManager.cpp:
3446         (WebKit::StorageManager::StorageArea::isSessionStorage):
3447         (WebKit::StorageManager::createTransientLocalStorageMap):
3448         (WebKit::StorageManager::createSessionStorageMap):
3449         (WebKit::StorageManager::destroyStorageMap):
3450         * WebProcess/Storage/StorageAreaImpl.cpp:
3451         (WebKit::StorageAreaImpl::securityOrigin):
3452         * WebProcess/Storage/StorageAreaImpl.h:
3453         * WebProcess/Storage/StorageAreaMap.cpp:
3454         (WebKit::StorageAreaMap::StorageAreaMap):
3455         (WebKit::StorageAreaMap::~StorageAreaMap):
3456         * WebProcess/Storage/StorageAreaMap.h:
3457         (WebKit::StorageAreaMap::securityOrigin):
3458         * WebProcess/Storage/StorageNamespaceImpl.cpp:
3459         (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):
3460         (WebKit::StorageNamespaceImpl::storageArea):
3461         * WebProcess/Storage/StorageNamespaceImpl.h:
3462
3463 2015-05-27  Antti Koivisto  <antti@apple.com>
3464
3465         Disable network cache for old clients
3466         https://bugs.webkit.org/show_bug.cgi?id=145418
3467         rdar://problem/21126587
3468
3469         Reviewed by Andy Estes.
3470
3471         Old clients might use NSURLCache API to clear the cache. New cache requires use of new APIs.
3472
3473         * UIProcess/Cocoa/VersionChecks.h: Added.
3474         * UIProcess/Cocoa/VersionChecks.mm: Added.
3475
3476             Add linked-on-or-after check mechanism similar to WebKit1.
3477
3478         (WebKit::linkTimeVersion):
3479         (WebKit::linkedOnOrAfter):
3480         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3481         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3482
3483             Use it when deciding whether to enable the cache.
3484
3485         * WebKit2.xcodeproj/project.pbxproj:
3486
3487 2015-05-27  Dean Jackson  <dino@apple.com>
3488
3489         img.currentSrc problem in strict mode with old picturefill
3490         https://bugs.webkit.org/show_bug.cgi?id=144095
3491         <rdar://problem/21087013>
3492
3493         Reviewed by Simon Fraser.
3494
3495         Add a PICTURE_SIZES flag.
3496
3497         * Configurations/FeatureDefines.xcconfig:
3498
3499 2015-05-27  Chris Dumez  <cdumez@apple.com>
3500
3501         Assertion hit in WebPage::didChangeSelection()
3502         https://bugs.webkit.org/show_bug.cgi?id=145413
3503         <rdar://problem/21001129>
3504
3505         Reviewed by Ryosuke Niwa.
3506
3507         We sometimes hit the "ASSERT(layoutCount == view->layoutCount())"
3508         assertion in WebPage::didChangeSelection(). We manage to prevent
3509         synchronous layouts in most cases when calling editorState(). However,
3510         it seems it can still happen in some cases. Crashing in this case seems
3511         overkill and can be annoying to other developers, especially
3512         considering the implications are only on performance.
3513
3514         This patch drops the assertion.
3515
3516         * WebProcess/WebPage/WebPage.cpp:
3517         (WebKit::WebPage::didChangeSelection): Deleted.
3518
3519 2015-05-27  Anders Carlsson  <andersca@apple.com>
3520
3521         Address a follow-up review comment from Darin.
3522
3523         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3524         (WebKit::WebsiteDataStore::removeMediaKeys):
3525
3526 2015-05-26  Anders Carlsson  <andersca@apple.com>
3527
3528         WKWebsiteDataStore should handle media keys
3529         https://bugs.webkit.org/show_bug.cgi?id=145394
3530         rdar://problem/20617794.
3531
3532         Reviewed by Darin Adler.
3533
3534         * Shared/WebsiteData/WebsiteDataTypes.h:
3535         Add WebsiteDataTypeMediaKeys enum.
3536
3537         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
3538         (API::WebsiteDataStore::defaultDataStoreConfiguration):
3539         Set up mediaKeysStorageDirectory.
3540
3541         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
3542         (dataTypesToString):
3543         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
3544         (WebKit::toWebsiteDataTypes):
3545         (WebKit::toWKWebsiteDataTypes):
3546         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h: Added.
3547         Add _WKWebsiteDataTypeMediaKeys.
3548
3549         * UIProcess/WebProcessPool.cpp:
3550         (WebKit::legacyWebsiteDataStoreConfiguration):
3551         Set up mediaKeysStorageDirectory.
3552
3553         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3554         (WebKit::WebsiteDataStore::WebsiteDataStore):
3555         Set m_mediaKeysStorageDirectory.
3556
3557         (WebKit::WebsiteDataStore::fetchData):
3558         Make CallbackAggregator ThreadSafeRefCounted.
3559         Handle WebsiteDataTypeMediaKeys by calling mediaKeyOrigins on our background queue.
3560
3561         (WebKit::WebsiteDataStore::removeData):
3562         Make CallbackAggregator ThreadSafeRefCounted.
3563         Handle WebsiteDataTypeMediaKeys by calling removeMediaKeys on our background queue.
3564
3565         (WebKit::WebsiteDataStore::mediaKeyOrigins):
3566         Compute the origins.
3567
3568         (WebKit::computeMediaKeyFile):
3569         Add helper function that returns the media key given a containing directory.
3570
3571         (WebKit::WebsiteDataStore::removeMediaKeys):
3572         Remove media key files.
3573
3574         * UIProcess/WebsiteData/WebsiteDataStore.h:
3575         Add new members.
3576
3577         * WebKit2.xcodeproj/project.pbxproj:
3578         Add new files.
3579
3580 2015-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>
3581
3582         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.9.2 release.
3583
3584         * gtk/NEWS: Add release notes for 2.9.2.
3585
3586 2015-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>
3587
3588         [SOUP] Network Cache: Handle the case when we fail to create the IO stream
3589         https://bugs.webkit.org/show_bug.cgi?id=145406
3590
3591         Reviewed by Sergio Villar Senin.
3592
3593         We were asserting in that case, but it can happen that we
3594         fail to create the stream. It happened to me after r184690, that
3595         changed the NetworkCache::Key hash. Since this was not expected to
3596         happen, the async operation never finished and the completion
3597         handler never called, leaving resources loading forever. We
3598         should make sure we call the completion handler with an error
3599         code, so that the load finishes and the entry is silently removed
3600         from the cache.
3601
3602         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
3603         (WebKit::NetworkCache::IOChannel::read):
3604         (WebKit::NetworkCache::IOChannel::readSync):
3605         (WebKit::NetworkCache::IOChannel::write):
3606
3607 2015-05-26  Carlos Garcia Campos  <cgarcia@igalia.com>
3608
3609         Network Cache: Add cache capacity to the totals of JSON file
3610         https://bugs.webkit.org/show_bug.cgi?id=145246
3611
3612         Reviewed by Antti Koivisto.
3613
3614         * NetworkProcess/cache/NetworkCache.cpp:
3615         (WebKit::NetworkCache::Cache::dumpContentsToFile):
3616         * NetworkProcess/cache/NetworkCacheStorage.h:
3617         (WebKit::NetworkCache::Storage::capacity):
3618
3619 2015-05-26  Anders Carlsson  <andersca@apple.com>
3620
3621         Add a symlink for every file inside /S/L/F/WebKit.framework to the PrivateFrameworks mirror.
3622
3623         rdar://problem/21111232.
3624
3625         Reviewed by Dan Bernstein.
3626
3627         * WebKit2.xcodeproj/project.pbxproj:
3628
3629 2015-05-26  Hunseop Jeong  <hs85.jeong@samsung.com>
3630
3631         [EFL] webview should be updated from (0,0) when using the evasGL.
3632         https://bugs.webkit.org/show_bug.cgi?id=137948
3633
3634         Reviewed by Gyuyoung Kim.
3635
3636         Changed the point of the start position to update the evasObject
3637         correctly when using the evasGL for graphics backend.
3638
3639         * UIProcess/API/efl/EwkView.cpp:
3640         (EwkView::displayTimerFired):
3641
3642 2015-05-26  Dan Bernstein  <mitz@apple.com>
3643
3644         <rdar://problem/21104551> Update build settings
3645
3646         Reviewed by Anders Carlsson.
3647
3648         * Configurations/DebugRelease.xcconfig:
3649         * Configurations/FeatureDefines.xcconfig:
3650         * Configurations/Version.xcconfig:
3651         * Configurations/WebContentService.Development.xcconfig:
3652         * Configurations/WebContentService.xcconfig:
3653
3654 2015-05-26  Milan Crha  <mcrha@redhat.com>
3655
3656         [GTK] Expand wildcards inside generate-inspector-gresource-manifest.py
3657         https://bugs.webkit.org/show_bug.cgi?id=138134
3658
3659         Reviewed by Žan Doberšek.
3660
3661         * PlatformGTK.cmake: Command line with expanded resources exceeds 32KB, which
3662         is a limit on Windows. It's better to expand wildcards inside the python script.
3663
3664 2015-05-25  Dan Bernstein  <mitz@apple.com>
3665
3666         ASSERT_MAIN_THREAD and DOM_ASSERT_MAIN_THREAD are unnecessary no-ops
3667         https://bugs.webkit.org/show_bug.cgi?id=145372
3668
3669         Reviewed by Sam Weinig.
3670
3671         * Configurations/Base.xcconfig: Removed DISABLE_THREAD_CHECK from DEBUG_DEFINES.
3672
3673 2015-05-25  Carlos Garcia Campos  <cgarcia@igalia.com>
3674
3675         [GTK] Add construct property to WebKitWebContext to set the IndexedDB database directory
3676         https://bugs.webkit.org/show_bug.cgi?id=140882
3677
3678         Reviewed by Gustavo Noronha Silva.
3679
3680         Add WebKitWebContext:indexed-db-database-directory construct only property.
3681
3682         * UIProcess/API/gtk/WebKitWebContext.cpp:
3683         (webkitWebContextGetProperty):
3684         (webkitWebContextSetProperty):
3685         (webkitWebContextConstructed):
3686         (webkit_web_context_class_init):
3687
3688 2015-05-24  Sam Weinig  <sam@webkit.org>
3689
3690         Crash when using a removed ScriptMessageHandler
3691         <rdar://problem/20888499>
3692         https://bugs.webkit.org/show_bug.cgi?id=145359
3693
3694         Reviewed by Dan Bernstein.
3695
3696         * WebProcess/UserContent/WebUserContentController.cpp:
3697         (WebKit::WebUserMessageHandlerDescriptorProxy::~WebUserMessageHandlerDescriptorProxy):
3698         Invalidate the descriptor when the message handler client (as implemented by WebUserMessageHandlerDescriptorProxy)
3699         goes away. This will happen if a script message handler is removed at the API level or the WebUserContentController
3700         is destroyed (which will happen if all the pages get destroyed).
3701
3702 2015-05-23  Dan Bernstein  <mitz@apple.com>
3703
3704         <rdar://problem/21090327> /S/L/PrivateFrameworks/WebKit.framework is missing Headers and PrivateHeaders symlinks
3705         https://bugs.webkit.org/show_bug.cgi?id=145354
3706
3707         Reviewed by David Kilzer.
3708
3709         * WebKit2.xcodeproj/project.pbxproj: Create Headers and PrivateHeaders symlinks alongside
3710         the dylib symlink.
3711
3712 2015-05-23  Sungmann Cho  <sungmann.cho@navercorp.com>
3713
3714         Rename ShareableResource::create(Handle&) to map(Handle&) to match SharedMemory.
3715         https://bugs.webkit.org/show_bug.cgi?id=145288
3716
3717         Reviewed by Sam Weinig.
3718
3719         * Shared/ShareableResource.cpp:
3720         (WebKit::ShareableResource::Handle::tryWrapInSharedBuffer):
3721         (WebKit::ShareableResource::map):
3722         (WebKit::ShareableResource::create): Deleted.
3723         * Shared/ShareableResource.h:
3724
3725 2015-05-22  Jon Lee  <jonlee@apple.com>
3726
3727         Rename MediaPlaybackAllowsInline
3728         https://bugs.webkit.org/show_bug.cgi?id=145315
3729
3730         Reviewed by Eric Carlson.
3731
3732         Our API uses allowsInlineMediaPlayback. Our symbols should reflect the same.
3733
3734         * Shared/WebPreferencesDefinitions.h:
3735         * UIProcess/API/C/WKPreferences.cpp:
3736         (WKPreferencesSetMediaPlaybackAllowsInline): Update the call to preferences.
3737         The C API will not change in a future patch.
3738         (WKPreferencesGetMediaPlaybackAllowsInline): Ditto.
3739         * UIProcess/API/Cocoa/WKWebView.mm:
3740         (-[WKWebView initWithFrame:configuration:]): Update the name of the key.
3741         * WebProcess/WebPage/WebPage.cpp:
3742         (WebKit::WebPage::updatePreferences): Ditto.
3743
3744         * UIProcess/API/gtk/WebKitSettings.cpp: Update the call.
3745         (webkit_settings_get_media_playback_allows_inline):
3746         (webkit_settings_set_media_playback_allows_inline):
3747
3748 2015-05-22  Jon Lee  <jonlee@apple.com>
3749
3750         Rename MediaPlaybackAllowsAirPlay
3751         https://bugs.webkit.org/show_bug.cgi?id=145316
3752
3753         Reviewed by Eric Carlson.
3754
3755         In preparation for an API rename, update internal symbols from mediaPlaybackAllowsAirPlay
3756         to allowsAirPlayForMediaPlayback.
3757
3758         * Shared/WebPreferencesDefinitions.h: Update the name.
3759         * UIProcess/API/Cocoa/WKWebView.mm:
3760         (-[WKWebView initWithFrame:configuration:]): Ditto.
3761         * WebProcess/WebPage/WebPage.cpp:
3762         (WebKit::WebPage::updatePreferences): Update the call to settings.
3763
3764 2015-05-22  Jon Lee  <jonlee@apple.com>
3765
3766         Unreviewed GTK fix after r184802.
3767
3768         * UIProcess/API/gtk/WebKitSettings.cpp:
3769         (webkit_settings_get_media_playback_requires_user_gesture):
3770         (webkit_settings_set_media_playback_requires_user_gesture):
3771
3772 2015-05-22  Jon Lee  <jonlee@apple.com>
3773
3774         Rename MediaPlaybackRequiresUserGesture
3775         https://bugs.webkit.org/show_bug.cgi?id=145314
3776
3777         Reviewed by Anders Carlsson.
3778
3779         In preparation for an API rename, update internal symbols from mediaPlaybackRequiresUserGesture
3780         to requiresUserGestureForMediaPlayback.
3781
3782         No changes are being made to the API in this patch.
3783
3784         * Shared/WebPreferencesDefinitions.h: Update the name of the macro and the setting.
3785         * UIProcess/API/C/WKPreferences.cpp: The C API will not change in a future patch.
3786         (WKPreferencesSetMediaPlaybackRequiresUserGesture): Update the call to preferences.
3787         (WKPreferencesGetMediaPlaybackRequiresUserGesture): Ditto.
3788         * UIProcess/API/Cocoa/WKWebView.mm:
3789         (-[WKWebView initWithFrame:configuration:]): Update the name of the key.
3790         * WebProcess/WebPage/WebPage.cpp:
3791         (WebKit::WebPage::updatePreferences): Ditto.
3792
3793 2015-05-22  Commit Queue  <commit-queue@webkit.org>
3794
3795         Unreviewed, rolling out r183647.
3796         https://bugs.webkit.org/show_bug.cgi?id=145326
3797
3798         broke some toolbar blurring behavior (Requested by thorton on
3799         #webkit).
3800
3801         Reverted changeset:
3802
3803         "Asynchronous (or timed-out synchronous) resize flashes white
3804         instead of page background color"
3805         https://bugs.webkit.org/show_bug.cgi?id=144468
3806         http://trac.webkit.org/changeset/183647
3807
3808 2015-05-22  Yongjun Zhang  <yongjun_zhang@apple.com>
3809
3810         Image link doesn't create a preview view controller.
3811         https://bugs.webkit.org/show_bug.cgi?id=145320
3812
3813         Also try to create the preview view controller if the hit-tested node
3814         is a image link.
3815
3816         Reviewed by Beth Dakin.
3817
3818         * UIProcess/ios/WKContentViewInteraction.mm:
3819         (-[WKContentView gestureRecognizerShouldBegin:]):
3820         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
3821
3822 2015-05-22  Tim Horton  <timothy_horton@apple.com>
3823
3824         Avoid doing an extra layout in some cases while doing scale-to-fit
3825         https://bugs.webkit.org/show_bug.cgi?id=145321
3826         <rdar://problem/21051165>
3827
3828         Reviewed by Beth Dakin.
3829
3830         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
3831         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3832         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
3833         If we make it to scaleViewToFitDocumentIfNeeded with valid layout,
3834         the view width is still less than the last-known minimum document size,
3835         and the document size hasn't changed, update the view scale without
3836         doing an extra layout, keeping the fixed layout size at the previously
3837         computed minimum document size.
3838
3839 2015-05-22  Beth Dakin  <bdakin@apple.com>
3840
3841         Yellow highlight and DD popover don't go away when scrolling an iframe
3842         https://bugs.webkit.org/show_bug.cgi?id=145312
3843         -and corresponding-
3844         rdar://problem/19692334
3845
3846         Reviewed by Tim Horton.
3847
3848         Match what Lookup already does for their popover and dismiss our popovers on 
3849         scroll.
3850         * UIProcess/API/mac/WKView.mm:
3851         (-[WKView scrollWheel:]):
3852
3853         This should not be needed anymore.
3854         * UIProcess/WebPageProxy.cpp:
3855         (WebKit::WebPageProxy::pageDidScroll):
3856
3857 2015-05-22  Tim Horton  <timothy_horton@apple.com>
3858
3859         Remove action menu support
3860         https://bugs.webkit.org/show_bug.cgi?id=145305
3861         <rdar://problem/21070771>
3862
3863         Reviewed by Anders Carlsson.
3864
3865         * Configurations/WebKit.xcconfig:
3866         * Shared/API/c/WKActionMenuItemTypes.h:
3867         * Shared/API/c/WKActionMenuTypes.h:
3868         * UIProcess/API/Cocoa/WKViewPrivate.h:
3869         * UIProcess/API/mac/WKView.mm:
3870         (-[WKView _didPerformImmediateActionHitTest:contentPreventsDefault:userData:]):
3871         (-[WKView dealloc]): Deleted.
3872         (-[WKView mouseDown:]): Deleted.
3873         (-[WKView initWithFrame:processPool:configuration:webView:]): Deleted.
3874         (-[WKView prepareForMenu:withEvent:]): Deleted.
3875         (-[WKView willOpenMenu:withEvent:]): Deleted.
3876         (-[WKView didCloseMenu:withEvent:]): Deleted.
3877         (-[WKView _didPerformActionMenuHitTest:forImmediateAction:contentPreventsDefault:userData:]): Deleted.
3878         (-[WKView _actionMenuItemsForHitTestResult:withType:defaultActionMenuItems:]): Deleted.
3879         (-[WKView _actionMenuItemsForHitTestResult:withType:defaultActionMenuItems:userData:]): Deleted.
3880         * UIProcess/API/mac/WKViewInternal.h:
3881         * UIProcess/PageClient.h:
3882         * UIProcess/WebPageProxy.cpp:
3883         (WebKit::WebPageProxy::performImmediateActionHitTestAtLocation):
3884         (WebKit::WebPageProxy::didPerformImmediateActionHitTest):
3885         (WebKit::WebPageProxy::performActionMenuHitTestAtLocation): Deleted.
3886         (WebKit::WebPageProxy::selectLastActionMenuRange): Deleted.
3887         (WebKit::WebPageProxy::focusAndSelectLastActionMenuHitTestResult): Deleted.
3888         (WebKit::WebPageProxy::didPerformActionMenuHitTest): Deleted.
3889         * UIProcess/WebPageProxy.h:
3890         * UIProcess/WebPageProxy.messages.in:
3891         * UIProcess/mac/PageClientImpl.h:
3892         * UIProcess/mac/PageClientImpl.mm:
3893         (WebKit::PageClientImpl::didPerformImmediateActionHitTest):
3894         (WebKit::PageClientImpl::didPerformActionMenuHitTest): Deleted.
3895         * UIProcess/mac/WKActionMenuController.h: Removed.
3896         * UIProcess/mac/WKActionMenuController.mm: Removed.
3897         * UIProcess/mac/WKImmediateActionController.h:
3898         * UIProcess/mac/WKImmediateActionController.mm:
3899         (-[WKImmediateActionController didPerformImmediateActionHitTest:contentPreventsDefault:userData:]):
3900         (-[WKImmediateActionController immediateActionRecognizerWillPrepare:]):
3901         (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
3902         (-[WKImmediateActionController didPerformActionMenuHitTest:contentPreventsDefault:userData:]): Deleted.
3903         * WebKit2.xcodeproj/project.pbxproj:
3904         * WebProcess/InjectedBundle/API/APIInjectedBundlePageContextMenuClient.h:
3905         (API::InjectedBundle::PageContextMenuClient::prepareForImmediateAction):
3906         (API::InjectedBundle::PageContextMenuClient::prepareForActionMenu): Deleted.
3907         * WebProcess/InjectedBundle/API/c/WKBundlePageContextMenuClient.h:
3908         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
3909         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h:
3910         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp:
3911         (WebKit::InjectedBundlePageContextMenuClient::prepareForImmediateAction):
3912         (WebKit::InjectedBundlePageContextMenuClient::prepareForActionMenu): Deleted.
3913         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h:
3914         * WebProcess/WebPage/WebPage.h:
3915         * WebProcess/WebPage/WebPage.messages.in:
3916         * WebProcess/WebPage/WebPageOverlay.cpp:
3917         (WebKit::WebPageOverlay::actionContextForResultAtPoint):
3918         * WebProcess/WebPage/WebPageOverlay.h:
3919         (WebKit::WebPageOverlay::Client::actionContextForResultAtPoint):
3920         * WebProcess/WebPage/mac/WebPageMac.mm:
3921         (WebKit::textIndicatorTransitionForImmediateAction):
3922         (WebKit::WebPage::performImmediateActionHitTestAtLocation):
3923         (WebKit::textIndicatorTransitionForActionMenu): Deleted.
3924         (WebKit::WebPage::performActionMenuHitTestAtLocation): Deleted.
3925         (WebKit::WebPage::selectLastActionMenuRange): Deleted.
3926         (WebKit::WebPage::focusAndSelectLastActionMenuHitTestResult): Deleted.
3927         Remove everything, except some enums that clients still refer to.
3928         Also, leave SPI that used to be shared between immediate actions and
3929         action menus intact, even if it had "action menu" in the name. We can
3930         deprecate and rename in another patch... except for the very recently-added
3931         support from r184106, which we'll revert entirely, removing WKBundlePageOverlayV2, 
3932         which was not adopted by any clients.
3933
3934 2015-05-22  Brady Eidson  <beidson@apple.com>
3935
3936         Rework how the ResourceRequest user initiated property key is used.
3937         Followup to https://bugs.webkit.org/show_bug.cgi?id=145281
3938
3939         Reviewed by Dan Bernstein.
3940
3941         * Shared/API/Cocoa/_WKNSURLRequestExtras.mm:
3942         (-[NSURLRequest _web_isUserInitiated]):
3943         (-[NSMutableURLRequest _web_setIsUserInitiated:]):
3944
3945         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3946         (WKResourceRequestIsUserInitiatedKey): Deleted.
3947         (InitWebCoreSystemInterface): Deleted.
3948
3949 2015-05-21  Gavin Barraclough  <barraclough@apple.com>
3950
3951         Networking process sometimes suspended while WebContent runnable
3952         https://bugs.webkit.org/show_bug.cgi?id=145291
3953         <rdar://problem/21033029>
3954
3955         Reviewed by Andreas Kling.
3956
3957         There is an asymmetry in how the Networking process suspension is managed.
3958         We drop the assertion (& suspend the process) whenever the WebProcess says
3959         it is ready to suspend, but we only take the assertion (& resume execution)
3960         when the WebContent process is actually resumed. This leaves a race – where
3961         the WebContent process was willing to be suspended, but the UI app changed
3962         its mind suspending it. Since the WebContent process never actually suspended
3963         (we only prepared it to), we never send a resume, and since we never resume,
3964         we never wake the Networking process.
3965
3966         The fix is pretty clean. A web process should take a token on the networking
3967         process precisely whenever it holds an assertion on the web content process.
3968         This also enables a nice refinement, that when holding a BG assertion on the
3969         WebContent process we only need to hold a BG assertion on the networking
3970         process.
3971
3972         * UIProcess/Network/NetworkProcessProxy.cpp:
3973         (WebKit::NetworkProcessProxy::didSetAssertionState):
3974             - no-op
3975         * UIProcess/Network/NetworkProcessProxy.h:
3976             - added didSetAssertionState.
3977         * UIProcess/ProcessThrottler.cpp:
3978         (WebKit::ProcessThrottler::updateAssertionNow):
3979         (WebKit::ProcessThrottler::updateAssertion):
3980         (WebKit::ProcessThrottler::didConnectToProcess):
3981             - whenever taking/updating the assertion, inform the client via didSetAssertionState.
3982         * UIProcess/ProcessThrottlerClient.h:
3983             - added didSetAssertionState.
3984         * UIProcess/WebProcessProxy.cpp:
3985         (WebKit::WebProcessProxy::didFinishLaunching):
3986             removed initializeNetworkProcessActivityToken - this is taken via ProcessThrottler::didConnectToProcess.
3987         (WebKit::WebProcessProxy::sendProcessDidResume):
3988             - removed call to initializeNetworkProcessActivityToken - updated via didSetAssertionState.
3989         (WebKit::WebProcessProxy::processReadyToSuspend):
3990             - removed update of m_tokenForNetworkProcess - updated via didSetAssertionState.
3991         (WebKit::WebProcessProxy::didSetAssertionState):
3992             - update m_backgroundTokenForNetworkProcess/m_foregroundTokenForNetworkProcess.
3993         (WebKit::WebProcessProxy::initializeNetworkProcessActivityToken): Deleted.
3994             - updated via didSetAssertionState.
3995         * UIProcess/WebProcessProxy.h:
3996             - added didSetAssertionState, added separate FG/BG activity tokens for Networking process.
3997
3998 2015-05-22  Dan Bernstein  <mitz@apple.com>
3999
4000         Fixed the fix for <rdar://problem/20830673> Symlink the WebKit dylib instead of just the framework directory
4001         https://bugs.webkit.org/show_bug.cgi?id=145287
4002
4003         Reviewed by Anders Carlsson.
4004
4005         * WebKit2.xcodeproj/project.pbxproj: Give the symlink the correct destination.
4006
4007 2015-05-21  Brady Eidson  <beidson@apple.com>
4008
4009         Add an "initiated by user gesture" flag to ResourceRequest.
4010         https://bugs.webkit.org/show_bug.cgi?id=145281
4011
4012         Reviewed by Alex Christensen.
4013
4014         Expose a new category on NSURLRequest to allow SPI clients to easily set/get the flag:
4015         * Shared/API/Cocoa/_WKNSURLRequestExtras.h: Added.
4016         * Shared/API/Cocoa/_WKNSURLRequestExtras.mm: Added.
4017         (-[NSURLRequest _web_isUserInitiated]):
4018         (-[NSMutableURLRequest _web_setIsUserInitiated:]):
4019
4020         * WebKit2.xcodeproj/project.pbxproj:
4021
4022         Expose the new property key to WebCore:
4023         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
4024         (WKResourceRequestIsUserInitiatedKey):
4025         (InitWebCoreSystemInterface):
4026
4027 2015-05-21  Daniel Bates  <dabates@apple.com>
4028
4029         Rollout <http://trac.webkit.org/changeset/183909>
4030         (https://bugs.webkit.org/show_bug.cgi?id=144657)
4031
4032         Revert <http://trac.webkit.org/changeset/183909> since pausing the database
4033         thread prevents in-progress transactions from completing. We need to think
4034         about this change some more.
4035
4036         * UIProcess/WebPageProxy.h:
4037         * UIProcess/ios/WKContentView.mm:
4038         (-[WKContentView _applicationDidEnterBackground:]): Deleted.
4039         * UIProcess/ios/WebPageProxyIOS.mm:
4040         (WebKit::WebPageProxy::applicationDidEnterBackground): Deleted.
4041         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
4042         (WebKit::WebDatabaseManager::setPauseAllDatabases): Deleted.
4043         * WebProcess/WebCoreSupport/WebDatabaseManager.h:
4044         * WebProcess/WebPage/WebPage.h:
4045         * WebProcess/WebPage/WebPage.messages.in:
4046         * WebProcess/WebPage/ios/WebPageIOS.mm:
4047         (WebKit::WebPage::applicationWillEnterForeground): Deleted.
4048         (WebKit::WebPage::applicationDidEnterBackground): Deleted.
4049
4050 2015-05-21  Enrica Casucci  <enrica@apple.com>
4051
4052         [iOS] Crash when taking a snapshot of a large PDF.
4053         https://bugs.webkit.org/show_bug.cgi?id=145286
4054         rdar://problem/20892362
4055
4056         Reviewed by Tim Horton.
4057
4058         The code for the PDF case was incorrectly computing the snapshot rect.
4059         On top of that drawViewHierarchyInRect was ignoring the rect and
4060         always creating an image using the view bounds causing the crash.