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