3c4084092e9f8fb84410411362180c7bf0742f07
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-07-09  Alex Christensen  <achristensen@webkit.org>
2
3         [Content Extensions] Add 3 byte jump size.
4         https://bugs.webkit.org/show_bug.cgi?id=146425
5
6         Reviewed by Darin Adler.
7
8         * UIProcess/API/APIUserContentExtensionStore.h:
9         Increment CurrentContentExtensionFileVersion because of change in the bytecode.
10
11 2015-07-09  Anders Carlsson  <andersca@apple.com>
12
13         SafariViewController loads partial webpage or entirely blank webpage
14         https://bugs.webkit.org/show_bug.cgi?id=146815
15         rdar://problem/21734757
16
17         Reviewed by Dan Bernstein.
18
19         * Platform/spi/ios/UIKitSPI.h:
20         Add _hostProcessIdentifier getter.
21
22         * UIProcess/ApplicationStateTracker.h:
23         Change ApplicationStateTracker to hold on to a WKContentView instead of a UIView.
24
25         * UIProcess/ApplicationStateTracker.mm:
26         (WebKit::applicationType):
27         Add a helper function that returns the type of application the web view is hosted by (regular
28         application, view service or extension).
29
30         (WebKit::ApplicationStateTracker::ApplicationStateTracker):
31         Register notifications and update m_isInBackground. For regular applications, just listen for UIApplication notifications.
32         For view services, walk the view controller hierarchy and find the service view controller and listen for notifications and use
33         BKS to find the background state of the host application. For extensions, just use BKSApplicationStateMonitor directly.
34
35         (WebKit::isViewService): Deleted.
36
37         * UIProcess/ios/WKContentView.mm:
38         (-[WKContentView willMoveToWindow:]):
39         If we're moving out of a window, null out the state tracker.
40
41         (-[WKContentView didMoveToWindow]):
42         If we moved to a window, create a new state tracker.
43
44         (-[WKContentView isBackground]):
45         Handle a null application state.
46
47         (-[WKContentView _commonInitializationWithProcessPool:configuration:]): Deleted.
48         Don't create the application state here.
49
50 2015-07-09  Dan Bernstein  <mitz@apple.com>
51
52         [Cocoa] Report the first paint after committing a load as a rendering progress event
53         https://bugs.webkit.org/show_bug.cgi?id=146765
54
55         Reviewed by Tim Horton.
56
57         * Shared/API/Cocoa/_WKRenderingProgressEvents.h: Added _WKRenderingProgressEventFirstPaint.
58
59         * UIProcess/API/Cocoa/WKWebView.mm:
60         (-[WKWebView _didCommitLayerTree:]): If this is the first layer tree commit since the load
61         was committed, and the delegate is observing _WKRenderingProgressEventFirstPaint, call
62         NavigationState::didFirstPaint.
63
64         * UIProcess/Cocoa/NavigationState.h:
65         * UIProcess/Cocoa/NavigationState.mm:
66         (WebKit::NavigationState::didFirstPaint): Added. Calls -_webView:renderingProgressDidChange:
67         with _WKRenderingProgressEventFirstPaint.
68
69 2015-07-08  Jinwoo Song  <jinwoo7.song@samsung.com>
70
71         [EFL] When closing inspector window, EwkView is not released properly.
72         https://bugs.webkit.org/show_bug.cgi?id=146716
73
74         Reviewed by Gyuyoung Kim.
75
76         It's because inspector window could not be deleted by remaining reference
77         from inspector view(evas object). This patch deletes the inspector window
78         after finishing the evas object smart call.
79
80         * UIProcess/efl/WebInspectorProxyEfl.cpp:
81         (WebKit::destroyInspectorWindow):
82         (WebKit::WebInspectorProxy::platformDidClose):
83
84 2015-07-08  Hyungwook Lee  <hyungwook.lee@navercorp.com>
85
86         Fix ASSERTION FAILED: !m_pendingNavigationID in WebPage::reload().
87         https://bugs.webkit.org/show_bug.cgi?id=146546
88
89         Reviewed by Darin Adler.
90
91         We did't reset pendingNavigationID value when request url is empty.
92         Hence we need to ignore ASSERT check in this case.
93
94         * WebProcess/WebPage/WebPage.cpp:
95         (WebKit::WebPage::reload):
96
97 2015-07-08  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
98
99         Use Ref/RefPtr instead of PassRefPtr in WebKit2 - 2
100         https://bugs.webkit.org/show_bug.cgi?id=146591
101
102         Reviewed by Darin Adler.
103
104         Following patch in order to reduce use of PassRefPtr.
105
106         * Shared/BlobDataFileReferenceWithSandboxExtension.h:
107         * Shared/Cocoa/CompletionHandlerCallChecker.h:
108         * Shared/Cocoa/CompletionHandlerCallChecker.mm:
109         (WebKit::CompletionHandlerCallChecker::create):
110         * Shared/Downloads/DownloadAuthenticationClient.h:
111         (WebKit::DownloadAuthenticationClient::create):
112         * Shared/SandboxExtension.h:
113         * Shared/ShareableResource.cpp:
114         (WebKit::ShareableResource::create):
115         * Shared/ShareableResource.h:
116         * Shared/mac/ObjCObjectGraph.h:
117         (WebKit::ObjCObjectGraph::create):
118         * Shared/mac/SandboxExtensionMac.mm:
119         (WebKit::SandboxExtension::create):
120         * UIProcess/API/Cocoa/WKProcessGroup.mm:
121         (getInjectedBundleInitializationUserData):
122         * UIProcess/WebPreferences.cpp:
123         (WebKit::WebPreferences::create):
124         * UIProcess/WebPreferences.h:
125         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
126         (WKBundlePageOverlayCreate):
127         * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.mm:
128         (WKBundlePageBannerCreateBannerWithCALayer):
129         * WebProcess/InjectedBundle/InjectedBundleDOMWindowExtension.cpp:
130         (WebKit::InjectedBundleDOMWindowExtension::create):
131         * WebProcess/InjectedBundle/InjectedBundleDOMWindowExtension.h:
132         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
133         (WebKit::InjectedBundleHitTestResult::create):
134         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.h:
135         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
136         (WebKit::InjectedBundleNavigationAction::create):
137         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
138         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp:
139         (WebKit::InjectedBundlePageContextMenuClient::getCustomMenuFromDefaultItems):
140         (WebKit::InjectedBundlePageContextMenuClient::prepareForImmediateAction):
141         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.cpp:
142         (WebKit::InjectedBundleScriptWorld::create):
143         * WebProcess/InjectedBundle/InjectedBundleScriptWorld.h:
144         * WebProcess/Network/NetworkProcessConnection.h:
145         (WebKit::NetworkProcessConnection::create):
146         * WebProcess/Network/WebResourceLoader.cpp:
147         (WebKit::WebResourceLoader::create):
148         * WebProcess/Network/WebResourceLoader.h:
149         * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
150         (WebKit::NotificationPermissionRequestManager::create):
151         * WebProcess/Notifications/NotificationPermissionRequestManager.h:
152         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
153         (WebKit::NetscapePlugin::create):
154         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
155         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
156         (WebKit::NetscapePluginStream::create):
157         * WebProcess/Plugins/PDF/PDFPlugin.h:
158         * WebProcess/Plugins/PDF/PDFPlugin.mm:
159         (WebKit::PDFPlugin::create):
160         * WebProcess/Plugins/PDF/PDFPluginAnnotation.h:
161         (WebKit::PDFPluginAnnotation::PDFPluginAnnotationEventListener::create):
162         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.h:
163         * WebProcess/Plugins/PDF/PDFPluginChoiceAnnotation.mm:
164         (WebKit::PDFPluginChoiceAnnotation::create):
165         * WebProcess/Plugins/PDF/PDFPluginPasswordField.h:
166         * WebProcess/Plugins/PDF/PDFPluginPasswordField.mm:
167         (WebKit::PDFPluginPasswordField::create):
168         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.h:
169         * WebProcess/Plugins/PDF/PDFPluginTextAnnotation.mm:
170         (WebKit::PDFPluginTextAnnotation::create):
171         * WebProcess/Plugins/PluginProcessConnection.h:
172         (WebKit::PluginProcessConnection::create):
173         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
174         (WebKit::PluginProcessConnectionManager::create):
175         * WebProcess/Plugins/PluginProcessConnectionManager.h:
176         * WebProcess/Plugins/PluginProxy.cpp:
177         (WebKit::PluginProxy::create):
178         * WebProcess/Plugins/PluginProxy.h:
179         * WebProcess/Plugins/PluginView.cpp:
180         (WebKit::PluginView::URLRequest::create):
181         (WebKit::PluginView::Stream::create):
182         (WebKit::PluginView::create):
183         * WebProcess/Plugins/PluginView.h:
184         * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
185         (WebKit::RemoteScrollingCoordinator::create):
186         * WebProcess/Storage/StorageAreaImpl.cpp:
187         (WebKit::StorageAreaImpl::create):
188         * WebProcess/Storage/StorageAreaImpl.h:
189         * WebProcess/Storage/StorageAreaMap.cpp:
190         (WebKit::StorageAreaMap::create):
191         * WebProcess/Storage/StorageAreaMap.h:
192         * WebProcess/WebConnectionToUIProcess.cpp:
193         (WebKit::WebConnectionToUIProcess::create):
194         * WebProcess/WebConnectionToUIProcess.h:
195         * WebProcess/WebCoreSupport/WebPopupMenu.cpp:
196         (WebKit::WebPopupMenu::create):
197         * WebProcess/WebCoreSupport/WebPopupMenu.h:
198         * WebProcess/WebCoreSupport/WebSearchPopupMenu.cpp:
199         (WebKit::WebSearchPopupMenu::create):
200         * WebProcess/WebCoreSupport/WebSearchPopupMenu.h:
201         * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h:
202         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
203         (WebKit::WebFrameNetworkingContext::create):
204         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
205         (WebKit::WebFrameNetworkingContext::create):
206         * WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.h:
207         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::create):
208         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
209         (WebKit::CoordinatedLayerTreeHost::create):
210         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
211         (WebKit::ThreadedCoordinatedLayerTreeHost::create):
212         * WebProcess/WebPage/EventDispatcher.cpp:
213         (WebKit::EventDispatcher::create):
214         * WebProcess/WebPage/EventDispatcher.h:
215         * WebProcess/WebPage/PageBanner.h:
216         * WebProcess/WebPage/WebBackForwardListProxy.h:
217         (WebKit::WebBackForwardListProxy::create):
218         * WebProcess/WebPage/WebContextMenu.h:
219         (WebKit::WebContextMenu::create):
220         * WebProcess/WebPage/WebDocumentLoader.h:
221         (WebKit::WebDocumentLoader::create):
222         * WebProcess/WebPage/WebInspector.cpp:
223         (WebKit::WebInspector::create):
224         * WebProcess/WebPage/WebInspector.h:
225         * WebProcess/WebPage/WebInspectorUI.cpp:
226         (WebKit::WebInspectorUI::create):
227         * WebProcess/WebPage/WebInspectorUI.h:
228         * WebProcess/WebPage/WebOpenPanelResultListener.cpp:
229         (WebKit::WebOpenPanelResultListener::create):
230         * WebProcess/WebPage/WebOpenPanelResultListener.h:
231         * WebProcess/WebPage/WebPageOverlay.cpp:
232         (WebKit::WebPageOverlay::create):
233         * WebProcess/WebPage/WebPageOverlay.h:
234         * WebProcess/WebPage/WebUndoStep.cpp:
235         (WebKit::WebUndoStep::create):
236         * WebProcess/WebPage/WebUndoStep.h:
237         * WebProcess/WebPage/mac/PageBannerMac.mm:
238         (WebKit::PageBanner::create):
239         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
240         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
241         (WebKit::PlatformCAAnimationRemote::create):
242         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
243         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
244         (WebKit::RemoteLayerTreeDrawingArea::BackingStoreFlusher::create):
245         * WebProcess/ios/WebVideoFullscreenManager.h:
246         * WebProcess/ios/WebVideoFullscreenManager.mm:
247         (WebKit::WebVideoFullscreenManager::create):
248
249 2015-07-08  Anders Carlsson  <andersca@apple.com>
250
251         WKSecurityOrigin.h has wrong availability info
252         https://bugs.webkit.org/show_bug.cgi?id=146761
253         rdar://problem/21735802
254
255         Reviewed by Dan Bernstein.
256
257         * UIProcess/API/Cocoa/WKSecurityOrigin.h:
258
259 2015-07-08  Andreas Kling  <akling@apple.com>
260
261         [iOS] Scrolling is laggy when the keyboard is up and a form element is focused.
262         <https://webkit.org/b/146735>
263         <rdar://problem/21151033>
264
265         Reviewed by Enrica Casucci.
266
267         Every touch on the page causes us to call elementDidFocus(), since we may need to bring
268         up a keyboard if the node had previously been programmatically focused. This was causing
269         little lag spikes during scrolling every time you'd put your finger to the screen.
270
271         Have WebPage::elementDidFocus() return early if the node already has focus, and we've
272         started an input session in response to non-programmatic focus already.
273
274         * WebProcess/WebPage/WebPage.h:
275         * WebProcess/WebPage/ios/WebPageIOS.mm:
276         (WebKit::WebPage::elementDidFocus):
277         (WebKit::WebPage::elementDidBlur):
278
279 2015-07-08  Matt Rajca  <mrajca@apple.com>
280
281         Media Session: indicate to clients whether a media session has active media elements
282         https://bugs.webkit.org/show_bug.cgi?id=146742
283
284         Reviewed by Tim Horton.
285
286         * UIProcess/API/C/WKPage.cpp:
287         (WKPageHasMediaSessionWithActiveMediaElements):
288         * UIProcess/API/C/WKPagePrivate.h:
289         * UIProcess/WebPageProxy.cpp:
290         (WebKit::WebPageProxy::hasMediaSessionWithActiveMediaElementsDidChange):
291         * UIProcess/WebPageProxy.h:
292         (WebKit::WebPageProxy::hasMediaSessionWithActiveMediaElementsDidChange):
293         * UIProcess/WebPageProxy.messages.in:
294         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
295         (WebKit::WebChromeClient::hasMediaSessionWithActiveMediaElementsDidChange):
296         * WebProcess/WebCoreSupport/WebChromeClient.h:
297
298 2015-07-07  Matt Rajca  <mrajca@apple.com>
299
300         Media Session: propagate artwork URL with metadata to UI clients
301         https://bugs.webkit.org/show_bug.cgi?id=146698
302
303         Reviewed by Tim Horton.
304
305         * Shared/WebMediaSessionMetadata.h:
306         (WebKit::WebMediaSessionMetadata::artworkURL):
307         * UIProcess/API/C/WKMediaSessionMetadata.cpp:
308         (WKMediaSessionMetadataCopyArtworkURL):
309         * UIProcess/API/C/WKMediaSessionMetadata.h:
310
311 2015-07-08  Yongjun Zhang  <yongjun_zhang@apple.com>
312
313         Don't allow page scroll when previewing a link or image.
314         https://bugs.webkit.org/show_bug.cgi?id=146741
315         rdar://problem/21733053
316
317         Reviewed by Beth Dakin.
318
319         Don't let preview gesture and scroll panning gesture or zooming gesture recognize at the same time.
320
321         * UIProcess/ios/WKContentViewInteraction.mm:
322         (-[WKContentView gestureRecognizer:canPreventGestureRecognizer:]):
323
324 2015-07-08  Tim Horton  <timothy_horton@apple.com>
325
326         Snapshots can be misplaced when custom swipe views are offset from the window origin
327         https://bugs.webkit.org/show_bug.cgi?id=146744
328         <rdar://problem/20942120>
329
330         Reviewed by Dean Jackson.
331
332         * UIProcess/mac/ViewGestureControllerMac.mm:
333         (WebKit::ViewGestureController::beginSwipeGesture):
334         Keep swipeArea in window coordinates; it was already in window coordinates
335         when using custom swipe views, but not in the non-custom case.
336
337         Convert from window coordinates to parent-of-m_swipeLayer coordinates when
338         determining m_swipeLayer's frame.
339
340 2015-07-07  Andy Estes  <aestes@apple.com>
341
342         [iOS][WK2] Ignore synthetic clicks in subframes initiated on a previous page
343         https://bugs.webkit.org/show_bug.cgi?id=146712
344
345         Reviewed by Benjamin Poulain.
346
347         r178980 fixed an issue where, if a main frame navigation occurs in response to a touch event, a synthetic click
348         event could fire on the navigated-to page. This change extends this fix to apply to subframes.
349
350         * WebProcess/WebPage/WebFrame.cpp:
351         (WebKit::WebFrame::WebFrame):
352         * WebProcess/WebPage/WebFrame.h:
353         (WebKit::WebFrame::firstLayerTreeTransactionIDAfterDidCommitLoad):
354         (WebKit::WebFrame::setFirstLayerTreeTransactionIDAfterDidCommitLoad):
355         * WebProcess/WebPage/WebPage.cpp:
356         (WebKit::WebPage::didCommitLoad): Stored the next layer tree transaction ID, and called cancelPotentialTapInFrame(), for the committed frame.
357         * WebProcess/WebPage/WebPage.h:
358         * WebProcess/WebPage/ios/WebPageIOS.mm:
359         (WebKit::WebPage::handleTap): Determined the first post-commit layer tree transaction ID from the tap target node's frame.
360         (WebKit::WebPage::commitPotentialTap): Ditto.
361         (WebKit::WebPage::cancelPotentialTap): Called cancelPotentialTapInFrame(), passing m_mainFrame.
362         (WebKit::WebPage::cancelPotentialTapInFrame): Taught to only cancel a potential tap whose target node is a descendant of the given frame.
363         (WebKit::WebPage::updateVisibleContentRects): Updated to use the main frame's first post-commit layer tree transaction ID.
364
365 2015-07-08  Brady Eidson  <beidson@apple.com>
366
367         Move PingLoaders to the NetworkingProcess.
368         <rdar://problem/18860263> and https://bugs.webkit.org/show_bug.cgi?id=146710
369
370         Reviewed by Tim Horton.
371
372         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
373         (WebKit::NetworkConnectionToWebProcess::loadPing): Create a PingHandle and then return.
374         * NetworkProcess/NetworkConnectionToWebProcess.h:
375         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
376         
377         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
378         (WebKit::WebPlatformStrategies::createPingHandle): If the Network process is enabled,
379           compile the appropriate load parameters and then message to it.
380           Otherwise, use the default in-process PingHandle.
381         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
382
383 2015-07-08  Beth Dakin  <bdakin@apple.com>
384
385         Only support image previews for clients that implement commitPreviewedImageWithURL 
386         delegate
387         https://bugs.webkit.org/show_bug.cgi?id=146739
388         -and corresponding-
389         rdar://problem/21692929
390
391         Reviewed by Tim Horton.
392
393         We should only support image previews for clients that implement 
394         commitPreviewedImageWithURL delegate since there is no default commit action.
395         * UIProcess/ios/WKContentViewInteraction.mm:
396         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
397
398 2015-07-08  Anders Carlsson  <andersca@apple.com>
399
400         Make ApplicationStateTracker be per view instead of being a singleton
401         https://bugs.webkit.org/show_bug.cgi?id=146737
402
403         Reviewed by Andreas Kling.
404
405         * UIProcess/ApplicationStateTracker.h:
406         Update to be per view instead of a singleton.
407
408         * UIProcess/ApplicationStateTracker.mm:
409         (WebKit::ApplicationStateTracker::ApplicationStateTracker):
410         Change to take a view + selectors.
411
412         (WebKit::ApplicationStateTracker::~ApplicationStateTracker):
413         Invalidate the state monitor and remove the listeners.
414
415         (WebKit::ApplicationStateTracker::applicationDidEnterBackground):
416         Just call the single background method.
417
418         (WebKit::ApplicationStateTracker::applicationWillEnterForeground):
419         Just call the single foreground method.
420
421         (WebKit::ApplicationStateTracker::singleton): Deleted.
422         (WebKit::ApplicationStateTracker::addListener): Deleted.
423         (WebKit::ApplicationStateTracker::invokeListeners): Deleted.
424         (WebKit::ApplicationStateTracker::pruneListeners): Deleted.
425
426         * UIProcess/ios/WKContentView.mm:
427         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
428         Create the ApplicationStateTracker here.
429
430         (-[WKContentView isBackground]):
431         Get the ivar instead of the singleton.
432
433 2015-07-08  Beth Dakin  <bdakin@apple.com>
434
435         InteractionInformationAtPosition bounds seem wrong on many sites, affects 
436         apple.com
437         https://bugs.webkit.org/show_bug.cgi?id=146736
438         -and corresponding-
439         rdar://problem/21655549
440
441         Reviewed by Tim Horton.
442
443         http://trac.webkit.org/changeset/186132/ changed the bounds for 
444         InteractionInformationAtPosition. The image-related changes are good, but the 
445         link-related changes feel wrong on many sites. We should revert the change for now 
446         and just use the absoluteBoundingBoxRect() for non-images.
447         * WebProcess/WebPage/ios/WebPageIOS.mm:
448         (WebKit::WebPage::getPositionInformation):
449
450 2015-07-08  Beth Dakin  <bdakin@apple.com>
451
452         Add actions to image previews
453         https://bugs.webkit.org/show_bug.cgi?id=146702
454         -and corresponding-
455         <rdar://problem/21642654>
456
457         Reviewed by Sam Weinig.
458
459         Add an array of actions and _WKActivatedElementInfo in order to properly invoke 
460         the actions.
461         * UIProcess/WKImagePreviewViewController.h:
462         * UIProcess/WKImagePreviewViewController.mm:
463         (-[WKImagePreviewViewController loadView]):
464         (-[WKImagePreviewViewController initWithCGImage:defaultActions:elementInfo:]):
465         (_scaleSizeWithinSize):
466         (-[WKImagePreviewViewController initWithCGImage:]): Deleted.
467
468         Re-factor defaultActionsForImageSheet into a stand-alone function so that it can 
469         be invoked for previews as well as for the action sheet.
470         * UIProcess/ios/WKActionSheetAssistant.h:
471         * UIProcess/ios/WKActionSheetAssistant.mm:
472         (-[WKActionSheetAssistant showImageSheet]):
473         (-[WKActionSheetAssistant defaultActionsForLinkSheet]):
474         (-[WKActionSheetAssistant defaultActionsForImageSheet]):
475         (-[WKActionSheetAssistant showLinkSheet]):
476
477         WKImagePreviewViewController initializer now takes the default actions and 
478         _WKActivatedElementInfo.
479         * UIProcess/ios/WKContentViewInteraction.mm:
480         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
481
482 2015-07-08  Dan Bernstein  <mitz@apple.com>
483
484         <rdar://problem/21669397> [iOS] Keyboard shortcuts that take focus away from the web view end up typing a letter into the newly focused field
485         https://bugs.webkit.org/show_bug.cgi?id=146732
486
487         Reviewed by Sam Weinig.
488
489         * UIProcess/ios/WKContentViewInteraction.mm:
490         (-[WKContentView _interpretKeyEvent:isCharEvent:]): Bail out if we are no longer the first
491         responder.
492
493 2015-07-07  Anders Carlsson  <andersca@apple.com>
494
495         Always begin a background task when needed, not just when we go into the background
496         https://bugs.webkit.org/show_bug.cgi?id=146704
497
498         Reviewed by Gavin Barraclough.
499
500         The system let background code run for the same amount of time regardless of whether the assertion was grabbed
501         when the app is in the foreground or being backgrounded, so remove the background/foreground tracking code.
502
503         * UIProcess/ios/ProcessAssertionIOS.mm:
504         (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
505         (-[WKProcessAssertionBackgroundTaskManager init]): Deleted.
506         (-[WKProcessAssertionBackgroundTaskManager _applicationWillEnterForeground]): Deleted.
507         (-[WKProcessAssertionBackgroundTaskManager _applicationDidEnterBackground]): Deleted.
508
509 2015-07-08  Antti Koivisto  <antti@apple.com>
510
511         Network Cache: Don't open files in main thread
512         https://bugs.webkit.org/show_bug.cgi?id=146722
513
514         Follow-up.
515
516         * NetworkProcess/cache/NetworkCacheStorage.cpp:
517         (WebKit::NetworkCache::Storage::dispatchReadOperation):
518
519             Accessing m_bodyFilter is technically not thread safe so keep it in main thread.
520
521 2015-07-08  Antti Koivisto  <antti@apple.com>
522
523         Network Cache: Don't open files in main thread
524         https://bugs.webkit.org/show_bug.cgi?id=146722
525
526         Reviewed by Chris Dumez.
527
528         While we use open() with O_NONBLOCK profiling indicates that we still may block up to 5ms under the syscall in some case.
529
530         * NetworkProcess/cache/NetworkCacheStorage.cpp:
531         (WebKit::NetworkCache::Storage::dispatchReadOperation):
532
533             Dispatch read operation to a concurrent queue.
534             With this we can also eliminate the separate dispatch() for body blob read.
535
536 2015-07-08  Sungmann Cho  <sungmann.cho@navercorp.com>
537
538         [Unix] Remove unused local variable from Connection::sendOutgoingMessage().
539         https://bugs.webkit.org/show_bug.cgi?id=146713
540
541         Reviewed by Csaba Osztrogonác.
542
543         * Platform/IPC/unix/ConnectionUnix.cpp:
544         (IPC::Connection::sendOutgoingMessage):
545
546 2015-07-07  Tim Horton  <timothy_horton@apple.com>
547
548         Occasional null deref in the CA callback in flushLayers()
549         https://bugs.webkit.org/show_bug.cgi?id=146700
550         <rdar://problem/21668754>
551
552         Reviewed by Simon Fraser.
553
554         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
555         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
556         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
557         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
558         Make sure we keep the WebPage alive, and null-check the potentially null
559         WebCore objects (Page and Frame).
560
561 2015-07-06  Matt Rajca  <mrajca@apple.com>
562
563         Media Session: propagate metadata changes to UI clients
564         https://bugs.webkit.org/show_bug.cgi?id=146660
565
566         Reviewed by Tim Horton.
567
568         * CMakeLists.txt: Added WebMediaSessionMetadata and WKMediaSessionMetadata.
569         * Shared/API/APIObject.h: Added a media session metadata type.
570         * Shared/API/c/WKBase.h:
571         * Shared/WebMediaSessionMetadata.cpp: Added API adapter for WebCore::MediaSessionMetadata.
572         (WebKit::WebMediaSessionMetadata::create):
573         (WebKit::WebMediaSessionMetadata::WebMediaSessionMetadata):
574         (WebKit::WebMediaSessionMetadata::~WebMediaSessionMetadata):
575         * Shared/WebMediaSessionMetadata.h: Added API adapter for WebCore::MediaSessionMetadata.
576         (WebKit::WebMediaSessionMetadata::title):
577         (WebKit::WebMediaSessionMetadata::artist):
578         (WebKit::WebMediaSessionMetadata::album):
579         * UIProcess/API/APIUIClient.h: Added 'mediaSessionMetadataDidChange' interface.
580         (API::UIClient::mediaSessionMetadataDidChange):
581         * UIProcess/API/C/WKAPICast.h:
582         * UIProcess/API/C/WKMediaSessionMetadata.cpp: Added C wrapper for WebMediaSessionMetadata.
583         (WKMediaSessionMetadataGetTypeID):
584         (WKMediaSessionMetadataCopyTitle):
585         (WKMediaSessionMetadataCopyArtist):
586         (WKMediaSessionMetadataCopyAlbum):
587         * UIProcess/API/C/WKMediaSessionMetadata.h: Added C wrapper for WebMediaSessionMetadata.
588         * UIProcess/API/C/WKPage.cpp: Forward 'mediaSessionMetadataDidChange' to client.
589         (WKPageSetPageUIClient):
590         * UIProcess/API/C/WKPageUIClient.h: Added 'mediaSessionMetadataDidChange' callback.
591         * UIProcess/WebPageProxy.cpp: Forward 'mediaSessionMetadataDidChange' to UI client.
592         (WebKit::WebPageProxy::mediaSessionMetadataDidChange):
593         * WebKit2.xcodeproj/project.pbxproj: Added WebMediaSessionMetadata and WKMediaSessionMetadata.
594
595 2015-07-07  Brady Eidson  <beidson@apple.com>
596
597         HTTP Auth cached after disabling private browsing/reset.
598         <rdar://problem/8293055> and https://bugs.webkit.org/show_bug.cgi?id=146654
599
600         Reviewed by Tim Horton.
601
602         * WebProcess/Plugins/PluginView.cpp:
603         (WebKit::PluginView::getAuthenticationInfo):
604
605 2015-07-07  Anders Carlsson  <andersca@apple.com>
606
607         Make sure to remove the download message receiver before freeing it
608         https://bugs.webkit.org/show_bug.cgi?id=146687
609
610         Reviewed by Simon Fraser.
611
612         * UIProcess/Downloads/DownloadProxyMap.cpp:
613         (WebKit::DownloadProxyMap::downloadFinished):
614
615 2015-07-07  Chris Dumez  <cdumez@apple.com>
616
617         Unreviewed, Fix non-Mac build after r186464.
618
619         * UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp:
620         (WebKit::CustomProtocolManagerProxy::~CustomProtocolManagerProxy):
621
622 2015-07-06  Anders Carlsson  <andersca@apple.com>
623
624         Make sure to remove message receivers before they are deallocated
625         https://bugs.webkit.org/show_bug.cgi?id=146666
626         rdar://problem/21331118
627
628         Reviewed by Tim Horton.
629
630         Add code so we can assert that there are no message receiver maps pointing to a message receiver
631         when it's being destroyed. Fix all the assertions by calling removeMessageReceiver in the right places.
632
633         * Platform/IPC/MessageReceiver.h:
634         (IPC::MessageReceiver::~MessageReceiver):
635         (IPC::MessageReceiver::willBeAddedToMessageReceiverMap):
636         (IPC::MessageReceiver::willBeRemovedFromMessageReceiverMap):
637         * Platform/IPC/MessageReceiverMap.cpp:
638         (IPC::MessageReceiverMap::addMessageReceiver):
639         (IPC::MessageReceiverMap::removeMessageReceiver):
640         (IPC::MessageReceiverMap::invalidate):
641         * Shared/ChildProcess.cpp:
642         (WebKit::ChildProcess::removeMessageReceiver):
643         * Shared/ChildProcess.h:
644         * Shared/ChildProcessProxy.cpp:
645         (WebKit::ChildProcessProxy::removeMessageReceiver):
646         * Shared/ChildProcessProxy.h:
647         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
648         (-[WKBrowsingContextController dealloc]):
649         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
650         * UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm:
651         (WebKit::CustomProtocolManagerProxy::~CustomProtocolManagerProxy):
652         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
653         (WebKit::WebUserContentControllerProxy::~WebUserContentControllerProxy):
654         * UIProcess/WebConnectionToWebProcess.cpp:
655         (WebKit::WebConnectionToWebProcess::invalidate):
656         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
657         (-[WKWebProcessPlugInBrowserContextController dealloc]):
658         * WebProcess/WebConnectionToUIProcess.cpp:
659         (WebKit::WebConnectionToUIProcess::invalidate):
660
661 2015-07-06  Brent Fulgham  <bfulgham@apple.com>
662
663         Ensure media playback is stopped during page close
664         https://bugs.webkit.org/show_bug.cgi?id=146554
665         <rdar://problem/18033944>
666
667         Reviewed by Brady Eidson.
668
669         * WebProcess/WebProcess.cpp:
670         (WebKit::WebProcess::didClose): Make sure to clean up any running media sessions when
671         the process is being shut down.
672
673 2015-07-06  Commit Queue  <commit-queue@webkit.org>
674
675         Unreviewed, rolling out r186385.
676         https://bugs.webkit.org/show_bug.cgi?id=146668
677
678         crashes 3 webaudio tests in debug builds (Requested by
679         alexchristensen on #webkit).
680
681         Reverted changeset:
682
683         "Ensure media playback is stopped during page close"
684         https://bugs.webkit.org/show_bug.cgi?id=146554
685         http://trac.webkit.org/changeset/186385
686
687 2015-07-06  Brent Fulgham  <bfulgham@apple.com>
688
689         Ensure media playback is stopped during page close
690         https://bugs.webkit.org/show_bug.cgi?id=146554
691         <rdar://problem/18033944>
692
693         Reviewed by Brady Eidson.
694
695         * WebProcess/WebProcess.cpp:
696         (WebKit::WebProcess::didClose): Make sure to clean up any running media sessions when
697         the process is being shut down.
698
699 2015-07-06  Yongjun Zhang  <yongjun_zhang@apple.com>
700
701         Allow UIDelegate to customize link actions in preview.
702         https://bugs.webkit.org/show_bug.cgi?id=146567
703
704         Add a new UIDelegate method to pass the defaultActions and elementInfo to client to allow
705         the client customize the actions based on the element. Also add a new SPI runActionWithElementInfo:
706         to _WKElementAction and make it aware of the WKActionSheetAssistant that creates it, so that
707         the client can run the action without knowing WKActionSheetAssistant.
708
709         Reviewed by Beth Dakin.
710
711         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Add delegate method _webView:previewViewControllerForURL:defaultActions:elementInfo:.
712         * UIProcess/API/Cocoa/_WKElementAction.h: Add a SPI runActionWithElementInfo:.
713         * UIProcess/API/Cocoa/_WKElementAction.mm:
714         (-[_WKElementAction _initWithTitle:actionHandler:type:assistant:]): Modified initializer, also initialize _defaultActionSheetAssistant
715             iVar if the caller provides that.
716         (+[_WKElementAction elementActionWithTitle:actionHandler:]): Use the new initializer.
717         (+[_WKElementAction _elementActionWithType:customTitle:assistant:]): A new helper method to create _WKElementAction with assistant.
718         (+[_WKElementAction _elementActionWithType:assistant:]):
719         (+[_WKElementAction elementActionWithType:customTitle:]):
720         (-[_WKElementAction runActionWithElementInfo:]):
721         * UIProcess/API/Cocoa/_WKElementActionInternal.h:
722         * UIProcess/ios/WKActionSheetAssistant.h: Add a method defaultActionsForLinkSheet.
723         * UIProcess/ios/WKActionSheetAssistant.mm:
724         (-[WKActionSheetAssistant defaultActionsForLinkSheet]): Get default actions for current link that is activated.
725         (-[WKActionSheetAssistant showLinkSheet]): Use defaultActionsForLinkSheet.
726         * UIProcess/ios/WKContentViewInteraction.mm:
727         (-[WKContentView previewViewControllerForPosition:inSourceView:]): Pass defaultActions and elementInfo to UIDelegate when querying
728             for preview view controller.
729         (-[WKContentView didDismissPreviewViewController:committing:]):
730
731 2015-07-06  Brady Eidson  <beidson@apple.com>
732
733         ShouldOpenExternalURLsPolicy should default to "Allow" for WK2 API loads.
734         <rdar://problem/21640050> and https://bugs.webkit.org/show_bug.cgi?id=146563
735
736         Reviewed by Geoff Garen.
737
738         * UIProcess/API/Cocoa/WKWebView.mm:
739         (-[WKWebView loadRequest:]): Move _loadRequest:withOptions: logic back here, just without options.
740         (-[WKWebView _loadRequest:withOptions:]): This SPI is now unneeded, but must remain inactive.
741         * UIProcess/WebPageProxy.h:
742
743 2015-07-06  Csaba Osztrogonác  <ossy@webkit.org>
744
745         URTBF after r186357 to fix non Cocoa platforms.
746
747         * NetworkProcess/NetworkProcess.cpp:
748         (WebKit::NetworkProcess::deleteWebsiteData):
749
750 2015-07-06  Antti Koivisto  <antti@apple.com>
751
752         With multipart/replaced (e.g. motion JPEG), m_bufferedDataForCache grows unbounded in Networking process
753         https://bugs.webkit.org/show_bug.cgi?id=146630
754         <rdar://problem/21677340>
755
756         Follow-up.
757
758         * NetworkProcess/NetworkResourceLoader.cpp:
759         (WebKit::NetworkResourceLoader::didReceiveBuffer):
760
761             Typo 1014 -> 1024
762
763 2015-07-06  Commit Queue  <commit-queue@webkit.org>
764
765         Unreviewed, rolling out r185896.
766         https://bugs.webkit.org/show_bug.cgi?id=146647
767
768         Caused by a refcounting error in GTK+; it's actually legal for
769         the event to be null, just the gi annotations were wrong.
770         (Requested by mcatanzaro on #webkit).
771
772         Reverted changeset:
773
774         "[GTK] Crash performing drag-and-drop"
775         https://bugs.webkit.org/show_bug.cgi?id=146267
776         http://trac.webkit.org/changeset/185896
777
778 2015-07-06  Anders Carlsson  <andersca@apple.com>
779
780         Provide API to clear the HSTS cache
781         https://bugs.webkit.org/show_bug.cgi?id=146565
782         rdar://problem/20023805
783
784         Reviewed by Tim Horton.
785
786         * NetworkProcess/NetworkProcess.cpp:
787         (WebKit::NetworkProcess::deleteWebsiteData):
788         * NetworkProcess/NetworkProcess.h:
789         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
790         (WebKit::NetworkProcess::clearHSTSCache):
791         * Shared/WebsiteData/WebsiteDataTypes.h:
792         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
793         (dataTypesToString):
794         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
795         (WebKit::toWebsiteDataTypes):
796         (WebKit::toWKWebsiteDataTypes):
797         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
798         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
799         (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
800
801 2015-07-06  Antti Koivisto  <antti@apple.com>
802
803         With multipart/replaced (e.g. motion JPEG), m_bufferedDataForCache grows unbounded in Networking process
804         https://bugs.webkit.org/show_bug.cgi?id=146630
805         <rdar://problem/21677340>
806
807         Reviewed by Chris Dumez.
808
809         * NetworkProcess/NetworkResourceLoader.cpp:
810         (WebKit::NetworkResourceLoader::didReceiveResponseAsync):
811
812             Don't buffer multipart/x-mixed-replace. We never want to cache these.
813
814         (WebKit::NetworkResourceLoader::didReceiveBuffer):
815
816             Limit the maximum size of the cache buffer to 10MB. This prevents unbounded memory growth if the resource
817             keeps streaming. It also prevents giant entries from pushing other data out of the cache.
818
819         (WebKit::NetworkResourceLoader::didFinishLoading):
820
821 2015-07-06  Zan Dobersek  <zdobersek@igalia.com>
822
823         [GTK] Guard X11-specific code in webkitWebViewBaseDidRelaunchWebProcess()
824         https://bugs.webkit.org/show_bug.cgi?id=146627
825
826         Reviewed by Carlos Garcia Campos.
827
828         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
829         (webkitWebViewBaseDidRelaunchWebProcess):
830         Guard calls to DrawingAreaImpl::setNativeSurfaceHandleForCompositing()
831         that pass in an X11 Window ID with the PLATFORM(X11) build guards.
832
833 2015-07-05  Chris Dumez  <cdumez@apple.com>
834
835         [WK2] Current page's scroll position is lost when transferring sessionState from one view to another
836         https://bugs.webkit.org/show_bug.cgi?id=146625
837         <rdar://problem/21585268>
838
839         Reviewed by Gavin Barraclough.
840
841         The current page's scroll position was lost when transferring the
842         sessionState from one view to another. This is because we only update
843         the current WebBackForwardListItem after navigating away.
844         However, when the client swaps WebViews for navigating, we don't detect
845         this as navigating away and the current WebBackForwardListItem is not
846         updated with the current page's state (including the scroll position).
847         This means that the information is not transferred via the sessionState
848         and the scroll position (among other things) ends up being lost when
849         navigating back in the new WebView.
850
851         Retrieving the session state is a synchronous API and we want to avoid
852         doing a synchronous IPC between the UIProcess and the WebProcess to
853         retrieve the current page's state. Therefore, the approach chosen in
854         this patch is to detect when the user is done scrolling the main frame
855         (using a HystererisActivity) and then update the scroll position on the
856         current HistoryItem. This way, the current WebBackForwardListItem
857         normally has an up-to-date scroll position for the main frame when the
858         sessionState is queried by the client.
859
860         The solution is not perfect as we don't keep the whole page state
861         up-to-date for the current WebBackForwardListItem, only the main frame
862         state. However, the proposed solution is cheap, avoid synchronous IPC
863         and provides a much better user experience in most cases.
864
865         * WebProcess/WebPage/WebPage.cpp:
866         (WebKit::WebPage::WebPage):
867         (WebKit::WebPage::pageDidScroll):
868         (WebKit::WebPage::pageStoppedScrolling):
869         * WebProcess/WebPage/WebPage.h:
870
871 2015-07-05  Timothy Hatcher  <timothy@apple.com>
872
873         Crash when closing the web inspector
874         https://bugs.webkit.org/show_bug.cgi?id=146620
875
876         Reviewed by Darin Adler.
877
878         * WebProcess/WebPage/WebInspectorUI.cpp:
879         (WebKit::WebInspectorUI::closeWindow): Null check the connection, like it is
880         in other places where it is used.
881
882 2015-07-04  Chris Dumez  <cdumez@apple.com>
883
884         Drop RefPtr::clear() method
885         https://bugs.webkit.org/show_bug.cgi?id=146556
886
887         Reviewed by Brady Eidson.
888
889         Drop RefPtr::clear() method in favor of "= nullptr;" pattern.        
890
891 2015-07-03  Dan Bernstein  <mitz@apple.com>
892
893         [Xcode] Update some build settings as recommended by Xcode 7
894         https://bugs.webkit.org/show_bug.cgi?id=146597
895
896         Reviewed by Sam Weinig.
897
898         * Configurations/Base.xcconfig: Enabled CLANG_WARN_UNREACHABLE_CODE and
899         GCC_NO_COMMON_BLOCKS. Removed GCC_MODEL_TUNING.
900
901         * WebKit2.xcodeproj/project.pbxproj: Updated LastUpgradeCheck.
902
903 2015-07-03  Carlos Garcia Campos  <cgarcia@igalia.com>
904
905         REGRESSION(r186025): [SOUP] NetworkCache gets blocked in traverse since r186025
906         https://bugs.webkit.org/show_bug.cgi?id=146545
907
908         Reviewed by Sergio Villar Senin.
909
910         In r186025 the readSync method used when traversing the cache
911         files was removed in favor of using parallel async reads to speed
912         up the traverse. The approach used doesn't work for soup, because
913         the IO operations are async, but run their callbacks in the
914         current thread. The network cache now runs up to 5 async reads in
915         the io work queue thread, and waits for them to finish, and those
916         asycn reads never finish for the soup backend because the thread
917         is blocked waiting for them. We need to use a different thread to
918         run those reads.
919
920         * NetworkProcess/cache/NetworkCacheIOChannel.h: Add
921         readSyncInThread private method.
922         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
923         (WebKit::NetworkCache::IOChannel::read): When not called in the
924         main thread, call readSyncInThread() instead.
925         (WebKit::NetworkCache::IOChannel::readSyncInThread): Run the read
926         operation synchronously in a different thread, since the current
927         thread might be blocked waiting for us.
928
929 2015-07-02  Przemek Piorkowski  <piorkowskiprzemyslaw@gmail.com>
930
931         [EFL] test_ewk2_application_cache_manager has been failed since r185527
932         https://bugs.webkit.org/show_bug.cgi?id=146016
933
934         Reviewed by Gyuyoung Kim.
935
936         In order to handle properly WebApplicationCacheManagerProxy implementation which use
937         WebsiteDataRecord it is necessary to enable PUBLIC_SUFFIX_LIST for EFL.
938         Implementation of PUBLIC_SUFFIX_LIST already exists for soup so EFL can use it as well.
939
940         * UIProcess/API/efl/tests/test_ewk2_application_cache_manager.cpp:
941         (TEST_F): enable ewk_application_cache_manager as it is passing now.
942
943 2015-07-02  Commit Queue  <commit-queue@webkit.org>
944
945         Unreviewed, rolling out r186247 and r186250.
946         https://bugs.webkit.org/show_bug.cgi?id=146572
947
948         Broke the build on Mavericks bots (Requested by cdumez on
949         #webkit).
950
951         Reverted changesets:
952
953         "Provide API to clear the HSTS cache"
954         https://bugs.webkit.org/show_bug.cgi?id=146565
955         http://trac.webkit.org/changeset/186247
956
957         "Unreviewed build fix for non-COCOA ports after r186247."
958         http://trac.webkit.org/changeset/186250
959
960 2015-07-02  Jinwoo Song  <jinwoo7.song@samsung.com>
961
962         Unreviewed build fix for non-COCOA ports after r186247.
963
964         * NetworkProcess/NetworkProcess.cpp:
965         (WebKit::NetworkProcess::deleteWebsiteData): Add PLATFORM(COCOA) guard.
966
967 2015-07-02  Anders Carlsson  <andersca@apple.com>
968
969         Provide API to clear the HSTS cache
970         https://bugs.webkit.org/show_bug.cgi?id=146565
971         rdar://problem/20023805
972
973         Reviewed by Tim Horton.
974
975         * NetworkProcess/NetworkProcess.cpp:
976         (WebKit::NetworkProcess::deleteWebsiteData):
977         * NetworkProcess/NetworkProcess.h:
978         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
979         (WebKit::NetworkProcess::clearHSTSCache):
980         * Shared/WebsiteData/WebsiteDataTypes.h:
981         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
982         (dataTypesToString):
983         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
984         (WebKit::toWebsiteDataTypes):
985         (WebKit::toWKWebsiteDataTypes):
986         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
987         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
988         (WebKit::computeNetworkProcessAccessTypeForDataRemoval):
989
990 2015-07-02  Mark Lam  <mark.lam@apple.com>
991
992         Gardening: fix broken 32-bit build..
993         https://bugs.webkit.org/show_bug.cgi?id=146416
994
995         Not reviewed.
996
997         * UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm:
998         (API::SerializedScriptValue::deserialize):
999
1000 2015-07-02  Brent Fulgham  <bfulgham@apple.com>
1001
1002         Correct *another* typo in r186238.
1003
1004         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Fix parameter name scrolView -> scrollView.
1005
1006 2015-07-02  Brent Fulgham  <bfulgham@apple.com>
1007
1008         Correct typo in r186238.
1009
1010         * UIProcess/API/Cocoa/WKWebView.mm:
1011         (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
1012
1013 2015-07-02  Brent Fulgham  <bfulgham@apple.com>
1014
1015         Provide delegate SPI for clients to notify WebKit about content inset changes
1016         https://bugs.webkit.org/show_bug.cgi?id=146482
1017         <rdar://problem/21602741>
1018
1019         Reviewed by Darin Adler.
1020
1021         Provide a new SPI for WebKit client applications to use to inform WebKit of planned
1022         adjustments to the edge insets of the view.
1023
1024         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Add new optional delegate method.
1025         * UIProcess/API/Cocoa/WKWebView.mm:
1026         (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]): If the new delegate
1027         method exists, use the specified content insets, rather than the current state of the view.
1028
1029 2015-07-02  Beth Dakin  <bdakin@apple.com>
1030
1031         Allow the UIDelegate to customize an image preview
1032         https://bugs.webkit.org/show_bug.cgi?id=146557
1033         -and corresponding-
1034         rdar://problem/21657424
1035
1036         Reviewed by Tim Horton.
1037
1038         Add imageURL to InteractionInformationAtPosition.
1039         * Shared/InteractionInformationAtPosition.cpp:
1040         (WebKit::InteractionInformationAtPosition::encode):
1041         (WebKit::InteractionInformationAtPosition::decode):
1042         * Shared/InteractionInformationAtPosition.h:
1043
1044         Two new delegate methods.
1045         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
1046
1047         Call the delegate methods at the appropriate time.
1048         * UIProcess/ios/WKContentViewInteraction.mm:
1049         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
1050         (-[WKContentView commitPreviewViewController:]):
1051
1052         Include the imageURL in InteractionInformationAtPosition.
1053         * WebProcess/WebPage/ios/WebPageIOS.mm:
1054         (WebKit::WebPage::getPositionInformation):
1055
1056 2015-07-02  Anders Carlsson  <andersca@apple.com>
1057
1058         Instead of requiring ToT UIKIt, check that UI_WEB_TOUCH_EVENT_HAS_IS_POTENTIAL_TAP is defined to 1
1059         https://bugs.webkit.org/show_bug.cgi?id=146558
1060
1061         Reviewed by Beth Dakin.
1062
1063         * Shared/ios/NativeWebTouchEventIOS.mm:
1064         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
1065
1066 2015-07-02  Brady Eidson  <beidson@apple.com>
1067
1068         Remove change I accidentally committed in r186232
1069
1070         * UIProcess/WebsiteData/WebsiteDataStore.h:
1071
1072 2015-07-02  Alex Christensen  <achristensen@webkit.org>
1073
1074         Fix EWS build after r186182.
1075
1076         * WebProcess/WebPage/WebPage.h:
1077         (WebKit::WebPage::userMediaPermissionRequestManager):
1078         Don't export a function defined in a header, or it will generate a weak external symbol.
1079
1080 2015-07-02  Brady Eidson  <beidson@apple.com>
1081
1082         Add preference to disable all http-equiv.
1083         <rdar://problem/9091261> and https://bugs.webkit.org/show_bug.cgi?id=146553
1084
1085         Reviewed by Sam Weinig.
1086
1087         * Shared/WebPreferencesDefinitions.h:
1088         
1089         * UIProcess/API/C/WKPreferences.cpp:
1090         (WKPreferencesSetMetaRefreshEnabled): Still expose this SPI, but have it affect
1091           the "httpEquivEnabled" setting.
1092         (WKPreferencesGetMetaRefreshEnabled): Ditto
1093         (WKPreferencesSetHTTPEquivEnabled):
1094         (WKPreferencesGetHTTPEquivEnabled):
1095         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1096         
1097         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1098         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1099         
1100         * WebProcess/WebPage/WebPage.cpp:
1101         (WebKit::WebPage::updatePreferences):
1102
1103 2015-07-02  Mark Lam  <mark.lam@apple.com>
1104
1105         WKWebView evaluateJavaScript:completionHandler: should reuse its JSContext instance.
1106         https://bugs.webkit.org/show_bug.cgi?id=146416
1107
1108         Reviewed by Anders Carlsson.
1109
1110         The core issue here is that we need to be able to deserialized an
1111         API::SerializedScriptValue instance into an ObjC object graph.  We'll solve this
1112         by introducing a API::SerializedScriptValue::deserialize() functions that does
1113         the job.  The deserialize() function will will use a SharedJSContext to provide
1114         the needed JSContext for doing this work.
1115
1116         Also updated ScriptMessageHandlerDelegate::didPostMessage() to use this new
1117         deserialize() function.
1118
1119         * Shared/API/APISerializedScriptValue.h:
1120         (API::SerializedScriptValue::deserialize):
1121         (API::SerializedScriptValue::internalRepresentation):
1122         - Changed to return a WebCore::SerializedScriptValue*.  This makes it friendlier
1123           to use in the 2 places that need it.
1124
1125         * UIProcess/API/Cocoa/APISerializedScriptValueCocoa.mm: Added.
1126         (API::SharedJSContext::SharedJSContext):
1127         (API::SharedJSContext::ensureContext):
1128         (API::SharedJSContext::releaseContext):
1129         (API::SerializedScriptValue::deserialize):
1130         * UIProcess/API/Cocoa/WKUserContentController.mm:
1131         * UIProcess/API/Cocoa/WKWebView.mm:
1132         (-[WKWebView evaluateJavaScript:completionHandler:]):
1133         * UIProcess/API/gtk/WebKitWebView.cpp:
1134         (webkitWebViewRunJavaScriptCallback):
1135         - Removed a now unnecessary cast.
1136         * WebKit2.xcodeproj/project.pbxproj:
1137
1138 2015-07-02  Dan Bernstein  <mitz@apple.com>
1139
1140         <rdar://problem/21429613> [iOS] Stop making symlinks from PrivateFrameworks to Frameworks
1141         https://bugs.webkit.org/show_bug.cgi?id=146542
1142
1143         Reviewed by Sam Weinig.
1144
1145         * WebKit2.xcodeproj/project.pbxproj: Removed the build phase that makes the directory of
1146         symlinks.
1147
1148 2015-07-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1149
1150         [GTK] WebSQL doesn't work because openDatabase always fails with DOM Exception 18
1151         https://bugs.webkit.org/show_bug.cgi?id=146234
1152
1153         Reviewed by Sergio Villar Senin.
1154
1155         This is because we don't provide any quota, and 0 is used by
1156         default, so there's never enough quota and openDatabase fails. We
1157         should expose this in the API, but for now, we could use a default
1158         quota of 5MB like WTR does.
1159
1160         * UIProcess/API/gtk/WebKitUIClient.cpp: Override
1161         exceededDatabaseQuota and return always the default quota.
1162         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
1163         (WebKit::exceededDatabaseQuota): Return the quota based on the
1164         expected usage and current database usabe like mac does.
1165         (WebKit::WebInspectorProxy::platformCreateInspectorPage): Add
1166         custom UI client to implement exceededDatabaseQuota.
1167
1168 2015-07-02  Commit Queue  <commit-queue@webkit.org>
1169
1170         Unreviewed, rolling out r185704.
1171         https://bugs.webkit.org/show_bug.cgi?id=146544
1172
1173         Didn't fix the problem (Requested by anttik on #webkit).
1174
1175         Reverted changeset:
1176
1177         "~4% Membuster regression after WebKit r185452"
1178         https://bugs.webkit.org/show_bug.cgi?id=146112
1179         http://trac.webkit.org/changeset/185704
1180
1181 2015-07-02  Carlos Garcia Campos  <cgarcia@igalia.com>
1182
1183         [GTK] Accelerated Compositing stops working after a web process crash
1184         https://bugs.webkit.org/show_bug.cgi?id=146508
1185
1186         Reviewed by Martin Robinson.
1187
1188         The problem is that we don't send the window ID again to the new
1189         web process.
1190
1191         * UIProcess/API/gtk/PageClientImpl.cpp:
1192         (WebKit::PageClientImpl::didRelaunchProcess): Call
1193         webkitWebViewBaseDidRelaunchWebProcess().
1194         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1195         (webkitWebViewBaseDidRelaunchWebProcess): Set the window ID to
1196         the new drawing area.
1197         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
1198
1199 2015-07-01  Joseph Pecoraro  <pecoraro@apple.com>
1200
1201         Web Inspector: [Mac] InspectorFrontendHost.beep() doesn't play a sound, sandbox warnings
1202         https://bugs.webkit.org/show_bug.cgi?id=146525
1203
1204         Reviewed by Timothy Hatcher.
1205
1206         * WebProcess/com.apple.WebProcess.sb.in:
1207         Get NSBeep working without any sandbox warnings.
1208
1209 2015-07-01  Anders Carlsson  <andersca@apple.com>
1210
1211         Remove code to recompute rounded window corners
1212         https://bugs.webkit.org/show_bug.cgi?id=146534
1213
1214         Reviewed by Simon Fraser.
1215
1216         This code is no longer needed since we're always layer-backed now.
1217
1218         * UIProcess/API/mac/WKView.mm:
1219         (-[WKView displayIfNeeded]): Deleted.
1220         (-[WKView _cacheWindowBottomCornerRect]): Deleted.
1221         * UIProcess/API/mac/WKViewInternal.h:
1222
1223 2015-07-01  Yongjun Zhang  <yongjun_zhang@apple.com>
1224
1225         Web page doesn't update its loading state when web process becomes suspended if there are pending network requests (XHR).
1226         https://bugs.webkit.org/show_bug.cgi?id=146439
1227
1228         When web page is loading, we hold a background activity token in NavigationState and we release the token when the page done
1229         loading. A web page can start loading subresources (like XHR) after the page is loaded, and WebPageProxy will update its
1230         _networkRequestsInProgress state which will notify the client there is network actvity on-going. Since we don't hold
1231         the background activity token after page is loaded, the WebContent process could become suspended without notifying the client
1232         and the client will lose track of the loading state.
1233
1234         The first thought was to hold another background activity when _networkRequestsInProgress flag is set in NavigationState.
1235         However, this could result in side-effect that a WebContent process can stay active for too long if there is a long lasting
1236         XHR resquest.
1237         
1238         This patch fix this by notifying the client that network activity is stopped when WebContent process is going to be suspended.
1239         We also cache the networkRequestsInProgress state for suspended process, so that when it becomes foreground, we can tell
1240         the client the correct state of network activity.
1241
1242         Reviewed by Dan Bernstein.
1243
1244         * UIProcess/WebPageProxy.cpp:
1245         (WebKit::WebPageProxy::WebPageProxy): Initialize m_hasNetworkRequestsOnSuspended.
1246         (WebKit::WebPageProxy::processWillBecomeSuspended): If there is pending requests on suspend, cache the network activity state
1247             and notify the client.
1248         (WebKit::WebPageProxy::processWillBecomeForground): Restore the network activity state when the process becomes foreground. 
1249         (WebKit::WebPageProxy::resetState):
1250         * UIProcess/WebPageProxy.h: Add a data member m_hasNetworkRequestsOnSuspended to cache the network activity state on process
1251             suspend.
1252         * UIProcess/WebProcessProxy.cpp:
1253         (WebKit::WebProcessProxy::didSetAssertionState):
1254
1255 2015-07-01  Dean Jackson  <dino@apple.com>
1256
1257         Disable the experimental WebGL2 implementation
1258         https://bugs.webkit.org/show_bug.cgi?id=146526
1259         <rdar://problem/21641235>
1260
1261         Reviewed by Myles Maxfield.
1262
1263         Add (and disable) an ENABLE_WEBGL2 flag.
1264
1265         * Configurations/FeatureDefines.xcconfig:
1266
1267 2015-07-01  Brady Eidson  <beidson@apple.com>
1268
1269         Never try to pass URLs to LaunchServices when they're the same domain as the current URL.
1270         <rdar://problem/20731429> and https://bugs.webkit.org/show_bug.cgi?id=146521
1271
1272         Reviewed by Alex Christensen.
1273
1274         * UIProcess/Cocoa/NavigationState.mm:
1275         (WebKit::tryAppLink): Compare the proposed URL to the current URL to see if they’re in the same domain.
1276         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1277
1278 2015-07-01  Tim Horton  <timothy_horton@apple.com>
1279
1280         WKWebView snapshots have the wrong scale after rotation
1281         https://bugs.webkit.org/show_bug.cgi?id=146476
1282         <rdar://problem/18345247>
1283
1284         Reviewed by Anders Carlsson.
1285
1286         * UIProcess/API/Cocoa/WKWebView.mm:
1287         (-[WKWebView _didCommitLayerTree:]):
1288         "Coordinate" -> "Coordinates".
1289
1290         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
1291         Defer any snapshotting that happens during a resize until after
1292         the resize completes. This will ensure that (in the case of an IOSurface
1293         snapshot) the tiles are up to date, and (in the case of a software snapshot)
1294         that our understanding of the scale and scroll offset of the WKContentView
1295         are up to date, so that we can correctly convert from view to content coordinates
1296         in the UI process.
1297
1298         (-[WKWebView _endAnimatedResize]):
1299         Perform the deferred snapshotting after the resize completes.
1300
1301 2015-07-01  Beth Dakin  <bdakin@apple.com>
1302
1303         This is a quick follow-on to http://trac.webkit.org/changeset/186132
1304
1305         Rubber-stamped by Darin Adler.
1306
1307         Make this a one-liner.
1308         * WebProcess/WebPage/ios/WebPageIOS.mm:
1309         (WebKit::WebPage::getPositionInformation):
1310
1311 2015-07-01  Matthew Daiter  <mdaiter@apple.com>
1312
1313         Enable MEDIA_STREAM flag
1314         https://bugs.webkit.org/show_bug.cgi?id=145947
1315         <rdar://problem/21365829>
1316
1317         Reviewed by Eric Carlson.
1318
1319         * Configurations/FeatureDefines.xcconfig: Add MEDIA_STREAM flag
1320         * WebKit2.xcodeproj/project.pbxproj: Changed some project to private
1321         declarations of headers
1322         * WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
1323         * WebProcess/WebPage/WebPage.h:
1324         (WebKit::WebPage::userMediaPermissionRequestManager):
1325
1326 2015-07-01  Brady Eidson  <beidson@apple.com>
1327
1328         Check shouldOpenExternalURLs instead of isProcessingUserGesture before passing URL to LaunchServices.
1329         <rdar://problem/20577859> and https://bugs.webkit.org/show_bug.cgi?id=146513
1330
1331         Reviewed by Darin Adler.
1332
1333         * UIProcess/Cocoa/NavigationState.mm:
1334         (WebKit::tryAppLink): The expected value of isProcessingUserGesture is lost over redirects.
1335           shouldOpenExternalURLs actually fits this role perfectly.
1336
1337 2015-07-01  Michael Catanzaro  <mcatanzaro@igalia.com>
1338
1339         [GTK] [Wayland] Build broken with ENABLE_WAYLAND_TARGET=ON
1340         https://bugs.webkit.org/show_bug.cgi?id=146512
1341
1342         Unreviewed, fix build with ENABLE_WAYLAND_TARGET=ON after r185949.
1343
1344         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
1345         (webkitWebViewBaseCreateWebPage):
1346
1347 2015-06-30  Martin Robinson  <mrobinson@igalia.com>
1348
1349         [GTK] REGRESSION(r183936): Test /webkit2/WebKitWebContext/spell-checker fails since r183936
1350         https://bugs.webkit.org/show_bug.cgi?id=144828
1351
1352         Reviewed by Carlos Garcia Campos.
1353
1354         Instead of setting spell checking languages unconditionally when building int
1355         developer mode, add some C API that allows setting them in WebKitTestRunner.
1356
1357         * PlatformGTK.cmake: Add the new C API file to the source list.
1358         * UIProcess/API/C/gtk/WKTextCheckerGtk.cpp:
1359         (WKTextCheckerSetSpellCheckingLanguages): Added this function which allows settings
1360         the spell checking languages from the C API.
1361         * UIProcess/API/C/gtk/WKTextCheckerGtk.h: Added.
1362         * UIProcess/gtk/TextCheckerGtk.cpp:
1363         (WebKit::enchantTextChecker): Remove the hack which sets the spell checking languages automatically
1364         for development builds.
1365
1366 2015-07-01  Joseph Pecoraro  <pecoraro@apple.com>
1367
1368         [Mac] Numerous CGColor leaks in swipe gestures
1369         https://bugs.webkit.org/show_bug.cgi?id=146501
1370
1371         Reviewed by Tim Horton.
1372
1373         * UIProcess/mac/ViewGestureControllerMac.mm:
1374         (WebKit::ViewGestureController::beginSwipeGesture):
1375
1376 2015-07-01  Joseph Pecoraro  <pecoraro@apple.com>
1377
1378         [Mac] Confusing RetainPtr use in TiledCoreAnimationDrawingArea
1379         https://bugs.webkit.org/show_bug.cgi?id=146503
1380
1381         Reviewed by Tim Horton.
1382
1383         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1384         (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
1385         Simplify adoption into a new RetainPtr.
1386
1387 2015-06-30  Simon Fraser  <simon.fraser@apple.com>
1388
1389         Fix CoordinatedGraphics.
1390
1391         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1392         (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer):
1393
1394 2015-06-30  Simon Fraser  <simon.fraser@apple.com>
1395
1396         More Gtk/EFL fixing.
1397
1398         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1399         (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer):
1400         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
1401         (WebKit::LayerTreeHostGtk::flushPendingLayerChanges):
1402
1403 2015-06-30  Andy VanWagoner  <thetalecrafter@gmail.com>
1404
1405         Implement ECMAScript Internationalization API
1406         https://bugs.webkit.org/show_bug.cgi?id=90906
1407
1408         Reviewed by Benjamin Poulain.
1409
1410         * Configurations/FeatureDefines.xcconfig: add ENABLE_INTL flag
1411
1412 2015-06-30  Simon Fraser  <simon.fraser@apple.com>
1413
1414         Fix Mac and Windows builds.
1415
1416         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1417         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
1418
1419 2015-06-30  Simon Fraser  <simon.fraser@apple.com>
1420
1421         [iOS] Missing tiles inside position:fixed on scrolling
1422         https://bugs.webkit.org/show_bug.cgi?id=146485
1423         rdar://problem/21226861
1424
1425         Reviewed by Tim Horton.
1426
1427         Layer flushing adjusts the coverage rect for tiled layers, but does so at times
1428         when position:fixed layers are moved around by the scrolling tree. The computed
1429         coverage rect then doesn't reflect the layer's on-screen position, causing missing
1430         tiles.
1431
1432         Fix by pushing the notion of being in a "stable state" onto FrameView, and passing
1433         that state into the layer flush. When not in a stable state, flushing doesn't change
1434         the visible and coverage rects for layers that are viewport-constrained.
1435
1436         * WebProcess/WebPage/ios/WebPageIOS.mm:
1437         (WebKit::WebPage::updateVisibleContentRects):
1438         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1439         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
1440
1441 2015-06-30  Hyungwook Lee  <hyungwook.lee@navercorp.com>
1442
1443         [EFL] Implement ewk_favicon_database_clear() API.
1444         https://bugs.webkit.org/show_bug.cgi?id=146337
1445
1446         Reviewed by Gyuyoung Kim.
1447
1448         We need to provide way to clear favicon data.
1449
1450         * UIProcess/API/efl/ewk_favicon_database.cpp:
1451         (EwkFaviconDatabase::getIconSurfaceSynchronously):
1452         (EwkFaviconDatabase::clearFaviconDatabase):
1453         (EwkFaviconDatabase::iconDataReadyForPageURL):
1454         (ewk_favicon_database_icon_change_callback_del):
1455         (ewk_favicon_database_clear):
1456         * UIProcess/API/efl/ewk_favicon_database.h:
1457         * UIProcess/API/efl/ewk_favicon_database_private.h:
1458         * UIProcess/API/efl/tests/test_ewk2_favicon_database.cpp:
1459         (TEST_F):
1460
1461 2015-06-30  Andreas Kling  <akling@apple.com>
1462
1463         [iOS] Ignore viewport rect changes during zoom bouncing.
1464         <https://webkit.org/b/146480>
1465
1466         Reviewed by Benjamin Poulain.
1467
1468         When the user has pinch-zoomed past the maximum zoom scale and lets go of the screen,
1469         we animate a bounce back to the maximum scale.
1470
1471         Suppress viewport rect updates during this bounce animation since we don't need them
1472         anyway. This fixes an issue where we'd sometimes get a weird rect during the animation
1473         and if could send that to the web process, causing it to generate tiles for a part of
1474         the page that's not actually exposed.
1475
1476         * UIProcess/API/Cocoa/WKWebView.mm:
1477         (-[WKWebView _updateVisibleContentRects]):
1478
1479 2015-06-30  Enrica Casucci  <enrica@apple.com>
1480
1481         <rdar://problem/20655729> WebKit should heuristically exclude scrolling touch events from the user gesture category
1482
1483         Reviewed by Benjamin Poulain.
1484
1485         * Platform/spi/ios/UIKitSPI.h:
1486         * Shared/WebEvent.h:
1487         (WebKit::WebTouchEvent::WebTouchEvent):
1488         (WebKit::WebTouchEvent::position):
1489         (WebKit::WebTouchEvent::isPotentialTap):
1490         (WebKit::WebTouchEvent::isGesture):
1491         (WebKit::WebTouchEvent::gestureScale):
1492         (WebKit::WebTouchEvent::gestureRotation):
1493         * Shared/WebEventConversion.cpp:
1494         (WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):
1495         * Shared/ios/NativeWebTouchEventIOS.mm:
1496         (WebKit::NativeWebTouchEvent::NativeWebTouchEvent):
1497         * Shared/ios/WebTouchEventIOS.cpp:
1498         (WebKit::WebTouchEvent::encode):
1499         (WebKit::WebTouchEvent::decode):
1500         Pipe isPotentialTap through.
1501
1502 2015-06-30  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1503
1504         [GTK] [EFL] Unreviewed build fix after r186118.
1505
1506         Add if PLATFORM(COCOA) back.
1507
1508         * WebProcess/WebProcess.cpp:
1509         (WebKit::WebProcess::nonVisibleProcessCleanupTimerFired):
1510         * WebProcess/WebProcess.h:
1511
1512 2015-06-30  Simon Fraser  <simon.fraser@apple.com>
1513
1514         Crash under _layoutForNodeHighlight: when inspecting espn.com
1515         https://bugs.webkit.org/show_bug.cgi?id=146422
1516
1517         Reviewed by Joseph Pecoraro.
1518         
1519         When inspecting espn.com, MobileSafari sometimes crashes, because
1520         highlight.quads is empty. I was not able to quickly determine why.
1521
1522         Fix by bailing in this case.
1523
1524         * UIProcess/WKInspectorHighlightView.mm:
1525         (-[WKInspectorHighlightView _layoutForNodeHighlight:]):
1526
1527 2015-06-30  Matt Baker  <mattbaker@apple.com>
1528
1529         Web Inspector: Reduce rendering frames "Other" time by instrumenting compositing
1530         https://bugs.webkit.org/show_bug.cgi?id=146168
1531
1532         Reviewed by Brian Burg.
1533
1534         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1535         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
1536         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
1537         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
1538         Added CA transaction post-commit handlers to instrument end of composite.
1539
1540 2015-06-30  Beth Dakin  <bdakin@apple.com>
1541
1542         The bounds on InteractionInformationAtPosition should be more precise
1543         https://bugs.webkit.org/show_bug.cgi?id=146468
1544         -and corresponding-
1545         rdar://problem/20739834
1546
1547         Reviewed by Enrica Casucci and Simon Fraser.
1548
1549         For links, get the TextQuads from the Range, and for images, look at the 
1550         absoluteContentQuad(). All other items can continue to use absoluteBoundingBox.
1551         * WebProcess/WebPage/ios/WebPageIOS.mm:
1552         (WebKit::WebPage::getPositionInformation):
1553
1554 2015-06-30  Anders Carlsson  <andersca@apple.com>
1555
1556         Disable Spintracer when getting the list of plug-ins
1557         https://bugs.webkit.org/show_bug.cgi?id=146467
1558         rdar://problem/21616640
1559
1560         Reviewed by Tim Horton.
1561
1562         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1563         (WebKit::WebPlatformStrategies::populatePluginCache):
1564
1565 2015-06-30  Anders Carlsson  <andersca@apple.com>
1566
1567         Java Plugin cannot launch JavaUpdater.app after renaming
1568         https://bugs.webkit.org/show_bug.cgi?id=146464
1569         rdar://problem/19747153
1570
1571         Reviewed by Tim Horton.
1572
1573         Check for both "JavaUpdater.app" and "Java Updater.app".
1574
1575         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1576         (WebKit::isJavaUpdaterURL):
1577
1578 2015-06-30  Chris Dumez  <cdumez@apple.com>
1579
1580         [WK2] Avoid taking a useless / blank navigation snapshot when navigating after restoring sessionState
1581         https://bugs.webkit.org/show_bug.cgi?id=146446
1582         <rdar://problem/21584231>
1583
1584         Reviewed by Darin Adler.
1585
1586         We currently take a useless / blank navigation snapshot when navigating
1587         after restoring the back / forward list from a sessionState object.
1588         This is because we get a current HistoryItem from the sessionState
1589         which we have never really navigated to. We then take a navigation
1590         snapshot for the current HistoryItem when navigating away as we usually
1591         do. However, in this case, the HistoryItem was imported and there is
1592         nothing to snapshot.
1593
1594         Taking this snapshot is not only wasteful, it can also potentially
1595         overwrite the snapshot that was set by the client using
1596         WKWebView._saveBackForwardSnapshotForItem() SPI.
1597
1598         To address the problem, this patch suppresses navigation snapshotting
1599         after restoring the back / forward list from a session state and until
1600         the next load is committed.
1601
1602         * UIProcess/WebPageProxy.cpp:
1603         (WebKit::WebPageProxy::recordNavigationSnapshot):
1604         (WebKit::WebPageProxy::restoreFromSessionState):
1605         (WebKit::WebPageProxy::didCommitLoadForFrame):
1606         * UIProcess/WebPageProxy.h:
1607
1608 2015-06-29  Anders Carlsson  <andersca@apple.com>
1609
1610         Get rid of unused WKSI functions
1611         https://bugs.webkit.org/show_bug.cgi?id=146443
1612
1613         Reviewed by Tim Horton.
1614
1615         * UIProcess/API/Cocoa/WKWebView.mm:
1616         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1617         (InitWebCoreSystemInterface): Deleted.
1618         * WebProcess/WebProcess.cpp:
1619         (WebKit::WebProcess::nonVisibleProcessCleanupTimerFired):
1620         * WebProcess/WebProcess.h:
1621         * WebProcess/cocoa/WebProcessCocoa.mm:
1622         (WebKit::WebProcess::destroyRenderingResources):
1623
1624 2015-06-29  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1625
1626         [GTK] Unreviewed GTK build fix since r186088 and r186095.
1627         https://bugs.webkit.org/show_bug.cgi?id=146449
1628
1629         * PlatformGTK.cmake:
1630         * UIProcess/API/gtk/PageClientImpl.h:
1631
1632 2015-06-29  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1633
1634         Unreviewed EFL build fix since r186088 and r186095.
1635
1636         * CMakeLists.txt: Remove ConnectionStack.cpp.
1637         * UIProcess/CoordinatedGraphics/WebView.h: Override virtual didFailLoadForMainFrame().
1638
1639 2015-06-29  Brady Eidson  <beidson@apple.com>
1640
1641         Flag sync XHRs from the network process so they can be handled appropriately.
1642         <rdar://problem/21579162> and https://bugs.webkit.org/show_bug.cgi?id=146441
1643
1644         Reviewed by Darin Adler.
1645
1646         * NetworkProcess/NetworkResourceLoader.h:
1647         (WebKit::NetworkResourceLoader::loadingSynchronousXHR): Return isSynchronous().
1648
1649 2015-06-29  Anders Carlsson  <andersca@apple.com>
1650
1651         Remove an empty group from the Xcode project.
1652
1653         * WebKit2.xcodeproj/project.pbxproj:
1654
1655 2015-06-29  Anders Carlsson  <andersca@apple.com>
1656
1657         Get rid of ConnectionStack
1658         https://bugs.webkit.org/show_bug.cgi?id=146437
1659
1660         Reviewed by Andreas Kling.
1661
1662         Just use a TemporaryChange and a static variable instead.
1663
1664         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1665         * PluginProcess/WebProcessConnection.cpp:
1666         (WebKit::WebProcessConnection::setGlobalException):
1667         (WebKit::WebProcessConnection::didReceiveMessage):
1668         (WebKit::WebProcessConnection::didReceiveSyncMessage):
1669         * Shared/ConnectionStack.cpp: Removed.
1670         (WebKit::ConnectionStack::singleton): Deleted.
1671         * Shared/ConnectionStack.h: Removed.
1672         (WebKit::ConnectionStack::current): Deleted.
1673         (WebKit::ConnectionStack::CurrentConnectionPusher::CurrentConnectionPusher): Deleted.
1674         (WebKit::ConnectionStack::CurrentConnectionPusher::~CurrentConnectionPusher): Deleted.
1675         * WebKit2.xcodeproj/project.pbxproj:
1676
1677 2015-06-29  Tim Horton  <timothy_horton@apple.com>
1678
1679         Fix the build.
1680
1681         * UIProcess/API/Cocoa/WKWebView.mm:
1682         (-[WKWebView _didFailLoadForMainFrame]):
1683         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1684         * UIProcess/ios/PageClientImplIOS.h:
1685         * UIProcess/ios/PageClientImplIOS.mm:
1686         (WebKit::PageClientImpl::didFailLoadForMainFrame):
1687
1688 2015-06-29  Dean Jackson  <dino@apple.com>
1689
1690         Temporarily disable PICTURE_SIZES
1691         https://bugs.webkit.org/show_bug.cgi?id=146435
1692         <rdar://problem/21087013>
1693
1694         Temporarily disable PICTURE_SIZES because it causes problems with out
1695         of date <picture> polyfills.
1696
1697         Temporarily disable PICTURE_SIZES until Safari branches.
1698
1699         * Configurations/FeatureDefines.xcconfig:
1700
1701 2015-06-29  Anders Carlsson  <andersca@apple.com>
1702
1703         Don't try to access a possibly deallocated WebFrameProxy object
1704         https://bugs.webkit.org/show_bug.cgi?id=146428
1705         rdar://problem/21446364
1706
1707         Reviewed by Tim Horton.
1708
1709         Make sure to call isMainFrame before calling out to the client inside
1710         WebPageProxy::didFailLoadForFrame, matching what we do for WebPageProxy::didFinishLoadForFrame.
1711
1712         Also, add a ViewGestureController::didFailLoadForMainFrame function and call that instead of
1713         calling didFinishLoadForMainFrame in the failure case.
1714
1715         * UIProcess/API/mac/WKView.mm:
1716         (-[WKView _didFailLoadForMainFrame]):
1717         * UIProcess/API/mac/WKViewInternal.h:
1718         * UIProcess/PageClient.h:
1719         * UIProcess/WebPageProxy.cpp:
1720         (WebKit::WebPageProxy::didFailLoadForFrame):
1721         * UIProcess/ios/ViewGestureControllerIOS.mm:
1722         (WebKit::ViewGestureController::mainFrameLoadDidReachTerminalState):
1723         (WebKit::ViewGestureController::didFinishLoadForMainFrame): Deleted.
1724         * UIProcess/mac/PageClientImpl.h:
1725         * UIProcess/mac/PageClientImpl.mm:
1726         (WebKit::PageClientImpl::didFailLoadForMainFrame):
1727         * UIProcess/mac/ViewGestureController.h:
1728         (WebKit::ViewGestureController::didFinishLoadForMainFrame):
1729         (WebKit::ViewGestureController::didFailLoadForMainFrame):
1730         * UIProcess/mac/ViewGestureControllerMac.mm:
1731         (WebKit::ViewGestureController::mainFrameLoadDidReachTerminalState):
1732         (WebKit::ViewGestureController::didFinishLoadForMainFrame): Deleted.
1733
1734 2015-06-29  Yongjun Zhang  <yongjun_zhang@apple.com>
1735
1736         Disable default gesture recognizers on preview.
1737         https://bugs.webkit.org/show_bug.cgi?id=146424
1738         rdar://problem/21572828
1739
1740         We should disable default gesture recognizers on preview, to avoid activating links or
1741         triggering touch events accidentally. We can enable them after preview finishes.
1742
1743         Reviewed by Beth Dakin.
1744
1745         * UIProcess/ios/WKContentViewInteraction.mm:
1746         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]):
1747         (-[WKContentView didDismissPreviewViewController:committing:]):
1748
1749 2015-06-27  Ryosuke Niwa  <rniwa@webkit.org>
1750
1751         Font panel doesn't get updated when bolding text via cmd+b in Mail on OS X
1752         https://bugs.webkit.org/show_bug.cgi?id=146379
1753
1754         Reviewed by Darin Adler.
1755
1756         Since font panel doesn't open in WebKit2 at the moment, just add an empty implementation of didApplyStyle
1757
1758         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1759         (WebKit::WebEditorClient::didApplyStyle):
1760         * WebProcess/WebCoreSupport/WebEditorClient.h:
1761         * WebProcess/WebPage/WebPage.h:
1762
1763 2015-06-29  Dean Jackson  <dino@apple.com>
1764
1765         Setting to enable/disable media controls sizing on page zoom
1766         https://bugs.webkit.org/show_bug.cgi?id=146423
1767         <rdar://problem/18379634>
1768
1769         Reviewed by Eric Carlson.
1770
1771         Add a new setting "MediaControlsScaleWithPageZoom" that can disable
1772         the behaviour we currently implement on iOS, where the media controls
1773         attempt to remain at a fixed size independent of page zoom.
1774
1775         * Shared/WebPreferencesDefinitions.h: Initialize to false on iOS, true otherwise.
1776         * UIProcess/API/C/WKPreferences.cpp:
1777         (WKPreferencesSetMediaControlsScaleWithPageZoom):
1778         (WKPreferencesGetMediaControlsScaleWithPageZoom):
1779         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1780         * WebProcess/WebPage/WebPage.cpp:
1781         (WebKit::WebPage::updatePreferences):
1782
1783 2015-06-29  Chris Dumez  <cdumez@apple.com>
1784
1785         [WK2][iOS] Swipe gesture snapshot stays up for 3 seconds when swiping back after top-hit navigation
1786         https://bugs.webkit.org/show_bug.cgi?id=146415
1787         <rdar://problem/21595801>
1788
1789         Reviewed by Tim Horton.
1790
1791         Swipe gesture snapshot previously stayed up for 3 seconds when swiping
1792         back after a top-hit navigation. This is because we do not restore the
1793         scroll position in this case and the ViewGestureController was waiting
1794         for the scroll position to be restored before taking down the snapshot.
1795
1796         This patch adds a fail-safe mechanism so that the WebProcess can let
1797         the UIProcess know (via a CouldNotRestorePageState IPC) that the page
1798         state (including scroll position) could not be restored so that it can
1799         let the ViewGestureController it should not wait for the scroll
1800         position to be restored.
1801
1802         * UIProcess/API/Cocoa/WKWebView.mm:
1803         (-[WKWebView _couldNotRestorePageState]):
1804         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1805         * UIProcess/PageClient.h:
1806         * UIProcess/WebPageProxy.h:
1807         * UIProcess/WebPageProxy.messages.in:
1808         * UIProcess/ios/PageClientImplIOS.h:
1809         * UIProcess/ios/PageClientImplIOS.mm:
1810         (WebKit::PageClientImpl::couldNotRestorePageState):
1811         * UIProcess/ios/WebPageProxyIOS.mm:
1812         (WebKit::WebPageProxy::couldNotRestorePageState):
1813         * WebProcess/WebPage/ios/WebPageIOS.mm:
1814         (WebKit::WebPage::restorePageState):
1815
1816 2015-06-29  Chris Dumez  <cdumez@apple.com>
1817
1818         [WK2][iOS] Add WKWebView private API to save a back/forward snapshot
1819         https://bugs.webkit.org/show_bug.cgi?id=146398
1820         <rdar://problem/21584231>
1821
1822         Reviewed by Dan Bernstein.
1823
1824         Add WKWebView private API to save a back/forward snapshot so that the
1825         client can make sure a back/forward snapshot is available even when
1826         swapping WKWebView upon navigation.
1827
1828         This matches the WKView.saveBackForwardSnapshotForItem API we have on
1829         Mac.
1830
1831         * UIProcess/API/Cocoa/WKWebView.mm:
1832         (-[WKWebView saveBackForwardSnapshotForItem:]):
1833         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1834
1835 2015-06-29  Anders Carlsson  <andersca@apple.com>
1836
1837         Use DISPATCH_SOURCE_TYPE_MEMORYPRESSURE instead of DISPATCH_SOURCE_TYPE_MEMORYSTATUS
1838         https://bugs.webkit.org/show_bug.cgi?id=146413
1839
1840         Reviewed by Andreas Kling.
1841
1842         Replace SPI with API.
1843
1844         * UIProcess/ios/WebMemoryPressureHandlerIOS.mm:
1845         (WebKit::WebMemoryPressureHandler::WebMemoryPressureHandler):
1846         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
1847         (InitWebCoreSystemInterface): Deleted.
1848
1849 2015-06-29  Enrica Casucci  <enrica@apple.com>
1850
1851         [iOS] Hardware Keyboard: All combinations of arrow keys and space key do not scroll the view.
1852         https://bugs.webkit.org/show_bug.cgi?id=146290
1853         rdar://problem/18466015
1854
1855         We don't normally get called by the keyboard to handle the event if we are not
1856         interacting with editable content. In order to receive all the hardware keyboard events
1857         we need to implement _handleKeyUIEvent which is called for every key event
1858         when the view is first responder. This gives us the opportunity to send each keystroke
1859         to the WebProcess to let any Javascript handler intercept it and then perform the default
1860         action for the key combination.
1861         Unfortunately this mechanism does not provide key repeat, which is implemented in the
1862         keyboard layer. In order to have it at least for the arrow keys, we use the keyCommands
1863         mechanism only for those.
1864
1865         Reviewed by Darin Adler.
1866
1867         * Platform/spi/ios/UIKitSPI.h:
1868         * UIProcess/API/Cocoa/WKWebView.mm:
1869         (-[WKWebView _scrollByOffset:]):
1870         * UIProcess/API/Cocoa/WKWebViewInternal.h:
1871         * UIProcess/ios/WKContentViewInteraction.mm:
1872         (-[WKContentView canPerformAction:withSender:]):
1873         (-[WKContentView keyCommands]):
1874         (-[WKContentView _arrowKey:]):
1875         (-[WKContentView _handleKeyUIEvent:]):
1876         (-[WKContentView handleKeyEvent:]):
1877         (-[WKContentView handleKeyWebEvent:]):
1878         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
1879
1880 2015-06-28  Dan Bernstein  <mitz@apple.com>
1881
1882         Fixed the iOS 8.x build after r186066.
1883
1884         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
1885         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
1886         (WebKit::WebVideoFullscreenManagerProxy::create):
1887
1888 2015-06-28  Dan Bernstein  <mitz@apple.com>
1889
1890         Fixed the iOS build after r186059.
1891
1892         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
1893
1894 2015-06-28  Chris Fleizach  <cfleizach@apple.com>
1895
1896         AX: iOS: Crash at accessibilityObjectForMainFramePlugin()
1897         https://bugs.webkit.org/show_bug.cgi?id=146399
1898
1899         Reviewed by Darin Adler.
1900
1901         Could not reproduce issue, but the invalid address seems to indicate this is a nullptr access is happening when we try to get the plugin of the m_page variable when
1902         it has not been initialized.
1903
1904         * WebProcess/WebPage/ios/WebPageIOS.mm:
1905         (WebKit::WebPage::accessibilityObjectForMainFramePlugin):
1906
1907 2015-06-28  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1908
1909         Use Ref/RefPtr instead of PassRefPtr in WebKit2
1910         https://bugs.webkit.org/show_bug.cgi?id=146190
1911
1912         Reviewed by Darin Adler.
1913
1914         As a step to remove PassRefPtr, this patch reduces use of PassRefPtr in WebKit2.
1915
1916         * Shared/API/c/WKContextMenuItem.cpp:
1917         (WKContextMenuItemCreateAsAction):
1918         (WKContextMenuItemCreateAsCheckableAction):
1919         * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp:
1920         (WebKit::WebCoordinatedSurface::create):
1921         * Shared/CoordinatedGraphics/WebCoordinatedSurface.h:
1922         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.cpp:
1923         (WebKit::ThreadSafeCoordinatedSurface::create):
1924         * Shared/CoordinatedGraphics/threadedcompositor/ThreadSafeCoordinatedSurface.h:
1925         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1926         (WebKit::ThreadedCompositor::create):
1927         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1928         * Shared/Plugins/NPRemoteObjectMap.cpp:
1929         (WebKit::NPRemoteObjectMap::create):
1930         * Shared/Plugins/NPRemoteObjectMap.h:
1931         * Shared/WebBatteryStatus.h:
1932         (WebKit::WebBatteryStatus::create):
1933         * Shared/WebCertificateInfo.h:
1934         (WebKit::WebCertificateInfo::create):
1935         * Shared/WebContextMenuItem.h:
1936         (WebKit::WebContextMenuItem::create):
1937         * Shared/WebRenderObject.cpp:
1938         (WebKit::WebRenderObject::create):
1939         * Shared/WebRenderObject.h:
1940         (WebKit::WebRenderObject::create):
1941         * UIProcess/API/APINavigationData.h:
1942         (API::NavigationData::create):
1943         * UIProcess/API/APISession.cpp:
1944         (API::Session::createEphemeral):
1945         * UIProcess/API/APISession.h:
1946         * UIProcess/API/APISessionState.cpp:
1947         (API::SessionState::create):
1948         * UIProcess/API/APISessionState.h:
1949         * UIProcess/API/APIUserScript.h:
1950         * UIProcess/API/APIWebsiteDataStore.cpp:
1951         (API::WebsiteDataStore::createNonPersistentDataStore):
1952         (API::WebsiteDataStore::create):
1953         * UIProcess/API/APIWebsiteDataStore.h:
1954         * UIProcess/API/C/WKCredential.cpp:
1955         (WKCredentialCreate):
1956         (WKCredentialCreateWithCertificateInfo):
1957         * UIProcess/API/C/WKPage.cpp:
1958         (WKPageCopySessionState):
1959         (WKPageSetPageContextMenuClient):
1960         * UIProcess/API/C/WKSessionStateRef.cpp:
1961         (WKSessionStateCreateFromData):
1962         * UIProcess/API/C/WKUserScriptRef.cpp:
1963         (WKUserScriptCreateWithSource):
1964         * UIProcess/API/Cocoa/WKNSURLAuthenticationChallenge.mm:
1965         (-[WKNSURLAuthenticationChallengeSender useCredential:forAuthenticationChallenge:]):
1966         * UIProcess/API/Cocoa/WKProcessGroup.mm:
1967         (-[WKProcessGroup _setAllowsSpecificHTTPSCertificate:forHost:]):
1968         * UIProcess/API/Cocoa/WKProcessPool.mm:
1969         (-[WKProcessPool _setAllowsSpecificHTTPSCertificate:forHost:]):
1970         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1971         (+[WKWebsiteDataStore nonPersistentDataStore]):
1972         * UIProcess/API/efl/ewk_auth_request_private.h:
1973         (EwkAuthRequest::create):
1974         * UIProcess/API/efl/ewk_back_forward_list_item_private.h:
1975         (EwkBackForwardListItem::create):
1976         * UIProcess/API/efl/ewk_context.cpp:
1977         (EwkContext::create):
1978         * UIProcess/API/efl/ewk_context_menu_private.h:
1979         (EwkContextMenu::create):
1980         * UIProcess/API/efl/ewk_download_job_private.h:
1981         (EwkDownloadJob::create):
1982         * UIProcess/API/efl/ewk_file_chooser_request_private.h:
1983         (EwkFileChooserRequest::create):
1984         * UIProcess/API/efl/ewk_form_submission_request_private.h:
1985         (EwkFormSubmissionRequest::create):
1986         * UIProcess/API/efl/ewk_navigation_data_private.h:
1987         (EwkNavigationData::create):
1988         * UIProcess/API/efl/ewk_security_origin_private.h:
1989         (EwkSecurityOrigin::create):
1990         * UIProcess/Authentication/AuthenticationChallengeProxy.h:
1991         (WebKit::AuthenticationChallengeProxy::create):
1992         * UIProcess/Authentication/AuthenticationDecisionListener.h:
1993         (WebKit::AuthenticationDecisionListener::create):
1994         * UIProcess/Authentication/WebCredential.h:
1995         (WebKit::WebCredential::create):
1996         * UIProcess/Authentication/WebProtectionSpace.h:
1997         (WebKit::WebProtectionSpace::create):
1998         * UIProcess/Cocoa/NavigationState.mm:
1999         (WebKit::NavigationState::HistoryClient::didNavigateWithNavigationData):
2000         * UIProcess/Databases/DatabaseProcessProxy.cpp:
2001         (WebKit::DatabaseProcessProxy::create):
2002         * UIProcess/Databases/DatabaseProcessProxy.h:
2003         * UIProcess/Launcher/ProcessLauncher.h:
2004         (WebKit::ProcessLauncher::create):
2005         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2006         * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
2007         (WebKit::WebNotificationManagerProxy::create):
2008         * UIProcess/Notifications/WebNotificationManagerProxy.h:
2009         * UIProcess/Plugins/PluginProcessProxy.cpp:
2010         (WebKit::PluginProcessProxy::create):
2011         * UIProcess/Plugins/PluginProcessProxy.h:
2012         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
2013         (WebKit::RemoteScrollingTree::create):
2014         * UIProcess/Scrolling/RemoteScrollingTree.h:
2015         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2016         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::create):
2017         * UIProcess/WebProcessPool.cpp:
2018         (WebKit::WebProcessPool::WebProcessPool):
2019         * UIProcess/efl/WebPopupMenuListenerEfl.h:
2020         (WebKit::WebPopupMenuListenerEfl::create):
2021         * UIProcess/efl/WebViewEfl.cpp:
2022         (WebKit::WebView::create):
2023         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
2024         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2025         (WebKit::WebVideoFullscreenManagerProxy::create):
2026
2027 2015-06-28  Dan Bernstein  <mitz@apple.com>
2028
2029         [Cocoa] Remove _WKSecurityOrigin.{h,mm}
2030         https://bugs.webkit.org/show_bug.cgi?id=146402
2031
2032         Reviewed by Sam Weinig.
2033
2034         * UIProcess/API/Cocoa/WKSecurityOrigin.mm: Declare and define _WKSecurityOrigin here.
2035         (-[WKSecurityOrigin methodSignatureForSelector:]): Moved into a WKBinaryCompatibility
2036         category.
2037         (-[WKSecurityOrigin forwardInvocation:]): Ditto.
2038         * UIProcess/API/Cocoa/_WKSecurityOrigin.h: Removed.
2039         * UIProcess/API/Cocoa/_WKSecurityOrigin.mm: Removed.
2040         * WebKit2.xcodeproj/project.pbxproj: Removed references to _WKSecurityOrigin.{h,mm}.
2041
2042 2015-06-28  Dan Bernstein  <mitz@apple.com>
2043
2044         Tried to fix the EFL buid after r186046.
2045
2046         * UIProcess/efl/PageUIClientEfl.cpp:
2047         (WebKit::PageUIClientEfl::PageUIClientEfl):
2048
2049 2015-06-28  Dan Bernstein  <mitz@apple.com>
2050
2051         <rdar://problem/21581792> REGRESSION (r185915): Source-incompatible change in WKPageUIClient
2052         https://bugs.webkit.org/show_bug.cgi?id=146396
2053
2054         Reviewed by Anders Carlsson.
2055
2056         * UIProcess/API/C/WKPageUIClient.h: Renamed
2057         runJavaScript{Alert,Confirm,Prompt}_deprecatedForUseWithV0 back to runJavaScript{Alert,Confirm,Prompt}
2058         in client versions prior to V5.
2059
2060 2015-06-28  Tim Horton  <timothy_horton@apple.com>
2061
2062         REGRESSION: Page footers are displayed above the bottom of the WebView due to tiled scaling
2063         https://bugs.webkit.org/show_bug.cgi?id=146393
2064         <rdar://problem/21113217>
2065
2066         Reviewed by Sam Weinig.
2067
2068         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2069         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
2070         Don't include the top content inset in the layout size.
2071
2072 2015-06-26  Antti Koivisto  <antti@apple.com>
2073
2074         Make NetworkCache::traverse faster
2075         https://bugs.webkit.org/show_bug.cgi?id=146354
2076
2077         Reviewed by Anders Carlsson.
2078
2079         * NetworkProcess/cache/NetworkCacheIOChannel.h:
2080         (WebKit::NetworkCache::IOChannel::path):
2081         (WebKit::NetworkCache::IOChannel::type):
2082         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
2083         (WebKit::NetworkCache::IOChannel::open):
2084         (WebKit::NetworkCache::IOChannel::read):
2085         (WebKit::NetworkCache::IOChannel::write):
2086         (WebKit::NetworkCache::IOChannel::readSync): Deleted.
2087
2088             Not needed anymore.
2089
2090         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2091         (WebKit::NetworkCache::Storage::WriteOperation::WriteOperation):
2092         (WebKit::NetworkCache::Storage::TraverseOperation::TraverseOperation):
2093
2094             Add TraverseOperation, similar to Read/Write.
2095
2096         (WebKit::NetworkCache::Storage::open):
2097         (WebKit::NetworkCache::Storage::traverse):
2098
2099             Use async I/O.
2100             Use condition variable to allow maximum 5 parallel file reads.
2101
2102         * NetworkProcess/cache/NetworkCacheStorage.h:
2103
2104 2015-06-27  Carlos Garcia Campos  <cgarcia@igalia.com>
2105
2106         [SOUP] NetworkCache: Make NetworkProcess::clearDiskCache actually clear the the resources depending on the date
2107         https://bugs.webkit.org/show_bug.cgi?id=146316
2108
2109         Reviewed by Sergio Villar Senin.
2110
2111         And make sure the completion handler is called, as well. This
2112         functionality is already implemented in Storage::clear(), so we
2113         just need to pass the time point and completion handler to Cache::clear().
2114
2115         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2116         (WebKit::NetworkProcess::clearDiskCache):
2117
2118 2015-06-26  Beth Dakin  <bdakin@apple.com>
2119
2120         Rubber-stamped by Tim Horton.
2121
2122         As Dan pointed out in https://bugs.webkit.org/show_bug.cgi?id=146350 , this way of  
2123         getting the screen size was problematic on multiple counts. Fixed here by using 
2124         UIScreen. 
2125         * UIProcess/WKImagePreviewViewController.mm:
2126         (-[WKImagePreviewViewController initWithCGImage:]):
2127
2128 2015-06-26  Beth Dakin  <bdakin@apple.com>
2129
2130         WebPage::getPositionInformation() should not copy an image that is larger than the  
2131         screen
2132         https://bugs.webkit.org/show_bug.cgi?id=146367
2133
2134         Reviewed by Tim Horton.
2135
2136         Maintain aspectRatio, but scale down the buffer size if the image is larger than 
2137         the screen.
2138         * WebProcess/WebPage/ios/WebPageIOS.mm:
2139         (WebKit::WebPage::getPositionInformation):
2140
2141 2015-06-26  Mark Lam  <mark.lam@apple.com>
2142
2143         Re-instating the #import and assertion removed in r186014.
2144         https://bugs.webkit.org/show_bug.cgi?id=146358
2145
2146         Not reviewed.
2147
2148         * UIProcess/API/Cocoa/WKUserContentController.mm:
2149         - Speculative fix: should have used <wtf/MainThread.h> instead of <WTF/MainThread.h>.
2150
2151 2015-06-26  Mark Lam  <mark.lam@apple.com>
2152
2153         Gardening: remove an assertion and a #import to green the bot.
2154         https://bugs.webkit.org/show_bug.cgi?id=146358
2155
2156         Not reviewed.
2157
2158         * UIProcess/API/Cocoa/WKUserContentController.mm:
2159         - Not sure why the <WTF/MainThread.h> cannot be found on some bots, but I'm
2160           removing it (and the assertion that needed it) for now while I investigate
2161           further.
2162
2163 2015-06-26  Mark Lam  <mark.lam@apple.com>
2164
2165         ScriptMessageHandlerDelegate::didPostMessage() should reuse its JSContext instance.
2166         https://bugs.webkit.org/show_bug.cgi?id=146358
2167
2168         Reviewed by Anders Carlsson.
2169
2170         Currently, ScriptMessageHandlerDelegate::didPostMessage() creates a new JSContext each
2171         time it is called.  This JSContext is used only once to deserialized a JSON object
2172         and then destroyed.  We will change ScriptMessageHandlerDelegate to cache the JSContext
2173         and reuse it in all subsequent calls to didPostMessage().
2174
2175         Also added a @autoreleasepool scope in didPostMessage() so that transient ObjC objects
2176         will be release sooner.
2177
2178         * UIProcess/API/Cocoa/WKUserContentController.mm:
2179
2180 2015-06-26  Beth Dakin  <bdakin@apple.com>
2181
2182         Add support for image previews
2183         https://bugs.webkit.org/show_bug.cgi?id=146350
2184         -and corresponding-
2185         rdar://problem/20640234
2186
2187         Reviewed by Tim Horton.
2188
2189         For images, use the actual image instead of a snapshot.
2190         * WebProcess/WebPage/ios/WebPageIOS.mm:
2191         (WebKit::WebPage::getPositionInformation):
2192
2193         ViewController for image preview.
2194         * UIProcess/WKImagePreviewViewController.h: Added.
2195         * UIProcess/WKImagePreviewViewController.mm: Added.
2196         (-[WKImagePreviewViewController loadView]):
2197         (-[WKImagePreviewViewController initWithCGImage:]):
2198         (-[WKImagePreviewViewController viewDidLayoutSubviews]):
2199         (_scaleSizeWithinSize):
2200
2201         New enum and member variable to keep track of preview type.
2202         * UIProcess/ios/WKContentViewInteraction.h:
2203         * UIProcess/ios/WKContentViewInteraction.mm:
2204
2205         Only apply the http restriction to non-image links since we can still preview the 
2206         image of a non-http image link.
2207         (-[WKContentView gestureRecognizerShouldBegin:]):
2208
2209         Handle links and images.
2210         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
2211
2212         Return early for non-link previews.
2213         (-[WKContentView commitPreviewViewController:]):
2214
2215         New files.
2216         * WebKit2.xcodeproj/project.pbxproj:
2217
2218         Just use the actual image in the PositionInformation for image elements rather 
2219         than taking a screen shot.
2220         * WebProcess/WebPage/ios/WebPageIOS.mm:
2221         (WebKit::WebPage::getPositionInformation):
2222
2223 2015-06-26  Matt Rajca  <mrajca@apple.com>
2224
2225         Wireless Playback Target-related #import should be a #include
2226         https://bugs.webkit.org/show_bug.cgi?id=146283
2227
2228         Reviewed by Eric Carlson.
2229
2230         * Shared/WebCoreArgumentCoders.cpp:
2231
2232 2015-06-25  Joseph Pecoraro  <pecoraro@apple.com>
2233
2234         Web Inspector: Add Support for OS X Full Screen Mode
2235         https://bugs.webkit.org/show_bug.cgi?id=123510
2236
2237         Reviewed by Timothy Hatcher.
2238
2239         * UIProcess/mac/WebInspectorProxyMac.mm:
2240         (WebKit::WebInspectorProxy::createInspectorWindow):
2241         Allow full screen.
2242
2243 2015-06-25  Hyungwook Lee  <hyungwook.lee@navercorp.com>
2244
2245         [EFL] Make send / receive messages to communicate the Web and UI Processes using Injected Bundle.
2246         https://bugs.webkit.org/show_bug.cgi?id=145685
2247
2248         Reviewed by Gyuyoung Kim.
2249
2250         To have extensible port specific API facility using Injected Bundle,
2251         we need to load libewebkit_extension_manager.so in default that is same as what gtk port does.
2252
2253         * UIProcess/API/efl/ewk_context.cpp:
2254         (EwkContext::EwkContext):
2255         (EwkContext::findOrCreateWrapper):
2256         (bundlePathForExtension):
2257         (EwkContext::create):
2258         (EwkContext::allowSpecificHTTPSCertificateForHost):
2259         (EwkContext::isDefaultBundle):
2260         (ewk_context_default_get):
2261         * UIProcess/API/efl/ewk_context_private.h:
2262         * WebProcess/efl/ExtensionManagerEfl.cpp:
2263         (WebKit::ExtensionManagerEfl::initialize):
2264
2265 2015-06-25  Simon Fraser  <simon.fraser@apple.com>
2266
2267         [iOS WK2] Swiping back just after scrolling can cause some tiles to disappear
2268         https://bugs.webkit.org/show_bug.cgi?id=146329
2269         rdar://problem/21233010
2270
2271         Reviewed by Tim Horton.
2272         
2273         When doing a back swipe, views interposed between the WKWebView and the WKContentView
2274         get positions and animations for the swipe. This -_updateVisibleContentRects to
2275         compute bad visible and unobscured rects, so we lose tiles.
2276         
2277         Fix by "freezing" the visible and unobscured content rects in the view being
2278         swiped for the duration of the navigation gesture. When swiping the main view,
2279         we just plumb through navigationGestureDidEnd(). When Reader is showing and the
2280         swiped view is different from the navigating view, use the new navigationGestureDidEnd()
2281         override which takes no arguments.
2282
2283         * UIProcess/API/Cocoa/WKWebView.mm:
2284         (-[WKWebView _updateVisibleContentRects]):
2285         (-[WKWebView _navigationGestureDidBegin]):
2286         (-[WKWebView _navigationGestureDidEnd]):
2287         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2288         * UIProcess/API/gtk/PageClientImpl.cpp:
2289         (WebKit::PageClientImpl::navigationGestureDidEnd):
2290         * UIProcess/API/gtk/PageClientImpl.h:
2291         * UIProcess/CoordinatedGraphics/WebView.h:
2292         * UIProcess/PageClient.h:
2293         * UIProcess/WebPageProxy.cpp:
2294         (WebKit::WebPageProxy::navigationGestureDidEnd):
2295         * UIProcess/WebPageProxy.h:
2296         * UIProcess/ios/PageClientImplIOS.h:
2297         * UIProcess/ios/PageClientImplIOS.mm:
2298         (WebKit::PageClientImpl::navigationGestureDidBegin):
2299         (WebKit::PageClientImpl::navigationGestureDidEnd):
2300         * UIProcess/ios/ViewGestureControllerIOS.mm:
2301         (WebKit::ViewGestureController::beginSwipeGesture):
2302         (WebKit::ViewGestureController::endSwipeGesture):
2303         * UIProcess/mac/PageClientImpl.h:
2304         * UIProcess/mac/PageClientImpl.mm:
2305         (WebKit::PageClientImpl::navigationGestureDidEnd):
2306
2307 2015-06-25  Joseph Pecoraro  <pecoraro@apple.com>
2308
2309         [Mac] Web Inspector: Window dragging on toolbar should behave more like native window dragging
2310         https://bugs.webkit.org/show_bug.cgi?id=146324
2311
2312         Reviewed by Timothy Hatcher.
2313
2314         * UIProcess/API/mac/WKViewInternal.h:
2315         * UIProcess/API/mac/WKView.mm:
2316         (-[WKView _startWindowDrag]):
2317         Add a way to start a window drag from a WKView using the most
2318         recent mouse down event.
2319
2320         * WebProcess/WebPage/WebInspectorUI.h:
2321         * WebProcess/WebPage/WebInspectorUI.cpp:
2322         (WebKit::WebInspectorUI::startWindowDrag):
2323         Send a message that we should start a window drag.
2324
2325         * UIProcess/WebInspectorProxy.messages.in:
2326         * UIProcess/WebInspectorProxy.h:
2327         * UIProcess/WebInspectorProxy.cpp:
2328         (WebKit::WebInspectorProxy::startWindowDrag):
2329         (WebKit::WebInspectorProxy::platformStartWindowDrag):
2330         * UIProcess/efl/WebInspectorProxyEfl.cpp:
2331         (WebKit::WebInspectorProxy::platformStartWindowDrag):
2332         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
2333         (WebKit::WebInspectorProxy::platformStartWindowDrag):
2334         * UIProcess/mac/WebInspectorProxyMac.mm:
2335         (WebKit::WebInspectorProxy::platformStartWindowDrag):
2336         Let the platform start a window drag. Only implemented by Mac.
2337
2338 2015-06-25  Tim Horton  <timothy_horton@apple.com>
2339
2340         [iOS] When using the back swipe gesture in Safari, the previous webpage will flash for a second
2341         https://bugs.webkit.org/show_bug.cgi?id=146326
2342         <rdar://problem/17811304>
2343
2344         Reviewed by Dean Jackson.
2345
2346         * UIProcess/DrawingAreaProxy.h:
2347         (WebKit::DrawingAreaProxy::hideContentUntilPendingUpdate):
2348         (WebKit::DrawingAreaProxy::hideContentUntilAnyUpdate):
2349         (WebKit::DrawingAreaProxy::hideContentUntilNextUpdate): Deleted.
2350         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2351         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2352         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
2353         (WebKit::RemoteLayerTreeDrawingAreaProxy::hideContentUntilPendingUpdate):
2354         (WebKit::RemoteLayerTreeDrawingAreaProxy::hideContentUntilAnyUpdate):
2355         (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy): Deleted.
2356         (WebKit::RemoteLayerTreeDrawingAreaProxy::hideContentUntilNextUpdate): Deleted.
2357         Make it possible to distinguish between hiding the content until *any* commit
2358         comes in (for example, when we're coming back from being suspended and don't want
2359         to show anything until we are sure all the layers are valid) and hiding the content
2360         until the currently pending commit corresponding to the current state in the UI process
2361         has arrived (which is what we want when e.g. hiding content after a gesture navigation
2362         and not showing it until the commit including the navigation lands).
2363
2364         * UIProcess/API/Cocoa/WKWebView.mm:
2365         (-[WKWebView _hideContentUntilNextUpdate]):
2366         * UIProcess/ios/WKContentView.mm:
2367         (-[WKContentView _applicationWillEnterForeground]):
2368         Make use of "hideContentUntilAnyUpdate".
2369
2370         * UIProcess/ios/ViewGestureControllerIOS.mm:
2371         (WebKit::ViewGestureController::endSwipeGesture):
2372         Make use of "hideContentUntilPendingUpdate".
2373
2374 2015-06-25  Tim Horton  <timothy_horton@apple.com>
2375
2376         Viewport units are wrong when scaled in 2-up mode, cause content to hop around on apple.com/music
2377         https://bugs.webkit.org/show_bug.cgi?id=146322
2378         <rdar://problem/21413884>
2379
2380         Reviewed by Simon Fraser.
2381
2382         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2383         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
2384         Inflate the fixed layout height (by the viewScale) so that it's the size of the view.
2385
2386 2015-06-25  Chris Dumez  <cdumez@apple.com>
2387
2388         [WK2][iOS] Drop WebKitNetworkCacheTemporarilyDisabledForTesting NSUserDefaults
2389         https://bugs.webkit.org/show_bug.cgi?id=146323
2390         <rdar://problem/21552370>
2391
2392         Reviewed by Antti Koivisto.
2393
2394         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2395         (WebKit::WebProcessPool::isNetworkCacheEnabled):
2396
2397 2015-06-25  Tim Horton  <timothy_horton@apple.com>
2398
2399         Crash in ViewGestureController::didRestoreScrollPosition() running WKWebView.LoadAlternateHTMLStringFromProvisionalLoadError test
2400         https://bugs.webkit.org/show_bug.cgi?id=146309
2401         <rdar://problem/21476651>
2402
2403         Reviewed by Dan Bernstein.
2404
2405         * UIProcess/API/Cocoa/WKWebView.mm:
2406         (-[WKWebView _didCommitLayerTree:]):
2407         Null-check. _gestureController can be null if allowsBackForwardNavigationGestures is NO.
2408
2409 2015-06-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2410
2411         [GTK] Add initial WebKitWebsiteDataManager API for process configuration options
2412         https://bugs.webkit.org/show_bug.cgi?id=146149
2413
2414         Reviewed by Sergio Villar Senin.
2415
2416         Add WebKitWebsiteDataManager to replace the different ways we have
2417         to configure data store
2418         directories. WebKitWebContext:indexed-db-directory property has
2419         been removed, since it was added only in trunk, and
2420         WebKitWebContext:local-storage-directory has been deprecated. The
2421         method webkit_web_context_set_disk_cache_directory() has been
2422         deprecated too in favor of WebKitWebsiteDataManager.
2423
2424         * PlatformGTK.cmake: Add new files to compilation.
2425         * UIProcess/API/gtk/WebKitPrivate.h: Move networkCacheSubdirectory
2426         definition here.
2427         * UIProcess/API/gtk/WebKitWebContext.cpp:
2428         (webkitWebContextGetProperty): Replace indexed-db-directory getter
2429         with website-data-manager one.
2430         (webkitWebContextSetProperty): Replace indexed-db-directory setter
2431         with website-data-manager one.
2432         (webkitWebContextConstructed): Use the user provided
2433         WebKitWebsiteDataManager to configure the context or create a
2434         default WebKitWebsiteDataManager if not provided.
2435         (webkit_web_context_class_init): Replace indexed-db-directory
2436         property with website-data-manager.
2437         (webkit_web_context_new_with_website_data_manager):
2438         (webkit_web_context_get_website_data_manager):
2439         (webkitWebContextCreatePageForWebView): Get the WebsiteDataStore
2440         from the WebKitWebsiteDataManager.
2441         * UIProcess/API/gtk/WebKitWebContext.h:
2442         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp: Added.
2443         (webkitWebsiteDataManagerGetProperty):
2444         (webkitWebsiteDataManagerSetProperty):
2445         (webkit_website_data_manager_class_init):
2446         (webkitWebsiteDataManagerCreate):
2447         (webkitWebsiteDataManagerGetDataStore):
2448         (webkit_website_data_manager_new):
2449         (webkit_website_data_manager_get_local_storage_directory):
2450         (webkit_website_data_manager_get_disk_cache_directory):
2451         (webkit_website_data_manager_get_offline_application_cache_directory):
2452         (webkit_website_data_manager_get_indexeddb_directory):
2453         (webkit_website_data_manager_get_websql_directory):
2454         * UIProcess/API/gtk/WebKitWebsiteDataManager.h: Added.
2455         * UIProcess/API/gtk/WebKitWebsiteDataManagerPrivate.h: Added.
2456         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
2457         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types: Add webkit_website_data_manager_get_type.
2458         * UIProcess/API/gtk/webkit2.h: Include WebKitWebsiteDataManager.h.
2459
2460 2015-06-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2461
2462         [GTK] Do not use legacy data store options in WebKit2 GTK+ API
2463         https://bugs.webkit.org/show_bug.cgi?id=146145
2464
2465         Reviewed by Gustavo Noronha Silva.
2466
2467         Use a custom WebsiteDataStore in WebKitWebContext, configured with
2468         the context options, and passed to every page created. This is in
2469         preparation for exposing WebsiteDataStore in the public API.
2470
2471         * PlatformGTK.cmake: Add APIWebsiteDataStore.cpp to compilation.
2472         * UIProcess/API/APIWebsiteDataStore.cpp:
2473         * UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp:
2474         (API::WebsiteDataStore::defaultApplicationCacheDirectory):
2475         (API::WebsiteDataStore::defaultNetworkCacheDirectory):
2476         (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
2477         (API::WebsiteDataStore::defaultLocalStorageDirectory):
2478         (API::WebsiteDataStore::defaultMediaKeysStorageDirectory):
2479         (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
2480         (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
2481         (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
2482         (API::WebsiteDataStore::defaultDataStoreConfiguration):
2483         * UIProcess/API/gtk/WebKitWebContext.cpp:
2484         (websiteDataStoreConfigurationForWebProcessPoolConfiguration):
2485         Helper function to create the WebsiteDataStore configuration with
2486         the WebProcessPool configuration options.
2487         (webkitWebContextConstructed): Do not create a
2488         WebProcessPoolConfiguration with legacy options and create a WebsiteDataStore.
2489         (webkitWebContextCreatePageForWebView): Set the WebsiteDataStore
2490         and session ID in web page configuration.
2491         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2492         (webkitWebViewBaseCreate): Create a WebPageConfiguration for the
2493         given options and pass it to webkitWebViewBaseCreateWebPage.
2494         (webkitWebViewBaseCreateWebPage): It receives now a
2495         WebPageConfiguration, instead of creating it based on the given parameters.
2496         * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
2497         * UIProcess/gtk/WebProcessPoolGtk.cpp: Use WebsiteDataStore default configuration.
2498         (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory):
2499         (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory):
2500         (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory):
2501         (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory):
2502         (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory):
2503         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
2504
2505 2015-06-24  Anders Carlsson  <andersca@apple.com>
2506
2507         Detect view services by using the "com.apple.UIKit.vends-view-services" entitlement
2508         https://bugs.webkit.org/show_bug.cgi?id=146301
2509
2510         Reviewed by Tim Horton.
2511
2512         * UIProcess/ApplicationStateTracker.mm:
2513         (WebKit::hasEntitlement):
2514         (WebKit::isViewService):
2515
2516 2015-06-24  Anders Carlsson  <andersca@apple.com>
2517
2518         WebContent process is unreponsive/idle when WKWebView is inside a view service.
2519         https://bugs.webkit.org/show_bug.cgi?id=146296
2520
2521         Reviewed by Tim Horton.
2522
2523         * Platform/spi/ios/AssertionServicesSPI.h: Renamed from Source/WebKit2/Platform/spi/ios/BKSProcessAssertionSPI.h.
2524         Rename this and add SPI for BKSApplicationStateMonitor.
2525
2526         * Platform/spi/ios/UIKitSPI.h:
2527         Add _UIApplicationIsExtension SPI.
2528
2529         * UIProcess/ApplicationStateTracker.mm:
2530         (WebKit::isViewService):
2531         Return whether we're an extension or the safari view controller service.
2532
2533         (WebKit::isBackgroundState):
2534         Helper function that returns whether a given BKSApplicationState is a background state.
2535
2536         (WebKit::ApplicationStateTracker::ApplicationStateTracker):
2537         If we're a view service, create a BKSApplicationStateMonitor and listen for state changes for our pid.
2538
2539         * UIProcess/ios/ProcessAssertionIOS.mm:
2540         Update #import.
2541
2542         * WebKit2.xcodeproj/project.pbxproj:
2543         Update for rename.
2544
2545 2015-06-24  Matt Rajca  <mrajca@apple.com>
2546
2547         MediaSession: propagate MediaSessionMetadata to WebPageProxy
2548         https://bugs.webkit.org/show_bug.cgi?id=146282
2549
2550         Reviewed by Darin Adler and Tim Horton.
2551
2552         * Shared/WebCoreArgumentCoders.cpp: Added ArgumentEncoder support for MediaSessionMetadata so we can send it
2553           through the web page proxy.
2554         (IPC::ArgumentCoder<MediaSessionMetadata>::encode):
2555         (IPC::ArgumentCoder<MediaSessionMetadata>::decode):
2556         * Shared/WebCoreArgumentCoders.h:
2557         * UIProcess/WebPageProxy.cpp:
2558         (WebKit::WebPageProxy::mediaSessionMetadataDidChange):
2559         * UIProcess/WebPageProxy.h: Receive mediaSessionMetadataDidChange in the web page proxy.
2560         * UIProcess/WebPageProxy.messages.in: Added a new MediaSessionMetadataDidChange message.
2561         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2562         (WebKit::WebChromeClient::mediaSessionMetadataDidChange): Push a mediaSessionMetadataDidChange message through the web page proxy.
2563         * WebProcess/WebCoreSupport/WebChromeClient.h:
2564
2565 2015-06-24  Said Abou-Hallawa  <sabouhallawa@apple.com>
2566
2567         [Mac] A checkmark is briefly visible next to the webpage context menu items when they're clicked
2568         https://bugs.webkit.org/show_bug.cgi?id=146284
2569         <rdar://problem/20297182>
2570
2571         Reviewed by Darin Adler.
2572         
2573         The default value of [NSPopUpButtonCell altersStateOfSelectedItem] is YES.
2574         This makes the popup menu items checkable by default. We need to change the
2575         value of this attribute to NO when creating the popup menu, so the items
2576         are uncheckable. The value of this property needs to change back to YES
2577         if context menu is about selecting an option and not executing a command.
2578         
2579         * UIProcess/mac/WebContextMenuProxyMac.mm:
2580         (WebKit::WebContextMenuProxyMac::populate):
2581
2582 2015-06-24  Brady Eidson  <beidson@apple.com>
2583
2584         Update JavaScript dialog delegates to include a WKSecurityOriginRef argument.
2585         <rdar://problem/21269187> and https://bugs.webkit.org/show_bug.cgi?id=146249
2586
2587         Reviewed by Alex Christensen.
2588
2589         * UIProcess/API/C/WKPage.cpp:
2590         (WKPageSetPageUIClient): Call the new signature if the client has it set.
2591           Otherwise fall back to the old signature.
2592         * UIProcess/API/C/WKPageUIClient.h: Deprecate the old method signature, and add the new
2593           one to the newest V5 client structure.
2594
2595 2015-06-24  Ryuan Choi  <ryuan.choi@navercorp.com>
2596
2597         Remove some dead code from Download
2598         https://bugs.webkit.org/show_bug.cgi?id=146268
2599
2600         Reviewed by Darin Adler.
2601
2602         retrieveDestinationWithSuggestedFilename() was introduced for DownloadCFNetWin.cpp since r77585.
2603         didDecideDestination and others are also introduced for WebKit2 Windows port since r77055.
2604         Since WebKit2 Windows port is dropped, no one uses them now.
2605
2606         * Shared/Downloads/Download.cpp:
2607         (WebKit::Download::decideDestinationWithSuggestedFilename):
2608         (WebKit::Download::retrieveDestinationWithSuggestedFilename): Deleted.
2609         * Shared/Downloads/Download.h:
2610         (WebKit::Download::destination): Deleted.
2611         * Shared/Downloads/ios/DownloadIOS.mm:
2612         (WebKit::Download::didDecideDestination): Deleted.
2613         * Shared/Downloads/mac/DownloadMac.mm:
2614         (WebKit::Download::didDecideDestination): Deleted.
2615         * Shared/Downloads/soup/DownloadSoup.cpp:
2616         (WebKit::Download::didDecideDestination): Deleted.
2617
2618 2015-06-23  Anders Carlsson  <andersca@apple.com>
2619
2620         Fix build.
2621
2622         * UIProcess/ios/ProcessAssertionIOS.mm:
2623         (-[WKProcessAssertionBackgroundTaskManager init]):
2624
2625 2015-06-23  Michael Catanzaro  <mcatanzaro@igalia.com>
2626
2627         [GTK] Crash performing drag-and-drop
2628         https://bugs.webkit.org/show_bug.cgi?id=146267
2629
2630         Reviewed by Darin Adler.
2631
2632         Return early if gtk_get_current_event() returns null to avoid a crash. Note that this does
2633         not fix drag-and-drop. Note also this prevents the web process from forcing the UI process
2634         to crash by sending fake startDrag messages.
2635
2636         * UIProcess/gtk/DragAndDropHandler.cpp:
2637         (WebKit::DragAndDropHandler::startDrag):
2638
2639 2015-06-23  Anders Carlsson  <andersca@apple.com>
2640
2641         Add a class that tracks whether we're a background or foreground application
2642         https://bugs.webkit.org/show_bug.cgi?id=146259
2643         rdar://problem/19833808
2644
2645         Reviewed by Darin Adler.
2646
2647         First step towards being able to send out these notifications for view services.
2648
2649         * UIProcess/ApplicationStateTracker.h: Added.
2650         (WebKit::ApplicationStateTracker::isInBackground):
2651         * UIProcess/ApplicationStateTracker.mm: Added.
2652         (WebKit::ApplicationStateTracker::singleton):
2653         (WebKit::ApplicationStateTracker::ApplicationStateTracker):
2654         (WebKit::ApplicationStateTracker::addListener):
2655         (WebKit::ApplicationStateTracker::applicationDidEnterBackground):
2656         (WebKit::ApplicationStateTracker::applicationWillEnterForeground):
2657         (WebKit::ApplicationStateTracker::invokeListeners):
2658         (WebKit::ApplicationStateTracker::pruneListeners):
2659         * UIProcess/ios/ProcessAssertionIOS.mm:
2660         (-[WKProcessAssertionBackgroundTaskManager init]):
2661         (-[WKProcessAssertionBackgroundTaskManager _updateBackgroundTask]):
2662         (-[WKProcessAssertionBackgroundTaskManager _applicationWillEnterForeground]):
2663         (-[WKProcessAssertionBackgroundTaskManager _applicationDidEnterBackground]):
2664         (-[WKProcessAssertionBackgroundTaskManager dealloc]): Deleted.
2665         (-[WKProcessAssertionBackgroundTaskManager _applicationWillEnterForeground:]): Deleted.
2666         (-[WKProcessAssertionBackgroundTaskManager _applicationDidEnterBackground:]): Deleted.
2667         * UIProcess/ios/WKContentView.h:
2668         * UIProcess/ios/WKContentView.mm:
2669         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
2670         (-[WKContentView isBackground]):
2671         (-[WKContentView _applicationDidEnterBackground]):
2672         (-[WKContentView _applicationWillEnterForeground]):
2673         (-[WKContentView _applicationDidEnterBackground:]): Deleted.
2674         (-[WKContentView _applicationWillEnterForeground:]): Deleted.
2675         * WebKit2.xcodeproj/project.pbxproj:
2676
2677 2015-06-23  Anders Carlsson  <andersca@apple.com>
2678
2679         Remove windowResizerRect code, nobody is using it anymore
2680         https://bugs.webkit.org/show_bug.cgi?id=146265
2681
2682         Reviewed by Beth Dakin.
2683
2684         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2685         (WebKit::WebChromeClient::windowResizerRect): Deleted.
2686         * WebProcess/WebCoreSupport/WebChromeClient.h:
2687         * WebProcess/WebPage/WebPage.cpp:
2688         (WebKit::WebPage::windowResizerRect): Deleted.
2689         * WebProcess/WebPage/WebPage.h:
2690
2691 2015-06-23  Dan Bernstein  <mitz@apple.com>
2692
2693         Restore binary compatibility with iOS 8 Safari after r185877
2694         https://bugs.webkit.org/show_bug.cgi?id=146263
2695
2696         Reviewed by Anders Carlsson.
2697
2698         * Platform/spi/Cocoa: Added.
2699         * Platform/spi/Cocoa/NSInvocationSPI.h: Added.
2700
2701         * UIProcess/API/Cocoa/WKSecurityOrigin.mm:
2702         (-[WKSecurityOrigin methodSignatureForSelector:]): Override to check _WKSecurityOrigin for
2703         possible category methods with the specified selector.
2704         (-[WKSecurityOrigin forwardInvocation:]): Invoke using the implementation of the
2705         _WKSecurityOrigin category method.
2706
2707         * WebKit2.xcodeproj/project.pbxproj:
2708
2709 2015-06-23  Anders Carlsson  <andersca@apple.com>
2710
2711         Add operator! and copy/move constructors to WeakObjCPtr
2712         https://bugs.webkit.org/show_bug.cgi?id=146255
2713
2714         Reviewed by Andreas Kling.
2715
2716         * Shared/mac/WeakObjCPtr.h:
2717         (WebKit::WeakObjCPtr::WeakObjCPtr):
2718         (WebKit::WeakObjCPtr::operator!):
2719
2720 2015-06-23  Antti Koivisto  <antti@apple.com>
2721
2722         CrashTracer: com.apple.WebKit.Networking at JavaScriptCore: WTF::String::isolatedCopy const &
2723         https://bugs.webkit.org/show_bug.cgi?id=146236
2724         rdar://problem/21380700
2725
2726         Reviewed by Andreas Kling.
2727
2728         * NetworkProcess/cache/NetworkCache.cpp:
2729         (WebKit::NetworkCache::Cache::clear):
2730
2731             Don't crash if this is called with network cache disabled.
2732
2733 2015-06-23  Simon Fraser  <simon.fraser@apple.com>
2734
2735         Expose some more rendering progress events, and have MiniBrowser log for each of them
2736         https://bugs.webkit.org/show_bug.cgi?id=146227
2737
2738         Reviewed by Darin Adler.
2739
2740         Add _WKRenderingProgressEventFirstLayoutAfterSuppressedIncrementalRendering and 
2741         _WKRenderingProgressEventFirstPaintAfterSuppressedIncrementalRendering to the private
2742         header, and convert them to/from WebCore milestones.
2743
2744         * Shared/API/Cocoa/_WKRenderingProgressEvents.h:
2745         * Shared/API/Cocoa/_WKRenderingProgressEventsInternal.h:
2746         (renderingProgressEvents):
2747         * UIProcess/API/Cocoa/WKWebView.mm:
2748         (layoutMilestones):
2749
2750 2015-06-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2751
2752         Unreviewed. Fix GTK+ build after r185876 and r185877.
2753
2754         * UIProcess/API/gtk/WebKitUIClient.cpp:
2755         * UIProcess/API/gtk/WebKitUserContentManager.cpp:
2756         * UIProcess/API/gtk/WebKitWebView.cpp:
2757
2758 2015-06-23  Anders Carlsson  <andersca@apple.com>
2759
2760         Get rid of the window resizer size
2761         https://bugs.webkit.org/show_bug.cgi?id=146240
2762
2763         Reviewed by Darin Adler.
2764
2765         This code was only used by older versions of GTK+, so get rid of it.
2766
2767         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2768         (webkitWebViewBaseNotifyResizerSize): Deleted.
2769         (toplevelWindowResizeGripVisibilityChanged): Deleted.
2770         (webkitWebViewBaseSetToplevelOnScreenWindow): Deleted.
2771         (resizeWebKitWebViewBaseFromAllocation): Deleted.
2772         * UIProcess/WebPageProxy.cpp:
2773         (WebKit::WebPageProxy::setWindowResizerSize): Deleted.
2774         * UIProcess/WebPageProxy.h:
2775         * WebProcess/WebPage/WebPage.cpp:
2776         (WebKit::WebPage::windowResizerRect):
2777         (WebKit::WebPage::setWindowResizerSize): Deleted.
2778         * WebProcess/WebPage/WebPage.h:
2779         * WebProcess/WebPage/WebPage.messages.in:
2780
2781 2015-06-23  Brady Eidson  <beidson@apple.com>
2782
2783         WKFrameInfo should have an accessor for the Frame's current security origin.
2784         https://bugs.webkit.org/show_bug.cgi?id=146162
2785
2786         Reviewed by Dan Bernstein.
2787
2788         This patch:
2789         - Promotes _WKSecurityOrigin to API.
2790         - Makes the WKSecurityOrigin Cocoa API object work with API::SecurityOrigin.
2791         - Adds a WKSecurityOrigin accessor to WKFrameInfo.
2792         - Changes IPC messaging so every handler that calls out with a WKFrameInfo object
2793           gets a relevant SecurityOrigin to wrap.
2794
2795         * Shared/API/APISecurityOrigin.h:
2796         (API::SecurityOrigin::create):
2797         (API::SecurityOrigin::SecurityOrigin):
2798
2799         * Shared/API/Cocoa/WebKit.h:
2800
2801         * Shared/API/c/WKSharedAPICast.h:
2802         (WebKit::toCopiedAPI):
2803
2804         * Shared/Cocoa/APIObject.mm:
2805         (API::Object::newObject):
2806
2807         * Shared/SecurityOriginData.cpp:
2808         (WebKit::SecurityOriginData::fromFrame):
2809         * Shared/SecurityOriginData.h:
2810
2811         * UIProcess/API/APIFrameInfo.cpp:
2812         (API::FrameInfo::FrameInfo):
2813         * UIProcess/API/APIFrameInfo.h:
2814
2815         * UIProcess/API/APINavigationClient.h:
2816         (API::NavigationClient::didFailProvisionalLoadInSubframeWithError):
2817
2818         * UIProcess/API/APIUIClient.h:
2819         (API::UIClient::createNewPage):
2820         (API::UIClient::runJavaScriptAlert):
2821         (API::UIClient::runJavaScriptConfirm):
2822         (API::UIClient::runJavaScriptPrompt):
2823
2824         * UIProcess/API/C/WKApplicationCacheManager.cpp:
2825         (WKApplicationCacheManagerGetApplicationCacheOrigins):
2826
2827         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
2828         (WKKeyValueStorageManagerGetKeyValueStorageOrigins):
2829
2830         * UIProcess/API/C/WKOriginDataManager.cpp:
2831         (WKOriginDataManagerGetOrigins):
2832
2833         * UIProcess/API/C/WKPage.cpp:
2834         (WKPageSetPageUIClient):
2835         (WKPageSetPageNavigationClient):
2836
2837         * UIProcess/API/C/WKResourceCacheManager.cpp:
2838         (WKResourceCacheManagerGetCacheOrigins):
2839
2840         * UIProcess/API/Cocoa/WKFrameInfo.h:
2841         * UIProcess/API/Cocoa/WKFrameInfo.mm:
2842         (-[WKFrameInfo securityOrigin]):
2843
2844         * UIProcess/API/Cocoa/WKSecurityOrigin.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKSecurityOrigin.h.
2845         * UIProcess/API/Cocoa/WKSecurityOrigin.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKSecurityOrigin.mm.
2846         (-[WKSecurityOrigin dealloc]):
2847         (-[WKSecurityOrigin description]):
2848         (-[WKSecurityOrigin protocol]):
2849         (-[WKSecurityOrigin host]):
2850         (-[WKSecurityOrigin port]):
2851         (-[WKSecurityOrigin _apiObject]):
2852         * UIProcess/API/Cocoa/WKSecurityOriginInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/_WKSecurityOriginInternal.h.
2853         (API::wrapper):
2854
2855         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2856
2857         * UIProcess/API/Cocoa/WKUserContentController.mm:
2858
2859         * UIProcess/API/Cocoa/_WKSecurityOrigin.h:
2860         * UIProcess/API/Cocoa/_WKSecurityOrigin.mm:
2861         (-[_WKSecurityOrigin _initWithSecurityOrigin:]): Deleted.
2862         (-[_WKSecurityOrigin protocol]): Deleted.
2863         (-[_WKSecurityOrigin host]): Deleted.
2864         (-[_WKSecurityOrigin port]): Deleted.
2865
2866         * UIProcess/Cocoa/NavigationState.h:
2867         * UIProcess/Cocoa/NavigationState.mm:
2868         (WebKit::NavigationState::NavigationClient::didFailProvisionalLoadInSubframeWithError):
2869
2870         * UIProcess/Cocoa/UIDelegate.h:
2871         * UIProcess/Cocoa/UIDelegate.mm:
2872         (WebKit::UIDelegate::UIClient::createNewPage):
2873         (WebKit::UIDelegate::UIClient::runJavaScriptAlert):
2874         (WebKit::UIDelegate::UIClient::runJavaScriptConfirm):
2875         (WebKit::UIDelegate::UIClient::runJavaScriptPrompt):
2876         (WebKit::UIDelegate::UIClient::exceededDatabaseQuota):
2877         (WebKit::UIDelegate::UIClient::reachedApplicationCacheOriginQuota):
2878
2879         * UIProcess/UserContent/WebScriptMessageHandler.h:
2880
2881         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
2882         (WebKit::WebUserContentControllerProxy::didPostMessage):
2883         * UIProcess/UserContent/WebUserContentControllerProxy.h:
2884         * UIProcess/UserContent/WebUserContentControllerProxy.messages.in:
2885
2886         * UIProcess/WebPageProxy.cpp:
2887         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
2888         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
2889         (WebKit::WebPageProxy::decidePolicyForNewWindowAction):
2890         (WebKit::WebPageProxy::decidePolicyForResponse):
2891         (WebKit::WebPageProxy::decidePolicyForResponseSync):
2892         (WebKit::WebPageProxy::createNewPage):
2893         (WebKit::WebPageProxy::runJavaScriptAlert):
2894         (WebKit::WebPageProxy::runJavaScriptConfirm):
2895         (WebKit::WebPageProxy::runJavaScriptPrompt):
2896         * UIProcess/WebPageProxy.h:
2897         * UIProcess/WebPageProxy.messages.in:
2898
2899         * WebKit2.xcodeproj/project.pbxproj:
2900
2901         * WebProcess/UserContent/WebUserContentController.cpp:
2902         (WebKit::WebUserMessageHandlerDescriptorProxy::didPostMessage):
2903
2904         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2905         (WebKit::WebChromeClient::createWindow):
2906         (WebKit::WebChromeClient::runJavaScriptAlert):
2907         (WebKit::WebChromeClient::runJavaScriptConfirm):
2908         (WebKit::WebChromeClient::runJavaScriptPrompt):
2909
2910         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2911         (WebKit::WebFrameLoaderClient::dispatchDidFailProvisionalLoad):
2912         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
2913         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
2914         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
2915
2916 2015-06-23  Dan Bernstein  <mitz@apple.com>
2917
2918         <rdar://problem/21342465> Make -[WKWebView _certificateChain] public.
2919         https://bugs.webkit.org/show_bug.cgi?id=145886
2920
2921         Reviewed by Sam Weinig.
2922
2923         * Shared/WebCertificateInfo.h:
2924         (WebKit::WebCertificateInfo::create): Changed to return a Ref rather than a PassRefPtr.
2925
2926         * UIProcess/API/Cocoa/WKBrowsingContextController.mm: Added no-op overrides of new
2927         PageLoadState::Observer functions to PageLoadStateObserver.
2928
2929         * UIProcess/API/Cocoa/WKProcessGroup.mm:
2930         (-[WKProcessGroup _setAllowsSpecificHTTPSCertificate:forHost:]): Updated for change to
2931         WebCertificateInfo::create.
2932
2933         * UIProcess/API/Cocoa/WKProcessPool.mm:
2934         (-[WKProcessPool _setAllowsSpecificHTTPSCertificate:forHost:]): Ditto.
2935
2936         * UIProcess/API/Cocoa/WKWebView.h: Declared new certificateChain property on WKWebView.
2937
2938         * UIProcess/API/Cocoa/WKWebView.mm:
2939         (-[WKWebView certificateChain]): Added. Returns the certificate chain from the page load
2940         state, or an empty array if there is no certificate chain.
2941
2942         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Deprecated _certificateChain.
2943
2944         * UIProcess/Cocoa/NavigationState.h: Declared overrides of new PageLoadState::Observer
2945         functions.
2946         * UIProcess/Cocoa/NavigationState.mm:
2947         (WebKit::NavigationState::willChangeCertificateInfo): Override to call
2948         -willChangeValueForKey:.
2949         (WebKit::NavigationState::didChangeCertificateInfo): Override to call
2950         -didChangeValueForKey:.
2951
2952         * UIProcess/PageLoadState.cpp:
2953         (WebKit::PageLoadState::commitChanges): Call the new observer functions
2954         willChangeCertificateInfo and didChangeCertificateInfo.
2955         (WebKit::PageLoadState::didCommitLoad): Added new certificateInfo parameter, which is stored
2956         in the uncommitted state.
2957         * UIProcess/PageLoadState.h:
2958         (WebKit::PageLoadState::certificateInfo): Added this getter.
2959
2960         * UIProcess/WebFrameProxy.cpp:
2961         (WebKit::WebFrameProxy::didCommitLoad): Changed the parameter type from
2962         WebCore::CertificateInfo to WebCertificateInfo.
2963         * UIProcess/WebFrameProxy.h:
2964
2965         * UIProcess/WebPageProxy.cpp:
2966         (WebKit::WebPageProxy::didCommitLoadForFrame): Pass the certificate info to
2967         PageLoadState::didCommitLoad.
2968
2969 2015-06-22  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2970
2971         [EFL][CustomProtocol] Do not add duplicated custom scheme
2972         https://bugs.webkit.org/show_bug.cgi?id=146199
2973
2974         Reviewed by Carlos Garcia Campos.
2975
2976         WebSoupCustomProtocolRequestManager::registerSchemeForCustomProtocol generates
2977         a crash when duplicated scheme is registered on debug mode, or just registers it on release mode.
2978         However application can register duplicate scheme by mistake or on purpose. Thus it would be good
2979         if we don't register it instead of registering it or generating a crash when trying to regiseter
2980         duplicated scheme.
2981
2982         EFL port want to allow user to change registered callback, thus EWK2ContextTest::ewk_context_url_scheme_register()
2983         is modified to test it.
2984
2985         Test: ewk_context_url_scheme_register() in test_ewk2_context.cpp.
2986
2987         * UIProcess/API/efl/ewk_context.h: Added a comment to replace registered callback.
2988         * UIProcess/API/efl/tests/test_ewk2_context.cpp:
2989         (EWK2ContextTest::schemeRequestCallback1):
2990         (EWK2ContextTest::schemeRequestCallback2):
2991         (TEST_F):
2992         (EWK2ContextTest::schemeRequestCallback): Deleted.
2993         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp:
2994         (WebKit::WebSoupCustomProtocolRequestManager::registerSchemeForCustomProtocol):
2995
2996 2015-06-22  Carlos Garcia Campos  <cgarcia@igalia.com>
2997
2998         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.9.3 release.
2999
3000         * gtk/NEWS: Add release notes for 2.9.3.
3001
3002 2015-06-22  Dan Bernstein  <mitz@apple.com>
3003
3004         Part 2 of [Xcode] Fold the WebKit2SandboxProfiles-IOSOverride target into the Sandbox Profiles target
3005         https://bugs.webkit.org/show_bug.cgi?id=146197
3006
3007         Rubber-stamped by Anders Carlsson.
3008
3009         * WebKit2.xcodeproj/project.pbxproj: Deleted the WebKit2SandboxProfiles-IOSOverride target.
3010
3011 2015-06-22  Dean Jackson  <dino@apple.com>
3012
3013         Rename PlatformCA*Mac to PlatformCA*Cocoa
3014         https://bugs.webkit.org/show_bug.cgi?id=146224
3015         <rdar://problem/21497182>
3016
3017         Reviewed by Simon Fraser.
3018
3019         Rename PlatformCALayerMac and related files in platform/graphics/ca/mac
3020         to the more accurate Cocoa suffix.
3021
3022         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
3023         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
3024         (WebKit::PlatformCALayerRemote::filtersCanBeComposited):
3025         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
3026         (WebKit::PlatformCALayerRemoteCustom::create):
3027         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
3028         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3029         (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
3030
3031 2015-06-22  Anders Carlsson  <andersca@apple.com>
3032
3033         Simplify Connection::SyncMessageState
3034         https://bugs.webkit.org/show_bug.cgi?id=146213
3035
3036         Reviewed by Andreas Kling.
3037
3038         Since we no longer support Connections dispatching to multiple threads, we can make SyncMessageState
3039         into a singleton and get rid of the RunLoop -> SyncMessageState hash map.
3040
3041         * Platform/IPC/Connection.cpp:
3042         (IPC::Connection::SyncMessageState::singleton):
3043         (IPC::Connection::SyncMessageState::SyncMessageState):
3044         (IPC::Connection::SyncMessageState::processIncomingMessage):
3045         (IPC::Connection::SyncMessageState::dispatchMessages):
3046         (IPC::Connection::waitForSyncReply):
3047         (IPC::Connection::processIncomingSyncReply):
3048         (IPC::Connection::processIncomingMessage):
3049         (IPC::Connection::connectionDidClose):
3050         (IPC::Connection::SyncMessageState::syncMessageStateMap): Deleted.
3051         (IPC::Connection::SyncMessageState::syncMessageStateMapMutex): Deleted.
3052         (IPC::Connection::SyncMessageState::getOrCreate): Deleted.
3053         (IPC::Connection::SyncMessageState::~SyncMessageState): Deleted.
3054         (IPC::Connection::Connection): Deleted.
3055         * Platform/IPC/Connection.h:
3056
3057 2015-06-20  Alex Christensen  <achristensen@webkit.org>
3058
3059         [Content Extensions] Add SPI to reload without content blocking.
3060         https://bugs.webkit.org/show_bug.cgi?id=146128
3061         rdar://problem/20351903
3062
3063         Reviewed by Sam Weinig.
3064
3065         * Shared/WebPageCreationParameters.cpp:
3066         (WebKit::WebPageCreationParameters::encode):
3067         (WebKit::WebPageCreationParameters::decode):
3068         * Shared/WebPageCreationParameters.h:
3069         * UIProcess/API/C/WKPage.cpp:
3070         (WKPageSetCustomUserAgent):
3071         (WKPageSetUserContentExtensionsEnabled):
3072         (WKPageSupportsTextEncoding):
3073         * UIProcess/API/C/WKPage.h:
3074         * UIProcess/API/Cocoa/WKWebView.mm:
3075         (-[WKWebView _customUserAgent]):
3076         (-[WKWebView _setUserContentExtensionsEnabled:]):
3077         (-[WKWebView _userContentExtensionsEnabled]):
3078         (-[WKWebView _setCustomUserAgent:]):
3079         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3080         * UIProcess/WebPageProxy.cpp:
3081         (WebKit::WebPageProxy::creationParameters):
3082         (WebKit::WebPageProxy::setShouldScaleViewToFitDocument):
3083         (WebKit::WebPageProxy::setUserContentExtensionsEnabled):
3084         * UIProcess/WebPageProxy.h:
3085         (WebKit::WebPageProxy::userContentExtensionsEnabled):
3086         * WebProcess/WebPage/WebPage.cpp:
3087         (WebKit::WebPage::WebPage):
3088         (WebKit::WebPage::reinitializeWebPage):
3089         (WebKit::WebPage::setShouldScaleViewToFitDocument):
3090         (WebKit::WebPage::setUserContentExtensionsEnabled):
3091         * WebProcess/WebPage/WebPage.h:
3092         * WebProcess/WebPage/WebPage.messages.in:
3093         Pass a boolean from the API to WebCore.
3094
3095 2015-06-22  Anders Carlsson  <andersca@apple.com>
3096
3097         Remove m_clientRunLoop from IPC::Connection
3098         https://bugs.webkit.org/show_bug.cgi?id=146212
3099
3100         Reviewed by Sam Weinig.
3101
3102         We only ever create connections whose messages are dispatched to the main run loop, so we can 
3103         vastly simplify the code by only allowing messages to be dispatched there.
3104
3105         * DatabaseProcess/DatabaseToWebProcessConnection.cpp:
3106         (WebKit::DatabaseToWebProcessConnection::DatabaseToWebProcessConnection):
3107         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
3108         (WebKit::NetworkConnectionToWebProcess::NetworkConnectionToWebProcess):
3109         * Platform/IPC/Connection.cpp:
3110         (IPC::Connection::createServerConnection):
3111         (IPC::Connection::createClientConnection):
3112         (IPC::Connection::Connection):
3113         (IPC::Connection::addWorkQueueMessageReceiver):
3114         (IPC::Connection::removeWorkQueueMessageReceiver):
3115         (IPC::Connection::waitForMessage):
3116         (IPC::Connection::sendSyncMessage):
3117         (IPC::Connection::sendSyncMessageFromSecondaryThread):
3118         (IPC::Connection::processIncomingMessage):
3119         (IPC::Connection::connectionDidClose):
3120         (IPC::Connection::dispatchDidReceiveInvalidMessage):
3121         (IPC::Connection::enqueueIncomingMessage):
3122         (IPC::Connection::wakeUpRunLoop):
3123         * Platform/IPC/Connection.h:
3124         * Platform/IPC/mac/ConnectionMac.mm:
3125         (IPC::Connection::receiveSourceEventHandler):
3126         * PluginProcess/WebProcessConnection.cpp:
3127         (WebKit::WebProcessConnection::WebProcessConnection):
3128         * Shared/ChildProcess.cpp:
3129         (WebKit::ChildProcess::initialize):
3130         * Shared/ChildProcessProxy.cpp:
3131         (WebKit::ChildProcessProxy::didFinishLaunching):
3132         * UIProcess/Plugins/PluginProcessProxy.cpp:
3133         (WebKit::PluginProcessProxy::didFinishLaunching):
3134         * WebProcess/Databases/WebToDatabaseProcessConnection.cpp:
3135         (WebKit::WebToDatabaseProcessConnection::WebToDatabaseProcessConnection):
3136         * WebProcess/Network/NetworkProcessConnection.cpp:
3137         (WebKit::NetworkProcessConnection::NetworkProcessConnection):
3138         * WebProcess/Plugins/PluginProcessConnection.cpp:
3139         (WebKit::PluginProcessConnection::PluginProcessConnection):
3140         * WebProcess/WebPage/WebInspector.cpp:
3141         (WebKit::WebInspector::createInspectorPage):
3142         * WebProcess/WebPage/WebInspectorUI.cpp:
3143         (WebKit::WebInspectorUI::establishConnection):
3144
3145 2015-06-22  Anders Carlsson  <andersca@apple.com>
3146
3147         Crashes in hit testing under WebPage::acceptsFirstMouse() while handling sync message in plug-in teardown
3148         https://bugs.webkit.org/show_bug.cgi?id=146211
3149         rdar://problem/17180615
3150
3151         Reviewed by Sam Weinig.
3152
3153         If we're inside a sendSync message when we're being called, just bail.
3154
3155         * WebProcess/WebPage/mac/WebPageMac.mm:
3156         (WebKit::WebPage::acceptsFirstMouse):
3157
3158 2015-06-22  Dan Bernstein  <mitz@apple.com>
3159
3160         Part 1 of [Xcode] Fold the WebKit2SandboxProfiles-IOSOverride target into the Sandbox Profiles target
3161         https://bugs.webkit.org/show_bug.cgi?id=146197
3162
3163         Reviewed by Anders Carlsson.
3164
3165         * Configurations/SandboxProfiles.xcconfig: Added. Defines INSTALL_PATH based on the value
3166         of WK_INSTALL_OVERRIDE_SANDBOX_PROFILES.
3167         * WebKit2.xcodeproj/project.pbxproj: Use SandboxProfiles.xcconfig for the Sandbox Profiles
3168         target, and change the destination path in its Copy Files build phase to INSTALL_PATH.
3169
3170 2015-06-22  Antti Koivisto  <antti@apple.com>
3171
3172         Crash replacing TabDocument in MobileSafari at WebKit: -[WKWebView(WKPrivate) _beginAnimatedResizeWithUpdates:]
3173         https://bugs.webkit.org/show_bug.cgi?id=146201
3174
3175         Reviewed by Dan Bernstein.
3176
3177         * UIProcess/API/Cocoa/WKWebView.mm:
3178         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
3179
3180         No repro but if for some reason [_contentView bounds] width is zero we'll compute +Inf targetScale
3181         and then NaN contentOffset.x. Verified in lldb that this gives the exact crash signature seen.
3182
3183         Fix by checking that [_contentView bounds] is not empty like is done with other inputs.
3184
3185 2015-06-22  Carlos Garcia Campos  <cgarcia@igalia.com>
3186
3187         REGRESSION(r182303): [GTK] Context menu API is broken since r182303
3188         https://bugs.webkit.org/show_bug.cgi?id=146202
3189
3190         Reviewed by Žan Doberšek.
3191
3192         The problem is that ContextMenuclient API changed in r182303, but
3193         we didn't notice it either, and the default handler for
3194         getContextMenuFromProposedMenu was executed. An override keyword
3195         would have caught this.
3196
3197         * UIProcess/API/gtk/WebKitContextMenuClient.cpp: Build a Vector of
3198         WebContextMenuItemData as expected by our API, and add add
3199         override keyword to ensure this doesn't happen again.
3200
3201 2015-06-22  Zan Dobersek  <zdobersek@igalia.com>
3202
3203         [WK2] ConnectionUnix should use FastMalloc to allocate on-heap resources
3204         https://bugs.webkit.org/show_bug.cgi?id=146143
3205
3206         Reviewed by Carlos Garcia Campos.
3207
3208         IPC handling in Unix-specific IPC::Connection implementation should use
3209         FastMalloc to allocate on-heap resources, instead of allocating via the
3210         system allocator.
3211
3212         The AttachmentInfo class is marked as allocatable through FastMalloc.
3213         That way it can be allocated through FastMalloc while still handled
3214         through std::unique_ptr<>.
3215
3216         The char[] arrays in readBytesFromSocket() and Connection::sendOutgoingMessage()
3217         are now handled through a MallocPtr<> object.
3218
3219         In Connection::sendOutgoingMessage(), both the AttachmentInfo[] and char[]
3220         arrays are now only allocated if there are actual attachments contained
3221         in the message. The code that's conditioned with a non-empty attachments
3222         Vector is now also grouped together, in a single branch.
3223
3224         * Platform/IPC/unix/ConnectionUnix.cpp:
3225         (IPC::readBytesFromSocket):
3226         (IPC::Connection::sendOutgoingMessage):
3227
3228 2015-06-22  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3229
3230         [EFL] test_ewk2_application_cache_manager has been failed since r185527
3231         https://bugs.webkit.org/show_bug.cgi?id=146016
3232
3233         Reviewed by Csaba Osztrogonác.
3234
3235         * UIProcess/API/efl/tests/test_ewk2_application_cache_manager.cpp:
3236         (TEST_F): Disable this test for now. This test will be enabled again.
3237
3238 2015-06-16  Gavin Barraclough  <barraclough@apple.com>
3239
3240         Page load performance regression due to bugs.webkit.org/show_bug.cgi?id=145542
3241         https://bugs.webkit.org/show_bug.cgi?id=146198
3242
3243         Unreviewed rollout.
3244
3245         * UIProcess/API/gtk/WebKitWebContext.cpp:
3246         (webkit_web_context_prefetch_dns):
3247
3248 2015-06-21  Hyungwook Lee  <hyungwook.lee@navercorp.com>
3249
3250         WKApplicationCacheManagerDeleteEntriesForOrigin() has wrong WebsiteDataTypes.
3251         https://bugs.webkit.org/show_bug.cgi?id=146180
3252
3253         Reviewed by Sam Weinig.
3254
3255         Modify to use correct WebsiteDataTypes in WKApplicationCacheManagerDeleteEntriesForOrigin()
3256
3257         * UIProcess/API/C/WKApplicationCacheManager.cpp:
3258         (WKApplicationCacheManagerDeleteEntriesForOrigin):
3259
3260 2015-06-21  Dan Bernstein  <mitz@apple.com>
3261
3262         <rdar://problem/21444762> REGRESSION (r184215): Plug-in services crash on launch on Yosemite
3263         https://bugs.webkit.org/show_bug.cgi?id=146195
3264
3265         Reviewed by Sam Weinig.
3266
3267         * Configurations/PluginService.32.xcconfig: Changed the Yosemite definition of
3268         INFOPLIST_FILE such that it would also apply to the macosx10.10.internal SDK.
3269         * Configurations/PluginService.64.xcconfig: Ditto.
3270
3271 2015-06-21  Dan Bernstein  <mitz@apple.com>
3272
3273         Build fix.
3274
3275         * Shared/API/Cocoa/WKFoundation.h: Don’t use generics if the SDK doesn’t support them.
3276
3277 2015-06-21  Michael Catanzaro  <mcatanzaro@igalia.com>
3278
3279         [SOUP] Use GTask in WebKitSoupRequestInputStream
3280         https://bugs.webkit.org/show_bug.cgi?id=146184
3281
3282         Reviewed by Carlos Garcia Campos.
3283
3284         Replace deprecated use of GSimpleAsyncResult with GTask.
3285
3286         * WebProcess/soup/WebKitSoupRequestInputStream.cpp:
3287         (AsyncReadData::AsyncReadData):
3288         (webkitSoupRequestInputStreamReadAsyncResultComplete):
3289         (webkitSoupRequestInputStreamPendingReadAsyncComplete):
3290         (webkitSoupRequestInputStreamReadAsync):
3291         (webkitSoupRequestInputStreamReadFinish):
3292
3293 2015-06-21  Michael Catanzaro  <mcatanzaro@igalia.com>
3294
3295         Fix format strings in NetworkCache.cpp and NetworkCacheStatistics.cpp and WebIDBServerConnection.cpp
3296         https://bugs.webkit.org/show_bug.cgi?id=146172
3297
3298         Reviewed by Darin Adler.
3299
3300         Use the correct %"PRIu64" and %"PRIi64" for uint64_t and int64_t, instead of %llu and %lli.
3301
3302         * NetworkProcess/cache/NetworkCache.cpp:
3303         (WebKit::NetworkCache::Cache::retrieve):
3304         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
3305         (WebKit::NetworkCache::Statistics::initialize):
3306         (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
3307         (WebKit::NetworkCache::Statistics::recordRetrievalFailure):
3308         (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
3309         (WebKit::NetworkCache::Statistics::recordRevalidationSuccess):
3310         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
3311         (WebKit::WebIDBServerConnection::deleteDatabase):
3312         (WebKit::WebIDBServerConnection::didDeleteDatabase):
3313         (WebKit::WebIDBServerConnection::getOrEstablishIDBDatabaseMetadata):
3314         (WebKit::WebIDBServerConnection::didGetOrEstablishIDBDatabaseMetadata):
3315         (WebKit::WebIDBServerConnection::openTransaction):
3316         (WebKit::WebIDBServerConnection::didOpenTransaction):
3317         (WebKit::WebIDBServerConnection::beginTransaction):
3318         (WebKit::WebIDBServerConnection::didBeginTransaction):
3319         (WebKit::WebIDBServerConnection::commitTransaction):
3320         (WebKit::WebIDBServerConnection::didCommitTransaction):
3321         (WebKit::WebIDBServerConnection::resetTransaction):
3322         (WebKit::WebIDBServerConnection::didResetTransaction):
3323         (WebKit::WebIDBServerConnection::rollbackTransaction):
3324         (WebKit::WebIDBServerConnection::didRollbackTransaction):
3325         (WebKit::WebIDBServerConnection::createObjectStore):
3326         (WebKit::WebIDBServerConnection::didCreateObjectStore):
3327         (WebKit::WebIDBServerConnection::createIndex):
3328         (WebKit::WebIDBServerConnection::didCreateIndex):
3329         (WebKit::WebIDBServerConnection::deleteIndex):
3330         (WebKit::WebIDBServerConnection::didDeleteIndex):
3331         (WebKit::WebIDBServerConnection::get):
3332         (WebKit::WebIDBServerConnection::put):
3333         (WebKit::WebIDBServerConnection::didPutRecord):
3334         (WebKit::WebIDBServerConnection::didGetRecord):
3335         (WebKit::WebIDBServerConnection::didOpenCursor):
3336         (WebKit::WebIDBServerConnection::didAdvanceCursor):
3337         (WebKit::WebIDBServerConnection::didIterateCursor):
3338         (WebKit::WebIDBServerConnection::count):
3339         (WebKit::WebIDBServerConnection::didCount):
3340         (WebKit::WebIDBServerConnection::deleteRange):
3341         (WebKit::WebIDBServerConnection::didDeleteRange):
3342         (WebKit::WebIDBServerConnection::clearObjectStore):
3343         (WebKit::WebIDBServerConnection::didClearObjectStore):
3344         (WebKit::WebIDBServerConnection::deleteObjectStore):
3345         (WebKit::WebIDBServerConnection::didDeleteObjectStore):
3346         (WebKit::WebIDBServerConnection::changeDatabaseVersion):
3347         (WebKit::WebIDBServerConnection::didChangeDatabaseVersion):
3348         (WebKit::WebIDBServerConnection::openCursor):
3349         (WebKit::WebIDBServerConnection::cursorAdvance):
3350         (WebKit::WebIDBServerConnection::cursorIterate):
3351
3352 2015-06-20  Tim Horton  <timothy_horton@apple.com>
3353
3354         Deselection of text causes a noticeable jump on force touch machines
3355         https://bugs.webkit.org/show_bug.cgi?id=146173
3356         <rdar://problem/20992842>
3357
3358         Reviewed by Sam Weinig.
3359
3360         * Shared/WebCoreArgumentCoders.cpp:
3361         (IPC::ArgumentCoder<TextIndicatorData>::encode):
3362         (IPC::ArgumentCoder<TextIndicatorData>::decode):
3363         Encode/decode wantsMargin.
3364
3365         * WebProcess/WebPage/mac/WebPageMac.mm:
3366         (WebKit::WebPage::performImmediateActionHitTestAtLocation):
3367         (WebKit::textIndicatorTransitionForImmediateAction): Deleted.
3368         Get rid of TextIndicatorPresentationTransition::Crossfade.
3369
3370 2015-06-20  Dan Bernstein  <mitz@apple.com>
3371
3372         [Cocoa] Actually use Objective-C lightweight generics when the compiler supports them
3373         https://bugs.webkit.org/show_bug.cgi?id=146183
3374
3375         Reviewed by Sam Weinig.
3376
3377         * Shared/API/Cocoa/WKFoundation.h: When the compiler supports Objective-C generics, define
3378         WK_ARRAY and WK_SET to use them. Also added a definition of WK_DICTIONARY.
3379
3380         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Use WK_DICTIONARY for the options dictionary of
3381         -_loadRequest:withOptions:.
3382
3383         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3384         (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]): Made the completion
3385         halder type match the declaration, now that NSArray and WK_ARRAY(WKWebsiteDataRecord *) are
3386         not the same.
3387
3388         * mac/postprocess-framework-headers.sh: Also rewrite WK_DICTIONARY.
3389
3390 2015-06-20  Chris Dumez  <cdumez@apple.com>
3391
3392         [WK2][iOS] Avoid synchronous IPC on view state change when the content is not visible
3393         https://bugs.webkit.org/show_bug.cgi?id=146179
3394         <rdar://problem/20923432>
3395
3396         Reviewed by Tim Horton.
3397
3398         After r170787, viewStateChange() would cause a synchronous IPC between
3399         the UIProcess and the WebProcess when the view becomes visible. This
3400         was to avoid painting empty / black tiles when unsuspending the
3401         WebProcess on tab switch, in the event volatile IOSurfaces were purged.
3402
3403         However, this sync IPC can have performance implications and is not
3404         needed when the content is not actually visible yet (e.g.
3405         hideContentUntilNextUpdate() was called, or the tab was killed).
3406
3407         This patch avoids the synchronous IPC when the content is hidden and
3408         exposes a private API on WKWebView so that clients can ask for the
3409         content to be hidden until the next update. This would allow for
3410         clients to avoid the synchronous IPC if they don't need the content
3411         to be displayed synchronously (e.g. the view is obscured).
3412
3413         * UIProcess/API/Cocoa/WKWebView.mm:
3414         (-[WKWebView _hideContentUntilNextUpdate]):
3415         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3416         * UIProcess/DrawingAreaProxy.h:
3417         (WebKit::DrawingAreaProxy::hasVisibleContent):
3418         * UIProcess/WebPageProxy.cpp:
3419         (WebKit::WebPageProxy::dispatchViewStateChange):
3420         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
3421         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
3422         (WebKit::RemoteLayerTreeDrawingAreaProxy::isContentHidden):
3423
3424 2015-06-20  Michael Catanzaro  <mcatanzaro@igalia.com>
3425
3426         Check for SHA1 certificates ignores subresources
3427         https://bugs.webkit.org/show_bug.cgi?id=146159
3428
3429         Reviewed by Dan Bernstein.
3430
3431         * UIProcess/WebPageProxy.cpp:
3432         (WebKit::WebPageProxy::didCommitLoadForFrame): Call
3433         PageLoadState::didDisplayOrRunInsecureContent if a certificate chain contains a non-root
3434         SHA1 certificate when the frame is not the main frame.
3435
3436 2015-06-20  Dan Bernstein  <mitz@apple.com>
3437
3438         Added availability information to a recently-added delegate method.
3439
3440         Suggested by Alexey Proskuryakov and Anders Carlsson.
3441
3442         * UIProcess/API/Cocoa/WKUIDelegate.h: Annotated -webViewDidClose:.
3443
3444 2015-06-20  Ryuan Choi  <ryuan.choi@navercorp.com>
3445
3446         [EFL] Do not consider test directories when DEVELOPER_MODE is OFF
3447         https://bugs.webkit.org/show_bug.cgi?id=146171
3448
3449         Reviewed by Gyuyoung Kim.
3450
3451         * PlatformEfl.cmake:
3452         Do not define SOURCE_DIR when DEVELOPER_MODE is OFF for seccomp filter
3453         not to allow jhbuild directory.
3454         * Shared/efl/ProcessExecutablePathEfl.cpp:
3455         (WebKit::findProcessPath): Guard test code to ENABLE(DEVELOPER_MODE).
3456
3457 2015-06-18  Myles C. Maxfield  <mmaxfield@apple.com>
3458
3459         REGRESSION(r185475): [Mac] ASSERT() when clicking on text using web fonts with force touch trackpad
3460         https://bugs.webkit.org/show_bug.cgi?id=145890
3461         <rdar://problem/21390877>
3462
3463         Reviewed by Darin Adler and Tim Horton.
3464
3465         The best place to stop the serialization of unserializable fonts is inside WebKit2's IPC code. We want
3466         this logic to occur when encoding an NSAttributedString, rather than when encoding an NSDictionary,
3467         because changing the shape of an NSAttributedString is less likely to result in problems rather than
3468         changing the shape of an NSDictionary.
3469
3470         * Shared/mac/ArgumentCodersMac.mm:
3471         (IPC::fontIsSerializable):
3472         (IPC::filterUnserializableValues):
3473         (IPC::encode):
3474
3475 2015-06-19  Michael Catanzaro  <mcatanzaro@igalia.com>
3476
3477         [SOUP] Fix return-type-c-linkage warning after r185553
3478         https://bugs.webkit.org/show_bug.cgi?id=146014
3479
3480         Reviewed by Martin Robinson.
3481
3482         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.cpp:
3483         (WebKit::CustomProtocolManagerImpl::start): webkitSoupRequestGenericGetRequest now returns
3484         a pointer rather than a reference.
3485
3486 2015-06-19  Brady Eidson  <beidson@apple.com>
3487
3488         Rename WKSecurityOrigin.h/cpp to WKSecurityOriginRef.h/cpp.
3489         https://bugs.webkit.org/show_bug.cgi?id=146152
3490
3491         Reviewed by Dan Bernstein.
3492
3493         * CMakeLists.txt:
3494
3495         * Shared/API/c/WKSecurityOriginRef.cpp: Renamed from Source/WebKit2/Shared/API/c/WKSecurityOrigin.cpp.
3496         * Shared/API/c/WKSecurityOriginRef.h: Renamed from Source/WebKit2/Shared/API/c/WKSecurityOrigin.h.
3497
3498         * UIProcess/API/efl/ewk_security_origin.cpp:
3499         * UIProcess/API/efl/ewk_storage_manager.cpp:
3500
3501         * WebKit2.xcodeproj/project.pbxproj:
3502
3503 2015-06-18  Brent Fulgham  <bfulgham@apple.com>
3504
3505         [iOS] scrollIntoViewIfNeeded is not working with scroll-snap points
3506         https://bugs.webkit.org/show_bug.cgi?id=145318
3507         <rdar://problem/21081501>
3508
3509         Reviewed by Simon Fraser.
3510
3511         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
3512         (ArgumentCoder<ScrollingStateScrollingNode>::encode): Handle scroll snap point offset indices.
3513         (ArgumentCoder<ScrollingStateScrollingNode>::decode): Ditto.
3514         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
3515         (WebKit::RemoteScrollingCoordinatorProxy::currentSnapPointIndicesDidChange): Added. Send message
3516         to WebProcess when scroll snap indices have changed.
3517         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
3518         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
3519         (WebKit::RemoteScrollingTree::currentSnapPointIndicesDidChange): Added. Notify the
3520         RemoteScrollingCoordinatorProxy when scroll snap indices have changed.
3521         * UIProcess/Scrolling/RemoteScrollingTree.h:
3522         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.h:
3523         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
3524         (-[WKOverflowScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Revised.
3525         Identify changes in the current scroll snap point offset index (in either the horizontal or vertical
3526         directions), and send a notification when this happens.
3527         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::currentSnapPointIndicesDidChange): Added. Notify the
3528         Scrolling Tree when indices changed.
3529         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
3530         (WebKit::RemoteScrollingCoordinatorProxy::adjustTargetContentOffsetForSnapping): Revised. Always compute
3531         the new scroll snap offset index (even when we will rubber band).
3532         * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
3533         * WebProcess/Scrolling/RemoteScrollingCoordinator.messages.in: Add a new message to relay changes in scroll
3534         snap index.
3535         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
3536         (WebKit::RemoteScrollingCoordinator::currentSnapPointIndicesChangedForNode): Added.
3537
3538 2015-06-19  Jeremy Jones  <jeremyj@apple.com>
3539
3540         Revert switch to _synchronizedDrawingFence.
3541         https://bugs.webkit.org/show_bug.cgi?id=146136
3542         <rdar://problem/21227992>
3543
3544         Reviewed by Simon Fraser.
3545
3546         Revert _synchronizedDrawingFence code path that leaks a port.
3547
3548         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
3549         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame):
3550
3551 2015-06-19  Anders Carlsson  <andersca@apple.com>
3552
3553         Address review feedback from Darin.
3554
3555         * Shared/mac/HangDetectionDisablerMac.mm:
3556         (WebKit::clientsMayIgnoreEvents):
3557
3558 2015-06-19  Anders Carlsson  <andersca@apple.com>
3559
3560         Disable SpinTracer detection while loading sync XHR
3561         https://bugs.webkit.org/show_bug.cgi?id=146150
3562         rdar://problem/21462023
3563
3564         Reviewed by Dan Bernstein.
3565
3566         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
3567         (WebKit::WebPlatformStrategies::loadResourceSynchronously):
3568
3569 2015-06-19  Anders Carlsson  <andersca@apple.com>
3570
3571         Spintracer treats the web process as hung when it's showing JavaScript dialogs in the UI process
3572         https://bugs.webkit.org/show_bug.cgi?id=146124
3573         rdar://problem/21449395
3574
3575         Reviewed by Geoffrey Garen.
3576
3577         Add a HangDetectionDisabler RAII object and use it for JavaScript panels.
3578
3579         * Shared/HangDetectionDisabler.h: Added.
3580         (WebKit::HangDetectionDisabler::HangDetectionDisabler):
3581         (WebKit::HangDetectionDisabler::~HangDetectionDisabler):
3582         * Shared/mac/HangDetectionDisablerMac.mm: Added.
3583         (WebKit::clientsMayIgnoreEvents):
3584         (WebKit::setClientsMayIgnoreEvents):
3585         (WebKit::HangDetectionDisabler::HangDetectionDisabler):
3586         (WebKit::HangDetectionDisabler::~HangDetectionDisabler):
3587         * WebKit2.xcodeproj/project.pbxproj:
3588         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3589         (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel):
3590         (WebKit::WebChromeClient::runJavaScriptAlert):
3591         (WebKit::WebChromeClient::runJavaScriptConfirm):
3592         (WebKit::WebChromeClient::runJavaScriptPrompt):
3593
3594 2015-06-19  Dan Bernstein  <mitz@apple.com>
3595
3596         Fixed the build for platforms that don’t have SafariServices.
3597
3598         * UIProcess/ios/WKContentViewInteraction.mm:
3599         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
3600         (-[WKContentView commitPreviewViewController:]):
3601         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]):
3602
3603 2015-06-19  Csaba Osztrogonác  <ossy@webkit.org>
3604
3605         Remove unnecessary svn:executable flags
3606         https://bugs.webkit.org/show_bug.cgi?id=146107
3607
3608         Reviewed by Alexey Proskuryakov.
3609
3610         * UIProcess/API/efl/EwkView.cpp: Removed property svn:executable.
3611
3612 2015-06-19  Csaba Osztrogonác  <ossy@webkit.org>
3613
3614         [WK2] Fix unused-private-field warning in WebProcess/Plugins/PluginView.<h|cpp>
3615         https://bugs.webkit.org/show_bug.cgi?id=145252
3616
3617         Reviewed by Tim Horton.
3618
3619         * WebProcess/Plugins/PluginView.cpp:
3620         (WebKit::PluginView::PluginView): Added the necessary ifdef guard.
3621         * WebProcess/Plugins/PluginView.h: Added the necessary ifdef guard.
3622         * WebProcess/WebPage/WebPage.h: Moved the definition of ENABLE_PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC to WTF.
3623
3624 2015-06-18  Carlos Garcia Campos  <cgarcia@igalia.com>
3625
3626         Do not store configuration parameters twice in WebProcessPool
3627         https://bugs.webkit.org/show_bug.cgi?id=146102
3628
3629         Reviewed by Sam Weinig.
3630
3631         Since we are copying the given WebProcessPoolConfiguration and
3632         keeping it as a member, we don't need to keep an additional copy
3633         of its contents as extra members. This also prevents
3634         inconsistencies between the values in the configuration and the
3635         members when any of them are modified by WebProcessPool API.
3636
3637         * UIProcess/API/APIProcessPoolConfiguration.h: Return a const
3638         reference instead of a temporary in methods returning a String.
3639         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3640         (WebKit::WebProcessPool::updateProcessSuppressionState):
3641         (WebKit::WebProcessPool::platformInitializeWebProcess):
3642         * UIProcess/WebProcessPool.cpp:
3643         (WebKit::WebProcessPool::setProcessModel):
3644         (WebKit::WebProcessPool::setMaximumNumberOfProcesses):
3645         (WebKit::WebProcessPool::networkingProcessConnection):
3646         (WebKit::WebProcessPool::languageChanged):
3647         (WebKit::WebProcessPool::setUsesNetworkProcess):
3648         (WebKit::WebProcessPool::usesNetworkProcess):
3649         (WebKit::WebProcessPool::ensureNetworkProcess):
3650         (WebKit::WebProcessPool::ensureDatabaseProcess):
3651         (WebKit::WebProcessPool::ensureSharedWebProcess):
3652         (WebKit::WebProcessPool::createNewWebProcess):
3653         (WebKit::WebProcessPool::warmInitialProcess):
3654         (WebKit::WebProcessPool::disconnectProcess):
3655         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
3656         (WebKit::WebProcessPool::createWebPage):
3657         (WebKit::WebProcessPool::postMessageToInjectedBundle):
3658         (WebKit::WebProcessPool::setCanHandleHTTPSServerTrustEvaluation):
3659         (WebKit::WebProcessPool::setCacheModel):
3660         (WebKit::WebProcessPool::allowSpecificHTTPSCertificateForHost):
3661         (WebKit::WebProcessPool::requestWebContentStatistics):
3662         (WebKit::WebProcessPool::requestNetworkingStatistics):
3663         * UIProcess/WebProcessPool.h:
3664         (WebKit::WebProcessPool::sendToNetworkingProcess):
3665         (WebKit::WebProcessPool::sendToNetworkingProcessRelaunchingIfNecessary):
3666         (WebKit::WebProcessPool::sendToAllProcessesRelaunchingThemIfNecessary):
3667         (WebKit::WebProcessPool::sendToOneProcess):
3668         * UIProcess/gtk/WebProcessPoolGtk.cpp:
3669         (WebKit::WebProcessPool::platformInitializeWebProcess):
3670
3671 2015-06-18  Jon Lee  <jonlee@apple.com>
3672
3673         Update AVKit usage of pip
3674         https://bugs.webkit.org/show_bug.cgi?id=146095
3675         <rdar://problem/21386853>
3676
3677         Reviewed by Eric Carlson.
3678
3679         - Rename preference key
3680         - Rename shouldAllowAlternateFullscreen to shouldAllowPictureInPictureMediaPlayback
3681
3682         * Shared/WebPreferencesDefinitions.h:
3683         * UIProcess/API/C/WKPreferences.cpp: Remove unused preference calls.
3684         (WKPreferencesSetAllowsAlternateFullscreen): Deleted.
3685         (WKPreferencesGetAllowsAlternateFullscreen): Deleted.
3686         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3687         * UIProcess/API/Cocoa/WKWebView.mm:
3688         (-[WKWebView _isShowingVideoPictureInPicture]): Renamed.
3689         (-[WKWebView _isShowingVideoOptimized]): Deleted.
3690         (-[WKWebView _mayAutomaticallyShowVideoPictureInPicture]): Renamed.
3691         (-[WKWebView _mayAutomaticallyShowVideoOptimized]): Deleted.
3692         (shouldAllowPictureInPictureMediaPlayback): Renamed.
3693         (shouldAllowAlternateFullscreen): Deleted.
3694         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3695         * UIProcess/ios/PageClientImplIOS.mm:
3696         * UIProcess/ios/WebVideoFullscreenManagerProxy.h: Rename local variables.
3697         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
3698         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
3699         (WebKit::WebVideoFullscreenManagerProxy::mayAutomaticallyShowVideoPictureInPicture): Renamed.
3700         (WebKit::WebVideoFullscreenManagerProxy::mayAutomaticallyShowVideoOptimized): Deleted.
3701         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3702         * WebProcess/WebPage/WebPage.cpp:
3703         * WebProcess/ios/WebVideoFullscreenManager.mm:
3704
3705 2015-06-18  Jeremy Jones  <jeremyj@apple.com>
3706
3707         Fix crash when entering fullscreen during exit fullscreen animation.
3708         https://bugs.webkit.org/show_bug.cgi?id=146117
3709
3710         Reviewed by Simon Fraser.
3711
3712         A partial teardown left the LayerHostingContext in a bad state when attempting to reuse the model and interface
3713         objects. Instead, complete the teardown and don't reuse the objects.
3714
3715         * WebProcess/ios/WebVideoFullscreenManager.mm:
3716         (WebKit::WebVideoFullscreenManager::didEnterFullscreen): WebThreadRun is a no-op in WK2. Use dispatch_async.
3717         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen): Do complete teardown before entering fullscreen again.
3718
3719 2015-06-18  Anders Carlsson  <andersca@apple.com>
3720
3721         Remove shouldInterruptJavaScript
3722         https://bugs.webkit.org/show_bug.cgi?id=146118
3723
3724         Reviewed by Antti Koivisto.
3725
3726         * UIProcess/API/APIUIClient.h:
3727         (API::UIClient::shouldInterruptJavaScript): Deleted.
3728         * UIProcess/API/C/WKPage.cpp:
3729         (WKPageSetPageUIClient): Deleted.
3730         * UIProcess/API/C/WKPageUIClient.h:
3731         * UIProcess/WebPageProxy.cpp:
3732         (WebKit::WebPageProxy::shouldInterruptJavaScript): Deleted.
3733         * UIProcess/WebPageProxy.h:
3734         * UIProcess/WebPageProxy.messages.in:
3735         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3736         (WebKit::WebChromeClient::shouldInterruptJavaScript): Deleted.
3737         * WebProcess/WebCoreSupport/WebChromeClient.h:
3738
3739 2015-06-18  Tim Horton  <timothy_horton@apple.com>
3740
3741         Use SFSafariViewController for previews
3742         https://bugs.webkit.org/show_bug.cgi?id=146092
3743
3744         Reviewed by Darin Adler.
3745
3746         * UIProcess/ios/WKContentViewInteraction.mm:
3747         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
3748         (-[WKContentView commitPreviewViewController:]):
3749         * WebKit2.xcodeproj/project.pbxproj:
3750         * Source/WebKit2/Platform/spi/ios/SafariServicesSPI.h:
3751
3752 2015-06-18  Antti Koivisto  <antti@apple.com>
3753
3754         ~4% Membuster regression after WebKit r185452
3755         https://bugs.webkit.org/show_bug.cgi?id=146112
3756         rdar://problem/21406677
3757
3758         Reviewed by Chris Dumez.
3759
3760         Clear the cache write queue on critical memory pressure. There can be substantial amount of memory there and we
3761         don't know how long writing it out will take. System is often under I/O pressure too in low memory situations.
3762
3763         This also makes sense for process suspension where we send simulated critical memory event.
3764
3765         * NetworkProcess/NetworkProcess.cpp:
3766         (WebKit::NetworkProcess::lowMemoryHandler):
3767         * NetworkProcess/cache/NetworkCache.cpp:
3768         (WebKit::NetworkCache::Cache::handleMemoryPressureNotification):
3769         * NetworkProcess/cache/NetworkCache.h:
3770         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3771         (WebKit::NetworkCache::Storage::clearWriteQueue):
3772         * NetworkProcess/cache/NetworkCacheStorage.h:
3773
3774 2015-06-18  Csaba Osztrogonác  <ossy@webkit.org>
3775
3776         Fix missing braces and deprecated declarations warnings in WebKitNotificationProvider.cpp
3777         https://bugs.webkit.org/show_bug.cgi?id=145921
3778
3779         Reviewed by Carlos Garcia Campos.
3780
3781         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
3782         (WebKitNotificationProvider::WebKitNotificationProvider):
3783
3784 2015-06-18  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3785
3786         [EFL] test_ewk2_context has been failed since r185529
3787         https://bugs.webkit.org/show_bug.cgi?id=146046
3788
3789         Reviewed by Csaba Osztrogonác.
3790
3791         ewk_context_network_process_model test has been failed since r185529.
3792         This patch modifies the test which is similar to ewk_context_network_process_model
3793         based on multiple process model to fix the failure. Besides ewk_context_network_process_model
3794         seems to be fixed indirectly. So we enable it again.
3795
3796         * UIProcess/API/efl/tests/test_ewk2_context.cpp:
3797         (TEST_F):
3798
3799 2015-06-17  Yongjun Zhang  <yongjun_zhang@apple.com>
3800
3801         Also turn off long press on link preview.
3802         https://bugs.webkit.org/show_bug.cgi?id=146084
3803
3804         Also turn off long presss gesture when previewing. Turn that back on when preview is completed.
3805
3806         Reviewed by Tim Horton.
3807
3808         * UIProcess/ios/WKContentViewInteraction.mm:
3809         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]):
3810         (-[WKContentView didDismissPreviewViewController:committing:]):
3811
3812 2015-06-17  Brent Fulgham  <bfulgham@apple.com>
3813
3814         Overflow regions with scroll snap points are not reliably rubber banding
3815         https://bugs.webkit.org/show_bug.cgi?id=142522
3816         <rdar://problem/20100726>
3817
3818         Reviewed by Darin Adler.
3819
3820         Make sure we don't block rubberbanding behavior when a scroll gesture should take us past
3821         the end of the scroll container.
3822
3823         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
3824         (-[WKOverflowScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Don't adjust
3825         target point if we were going to scroll past the edges of the scroll container.
3826
3827 2015-06-17  Anders Carlsson  <andersca@apple.com>
3828
3829         Would like a way, in the API, to get notified about a web process crash
3830         https://bugs.webkit.org/show_bug.cgi?id=146085
3831         rdar://problem/17358828
3832
3833         Reviewed by Darin Adler.
3834
3835         * UIProcess/API/Cocoa/WKNavigationDelegate.h:
3836         * UIProcess/Cocoa/NavigationState.h:
3837         * UIProcess/Cocoa/NavigationState.mm:
3838         (WebKit::NavigationState::setNavigationDelegate):
3839         (WebKit::NavigationState::NavigationClient::processDidCrash):
3840
3841 2015-06-17  Tim Horton  <timothy_horton@apple.com>
3842
3843         Swipe gesture can get stuck, preventing scrolling and other gestures
3844         https://bugs.webkit.org/show_bug.cgi?id=146088
3845         <rdar://problem/16056087>
3846
3847         Reviewed by Darin Adler.
3848
3849         * UIProcess/mac/ViewGestureControllerMac.mm:
3850         (WebKit::ViewGestureController::trackSwipeGesture):
3851         Ignore mouse events that come in while we're doing a swipe.
3852         This prevents potentially problematic mouse events (especially context menus)
3853         won't be processed during a swipe, avoiding situations that can cause
3854         the swipe gesture to get stuck.
3855
3856 2015-06-17  Sungmann Cho  <sungmann.cho@navercorp.com>
3857
3858         Remove willSendEventToPlugin() from PluginController.h.
3859         https://bugs.webkit.org/show_bug.cgi?id=146054
3860
3861         Reviewed by Darin Adler.
3862
3863         PluginController::willSendEventToPlugin() was introduced by http://webkit.org/b/59124.
3864         This method had been used only for WebKit2 on Windows, and no one uses it now.
3865         So we can remove it.
3866
3867         No new tests, no behavior change.
3868
3869         * PluginProcess/PluginControllerProxy.cpp:
3870         (WebKit::PluginControllerProxy::willSendEventToPlugin): Deleted.
3871         * PluginProcess/PluginControllerProxy.h:
3872         * WebProcess/Plugins/PluginController.h:
3873         * WebProcess/Plugins/PluginView.cpp:
3874         (WebKit::PluginView::willSendEventToPlugin): Deleted.
3875         * WebProcess/Plugins/PluginView.h:
3876
3877 2015-06-17  Tim Horton  <timothy_horton@apple.com>
3878
3879         Repro crash when swiping back from a NY Times article @ WebPageProxy::navigationGestureDidEnd
3880         https://bugs.webkit.org/show_bug.cgi?id=146083
3881         <rdar://problem/20974232>
3882
3883         Reviewed by Darin Adler.
3884
3885         * UIProcess/ios/ViewGestureControllerIOS.mm:
3886         (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
3887         (WebKit::ViewGestureController::activeLoadMonitoringTimerFired):
3888         It is possible to get didSameDocumentNavigationForMainFrame *before*
3889         endSwipeGesture, while the user is still interactively swiping. We
3890         cannot remove the snapshot in this case, nor should we start the active
3891         load monitoring timer; all of these things should happen only after the
3892         swipe is completed and we've performed the navigation.
3893
3894         This was particularly bad (a crash instead of just a disappearing snapshot)
3895         because removing the snapshot also causes m_webPageProxyForBackForwardListForCurrentSwipe
3896         to be nulled out, but then it is dereferenced during endSwipeGesture.
3897
3898         Make sure that we never call removeSwipeSnapshotIfReady unless we were actually
3899         waiting to remove the swipe snapshot (because the gesture had completed).
3900         Most callers already did ensure this, but these two did not.
3901
3902 2015-06-17  Joseph Pecoraro  <pecoraro@apple.com>
3903
3904         Web Inspector: Improve Full Screen support for Web Inspector windows
3905         https://bugs.webkit.org/show_bug.cgi?id=146036
3906
3907         Reviewed by Timothy Hatcher.
3908
3909         * UIProcess/WebInspectorProxy.h:
3910         * UIProcess/mac/WebInspectorProxyMac.mm:
3911         (-[WKWebInspectorProxyObjCAdapter windowDidEnterFullScreen:]):
3912         (-[WKWebInspectorProxyObjCAdapter windowDidExitFullScreen:]):
3913         (WebKit::WebInspectorProxy::platformCanAttach):
3914         (WebKit::WebInspectorProxy::windowFullScreenDidChange):
3915         When entering / leaving full screen update attach availability to
3916         potentially show / hide the frontend's docking buttons.
3917
3918         (WebKit::WebInspectorProxy::createInspectorWindow):
3919         Allow a Web Inspector window to be a full screen auxillary window,
3920         so that if the application with a WebView opens a detached inspector
3921         window it can be shown on the same desktop as the full screen app.
3922         Also, reduce the minimum window size requirements for full screen tiling.
3923
3924 2015-06-17  Tim Horton  <timothy_horton@apple.com>
3925
3926         Safari tabs still have shrunken content after coming out of fullscreen
3927         https://bugs.webkit.org/show_bug.cgi?id=146037
3928         <rdar://problem/21105960>
3929
3930         Reviewed by Simon Fraser and Darin Adler.
3931
3932         * UIProcess/WebPageProxy.h:
3933         (WebKit::WebPageProxy::useFixedLayoutDidChange):
3934         (WebKit::WebPageProxy::fixedLayoutSizeDidChange):
3935         * UIProcess/WebPageProxy.messages.in:
3936         * WebProcess/WebPage/WebPage.cpp:
3937         (WebKit::WebPage::setUseFixedLayout):
3938         (WebKit::WebPage::setFixedLayoutSize):
3939         Keep the UI process up-to-date when fixed layout is enabled or the size changes.
3940         This is important because these things can change from the Web process side too,
3941         and the UI process uses its (potentially stale) version to do some short-circuiting.
3942         This was causing us to fail to turn off fixed layout when it was turned
3943         on from the Web process side (by TiledCoreAnimationDrawingArea).
3944
3945         * UIProcess/mac/WKViewLayoutStrategy.mm:
3946         (-[WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy willChangeLayoutStrategy]):
3947         Reset the view scale, which WKViewDynamicSizeComputedFromMinimumDocumentSizeLayoutStrategy
3948         makes heavy use of, just like the others.
3949
3950 2015-06-17  Dan Bernstein  <mitz@apple.com>
3951
3952         [Cocoa] Expose UIDelegate::UIClient::close via WKUIDelegate
3953         https://bugs.webkit.org/show_bug.cgi?id=145957
3954
3955         Reviewed by Darin Adler.
3956
3957         * UIProcess/API/Cocoa/WKUIDelegate.h: Added -webViewDidClose: to the protocol.
3958         * UIProcess/Cocoa/UIDelegate.h: Added a webViewDidClose boolean to the delegate methods struct.
3959         * UIProcess/Cocoa/UIDelegate.mm:
3960         (WebKit::UIDelegate::setDelegate): Initialize the webViewDidClose boolean.
3961         (WebKit::UIDelegate::UIClient::close): Changed to call the new delegate method. Left behind
3962         code that calls the old private method if it’s implemented.
3963
3964 2015-06-17  Carlos Garcia Campos  <cgarcia@igalia.com>
3965
3966         [GTK] WEBKIT_CACHE_MODEL_DOCUMENT_VIEWER doesn't disable memory cache when set before the web process is launched
3967         https://bugs.webkit.org/show_bug.cgi?id=146053
3968
3969         Reviewed by Martin Robinson.
3970
3971         The cache is disabled in WebProcess::platformSetCacheModel() when
3972         the cache model is CacheModelDocumentViewer, but it's enabled
3973         again by WebProcess::setMemoryCacheDisabled() when
3974         memoryCacheDisabled creation parameter is processed. We need to
3975         make sure the cache model and memoryCacheDisabled parameters are consistent.
3976
3977         * UIProcess/gtk/WebProcessPoolGtk.cpp:
3978         (WebKit::WebProcessPool::platformInitializeWebProcess): Initialize
3979         memoryCacheDisabled parameter to true if memory cache was
3980         explicitly disabled or cache model is CacheModelDocumentViewer.
3981
3982 2015-06-17  Zan Dobersek  <zdobersek@igalia.com>
3983
3984         [WK2] valueForKey() shouldn't copy the defaults map
3985         https://bugs.webkit.org/show_bug.cgi?id=146050
3986
3987         Reviewed by Sam Weinig.
3988
3989         * Shared/WebPreferencesStore.cpp:
3990         (WebKit::valueForKey): Avoid copying the defaults HashMap by binding the return value to a reference.
3991
3992 2015-06-16  Carlos Garcia Campos  <cgarcia@igalia.com>
3993
3994         [GTK] Inhibit screen saver when playing full screen video
3995         https://bugs.webkit.org/show_bug.cgi?id=145795
3996
3997         Reviewed by Gustavo Noronha Silva.
3998
3999         Use Freedesktop.org DBus API to inhibit/unhinibit the screen saver
4000         when entering/leaving fullscreen.
4001
4002         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
4003         (screenSaverInhibitedCallback):
4004         (webkitWebViewBaseSendInhibitMessageToScreenSaver):
4005         (screenSaverProxyCreatedCallback):
4006         (webkitWebViewBaseInhibitScreenSaver):
4007         (webkitWebViewBaseUninhibitScreenSaver):
4008         (webkitWebViewBaseEnterFullScreen):
4009         (webkitWebViewBaseExitFullScreen):
4010
4011 2015-06-16  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
4012
4013         Purge PassRefPtr with Ref or RefPtr
4014         https://bugs.webkit.org/show_bug.cgi?id=146001
4015
4016         Reviewed by Darin Adler.
4017
4018         As step to remove PassRefPtr, this patch reduces use of PassRefPtr in WebKit2.
4019         If function can't return nullptr, PassRefPtr is changed with Ref. If not, the function
4020         returns RefPtr.
4021
4022         * DatabaseProcess/DatabaseToWebProcessConnection.cpp:
4023         (WebKit::DatabaseToWebProcessConnection::create):
4024         * DatabaseProcess/DatabaseToWebProcessConnection.h:
4025         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.h:
4026         (WebKit::DatabaseProcessIDBConnection::create):
4027         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
4028         (WebKit::UniqueIDBDatabase::create):
4029         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.h:
4030         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
4031         (WebKit::NetworkConnectionToWebProcess::create):
4032         * NetworkProcess/NetworkConnectionToWebProcess.h:
4033         * NetworkProcess/RemoteNetworkingContext.h:
4034         * PluginProcess/WebProcessConnection.cpp:
4035         (WebKit::WebProcessConnection::create):
4036         * PluginProcess/WebProcessConnection.h:
4037         * Shared/API/APINumber.h:
4038         (API::Number::create):
4039         * Shared/API/APISecurityOrigin.h:
4040         (API::SecurityOrigin::createFromString):
4041         (API::SecurityOrigin::create):
4042         * Shared/API/APISerializedScriptValue.h:
4043         (API::SerializedScriptValue::create):
4044         (API::SerializedScriptValue::adopt):
4045         * Shared/APIWebArchive.h:
4046         * Shared/APIWebArchive.mm:
4047         (API::WebArchive::create):
4048         * Shared/APIWebArchiveResource.h:
4049         * Shared/APIWebArchiveResource.mm:
4050         (API::WebArchiveResource::create):
4051         * Shared/AsyncRequest.h:
4052         * UIProcess/API/efl/ewk_url_request_private.h:
4053         (EwkUrlRequest::create):
4054         * UIProcess/API/efl/ewk_url_response_private.h:
4055         (EwkUrlResponse::create):
4056         * UIProcess/API/efl/ewk_url_scheme_request_private.h:
4057         (EwkUrlSchemeRequest::create):
4058         * UIProcess/API/efl/ewk_window_features_private.h:
4059         (EwkWindowFeatures::create):
4060         * UIProcess/API/efl/tests/test_ewk2_object.cpp:
4061         (TestEwkObject1::create):
4062         (TestEwkObject2::create):
4063         * UIProcess/API/gtk/WebKitBatteryProvider.cpp:
4064         (WebKitBatteryProvider::create):
4065         * UIProcess/API/gtk/WebKitBatteryProvider.h:
4066         * UIProcess/API/gtk/WebKitColorChooser.cpp:
4067         (WebKit::WebKitColorChooser::create):
4068         * UIProcess/API/gtk/WebKitGeolocationProvider.cpp:
4069         (WebKitGeolocationProvider::create):
4070         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
4071         (WebKitNotificationProvider::create):
4072         * UIProcess/API/gtk/WebKitNotificationProvider.h:
4073         * UIProcess/GeolocationPermissionRequestProxy.h:
4074         (WebKit::GeolocationPermissionRequestProxy::create):
4075         * UIProcess/InspectorServer/HTTPRequest.h:
4076         (WebKit::HTTPRequest::create):
4077         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp:
4078         (WebKit::WebSoupCustomProtocolRequestManager::create):
4079         * UIProcess/Network/NetworkProcessProxy.cpp:
4080         (WebKit::NetworkProcessProxy::create):
4081         * UIProcess/Network/NetworkProcessProxy.h:
4082         * UIProcess/Notifications/NotificationPermissionRequest.cpp:
4083         (WebKit::NotificationPermissionRequest::create):
4084         * UIProcess/Notifications/NotificationPermissionRequest.h:
4085         * UIProcess/Notifications/WebNotification.h:
4086         (WebKit::WebNotification::create):
4087         * UIProcess/WebPageProxy.cpp:
4088         (WebKit::WebPageProxy::scriptValueCallback):
4089         * UIProcess/WebVibrationProx