57c2b358074438ff3c9f8885ba1e11ebec0bf57c
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-08-17  Timothy Horton  <timothy_horton@apple.com>
2
3         Adopt shrink-wrapping for TextIndicators on Mac
4         https://bugs.webkit.org/show_bug.cgi?id=148064
5
6         Reviewed by Beth Dakin.
7
8         * Shared/WebCoreArgumentCoders.cpp:
9         (IPC::ArgumentCoder<TextIndicatorData>::encode): Deleted.
10         (IPC::ArgumentCoder<TextIndicatorData>::decode): Deleted.
11         * WebProcess/WebPage/FindController.cpp:
12         (WebKit::FindController::updateFindIndicator):
13         * WebProcess/WebPage/ios/WebPageIOS.mm:
14         (WebKit::WebPage::getPositionInformation):
15         Use the new option, TextIndicatorOptionIncludeMarginIfRangeMatchesSelection,
16         for iOS and FindController, because we can keep the margins in these cases
17         because we don't have to animate to/from the blue highlight.
18
19 2015-08-16  Timothy Horton  <timothy_horton@apple.com>
20
21         Refactor ViewGestureController swipe snapshot removal to be more platform-independent
22         https://bugs.webkit.org/show_bug.cgi?id=148062
23
24         Reviewed by Dan Bernstein.
25
26         * Platform/Logging.h:
27         Add a ViewGestures logging channel.
28
29         * UIProcess/ViewGestureController.cpp: Added.
30         (viewGestureControllersForAllPages):
31         (WebKit::ViewGestureController::ViewGestureController):
32         (WebKit::ViewGestureController::~ViewGestureController):
33         (WebKit::ViewGestureController::gestureControllerForPage):
34         (WebKit::ViewGestureController::didFirstVisuallyNonEmptyLayoutForMainFrame):
35         (WebKit::ViewGestureController::didRepaintAfterNavigation):
36         (WebKit::ViewGestureController::didHitRenderTreeSizeThreshold):
37         (WebKit::ViewGestureController::didRestoreScrollPosition):
38         (WebKit::ViewGestureController::didReachMainFrameLoadTerminalState):
39         (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
40         (WebKit::ViewGestureController::checkForActiveLoads):
41         (WebKit::ViewGestureController::SnapshotRemovalTracker::eventsDescription):
42         (WebKit::ViewGestureController::SnapshotRemovalTracker::SnapshotRemovalTracker):
43         (WebKit::ViewGestureController::SnapshotRemovalTracker::log):
44         (WebKit::ViewGestureController::SnapshotRemovalTracker::start):
45         (WebKit::ViewGestureController::SnapshotRemovalTracker::reset):
46         (WebKit::ViewGestureController::SnapshotRemovalTracker::eventOccurred):
47         (WebKit::ViewGestureController::SnapshotRemovalTracker::cancelOutstandingEvent):
48         (WebKit::ViewGestureController::SnapshotRemovalTracker::fireRemovalCallbackIfPossible):
49         (WebKit::ViewGestureController::SnapshotRemovalTracker::fireRemovalCallbackImmediately):
50         (WebKit::ViewGestureController::SnapshotRemovalTracker::watchdogTimerFired):
51         (WebKit::ViewGestureController::SnapshotRemovalTracker::startWatchdog):
52         Build a platform-independent SnapshotRemovalTracker, which keeps track of
53         various events that we wait for before removing the snapshot. This
54         is constructed from the union of ViewGestureController{IOS, Mac}'s snapshot
55         removal code, and each platform ViewGestureController can specify which
56         events to wait for (because this currently differs slightly).
57
58         Add logging to SnapshotRemovalTracker to make debugging snapshot removal
59         issues much easier.
60
61         * UIProcess/mac/ViewGestureController.h:
62         (WebKit::ViewGestureController::backgroundColorForCurrentSnapshot):
63         (WebKit::ViewGestureController::didFinishLoadForMainFrame):
64         (WebKit::ViewGestureController::didFailLoadForMainFrame):
65
66         * UIProcess/ios/ViewGestureControllerIOS.mm:
67         (WebKit::ViewGestureController::platformTeardown):
68         (WebKit::ViewGestureController::beginSwipeGesture):
69         (WebKit::ViewGestureController::endSwipeGesture):
70         (WebKit::ViewGestureController::setRenderTreeSize):
71         (WebKit::ViewGestureController::willCommitPostSwipeTransitionLayerTree):
72         (WebKit::ViewGestureController::removeSwipeSnapshot):
73         (viewGestureControllersForAllPages): Deleted.
74         (WebKit::ViewGestureController::ViewGestureController): Deleted.
75         (WebKit::ViewGestureController::~ViewGestureController): Deleted.
76         (WebKit::ViewGestureController::didRestoreScrollPosition): Deleted.
77         (WebKit::ViewGestureController::mainFrameLoadDidReachTerminalState): Deleted.
78         (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame): Deleted.
79         (WebKit::ViewGestureController::activeLoadMonitoringTimerFired): Deleted.
80         (WebKit::ViewGestureController::swipeSnapshotWatchdogTimerFired): Deleted.
81         (WebKit::ViewGestureController::removeSwipeSnapshotIfReady): Deleted.
82         * UIProcess/mac/ViewGestureControllerMac.mm:
83         (WebKit::ViewGestureController::platformTeardown):
84         (WebKit::ViewGestureController::endSwipeGesture):
85         (WebKit::ViewGestureController::forceRepaintIfNeeded):
86         (WebKit::ViewGestureController::removeSwipeSnapshot):
87         (WebKit::ViewGestureController::ViewGestureController): Deleted.
88         (WebKit::ViewGestureController::~ViewGestureController): Deleted.
89         (WebKit::ViewGestureController::beginSwipeGesture): Deleted.
90         (WebKit::ViewGestureController::didHitRenderTreeSizeThreshold): Deleted.
91         (WebKit::ViewGestureController::didFirstVisuallyNonEmptyLayoutForMainFrame): Deleted.
92         (WebKit::ViewGestureController::mainFrameLoadDidReachTerminalState): Deleted.
93         (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame): Deleted.
94         (WebKit::ViewGestureController::activeLoadMonitoringTimerFired): Deleted.
95         (WebKit::ViewGestureController::swipeSnapshotWatchdogTimerFired): Deleted.
96         (WebKit::ViewGestureController::removeSwipeSnapshotAfterRepaint): Deleted.
97         Move shareable snapshot removal code to a new platform-independent ViewGestureController file.
98         Move the ViewGestureController constructor/destructor to the platform-independent file.
99
100         * UIProcess/mac/ViewGestureController.messages.in:
101         * WebKit2.xcodeproj/project.pbxproj:
102
103 2015-08-11  Andy Estes  <aestes@apple.com>
104
105         [Cocoa] Add redirect support to CustomProtocolManager
106         https://bugs.webkit.org/show_bug.cgi?id=147871
107
108         Reviewed by Dan Bernstein.
109         
110         NSURLProtocols have the ability to generate redirect responses. This change teaches CustomProtocolManager how to handle them.
111
112         * Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
113         (WebKit::CustomProtocolManager::wasRedirectedToRequest): Called -URLProtocol:wasRedirectedToRequest:redirectResponse: on the NSURLProtocolClient.
114         * Shared/Network/CustomProtocols/CustomProtocolManager.h:
115         * Shared/Network/CustomProtocols/CustomProtocolManager.messages.in: Defined WasRedirectedToRequest.
116         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
117         (WebKit::CustomProtocolManager::wasRedirectedToRequest): Defined empty function.
118         * UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm:
119         (-[WKCustomProtocolLoader connection:willSendRequest:redirectResponse:]): If a redirect response is received, send WasRedirectedToRequest and return nil to ignore the redirect.
120
121 2015-08-13  Andy Estes  <aestes@apple.com>
122
123         [Cocoa] Downloads do not start if policy decision is made asynchronously
124         https://bugs.webkit.org/show_bug.cgi?id=147985
125
126         Reviewed by Brady Eidson.
127
128         * WebProcess/Network/WebResourceLoader.cpp: Updated to include SubresourceLoader.h.
129         * WebProcess/WebPage/WebFrame.cpp:
130         (WebKit::WebFrame::convertMainResourceLoadToDownload): Started a new download if the main resource loader is not calling didReceiveResponse.
131
132 2015-08-14  Simon Fraser  <simon.fraser@apple.com>
133
134         Speculative fix for iOS build failure.
135
136         * Shared/mac/RemoteLayerTreeTransaction.h:
137
138 2015-08-14  Philippe Normand  <pnormand@igalia.com>
139
140         Unreviewed, remove dead code after r188385.
141
142         * UIProcess/API/gtk/WebKitUserMediaPermissionRequest.cpp:
143         (webkitUserMediaPermissionRequestAllow): Deleted.
144
145 2015-08-14  Carlos Garcia Campos  <cgarcia@igalia.com>
146
147         Unreviewed. Fix the build with !ENABLE(MEDIA_STREAM) after r188385.
148
149         * UIProcess/API/C/WKUserMediaPermissionRequest.cpp:
150         (WKUserMediaPermissionRequestDeviceNamesVideo):
151         (WKUserMediaPermissionRequestDeviceNamesAudio):
152
153 2015-08-14  Carlos Garcia Campos  <cgarcia@igalia.com>
154
155         Unreviewed. Fix GTK+ build after r188386.
156
157         * UIProcess/API/gtk/WebKitWindowProperties.cpp:
158         (webkitWindowPropertiesUpdateFromWebWindowFeatures):
159
160 2015-08-13  Tim Horton  <timothy_horton@apple.com>
161
162         Performing a Lookup on wrapped text puts the popover arrow in the wrong place (off to the right)
163         https://bugs.webkit.org/show_bug.cgi?id=148012
164         <rdar://problem/19238094>
165
166         Reviewed by Simon Fraser.
167
168         * UIProcess/mac/PageClientImpl.mm:
169         (WebKit::PageClientImpl::didPerformDictionaryLookup):
170         * UIProcess/mac/WKImmediateActionController.mm:
171         (-[WKImmediateActionController _animationControllerForText]):
172         Adopt the new SPI, handing it the first text rect, instead of having it
173         guess where to put the popover.
174
175 2015-08-13  Commit Queue  <commit-queue@webkit.org>
176
177         Unreviewed, rolling out r188418.
178         https://bugs.webkit.org/show_bug.cgi?id=148017
179
180         Fix EFL after the rollout of r188404 (Requested by smfr on
181         #webkit).
182
183         Reverted changeset:
184
185         "[CMake] Unreviewed build fix after r188404"
186         http://trac.webkit.org/changeset/188418
187
188 2015-08-13  Commit Queue  <commit-queue@webkit.org>
189
190         Unreviewed, rolling out r188404.
191         https://bugs.webkit.org/show_bug.cgi?id=148014
192
193         Broke 4 API tests (Requested by smfr on #webkit).
194
195         Reverted changeset:
196
197         "Add WKWindowFeaturesRef and a new modern createNewPage UI
198         client callback"
199         https://bugs.webkit.org/show_bug.cgi?id=147989
200         http://trac.webkit.org/changeset/188404
201
202 2015-08-13  Tim Horton  <timothy_horton@apple.com>
203
204         Try to fix the Gtk/EFL build.
205
206         * WebProcess/WebPage/FindController.cpp:
207         (WebKit::FindController::updateFindIndicator):
208
209 2015-08-13  Tim Horton  <timothy_horton@apple.com>
210
211         Refactor and improve TextIndicator to prepare for tests
212         https://bugs.webkit.org/show_bug.cgi?id=147622
213
214         Reviewed by Simon Fraser.
215
216         * Shared/WebCoreArgumentCoders.cpp:
217         (IPC::encodeOptionalImage):
218         (IPC::decodeOptionalImage):
219         (IPC::ArgumentCoder<TextIndicatorData>::encode):
220         (IPC::ArgumentCoder<TextIndicatorData>::decode):
221         Move encode/decodeOptionalImage to their own functions to avoid duplication.
222
223         * UIProcess/API/mac/WKView.mm:
224         (-[WKView _dictionaryLookupPopoverWillClose:]):
225         (-[WKView _setTextIndicator:]):
226         (-[WKView _setTextIndicator:withLifetime:]):
227         (-[WKView _clearTextIndicatorWithAnimation:]):
228         (-[WKView _dismissContentRelativeChildWindows]):
229         (-[WKView _dismissContentRelativeChildWindowsWithAnimation:]):
230         * UIProcess/API/mac/WKViewInternal.h:
231         * UIProcess/PageClient.h:
232         * UIProcess/WebPageProxy.cpp:
233         (WebKit::WebPageProxy::setTextIndicator):
234         * UIProcess/WebPageProxy.h:
235         * UIProcess/ios/PageClientImplIOS.h:
236         * UIProcess/ios/PageClientImplIOS.mm:
237         (WebKit::PageClientImpl::setTextIndicator):
238         (WebKit::PageClientImpl::clearTextIndicator):
239         * UIProcess/mac/PageClientImpl.h:
240         * UIProcess/mac/PageClientImpl.mm:
241         (WebKit::PageClientImpl::setTextIndicator):
242         (WebKit::PageClientImpl::clearTextIndicator):
243         (WebKit::PageClientImpl::didPerformDictionaryLookup):
244         * UIProcess/mac/WKImmediateActionController.mm:
245         (-[WKImmediateActionController _animationControllerForText]):
246         * WebProcess/WebPage/FindController.cpp:
247         (WebKit::FindController::updateFindIndicator):
248         * WebProcess/WebPage/ios/WebPageIOS.mm:
249         (WebKit::WebPage::getPositionInformation):
250         (WebKit::shouldUseTextIndicatorForLink): Deleted.
251         * WebProcess/WebPage/mac/WebPageMac.mm:
252         (WebKit::WebPage::dictionaryPopupInfoForRange):
253         (WebKit::WebPage::performImmediateActionHitTestAtLocation):
254         Adopt TextIndicatorOptions.
255         Adjust to Range method renames.
256
257 2015-08-13  Jaehun Lim  <ljaehun.lim@samsung.com>
258
259         [CMake] Unreviewed build fix after r188404
260
261         * CMakeLists.txt: Add UIProcess/API/APIWindowFeatures.cpp, UIProcess/API/C/WKWindowFeaturesRef.cpp
262
263 2015-08-13  Wenson Hsieh  <wenson_hsieh@apple.com>
264
265         A focused node should not be assisted when handling touch events synchronously
266         https://bugs.webkit.org/show_bug.cgi?id=147836
267         <rdar://problem/22204108>
268
269         Reviewed by Enrica Casucci.
270
271         Makes interaction with touch handlers no longer assist the currently focused element in the
272         general case. Added plumbing to reassist a currently focused node when dispatching touch events,
273         so that an input that programmatically focuses itself and prevents default on a touch event will
274         be properly assisted when it has been programmatically focused (either through Javascript or the
275         autofocus attribute) prior to receiving the touch event. This patch also removes the now
276         unnecessary special-casing of the Gmail settings app that currently makes the keyboard deploy
277         upon autofocus.
278
279         * UIProcess/ios/WKContentViewInteraction.mm:
280         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]): Removed
281             special case to avoid the early return for Gmail Add Account.
282         * WebProcess/WebCoreSupport/WebChromeClient.h: Added a handler for refocusing an element.
283         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
284         (WebKit::WebChromeClient::elementDidRefocus): Makes refocusing an element trigger input
285             assistance on iOS.
286         * WebProcess/WebPage/WebPage.cpp:
287         (WebKit::WebPage::dispatchTouchEvent): Removes logic to focus the currently focused element upon
288             receiving a touch event.
289
290 2015-08-13  Anders Carlsson  <andersca@apple.com>
291
292         Add WKWindowFeaturesRef and a new modern createNewPage UI client callback
293         https://bugs.webkit.org/show_bug.cgi?id=147989
294
295         Reviewed by Tim Horton.
296
297         * Platform/IPC/mac/ConnectionMac.mm:
298         * Shared/API/APIObject.h:
299         * Shared/API/c/WKBase.h:
300         * UIProcess/API/APIWindowFeatures.cpp: Added.
301         * UIProcess/API/APIWindowFeatures.h: Added.
302         * UIProcess/API/C/WKAPICast.h:
303         * UIProcess/API/C/WKPage.cpp:
304         (WKPageSetPageUIClient):
305         * UIProcess/API/C/WKPageUIClient.h:
306         * UIProcess/API/C/WKWindowFeaturesRef.cpp: Added.
307         (WKWindowFeaturesGetTypeID):
308         * UIProcess/API/C/WKWindowFeaturesRef.h: Added.
309         * UIProcess/API/Cocoa/WKWindowFeatures.mm:
310         (-[WKWindowFeatures dealloc]):
311         (-[WKWindowFeatures menuBarVisibility]):
312         (-[WKWindowFeatures statusBarVisibility]):
313         (-[WKWindowFeatures toolbarsVisibility]):
314         (-[WKWindowFeatures allowsResizing]):
315         (-[WKWindowFeatures x]):
316         (-[WKWindowFeatures y]):
317         (-[WKWindowFeatures width]):
318         (-[WKWindowFeatures height]):
319         (-[WKWindowFeatures _apiObject]):
320         (-[WKWindowFeatures _initWithWindowFeatures:]): Deleted.
321         * UIProcess/API/Cocoa/WKWindowFeaturesInternal.h:
322         (WebKit::wrapper):
323         * UIProcess/Cocoa/UIDelegate.mm:
324         (WebKit::UIDelegate::UIClient::createNewPage):
325         * WebKit2.xcodeproj/project.pbxproj:
326
327 2015-08-13  Simon Fraser  <simon.fraser@apple.com>
328
329         FilterOperation.h should not include FilterEffect.h
330         https://bugs.webkit.org/show_bug.cgi?id=147970
331
332         Reviewed by Daniel Bates.
333
334         FilterEffect.h pulls in lots of JSC goop via runtime/Uint8ClampedArray.h,
335         so move its include to FilterOperation.cpp.
336         
337         Causes include bloat because FilterOperation.h is pulled in via RenderStyle.h.
338
339         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
340
341 2015-08-12  Anders Carlsson  <andersca@apple.com>
342
343         Use WTF::Optional in WindowFeatures
344         https://bugs.webkit.org/show_bug.cgi?id=147956
345
346         Reviewed by Sam Weinig.
347
348         * Shared/WebCoreArgumentCoders.cpp:
349         (IPC::ArgumentCoder<WindowFeatures>::encode): Deleted.
350         (IPC::ArgumentCoder<WindowFeatures>::decode): Deleted.
351         * UIProcess/API/C/WKPage.cpp:
352         (WKPageSetPageUIClient):
353         * UIProcess/API/Cocoa/WKWindowFeatures.mm:
354         (-[WKWindowFeatures _initWithWindowFeatures:]):
355
356 2015-08-13  Matthew Daiter  <mdaiter@apple.com>
357
358         Linking device query ability from WebKit2 to clients
359         https://bugs.webkit.org/show_bug.cgi?id=147263
360         <rdar://problem/21983345>
361
362         Reviewed by Jer Noble.
363
364         * Platform/mac/LayerHostingContext.mm:
365         (WebKit::LayerHostingContext::setColorMatchUntaggedContent):
366         (WebKit::LayerHostingContext::colorMatchUntaggedContent):
367         * UIProcess/API/C/WKUserMediaPermissionRequest.cpp:
368         (WKUserMediaPermissionRequestAllow):
369         (WKUserMediaPermissionRequestDeviceNamesVideo):
370         (WKUserMediaPermissionRequestDeviceNamesAudio):
371         * UIProcess/API/C/WKUserMediaPermissionRequest.h:
372         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
373         (WebKit::UserMediaPermissionRequestManagerProxy::didReceiveUserMediaPermissionDecision): Deleted.
374         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
375         * UIProcess/UserMediaPermissionRequestProxy.cpp:
376         (WebKit::UserMediaPermissionRequestProxy::allow):
377         (WebKit::UserMediaPermissionRequestProxy::deny):
378         * UIProcess/UserMediaPermissionRequestProxy.h:
379         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
380         (WebKit::UserMediaPermissionRequestManager::didReceiveUserMediaPermissionDecision):
381
382
383 2015-08-12  Alexey Proskuryakov  <ap@apple.com>
384
385         [Mac] WebKit processes should have access to com.apple.nesessionmanager.flow-divert-token
386         https://bugs.webkit.org/show_bug.cgi?id=147949
387         rdar://problem/22254920
388
389         Reviewed by Anders Carlsson.
390
391         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
392         * WebProcess/com.apple.WebProcess.sb.in:
393
394 2015-08-12  Brian Burg  <bburg@apple.com>
395
396         Web Inspector: CRASH under WebInspector::closeFrontend for some protocol tests
397         https://bugs.webkit.org/show_bug.cgi?id=147948
398
399         Reviewed by Joseph Pecoraro.
400
401         * WebProcess/WebPage/WebInspector.cpp:
402         (WebKit::WebInspector::closeFrontend): Don't invalidate the channel if it's null.
403         * WebProcess/WebPage/WebInspector.h: Add default member variable values.
404
405 2015-08-12  Joseph Pecoraro  <pecoraro@apple.com>
406
407         Web Inspector: Not receiving responses for async request IndexedDB.requestDatabaseNames
408         https://bugs.webkit.org/show_bug.cgi?id=147844
409
410         Reviewed by Brian Burg.
411
412         * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp:
413         (WebKit::WebIDBFactoryBackend::getDatabaseNames):
414         This method should not return without calling either the success
415         or error callbacks. In this case, it can succeed with an empty list.
416
417 2015-08-12  Enrica Casucci  <enrica@apple.com>
418
419         Element interaction should not be canceled when the menu is already being shown.
420         https://bugs.webkit.org/show_bug.cgi?id=147945
421         rdar://problem/22206433
422
423         Reviewed by Beth Dakin.
424
425         When preview is canceled by the action menu gesture, we should not stop interacting
426         with the element, since the information about the element is used for the menu actions.
427         We now expose a new method in the action sheet assistant to know if the action sheed is
428         being shown and we use this as an indication that we should not stop the interaction
429         with the element.
430
431         * UIProcess/ios/WKActionSheetAssistant.h:
432         * UIProcess/ios/WKActionSheetAssistant.mm:
433         (-[WKActionSheetAssistant isShowingSheet]): Added.
434         * UIProcess/ios/WKContentViewInteraction.mm:
435         (-[WKContentView _interactionStoppedFromPreviewItemController:]): Do not stop
436         the interaction if the sheet is being shown.
437
438 2015-08-12  Matt Rajca  <mrajca@apple.com>
439
440         Fixed the Release build when MEDIA_SESSION is enabled.
441
442         * UIProcess/API/C/WKPage.cpp:
443         (WKPageHandleMediaEvent):
444
445 2015-08-07  Matt Rajca  <mrajca@apple.com>
446
447         Media Session: notify the UI process when media controls are enabled/disabled
448         https://bugs.webkit.org/show_bug.cgi?id=147802
449
450         Reviewed by Eric Carlson.
451
452         * UIProcess/WebMediaSessionFocusManager.cpp:
453         (WebKit::WebMediaSessionFocusManager::playbackAttributeDidChange): Generalized to take different attributes.
454         (WebKit::WebMediaSessionFocusManager::mediaElementIsPlayingDidChange): Deleted.
455         * UIProcess/WebMediaSessionFocusManager.h:
456         * UIProcess/WebPageProxy.cpp:
457         (WebKit::WebPageProxy::isPlayingMediaDidChange): Process new attributes for enabling/disabling media controls.
458
459 2015-08-12  Devin Rousso  <drousso@apple.com>
460
461         Web Inspector: Implement selector highlighting for iOS
462         https://bugs.webkit.org/show_bug.cgi?id=147919
463
464         Reviewed by Timothy Hatcher.
465
466         * UIProcess/WKInspectorHighlightView.mm:
467         (-[WKInspectorHighlightView _layoutForNodeHighlight:offset:]):
468         Added offset parameter to start drawing the highlight at that index of the highlight quad list.
469
470         (-[WKInspectorHighlightView _layoutForNodeListHighlight:]):
471         Loops through the highlight quads and draws a new highlight for every 4 highlight quad objects.
472
473         (-[WKInspectorHighlightView update:]):
474         Now uses the light highlighting for both nodes and lists of nodes.
475
476 2015-08-11  Carlos Garcia Campos  <cgarcia@igalia.com>
477
478         NetworkProcess: DNS prefetch happens in the Web Process
479         https://bugs.webkit.org/show_bug.cgi?id=147824
480
481         Reviewed by Alexey Proskuryakov.
482
483         DNS prefetch requests started in the WebProcess should be sent to
484         the network process when it's enabled.
485
486         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
487         (WebKit::NetworkConnectionToWebProcess::prefetchDNS): Do the
488         actual DNS prefetch.
489         * NetworkProcess/NetworkConnectionToWebProcess.h:
490         * NetworkProcess/NetworkConnectionToWebProcess.messages.in: Add
491         PrefetchDNS message.
492         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
493         (webkitWebExtensionDidReceiveMessage): Use WebProcess::prefetchDNS().
494         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
495         (WebKit::WebFrameLoaderClient::prefetchDNS): Ditto.
496         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
497         * WebProcess/WebPage/ios/WebPageIOS.mm:
498         (WebKit::WebPage::sendTapHighlightForNodeIfNecessary): Use
499         FrameLoaderClient to do the DNS prefetch.
500         * WebProcess/WebProcess.cpp:
501         (WebKit::WebProcess::prefetchDNS): Send the request to the network
502         process if it's enabled, otherwise do the actual DNS prefetch.
503         * WebProcess/WebProcess.h:
504
505 2015-08-11  Hunseop Jeong  <hs85.jeong@samsung.com>
506
507         Try to fix the EFL build after r188279
508         https://bugs.webkit.org/show_bug.cgi?id=147917
509
510         Reviewed by Gyuyoung Kim.
511
512         Replaced the WKPageLoaderClient with variable name because it is removed in r188279.
513
514         * UIProcess/efl/PageLoadClientEfl.cpp:
515         (WebKit::PageLoadClientEfl::PageLoadClientEfl):
516         * UIProcess/efl/PagePolicyClientEfl.cpp:
517         (WebKit::PagePolicyClientEfl::PagePolicyClientEfl):
518
519 2015-08-11  Andy Estes  <aestes@apple.com>
520
521         Tried again to fix the iOS build.
522
523         * UIProcess/ios/WKGeolocationProviderIOS.mm:
524         (-[WKGeolocationProviderIOS initWithProcessPool:]):
525
526 2015-08-11  Dan Bernstein  <mitz@apple.com>
527
528         Tried to fix the iOS build.
529
530         * UIProcess/ios/WKGeolocationProviderIOS.mm:
531         (-[WKGeolocationProviderIOS initWithProcessPool:]):
532
533 2015-08-11  Andy Estes  <aestes@apple.com>
534
535         WebFrameLoaderClient::dispatchDecidePolicyForResponse() calls an std::function after it's been moved from
536         https://bugs.webkit.org/show_bug.cgi?id=147873
537
538         Reviewed by Alexey Proskuryakov.
539         
540         I noticed during code inspection that we were calling an std::function after WTF::move() has been called on it.
541         Calling an empty std::function results in a C++ exception being thrown. I don't know how to make a sync IPC
542         message fail, so I'm not sure how to test this.
543
544         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
545         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse): Called didReceivePolicyDecision instead.
546
547 2015-08-11  Beth Dakin  <bdakin@apple.com>
548
549         REGRESSION (r188053): Sometimes unable to save an image from Google Search/
550         imgur via long press
551         https://bugs.webkit.org/show_bug.cgi?id=147896
552
553         Reviewed by Enrica Casucci.
554
555         http://trac.webkit.org/changeset/188053 added code to call cleanupSheet when 
556         the long press gesture is cancelled. However, the gesture will be called with 
557         the cancelled state when then user taps an item in the action sheet (such as 
558         “save image”), and sometimes the “cancel” comes in before the image has been 
559         saved. That is a problem because we need to avoid cleaning up the sheet until 
560         after the image is saved. Before that patch, we never cleaned up the sheet on 
561         cancel, so this patch goes back to that behavior. We also have to remove some 
562         assertions that assume that everything will be totally cleaned up when a new 
563         sheet is created, but that is not necessarily true due to interactions 
564         between the preview gesture and the long press gesture. 
565
566         Remove assertions.
567         * UIProcess/ios/WKActionSheetAssistant.mm:
568         (-[WKActionSheetAssistant _createSheetWithElementActions:showLinkTitle:]):
569         (-[WKActionSheetAssistant showImageSheet]):
570         (-[WKActionSheetAssistant showLinkSheet]):
571         (-[WKActionSheetAssistant showDataDetectorsSheet]):
572
573         Revert the part of Enrica’s patch that called cleanupSheet when the gesture 
574         is cancelled.
575         * UIProcess/ios/WKContentViewInteraction.mm:
576         (-[WKContentView _longPressRecognized:]):
577
578 2015-08-11  Anders Carlsson  <andersca@apple.com>
579
580         Remove unversioned client structs from the C SPI
581         https://bugs.webkit.org/show_bug.cgi?id=147894
582
583         Reviewed by Dan Bernstein.
584
585         * Shared/API/c/WKConnectionRef.h:
586         * UIProcess/API/C/WKContext.h:
587         * UIProcess/API/C/WKContextConnectionClient.h:
588         * UIProcess/API/C/WKContextDownloadClient.h:
589         * UIProcess/API/C/WKContextHistoryClient.h:
590         * UIProcess/API/C/WKContextInjectedBundleClient.h:
591         * UIProcess/API/C/WKCookieManager.h:
592         * UIProcess/API/C/WKDatabaseManager.h:
593         * UIProcess/API/C/WKGeolocationManager.h:
594         * UIProcess/API/C/WKIconDatabase.h:
595         * UIProcess/API/C/WKNotificationProvider.h:
596         * UIProcess/API/C/WKPageContextMenuClient.h:
597         * UIProcess/API/C/WKPageDiagnosticLoggingClient.h:
598         * UIProcess/API/C/WKPageFindClient.h:
599         * UIProcess/API/C/WKPageFindMatchesClient.h:
600         * UIProcess/API/C/WKPageFormClient.h:
601         * UIProcess/API/C/WKPageLoaderClient.h:
602         * UIProcess/API/C/WKPagePolicyClient.h:
603         * UIProcess/API/C/WKPageUIClient.h:
604         * WebProcess/InjectedBundle/API/c/WKBundle.h:
605         * WebProcess/InjectedBundle/API/c/WKBundlePageBanner.h:
606         * WebProcess/InjectedBundle/API/c/WKBundlePageContextMenuClient.h:
607         * WebProcess/InjectedBundle/API/c/WKBundlePageDiagnosticLoggingClient.h:
608         * WebProcess/InjectedBundle/API/c/WKBundlePageEditorClient.h:
609         * WebProcess/InjectedBundle/API/c/WKBundlePageFormClient.h:
610         * WebProcess/InjectedBundle/API/c/WKBundlePageFullScreenClient.h:
611         * WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h:
612         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h:
613         * WebProcess/InjectedBundle/API/c/WKBundlePagePolicyClient.h:
614         * WebProcess/InjectedBundle/API/c/WKBundlePageResourceLoadClient.h:
615         * WebProcess/InjectedBundle/API/c/WKBundlePageUIClient.h:
616
617 2015-08-11  Dan Bernstein  <mitz@apple.com>
618
619         Reverted r188255, because it turned out that delegates do nonot need this information.
620
621         * UIProcess/API/APIUIClient.h:
622         (API::UIClient::footerHeight):
623         (API::UIClient::drawHeader):
624         (API::UIClient::drawFooter):
625         (API::UIClient::printFrame):
626         (API::UIClient::canRunModal):
627         (API::UIClient::runModal):
628         * UIProcess/API/C/WKPage.cpp:
629         (WKPageSetPageUIClient):
630         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
631         * UIProcess/Cocoa/UIDelegate.h:
632         * UIProcess/Cocoa/UIDelegate.mm:
633         (WebKit::UIDelegate::UIDelegate):
634         (WebKit::UIDelegate::setDelegate):
635         (WebKit::UIDelegate::UIClient::reachedApplicationCacheOriginQuota):
636         (WebKit::UIDelegate::UIClient::printFrame):
637         (WebKit::UIDelegate::UIClient::close):
638         * UIProcess/WebPageProxy.cpp:
639         (WebKit::WebPageProxy::runOpenPanel):
640         (WebKit::WebPageProxy::printFrame):
641         (WebKit::WebPageProxy::printMainFrame):
642         (WebKit::WebPageProxy::setMediaVolume):
643         * UIProcess/WebPageProxy.h:
644         (WebKit::WebPageProxy::setShouldSendEventsSynchronously):
645         * UIProcess/WebPageProxy.messages.in:
646         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
647         (WebKit::WebChromeClient::print):
648         (WebKit::WebChromeClient::exceededDatabaseQuota):
649
650 2015-08-11  Dan Bernstein  <mitz@apple.com>
651
652         [Cocoa] The UI delegate can't tell if printing was user-initiated
653         https://bugs.webkit.org/show_bug.cgi?id=147869
654
655         Reviewed by Sam Weinig.
656
657         * UIProcess/API/APIUIClient.h:
658         (API::UIClient::printFrame): Added processingUserGesture argument.
659
660         * UIProcess/API/C/WKPage.cpp:
661         (WKPageSetPageUIClient): Updated for new client function signature.
662
663         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Added userInitiated boolean argument to
664           -_webView:printFrame:.
665
666         * UIProcess/Cocoa/UIDelegate.h: Added bool to m_delegateMethods for the new method.
667         * UIProcess/Cocoa/UIDelegate.mm:
668         (WebKit::UIDelegate::UIDelegate):
669         (WebKit::UIDelegate::setDelegate): Initialized new bool.
670         (WebKit::UIDelegate::UIClient::printFrame): Pass processingUserGesture as the delegate’s
671           userInitiated argument.
672
673         * UIProcess/WebPageProxy.cpp:
674         (WebKit::WebPageProxy::printFrame): Added processingUserGesture argument, passing it along
675           to the client.
676         * UIProcess/WebPageProxy.h:
677
678         * UIProcess/WebPageProxy.messages.in: Added processingUserGesture argument to printFrame.
679
680         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
681         (WebKit::WebChromeClient::print): Pass new argument.
682
683 2015-08-10  Matthew Daiter  <mdaiter@apple.com>
684
685         Add MediaDeviceIdentifier to WebsiteDataTypes
686         https://bugs.webkit.org/show_bug.cgi?id=147853
687
688         Reviewed by Jer Noble.
689
690         * Shared/WebsiteData/WebsiteDataTypes.h:
691
692 2015-08-10  Sam Weinig  <sam@webkit.org>
693
694         Try to fix the 32-bit build.
695
696         * UIProcess/API/mac/WKViewInternal.h:
697
698 2015-08-08  Sam Weinig  <sam@webkit.org>
699
700         Replace WebPageConfiguration with API::PageConfiguration and expose a C-SPI accessor for it
701         https://bugs.webkit.org/show_bug.cgi?id=147811
702
703         Reviewed by Darin Adler.
704
705         - Adds the missing pieces from WebPageConfiguration into API::PageConfiguration.
706         - Adds C-SPI to set and get the WebsiteDataStore on the WKPageConfigurationRef.
707         - Uses API::PageConfiguration to pass configuration information from WKWebView/WKView 
708           to WebPageProxy.
709         - Stores the API::PageConfiguration on the WebPageProxy and exposes a new C-SPI function,
710           WKPageCopyPageConfiguration, to get a copy of it.
711
712         * UIProcess/API/APIPageConfiguration.cpp:
713         (API::PageConfiguration::create):
714         (API::PageConfiguration::PageConfiguration):
715         (API::PageConfiguration::~PageConfiguration):
716         (API::PageConfiguration::copy):
717         (API::PageConfiguration::processPool):
718         (API::PageConfiguration::setRelatedPage):
719         (API::PageConfiguration::visitedLinkProvider):
720         (API::PageConfiguration::setVisitedLinkProvider):
721         (API::PageConfiguration::websiteDataStore):
722         (API::PageConfiguration::setWebsiteDataStore):
723         (API::PageConfiguration::sessionID):
724         (API::PageConfiguration::setSessionID):
725         (API::PageConfiguration::webPageConfiguration): Deleted.
726         * UIProcess/API/APIPageConfiguration.h:
727         (API::PageConfiguration::preferenceValues):
728         (API::PageConfiguration::treatsSHA1SignedCertificatesAsInsecure):
729         (API::PageConfiguration::setTreatsSHA1SignedCertificatesAsInsecure):
730         (API::PageConfiguration::alwaysRunsAtForegroundPriority):
731         (API::PageConfiguration::setAlwaysRunsAtForegroundPriority):
732         (API::PageConfiguration::create): Deleted.
733         * UIProcess/API/C/WKPage.cpp:
734         (WKPageGetPageGroup):
735         (WKPageCopyPageConfiguration):
736         (WKPageLoadURL):
737         * UIProcess/API/C/WKPage.h:
738         * UIProcess/API/C/WKPageConfigurationRef.cpp:
739         (WKPageConfigurationSetRelatedPage):
740         (WKPageConfigurationGetWebsiteDataStore):
741         (WKPageConfigurationSetWebsiteDataStore):
742         * UIProcess/API/C/WKPageConfigurationRef.h:
743         * UIProcess/API/Cocoa/WKWebView.mm:
744         (-[WKWebView initWithFrame:configuration:]):
745         * UIProcess/API/ios/WKViewIOS.mm:
746         (-[WKView _commonInitializationWithContextRef:pageGroupRef:relatedToPage:]):
747         * UIProcess/API/mac/WKView.mm:
748         (-[WKView _setPrimaryTrackingArea:]):
749         (-[WKView initWithFrame:processPool:configuration:webView:]):
750         (-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]):
751         (-[WKView initWithFrame:configurationRef:]):
752         (-[WKView wantsUpdateLayer]):
753         * UIProcess/API/mac/WKViewInternal.h:
754         * UIProcess/WebPageProxy.cpp:
755         (WebKit::WebPageProxy::create):
756         (WebKit::WebPageProxy::WebPageProxy):
757         (WebKit::WebPageProxy::~WebPageProxy):
758         (WebKit::WebPageProxy::configuration):
759         (WebKit::WebPageProxy::processIdentifier):
760         * UIProcess/WebPageProxy.h:
761         (WebKit::WebPageProxy::pageID):
762         (WebKit::WebPageProxy::sessionID):
763         * UIProcess/WebProcessPool.cpp:
764         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
765         (WebKit::WebProcessPool::createWebPage):
766         (WebKit::WebProcessPool::download):
767         * UIProcess/WebProcessPool.h:
768         * UIProcess/WebProcessProxy.cpp:
769         (WebKit::WebProcessProxy::webPage):
770         (WebKit::WebProcessProxy::createWebPage):
771         * UIProcess/WebProcessProxy.h:
772         (WebKit::WebProcessProxy::processPool):
773         * UIProcess/ios/WKContentView.h:
774         * UIProcess/ios/WKContentView.mm:
775         (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
776         (-[WKContentView initWithFrame:processPool:configuration:webView:]):
777         (-[WKContentView initWithFrame:processPool:configuration:wkView:]):
778         (-[WKContentView dealloc]):
779
780 2015-08-10  Commit Queue  <commit-queue@webkit.org>
781
782         Unreviewed, rolling out r187131 and r187286.
783         https://bugs.webkit.org/show_bug.cgi?id=147839
784
785          Causing mroe frequent crashes with invalid layer bounds
786         (rdar://problem/21465328) (Requested by smfr on #webkit).
787
788         Reverted changesets:
789
790         "[iOS] Menu drop down such as on nike.com does not stay"
791         https://bugs.webkit.org/show_bug.cgi?id=147047
792         http://trac.webkit.org/changeset/187131
793
794         "[iOS] REGRESSION (187131): Loading CuteOverload zooms in to
795         the top left corner."
796         https://bugs.webkit.org/show_bug.cgi?id=147251
797         http://trac.webkit.org/changeset/187286
798
799 2015-08-07  Matt Rajca  <mrajca@apple.com>
800
801         Media Session: generalize isFocusedContentMediaElementPlaying so it works with other playback attributes
802         https://bugs.webkit.org/show_bug.cgi?id=147797
803
804         Reviewed by Simon Fraser.
805
806         * UIProcess/API/C/WKMediaSessionFocusManager.cpp:
807         (WKMediaSessionFocusManagerValueForPlaybackAttribute):
808         (WKMediaSessionFocusManagerIsFocusedContentMediaElementPlaying): Deleted.
809         * UIProcess/API/C/WKMediaSessionFocusManager.h:
810         * UIProcess/WebMediaSessionFocusManager.cpp:
811         (WebKit::WebMediaSessionFocusManager::valueForPlaybackAttribute):
812         (WebKit::WebMediaSessionFocusManager::mediaControlIsEnabledDidChange):
813         (WebKit::WebMediaSessionFocusManager::isFocusedContentMediaElementPlaying): Deleted.
814         (WebKit::WebMediaSessionFocusManager::mediaElementIsPlayingDidChange): Deleted.
815         * UIProcess/WebMediaSessionFocusManager.h:
816
817 2015-08-10  Zan Dobersek  <zdobersek@igalia.com>
818
819         [CoordinatedGraphics] Fix forward declarations of CoordinatedGraphicsLayerState, ViewportAttributes
820         https://bugs.webkit.org/show_bug.cgi?id=147823
821
822         Reviewed by Carlos Garcia Campos.
823
824         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
825         * WebProcess/WebPage/LayerTreeHost.h:
826
827 2015-08-10  Carlos Garcia Campos  <cgarcia@igalia.com>
828
829         [GTK] Crash when the web view is destroyed while the screensaver DBUs proxy is being created
830         https://bugs.webkit.org/show_bug.cgi?id=147780
831
832         Reviewed by Sergio Villar Senin.
833
834         We should cancel the screenSaverInhibitCancellable on
835         dispose. Also use adoptGRef() when creating the cancellable object
836         to not leak it.
837
838         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
839         (webkitWebViewBaseDispose):
840         (webkitWebViewBaseSendInhibitMessageToScreenSaver):
841         (webkitWebViewBaseInhibitScreenSaver):
842
843 2015-08-09  Chris Dumez  <cdumez@apple.com>
844
845         Follow-up nit fixes after r187691.
846         https://bugs.webkit.org/show_bug.cgi?id=128006
847
848         Reviewed by Gavin Barraclough.
849
850         Use modern for-loops instead of explicit iterators.
851
852         * Shared/Authentication/AuthenticationManager.cpp:
853         (WebKit::AuthenticationManager::shouldCoalesceChallenge):
854         (WebKit::AuthenticationManager::coalesceChallengesMatching):
855
856 2015-08-07  Filip Pizlo  <fpizlo@apple.com>
857
858         Lightweight locks should be adaptive
859         https://bugs.webkit.org/show_bug.cgi?id=147545
860
861         Reviewed by Geoffrey Garen.
862
863         * WebProcess/WebPage/EventDispatcher.cpp:
864         (WebKit::EventDispatcher::clearQueuedTouchEventsForPage):
865         (WebKit::EventDispatcher::getQueuedTouchEventsForPage):
866         (WebKit::EventDispatcher::touchEvent):
867         (WebKit::EventDispatcher::dispatchTouchEvents):
868         * WebProcess/WebPage/EventDispatcher.h:
869         * WebProcess/WebPage/ViewUpdateDispatcher.cpp:
870         (WebKit::ViewUpdateDispatcher::visibleContentRectUpdate):
871         (WebKit::ViewUpdateDispatcher::dispatchVisibleContentRectUpdate):
872         * WebProcess/WebPage/ViewUpdateDispatcher.h:
873
874 2015-08-07  Wenson Hsieh  <wenson_hsieh@apple.com>
875
876         Temporarily allow programmatic input assistance for adding Gmail account
877         https://bugs.webkit.org/show_bug.cgi?id=147792
878
879         Reviewed by Enrica Casucci.
880         <rdar://problem/22126518>
881
882         Temporary fix for keyboard input sliding out and immediately back in upon user interaction
883         in the Gmail 2-factor authentication page.
884
885         * UIProcess/ios/WKContentViewInteraction.mm:
886         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]): Early
887             return no longer triggers due to lack of user interaction when adding a new Gmail account
888             through Settings.
889
890 2015-08-07  Brady Eidson  <beidson@apple.com>
891
892         Move concrete KeyedDecoder/Encoder implementations to WebCore.
893         https://bugs.webkit.org/show_bug.cgi?id=147757.
894
895         Rubberstamped by Andy Estes.
896
897         * DatabaseProcess/IndexedDB/IDBSerialization.cpp:
898         (WebKit::serializeIDBKeyPath):
899         (WebKit::deserializeIDBKeyPath):
900         (WebKit::serializeIDBKeyData):
901         (WebKit::deserializeIDBKeyData):
902         
903         * PlatformEfl.cmake:
904         * PlatformGTK.cmake:
905         * WebKit2.xcodeproj/project.pbxproj:
906
907 2015-08-07  Carlos Garcia Campos  <cgarcia@igalia.com>
908
909         Unreviewed. Fix GTK+ compile warning also introduced in r188121.
910
911         * UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequest.cpp:
912         (webkit_install_missing_media_plugins_permission_request_get_description):
913
914 2015-08-07  Carlos Garcia Campos  <cgarcia@igalia.com>
915
916         Unreviewed. Fix GTK+ debug build after r188121.
917
918         * UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequest.cpp:
919         (webkit_install_missing_media_plugins_permission_request_get_description):
920
921 2015-08-07  Carlos Garcia Campos  <cgarcia@igalia.com>
922
923         [GStreamer] Do not automatically show PackageKit codec installation notifications
924         https://bugs.webkit.org/show_bug.cgi?id=135973
925
926         Reviewed by Philippe Normand.
927
928         Add InstallMissingMediaPluginsPermissionRequest to ask the API
929         layer whether to allow or deny the installation of missing media
930         plugins. And add a GTK+ implementation based on current permission
931         request API. Replace the
932         PageClientImpl::createGstInstallPluginsContext() with
933         decicePolicyForInstallMissingMediaPluginsPermissionRequest() that
934         passes the InstallMissingMediaPluginsPermissionRequest object to
935         the API layer. The allow method receives the
936         GstInstallPluginsContext now, so that it can be created by the API implementation.
937
938         * PlatformEfl.cmake:
939         * PlatformGTK.cmake:
940         * UIProcess/API/gtk/PageClientImpl.cpp:
941         (WebKit::PageClientImpl::decicePolicyForInstallMissingMediaPluginsPermissionRequest):
942         * UIProcess/API/gtk/PageClientImpl.h:
943         * UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequest.cpp: Added.
944         (createGstInstallPluginsContext):
945         (webkitInstallMissingMediaPluginsPermissionRequestAllow):
946         (webkitInstallMissingMediaPluginsPermissionRequestDeny):
947         (webkit_permission_request_interface_init):
948         (webkitInstallMissingMediaPluginsPermissionRequestDispose):
949         (webkit_install_missing_media_plugins_permission_request_class_init):
950         (webkitInstallMissingMediaPluginsPermissionRequestCreate):
951         (webkit_install_missing_media_plugins_permission_request_get_description):
952         * UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequest.h: Added.
953         * UIProcess/API/gtk/WebKitInstallMissingMediaPluginsPermissionRequestPrivate.h: Added.
954         * UIProcess/API/gtk/WebKitWebView.cpp:
955         (webkitWebViewRequestInstallMissingMediaPlugins):
956         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
957         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
958         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types:
959         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
960         * UIProcess/API/gtk/webkit2.h:
961         * UIProcess/PageClient.h:
962         * UIProcess/WebPageProxy.h:
963         * UIProcess/WebPageProxy.messages.in:
964         * UIProcess/efl/WebViewEfl.h:
965         * UIProcess/gstreamer/InstallMissingMediaPluginsPermissionRequest.cpp: Copied from Source/WebKit2/UIProcess/gstreamer/WebPageProxyGStreamer.cpp.
966         (WebKit::InstallMissingMediaPluginsPermissionRequest::InstallMissingMediaPluginsPermissionRequest):
967         (WebKit::InstallMissingMediaPluginsPermissionRequest::~InstallMissingMediaPluginsPermissionRequest):
968         (WebKit::InstallMissingMediaPluginsPermissionRequest::allow):
969         (WebKit::InstallMissingMediaPluginsPermissionRequest::deny):
970         (WebKit::InstallMissingMediaPluginsPermissionRequest::didEndRequestInstallMissingMediaPlugins):
971         * UIProcess/gstreamer/InstallMissingMediaPluginsPermissionRequest.h: Copied from Source/WebKit2/WebProcess/WebPage/gstreamer/WebPageGStreamer.cpp.
972         (WebKit::InstallMissingMediaPluginsPermissionRequest::create):
973         (WebKit::InstallMissingMediaPluginsPermissionRequest::page):
974         (WebKit::InstallMissingMediaPluginsPermissionRequest::details):
975         (WebKit::InstallMissingMediaPluginsPermissionRequest::description):
976         * UIProcess/gstreamer/WebPageProxyGStreamer.cpp:
977         (WebKit::WebPageProxy::requestInstallMissingMediaPlugins):
978         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
979         (WebKit::WebChromeClient::requestInstallMissingMediaPlugins):
980         * WebProcess/WebCoreSupport/WebChromeClient.h:
981         * WebProcess/WebPage/WebPage.h:
982         * WebProcess/WebPage/gstreamer/WebPageGStreamer.cpp:
983         (WebKit::WebPage::requestInstallMissingMediaPlugins):
984
985 2015-08-06  Beth Dakin  <bdakin@apple.com>
986
987         TextIndicator can have stale contentImage data and crash
988         https://bugs.webkit.org/show_bug.cgi?id=147770
989         -and corresponding-
990         rdar://problem/22181735
991
992         Reviewed by Tim Horton.
993
994         If there is no contentImage or contentImageWithHighlight, set them to 
995         nullptr.
996         * Shared/WebCoreArgumentCoders.cpp:
997         (IPC::ArgumentCoder<TextIndicatorData>::decode):
998
999 2015-08-06  Dan Bernstein  <mitz@apple.com>
1000
1001         Fixed all the builds after trying to fix the non-HAVE(LINK_PREVIEW) build.
1002
1003         * UIProcess/ios/WKContentViewInteraction.mm:
1004
1005 2015-08-06  Dan Bernstein  <mitz@apple.com>
1006
1007         Fixed the non-HAVE(LINK_PREVIEW) build.
1008
1009         * UIProcess/ios/WKContentViewInteraction.mm:
1010
1011 2015-08-06  Enrica Casucci  <enrica@apple.com>
1012
1013         Cleanup action sheet only when long press is canceled (non ended).
1014         https://bugs.webkit.org/show_bug.cgi?id=147766
1015         rdar://problem/22181842
1016
1017         Reviewed by Tim Horton.
1018
1019         * UIProcess/ios/WKContentViewInteraction.mm:
1020         (-[WKContentView _longPressRecognized:]):
1021
1022 2015-08-06  Matt Rajca  <mrajca@apple.com>
1023
1024         Media Session: notify focus manager clients when the playing state of the focused media element changes
1025         https://bugs.webkit.org/show_bug.cgi?id=147745
1026
1027         Reviewed by Tim Horton.
1028
1029         Added plumbing to allow focus manager's clients to be notified when the focused Content media element begins
1030         playing or is paused.
1031
1032         * UIProcess/API/C/WKMediaSessionFocusManager.cpp:
1033         (WKMediaSessionFocusManagerSetClient):
1034         * UIProcess/API/C/WKMediaSessionFocusManager.h:
1035         * UIProcess/WebMediaSessionFocusManager.cpp:
1036         (WebKit::WebMediaSessionFocusManager::initializeClient):
1037         (WebKit::WebMediaSessionFocusManager::mediaElementIsPlayingDidChange):
1038         * UIProcess/WebMediaSessionFocusManager.h:
1039         * UIProcess/WebMediaSessionFocusManagerClient.cpp:
1040         (WebKit::WebMediaSessionFocusManagerClient::didChangePlaybackAttribute):
1041         * UIProcess/WebMediaSessionFocusManagerClient.h:
1042         * WebKit2.xcodeproj/project.pbxproj:
1043
1044 2015-08-06  Alex Christensen  <achristensen@webkit.org>
1045
1046         Make CMake usable on Mac.
1047         https://bugs.webkit.org/show_bug.cgi?id=147756
1048
1049         Reviewed by Tim Horton.
1050
1051         * PlatformMac.cmake:
1052         DatabaseProcess_SOURCES needs something in order to not have errors when generating build systems from CMake.
1053         This doesn't fix everything, but it can now be used to build jsc again.
1054
1055 2015-08-06  Enrica Casucci  <enrica@apple.com>
1056
1057         Build fix for iOS after http://trac.webkit.org/changeset/188053.
1058
1059         Unreviewed.
1060
1061         * UIProcess/ios/WKContentViewInteraction.mm:
1062         (-[WKContentView _registerPreview]):
1063
1064 2015-08-06  Enrica Casucci  <enrica@apple.com>
1065
1066         Allow long press to cancel link preview.
1067         https://bugs.webkit.org/show_bug.cgi?id=147743
1068         rdar://problem/22128839
1069
1070         Reviewed by Tim Horton.
1071
1072         We should be able to show the context menu at the beginnig of link preview.
1073
1074         * UIProcess/ios/WKContentViewInteraction.h:
1075         * UIProcess/ios/WKContentViewInteraction.mm:
1076         (-[WKContentView _removeDefaultGestureRecognizers]):
1077         (-[WKContentView _addDefaultGestureRecognizers]):
1078         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
1079         (-[WKContentView _longPressRecognized:]):
1080         (-[WKContentView _singleTapRecognized:]):
1081         (-[WKContentView _registerPreview]):
1082         (-[WKContentView _unregisterPreview]):
1083
1084 2015-08-06  Matt Rajca  <mrajca@apple.com>
1085
1086         Media Session: rename isFocusedContentMediaElementPaused and get rid of callback
1087         https://bugs.webkit.org/show_bug.cgi?id=147726
1088
1089         Reviewed by Simon Fraser.
1090
1091         - isFocusedContentMediaElementPaused should be renamed to isFocusedContentMediaElementPlaying to match recent
1092           refactoring work.
1093         - isFocusedContentMediaElementPlaying itself does not need a callback anymore because the value can be returned
1094           directly.
1095
1096         * UIProcess/API/C/WKMediaSessionFocusManager.cpp:
1097         (WKMediaSessionFocusManagerIsFocusedContentMediaElementPlaying): Removed callback and renamed from...
1098         (WKMediaSessionFocusManagerIsFocusedContentMediaElementPaused): Deleted.
1099         * UIProcess/API/C/WKMediaSessionFocusManager.h:
1100         * UIProcess/WebMediaSessionFocusManager.cpp:
1101         (WebKit::WebMediaSessionFocusManager::isFocusedContentMediaElementPlaying): Removed callback and renamed from...
1102         (WebKit::WebMediaSessionFocusManager::isFocusedContentMediaElementPaused): Deleted.
1103         * UIProcess/WebMediaSessionFocusManager.h:
1104
1105 2015-08-06  Csaba Osztrogonác  <ossy@webkit.org>
1106
1107         [EFL] Bump EFL version to 1.15.0
1108         https://bugs.webkit.org/show_bug.cgi?id=147450
1109
1110         Reviewed by Gyuyoung Kim.
1111
1112         * PlatformEfl.cmake:
1113
1114 2015-08-06  Carlos Garcia Campos  <cgarcia@igalia.com>
1115
1116         [GTK] Crash closing a page when a context menu is open
1117         https://bugs.webkit.org/show_bug.cgi?id=147682
1118
1119         Reviewed by Sergio Villar Senin.
1120
1121         Implement WebContextMenuProxy::cancelTracking() to clear the
1122         internal menu when the web page is closed.
1123
1124         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
1125         (WebKit::WebContextMenuProxyGtk::cancelTracking):
1126         (WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk): Deleted.
1127         * UIProcess/gtk/WebContextMenuProxyGtk.h:
1128
1129 2015-08-04  Matt Rajca  <mrajca@apple.com>
1130
1131         Media Session: push paused state to the media session focus manager instead of polling
1132         https://bugs.webkit.org/show_bug.cgi?id=147633
1133
1134         Reviewed by Simon Fraser.
1135
1136         * UIProcess/WebMediaSessionFocusManager.cpp:
1137         (WebKit::WebMediaSessionFocusManager::isFocusedContentMediaElementPaused): Report whether the focused media
1138          element is currently playing. The callback is no longer necessary and will be removed in a future patch in
1139          favor of returning a value directly.
1140         (WebKit::WebMediaSessionFocusManager::mediaElementIsPlayingDidChange): Keep track of whether the focused media
1141          element is currently playing.
1142         * UIProcess/WebMediaSessionFocusManager.h:
1143         * UIProcess/WebPageProxy.cpp:
1144         (WebKit::WebPageProxy::isPlayingMediaDidChange): If the focused media element begins/ends playing, keep track
1145          of its playing state.
1146         (WebKit::WebPageProxy::isMediaElementPaused): Deleted. We now push media playback state changes instead of
1147          polling.
1148         * UIProcess/WebPageProxy.h: isPlayingMediaDidChange is now passed the ID of the media element that triggered
1149          the 'playing' state change. This can be used in conjunction with the IsSourcePlaying media flag to identify
1150          whether the source element begin/ended playing.
1151         * UIProcess/WebPageProxy.messages.in: Ditto.
1152         * WebProcess/Plugins/PluginView.cpp:
1153         (WebKit::PluginView::setPluginIsPlayingAudio): Since a media element did not trigger this, pass in 0 for the
1154          source media element.
1155         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1156         (WebKit::WebChromeClient::isPlayingMediaDidChange): isPlayingMediaDidChange is now passed the ID of the media
1157          element that triggered the 'playing' state change.
1158         * WebProcess/WebCoreSupport/WebChromeClient.h: Ditto.
1159         * WebProcess/WebPage/WebPage.cpp:
1160         (WebKit::WebPage::isMediaElementPaused): Deleted. We now push media playback state changes instead of polling.
1161         * WebProcess/WebPage/WebPage.h: Ditto.
1162         * WebProcess/WebPage/WebPage.messages.in: Ditto.
1163
1164 2015-08-05  Tim Horton  <timothy_horton@apple.com>
1165
1166         PDFPlugins are clipped in link previews (and remain so when opened)
1167         https://bugs.webkit.org/show_bug.cgi?id=147708
1168         <rdar://problem/22055130>
1169
1170         Reviewed by Simon Fraser.
1171
1172         * UIProcess/API/mac/WKView.mm:
1173         (-[WKView initWithFrame:processPool:configuration:webView:]):
1174         (-[WKView _supportsArbitraryLayoutModes]):
1175         (-[WKView _didCommitLoadForMainFrame]):
1176         (-[WKView _setLayoutMode:]):
1177         (-[WKView _setViewScale:]):
1178         Avoid using any layout mode other than "ViewSize" for main frame PluginDocuments,
1179         because they will often end up behaving incorrectly (especially with PDFPlugin,
1180         which is even more special in that it takes over application of page scale).
1181
1182         Save any incoming changes to the viewScale and layoutMode, and re-apply
1183         them once we load something in the main frame that is *not* a PluginDocument.
1184
1185         * UIProcess/API/mac/WKViewInternal.h:
1186         * WebProcess/WebPage/WebPage.cpp:
1187         (WebKit::WebPage::scalePage):
1188         Make sure to reset WebCore's page scale if the main frame contains a 
1189         PluginDocument that takes care of page scale itself.
1190
1191         (WebKit::WebPage::didCommitLoad):
1192         Do the same thing as what we do in WKView _didCommitLoadForMainFrame,
1193         but without the UI process round-trip, to avoid an ugly flash.
1194
1195         * UIProcess/WebFrameProxy.cpp:
1196         (WebKit::WebFrameProxy::didCommitLoad):
1197         * UIProcess/WebFrameProxy.h:
1198         (WebKit::WebFrameProxy::containsPluginDocument):
1199         * UIProcess/WebPageProxy.cpp:
1200         (WebKit::WebPageProxy::didCommitLoadForFrame):
1201         * UIProcess/WebPageProxy.h:
1202         * UIProcess/WebPageProxy.messages.in:
1203         * UIProcess/mac/PageClientImpl.mm:
1204         (WebKit::PageClientImpl::didCommitLoadForMainFrame):
1205         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1206         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
1207         Plumb and keep track of whether the main frame contains a PluginDocument or not.
1208
1209 2015-08-05  Filip Pizlo  <fpizlo@apple.com>
1210
1211         Unreviewed, roll out http://trac.webkit.org/changeset/187972.
1212
1213         * DatabaseProcess/DatabaseProcess.cpp:
1214         (WebKit::DatabaseProcess::postDatabaseTask):
1215         (WebKit::DatabaseProcess::performNextDatabaseTask):
1216         * DatabaseProcess/DatabaseProcess.h:
1217         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
1218         (WebKit::UniqueIDBDatabase::shutdown):
1219         (WebKit::UniqueIDBDatabase::postMainThreadTask):
1220         (WebKit::UniqueIDBDatabase::performNextMainThreadTask):
1221         (WebKit::UniqueIDBDatabase::postDatabaseTask):
1222         (WebKit::UniqueIDBDatabase::performNextDatabaseTask):
1223         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
1224         * Platform/IPC/Connection.cpp:
1225         (IPC::Connection::sendSyncMessage):
1226         (IPC::Connection::sendSyncMessageFromSecondaryThread):
1227         (IPC::Connection::waitForSyncReply):
1228         (IPC::Connection::processIncomingSyncReply):
1229         (IPC::Connection::connectionDidClose):
1230         * Platform/IPC/Connection.h:
1231         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1232         (WebKit::CoordinatedGraphicsScene::appendUpdate):
1233         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1234         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1235         (WebKit::ThreadedCompositor::createCompositingThread):
1236         (WebKit::ThreadedCompositor::runCompositingThread):
1237         (WebKit::ThreadedCompositor::terminateCompositingThread):
1238         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1239         * Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
1240         (WebKit::CustomProtocolManager::addCustomProtocol):
1241         (WebKit::CustomProtocolManager::removeCustomProtocol):
1242         (WebKit::CustomProtocolManager::registerScheme):
1243         (WebKit::CustomProtocolManager::unregisterScheme):
1244         (WebKit::CustomProtocolManager::supportsScheme):
1245         (WebKit::CustomProtocolManager::protocolForID):
1246         * Shared/Network/CustomProtocols/CustomProtocolManager.h:
1247         * Shared/linux/SeccompFilters/SeccompBroker.cpp:
1248         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
1249         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
1250         (WebKit::PluginProcessConnectionManager::removePluginProcessConnection):
1251         (WebKit::PluginProcessConnectionManager::pluginProcessCrashed):
1252         * WebProcess/Plugins/PluginProcessConnectionManager.h:
1253         * WebProcess/WebPage/EventDispatcher.cpp:
1254         (WebKit::EventDispatcher::addScrollingTreeForPage):
1255         (WebKit::EventDispatcher::removeScrollingTreeForPage):
1256         (WebKit::EventDispatcher::wheelEvent):
1257         * WebProcess/WebPage/EventDispatcher.h:
1258         * WebProcess/soup/WebKitSoupRequestInputStream.cpp:
1259         (webkitSoupRequestInputStreamReadAsync):
1260         (webkitSoupRequestInputStreamAddData):
1261
1262 2015-08-05  Ryosuke Niwa  <rniwa@webkit.org>
1263
1264         WebInspectorProxy should make WKWebView first responder
1265         https://bugs.webkit.org/show_bug.cgi?id=147676
1266
1267         Reviewed by Timothy Hatcher.
1268
1269         Revert r181927 now that WKWebView forwards the first responder role to WKView as needed.
1270
1271         * UIProcess/mac/WebInspectorProxyMac.mm:
1272         (WebKit::WebInspectorProxy::platformBringToFront):
1273         (WebKit::WebInspectorProxy::platformAttach):
1274
1275 2015-08-04  Filip Pizlo  <fpizlo@apple.com>
1276
1277         Rename Mutex to DeprecatedMutex
1278         https://bugs.webkit.org/show_bug.cgi?id=147675
1279
1280         Reviewed by Geoffrey Garen.
1281
1282         * DatabaseProcess/DatabaseProcess.cpp:
1283         (WebKit::DatabaseProcess::postDatabaseTask):
1284         (WebKit::DatabaseProcess::performNextDatabaseTask):
1285         * DatabaseProcess/DatabaseProcess.h:
1286         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.cpp:
1287         (WebKit::UniqueIDBDatabase::shutdown):
1288         (WebKit::UniqueIDBDatabase::postMainThreadTask):
1289         (WebKit::UniqueIDBDatabase::performNextMainThreadTask):
1290         (WebKit::UniqueIDBDatabase::postDatabaseTask):
1291         (WebKit::UniqueIDBDatabase::performNextDatabaseTask):
1292         * DatabaseProcess/IndexedDB/UniqueIDBDatabase.h:
1293         * Platform/IPC/Connection.cpp:
1294         (IPC::Connection::sendSyncMessage):
1295         (IPC::Connection::sendSyncMessageFromSecondaryThread):
1296         (IPC::Connection::waitForSyncReply):
1297         (IPC::Connection::processIncomingSyncReply):
1298         (IPC::Connection::connectionDidClose):
1299         * Platform/IPC/Connection.h:
1300         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1301         (WebKit::CoordinatedGraphicsScene::appendUpdate):
1302         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1303         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1304         (WebKit::ThreadedCompositor::createCompositingThread):
1305         (WebKit::ThreadedCompositor::runCompositingThread):
1306         (WebKit::ThreadedCompositor::terminateCompositingThread):
1307         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1308         * Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
1309         (WebKit::CustomProtocolManager::addCustomProtocol):
1310         (WebKit::CustomProtocolManager::removeCustomProtocol):
1311         (WebKit::CustomProtocolManager::registerScheme):
1312         (WebKit::CustomProtocolManager::unregisterScheme):
1313         (WebKit::CustomProtocolManager::supportsScheme):
1314         (WebKit::CustomProtocolManager::protocolForID):
1315         * Shared/Network/CustomProtocols/CustomProtocolManager.h:
1316         * Shared/linux/SeccompFilters/SeccompBroker.cpp:
1317         * WebProcess/Plugins/PluginProcessConnectionManager.cpp:
1318         (WebKit::PluginProcessConnectionManager::getPluginProcessConnection):
1319         (WebKit::PluginProcessConnectionManager::removePluginProcessConnection):
1320         (WebKit::PluginProcessConnectionManager::pluginProcessCrashed):
1321         * WebProcess/Plugins/PluginProcessConnectionManager.h:
1322         * WebProcess/WebPage/EventDispatcher.cpp:
1323         (WebKit::EventDispatcher::addScrollingTreeForPage):
1324         (WebKit::EventDispatcher::removeScrollingTreeForPage):
1325         (WebKit::EventDispatcher::wheelEvent):
1326         * WebProcess/WebPage/EventDispatcher.h:
1327         * WebProcess/soup/WebKitSoupRequestInputStream.cpp:
1328         (webkitSoupRequestInputStreamReadAsync):
1329         (webkitSoupRequestInputStreamAddData):
1330
1331 2015-08-05  Daniel Bates  <dabates@apple.com>
1332
1333         REGRESSION (r185111): Clicking phone numbers doesn't prompt to call sometimes
1334         https://bugs.webkit.org/show_bug.cgi?id=147678
1335         <rdar://problem/21827815>
1336
1337         Reviewed by Brady Eidson.
1338
1339         Teach WebKit to save and restore the "should open external URLs" policy.
1340
1341         * Shared/SessionState.cpp:
1342         (WebKit::isValidEnum): Added.
1343         (WebKit::PageState::encode): Modified to encode the "should open external URLs" policy.
1344         (WebKit::PageState::decode): Modified to decode the "should open external URLs" policy.
1345         * Shared/SessionState.h: Added ShouldOpenExternalURLsPolicy to PageState (defaults to WebCore::ShouldOpenExternalURLsPolicy::ShouldNotAllow).
1346         * UIProcess/API/Cocoa/WKWebView.mm:
1347         (-[WKWebView _killWebContentProcessAndResetState]): Added; used in the unit test TestWebKitAPI/Tests/WebKit2Cocoa/ShouldOpenExternalURLsInNewWindowActions.mm.
1348         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Declare -[WKWebView _killWebContentProcessAndResetState].
1349         * UIProcess/mac/LegacySessionStateCoding.cpp: Defined constant sessionHistoryEntryShouldOpenExternalURLsPolicyKey.
1350         (WebKit::encodeSessionHistory): Modified to encode the "should open external URLs" policy.
1351         (WebKit::decodeSessionHistoryEntry): Modified to decode the "should open external URLs" policy.
1352         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
1353         (WebKit::toPageState): Copy "should open external URLs" policy from specified history item.
1354         (WebKit::toHistoryItem): Apply "should open external URLs" policy from PageState to HistoryItem.
1355
1356 2015-08-04  Antti Koivisto  <antti@apple.com>
1357
1358         Network cache fetches should have timeout
1359         https://bugs.webkit.org/show_bug.cgi?id=147631
1360
1361         Reviewed by Andreas Kling.
1362
1363         System might be under heavy I/O pressure. If it takes long time to get data from disk we should load from network instead.
1364
1365         This patch introduces 1.5s timeout for disk reads. If the last dispatched cache read takes longer than that we cancel all
1366         active and pending reads and just load those resources from network.
1367
1368         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1369         (WebKit::NetworkCache::Storage::ReadOperation::ReadOperation):
1370         (WebKit::NetworkCache::Storage::ReadOperation::cancel):
1371         (WebKit::NetworkCache::Storage::ReadOperation::finish):
1372
1373             Factor to functions.
1374
1375         (WebKit::NetworkCache::Storage::Storage):
1376         (WebKit::NetworkCache::Storage::updateFileModificationTime):
1377         (WebKit::NetworkCache::Storage::dispatchReadOperation):
1378         (WebKit::NetworkCache::Storage::finishReadOperation):
1379         (WebKit::NetworkCache::Storage::cancelAllReadOperations):
1380         (WebKit::NetworkCache::Storage::dispatchPendingReadOperations):
1381         (WebKit::NetworkCache::Storage::dispatchPendingWriteOperations):
1382
1383             Also make dispatch functions transfer the operation ownership.
1384
1385         (WebKit::NetworkCache::shouldStoreBodyAsBlob):
1386         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
1387         * NetworkProcess/cache/NetworkCacheStorage.h:
1388
1389 2015-08-04  Matt Rajca  <mrajca@apple.com>
1390
1391         Media Session: add a focus manager that WebKit clients can use to access the focused media element
1392         https://bugs.webkit.org/show_bug.cgi?id=147629
1393
1394         Reviewed by Tim Horton.
1395
1396         * Shared/API/APIObject.h: Added a new type for the focus manager.
1397         * Shared/API/c/WKBase.h: Added a new type for the focus manager.
1398         * UIProcess/API/C/WKAPICast.h: Added a new type for the focus manager.
1399         * UIProcess/API/C/WKContext.cpp: The "global" focus manager is accessed via WKContext.
1400         (WKContextGetMediaSessionFocusManager):
1401         * UIProcess/API/C/WKContext.h:
1402         * UIProcess/API/C/WKMediaSessionFocusManager.cpp: Added C wrapper for WebMediaSessionFocusManager.
1403         (WKMediaSessionFocusManagerGetTypeID):
1404         (WKMediaSessionFocusManagerIsFocusedContentMediaElementPaused):
1405         * UIProcess/API/C/WKMediaSessionFocusManager.h: Added C wrapper for WebMediaSessionFocusManager.
1406         * UIProcess/WebMediaSessionFocusManager.cpp: Added to keep track of the focused media element in the UI process and let clients query this state.
1407         (WebKit::WebMediaSessionFocusManager::supplementName):
1408         (WebKit::WebMediaSessionFocusManager::create):
1409         (WebKit::WebMediaSessionFocusManager::WebMediaSessionFocusManager):
1410         (WebKit::WebMediaSessionFocusManager::refWebContextSupplement):
1411         (WebKit::WebMediaSessionFocusManager::derefWebContextSupplement):
1412         (WebKit::WebMediaSessionFocusManager::isFocusedContentMediaElementPaused): Check if the media element on the focused page is paused.
1413         (WebKit::WebMediaSessionFocusManager::setFocusedMediaElement): Keep track of the focused page / media element pair.
1414         (WebKit::WebMediaSessionFocusManager::clearFocusedMediaElement): Reset the focused page / media element pair.
1415         * UIProcess/WebMediaSessionFocusManager.h: Added.
1416         * UIProcess/WebPageProxy.cpp:
1417         (WebKit::WebPageProxy::isMediaElementPaused): Updated to take a UnsignedCallback.
1418         (WebKit::WebPageProxy::focusedContentMediaElementDidChange): Store the focused media element in the focus manager.
1419         * UIProcess/WebPageProxy.h:
1420         * UIProcess/WebProcessPool.cpp: Added WebMediaSessionFocusManager as a supplement.
1421         * UIProcess/WebProcessPool.h: WebMediaSessionFocusManager is a supplement, so include its header.
1422         * WebKit2.xcodeproj/project.pbxproj: Added new sources and ran sort-xcode-project.
1423
1424 2015-08-04  Anders Carlsson  <andersca@apple.com>
1425
1426         Get rid of ReasonForCallingAllowPlugins since it's not used anywhere
1427         https://bugs.webkit.org/show_bug.cgi?id=147648
1428
1429         Reviewed by Andreas Kling.
1430
1431         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1432         (WebKit::WebFrameLoaderClient::objectContentType):
1433         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1434         (WebKit::WebPlatformStrategies::getPluginInfo):
1435         * WebProcess/WebPage/WebPage.cpp:
1436         (WebKit::WebPage::createPlugin):
1437         (WebKit::WebPage::canPluginHandleResponse):
1438         (WebKit::WebPage::canShowMIMEType):
1439
1440 2015-08-04  Alexey Proskuryakov  <ap@apple.com>
1441
1442         Implement NPAPI redirect handling
1443         https://bugs.webkit.org/show_bug.cgi?id=138675
1444         rdar://problem/15779101
1445
1446         Patch by Jeffrey Pfau, updated and tweaked by me.
1447
1448         Reviewed by Anders Carlsson.
1449
1450         * PluginProcess/PluginControllerProxy.cpp:
1451         (WebKit::PluginControllerProxy::loadURL):
1452         (WebKit::PluginControllerProxy::continueStreamLoad):
1453         (WebKit::PluginControllerProxy::cancelStreamLoad):
1454         (WebKit::PluginControllerProxy::didEvaluateJavaScript):
1455         (WebKit::PluginControllerProxy::streamWillSendRequest):
1456         (WebKit::PluginControllerProxy::streamDidReceiveResponse):
1457         * PluginProcess/PluginControllerProxy.h:
1458         * PluginProcess/PluginControllerProxy.messages.in:
1459         * WebProcess/Network/WebResourceLoader.cpp:
1460         (WebKit::WebResourceLoader::willSendRequest):
1461         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1462         (WebKit::NPN_ConvertPoint):
1463         (WebKit::NPN_URLRedirectResponse):
1464         (WebKit::initializeBrowserFuncs):
1465         (WebKit::netscapeBrowserFuncs):
1466         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
1467         (WebKit::NetscapePlugin::getAuthenticationInfo):
1468         (WebKit::NetscapePlugin::registerRedirect):
1469         (WebKit::NetscapePlugin::urlRedirectResponse):
1470         (WebKit::NetscapePlugin::setIsPlayingAudio):
1471         (WebKit::NetscapePlugin::NPP_URLNotify):
1472         (WebKit::NetscapePlugin::NPP_URLRedirectNotify):
1473         (WebKit::NetscapePlugin::NPP_GetValue):
1474         (WebKit::NetscapePlugin::didEvaluateJavaScript):
1475         (WebKit::NetscapePlugin::streamWillSendRequest):
1476         (WebKit::NetscapePlugin::streamDidReceiveResponse):
1477         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
1478         * WebProcess/Plugins/Netscape/NetscapePluginStream.cpp:
1479         (WebKit::NetscapePluginStream::~NetscapePluginStream):
1480         (WebKit::NetscapePluginStream::willSendRequest):
1481         (WebKit::NetscapePluginStream::didReceiveResponse):
1482         (WebKit::NetscapePluginStream::stop):
1483         (WebKit::NetscapePluginStream::setURL):
1484         (WebKit::NetscapePluginStream::cancel):
1485         * WebProcess/Plugins/Netscape/NetscapePluginStream.h:
1486         (WebKit::NetscapePluginStream::streamID):
1487         (WebKit::NetscapePluginStream::npStream):
1488         * WebProcess/Plugins/PDF/PDFPlugin.h:
1489         * WebProcess/Plugins/Plugin.h:
1490         * WebProcess/Plugins/PluginController.h:
1491         * WebProcess/Plugins/PluginProxy.cpp:
1492         (WebKit::PluginProxy::didEvaluateJavaScript):
1493         (WebKit::PluginProxy::streamWillSendRequest):
1494         (WebKit::PluginProxy::streamDidReceiveResponse):
1495         (WebKit::PluginProxy::setPluginIsPlayingAudio):
1496         (WebKit::PluginProxy::continueStreamLoad):
1497         (WebKit::PluginProxy::cancelStreamLoad):
1498         * WebProcess/Plugins/PluginProxy.h:
1499         * WebProcess/Plugins/PluginProxy.messages.in:
1500         * WebProcess/Plugins/PluginView.cpp:
1501         (WebKit::PluginView::Stream::streamID):
1502         (WebKit::PluginView::Stream::Stream):
1503         (WebKit::PluginView::Stream::cancel):
1504         (WebKit::PluginView::Stream::continueLoad):
1505         (WebKit::buildHTTPHeaders):
1506         (WebKit::lastModifiedDateMS):
1507         (WebKit::PluginView::Stream::willSendRequest):
1508         (WebKit::PluginView::Stream::didReceiveResponse):
1509         (WebKit::PluginView::cancelStreamLoad):
1510         (WebKit::PluginView::continueStreamLoad):
1511         (WebKit::PluginView::cancelManualStreamLoad):
1512         * WebProcess/Plugins/PluginView.h:
1513
1514 2015-08-04  Chris Dumez  <cdumez@apple.com>
1515
1516         Unreviewed, rolling out r187812.
1517
1518         This is not safe
1519
1520         Reverted changeset:
1521
1522         "[WK2] Reserve Vector capacity in VectorArgumentCoder<false,
1523         T, inlineCapacity>::decode()"
1524         https://bugs.webkit.org/show_bug.cgi?id=147619
1525         http://trac.webkit.org/changeset/187812
1526
1527 2015-08-03  Chris Dumez  <cdumez@apple.com>
1528
1529         [WK2] Reserve Vector capacity in VectorArgumentCoder<false, T, inlineCapacity>::decode()
1530         https://bugs.webkit.org/show_bug.cgi?id=147619
1531
1532         Reviewed by Andreas Kling.
1533
1534         Reserve Vector capacity in VectorArgumentCoder<false, T, inlineCapacity>::decode()
1535         as we know the size of the Vector in advance.
1536
1537         * Platform/IPC/ArgumentCoders.h:
1538
1539 2015-08-03  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1540
1541         [CoordinatedGraphics] Rearrange uses of USE_COORDINATED_GRAPHICS_MULTIPROCESS
1542         https://bugs.webkit.org/show_bug.cgi?id=147256
1543
1544         Reviewed by Benjamin Poulain.
1545
1546         Reduce uses of USE_COORDINATED_GRAPHICS_MULTIPROCESS guard in order to fix build
1547         breaks when USE_COORDINATED_GRAPHICS_MULTIPROCESS is off. This is first step to switch
1548         between multiprocess model to thread model.
1549
1550         * PlatformEfl.cmake:
1551         * Shared/DrawingAreaInfo.h:
1552         * UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
1553         (WKViewFindZoomableAreaForRect):
1554         * UIProcess/CoordinatedGraphics/CoordinatedDrawingAreaProxy.cpp:
1555         (WebKit::CoordinatedDrawingAreaProxy::CoordinatedDrawingAreaProxy):
1556         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp:
1557         (WebKit::CoordinatedLayerTreeHostProxy::commitCoordinatedGraphicsState):
1558         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h:
1559         * UIProcess/CoordinatedGraphics/PageViewportController.cpp:
1560         (WebKit::PageViewportController::pageTransitionViewportReady):
1561         * UIProcess/CoordinatedGraphics/WebPageProxyCoordinatedGraphics.cpp:
1562         * UIProcess/CoordinatedGraphics/WebView.cpp:
1563         * UIProcess/CoordinatedGraphics/WebView.h:
1564         * UIProcess/WebPageProxy.cpp:
1565         (WebKit::WebPageProxy::commitPageTransitionViewport):
1566         * UIProcess/WebPageProxy.h:
1567         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.cpp:
1568         (WebKit::CoordinatedDrawingArea::CoordinatedDrawingArea):
1569         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedDrawingArea.h:
1570         * WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp:
1571         * WebProcess/WebPage/DrawingAreaImpl.cpp:
1572         (WebKit::DrawingAreaImpl::DrawingAreaImpl):
1573         * WebProcess/WebPage/DrawingAreaImpl.h:
1574         * WebProcess/WebPage/LayerTreeHost.cpp:
1575         (WebKit::LayerTreeHost::create):
1576         * WebProcess/WebPage/WebPage.cpp:
1577         (WebKit::WebPage::sendViewportAttributesChanged):
1578         (WebKit::WebPage::pageDidRequestScroll):
1579         * WebProcess/WebPage/WebPage.h:
1580         * WebProcess/WebPage/WebPage.messages.in:
1581
1582 2015-08-03  Matt Rajca  <mrajca@apple.com>
1583
1584         Media Session: let UI clients query whether a media element is paused
1585         https://bugs.webkit.org/show_bug.cgi?id=147588
1586
1587         Reviewed by Tim Horton.
1588
1589         Added plumbing to determine if a page's media element is paused.
1590
1591         * UIProcess/WebPageProxy.cpp:
1592         (WebKit::WebPageProxy::isMediaElementPaused):
1593         * UIProcess/WebPageProxy.h:
1594         * WebProcess/WebPage/WebPage.cpp:
1595         (WebKit::WebPage::isMediaElementPaused):
1596         * WebProcess/WebPage/WebPage.h:
1597         * WebProcess/WebPage/WebPage.messages.in:
1598
1599 2015-08-03  Chris Dumez  <cdumez@apple.com>
1600
1601         Make sure error handling code APIUserContentExtensionStore closes open file descriptors
1602         https://bugs.webkit.org/show_bug.cgi?id=147562
1603
1604         Reviewed by Alex Christensen.
1605
1606         Make sure error handling code APIUserContentExtensionStore closes open
1607         file descriptors to avoid leaking them.
1608
1609         * NetworkProcess/cache/NetworkCacheData.cpp:
1610         (WebKit::NetworkCache::adoptAndMapFile):
1611         * UIProcess/API/APIUserContentExtensionStore.cpp:
1612         (API::compiledToFile):
1613
1614 2015-08-03  Beth Dakin  <bdakin@apple.com>
1615
1616         Need WKWebView API to enable/disable link preview
1617         https://bugs.webkit.org/show_bug.cgi?id=147573
1618         -and corresponding-
1619         rdar://problem/22077836
1620
1621         Reviewed by Dan Bernstein.
1622
1623         WKView implementation.
1624         * UIProcess/API/Cocoa/WKViewPrivate.h:
1625
1626         New API. Call into WKView to handle Mac.
1627         * UIProcess/API/Cocoa/WKWebView.h:
1628         * UIProcess/API/Cocoa/WKWebView.mm:
1629         (-[WKWebView initWithFrame:configuration:]):
1630         (-[WKWebView allowsLinkPreview]):
1631         (-[WKWebView setAllowsLinkPreview:]):
1632
1633         Remove the SPI declaration from WKWebViewPrivate in order to make this API.
1634         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1635
1636         Handle the Mac side.
1637         * UIProcess/API/mac/WKView.mm:
1638         (-[WKView viewDidMoveToWindow]):
1639         (-[WKView initWithFrame:processPool:configuration:webView:]):
1640         (-[WKView allowsBackForwardNavigationGestures]):
1641         (-[WKView allowsLinkPreview]):
1642         (-[WKView setAllowsLinkPreview:]):
1643
1644         Don’t register previews when link preview is prevented.
1645         * UIProcess/ios/WKContentViewInteraction.mm:
1646         (-[WKContentView _registerPreview]):
1647
1648 2015-08-03  Tim Horton  <timothy_horton@apple.com>
1649
1650         [iOS] Link previews sometimes don't hide the link highlight
1651         https://bugs.webkit.org/show_bug.cgi?id=147585
1652         <rdar://problem/22119648>
1653
1654         Reviewed by Beth Dakin.
1655
1656         * UIProcess/ios/WKContentViewInteraction.mm:
1657         (-[WKContentView _interactionStartedFromPreviewItemController:]):
1658         (-[WKContentView _interactionStoppedFromPreviewItemController:]):
1659         (-[WKContentView _previewItemController:didDismissPreview:committing:]):
1660         (-[WKContentView _previewItemController:willPresentPreview:forPosition:inSourceView:]): Deleted.
1661         Use interactionStarted/Stopped, which are always called, instead of didDismiss/willPresent,
1662         which are only called if we return a custom view controller from _presentedViewControllerForPreviewItemController.
1663         We continue using didDismiss to inform clients of dismissal because they'll
1664         only care if they customized the view controller.
1665
1666 2015-08-03  Chris Dumez  <cdumez@apple.com>
1667
1668         [WK2][NetworkCache] Do not munmap() on the main thread
1669         https://bugs.webkit.org/show_bug.cgi?id=147569
1670
1671         Reviewed by Geoffrey Garen.
1672
1673         Do not munmap() on the main thread for performance reasons and
1674         consistency as we already make sure to mmap() on another thread.
1675
1676         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
1677         (WebKit::NetworkCache::Data::adoptMap):
1678
1679 2015-08-03  Wenson Hsieh  <wenson_hsieh@apple.com>
1680
1681         Inputs with the autofocus attribute cause the keyboard to not deploy
1682         https://bugs.webkit.org/show_bug.cgi?id=147555
1683         <rdar://problem/22018044>
1684
1685         Reviewed by Andreas Kling.
1686
1687         Upon submitting a form by pressing "Go" on the keyboard, an <input> on the next page with the
1688         autofocus attribute may become non-interactible. When attempting to tap on the input, nothing
1689         seems to happen. This is because the state of WebPage upon invoking WebPage::elementDidFocus
1690         indicates (incorrectly) that the input element is already focused, and therefore hits an early
1691         return. To solve this, we explicitly reset m_hasFocusedDueToUserInteraction upon transitioning
1692         to a new page.
1693
1694         * WebProcess/WebPage/WebPage.cpp:
1695         (WebKit::WebPage::didStartPageTransition): On iOS, resets m_hasFocusedDueToUserInteraction as
1696             well. It was previously thought that this would be handled by blur() called on the assisted
1697             element when submitting a form. However, pressing "Go" on the iOS keyboard is an implicit
1698             submission and does not trigger a blur event.
1699
1700 2015-08-03  Chris Dumez  <cdumez@apple.com>
1701
1702         Fix error handling case in Cache::dumpContentsToFile()
1703         https://bugs.webkit.org/show_bug.cgi?id=147567
1704
1705         Reviewed by Andreas Kling.
1706
1707         Cache::dumpContentsToFile() was expecting openFile() to return 0 in case
1708         of error. However, it returns invalidPlatformFileHandle, which is -1 on
1709         Unix.
1710
1711         * NetworkProcess/cache/NetworkCache.cpp:
1712         (WebKit::NetworkCache::Cache::dumpContentsToFile):
1713
1714 2015-08-03  Chris Dumez  <cdumez@apple.com>
1715
1716         Make sure WebMemorySampler doesn't leak file descriptor
1717         https://bugs.webkit.org/show_bug.cgi?id=147564
1718
1719         Reviewed by Anders Carlsson.
1720
1721         WebMemorySampler was opening files but never closing them.
1722
1723         * Shared/WebMemorySampler.cpp:
1724         (WebKit::WebMemorySampler::stop):
1725         * Shared/WebMemorySampler.h:
1726
1727 2015-08-03  Carlos Garcia Campos  <cgarcia@igalia.com>
1728
1729         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.9.5 release.
1730
1731         * gtk/NEWS: Add release notes for 2.9.5.
1732
1733 2015-07-27  Matt Rajca  <mrajca@apple.com>
1734
1735         Media Session: inform the UI process when the focused Content media element changes
1736         https://bugs.webkit.org/show_bug.cgi?id=147323
1737
1738         Reviewed by Tim Horton.
1739
1740         * UIProcess/WebPageProxy.cpp:
1741         (WebKit::WebPageProxy::isPlayingMediaDidChange):
1742         * UIProcess/WebPageProxy.h:
1743         * UIProcess/WebPageProxy.messages.in:
1744         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1745         (WebKit::WebChromeClient::focusedContentMediaElementDidChange):
1746         * WebProcess/WebCoreSupport/WebChromeClient.h:
1747
1748 2015-07-31  Chris Dumez  <cdumez@apple.com>
1749
1750         Drop dummy Timer callbacks
1751         https://bugs.webkit.org/show_bug.cgi?id=147516
1752
1753         Reviewed by Alexey Proskuryakov.
1754
1755         Drop dummy Timer callbacks in the code base. A lot of Timer callbacks
1756         do nothing else beside calling a particular method. In such case, we
1757         can use the called method as Timer callback instead.
1758
1759         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
1760         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
1761         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
1762         (WebKit::RemoteLayerTreeDrawingArea::layerFlushTimerFired): Deleted.
1763
1764 2015-07-31  Chris Dumez  <cdumez@apple.com>
1765
1766         [WK2][NetworkCache] Drop HTTP method from NetworkCache::Key
1767         https://bugs.webkit.org/show_bug.cgi?id=143348
1768
1769         Reviewed by Antti Koivisto.
1770
1771         Drop HTTP method from NetworkCache::Key as we only cache GET responses
1772         for now. Even when we start caching HEAD responses, we likely will not
1773         want the method to be part of the key because:
1774         - A HEAD response can be used to update the headers of a previously cached response to GET
1775         - A cached GET response may be used to satisfy subsequent HEAD requests
1776
1777         * NetworkProcess/cache/NetworkCache.cpp:
1778         (WebKit::NetworkCache::makeCacheKey):
1779         * NetworkProcess/cache/NetworkCacheKey.cpp:
1780         (WebKit::NetworkCache::Key::Key):
1781         (WebKit::NetworkCache::Key::operator==):
1782         (WebKit::NetworkCache::Key::decode):
1783         (WebKit::NetworkCache::Key::operator=): Deleted.
1784         (WebKit::NetworkCache::Key::computeHash): Deleted.
1785         (WebKit::NetworkCache::Key::encode): Deleted.
1786         * NetworkProcess/cache/NetworkCacheKey.h:
1787         (WebKit::NetworkCache::Key::method): Deleted.
1788
1789 2015-07-31  Chris Dumez  <cdumez@apple.com>
1790
1791         Coalesce concurrent authentication challenges for the same ProtectionSpace
1792         https://bugs.webkit.org/show_bug.cgi?id=147496
1793         <rdar://problem/16839069>
1794
1795         Reviewed by Alexey Proskuryakov.
1796
1797         Coalesce concurrent authentication challenges for the same ProtectionSpace.
1798         Ideally, this would be done in the network layer but short term, this will
1799         make sure the user no longer gets repeating authentication dialogs for the
1800         same protection space.
1801
1802         This gets rid of a long-standing bug in WebKit / Safari where visiting a
1803         site using HTTP authentication would pop up one authentication dialog for
1804         each subresource being loaded from the network (especially when the main
1805         resource is loaded from the cache).
1806
1807         * Shared/Authentication/AuthenticationManager.cpp:
1808         (WebKit::canCoalesceChallenge):
1809         (WebKit::AuthenticationManager::addChallengeToChallengeMap):
1810         (WebKit::AuthenticationManager::shouldCoalesceChallenge):
1811         (WebKit::AuthenticationManager::coalesceChallengesMatching):
1812         (WebKit::AuthenticationManager::didReceiveAuthenticationChallenge):
1813         (WebKit::AuthenticationManager::useCredentialForChallenge):
1814         (WebKit::AuthenticationManager::useCredentialForSingleChallenge):
1815         (WebKit::AuthenticationManager::continueWithoutCredentialForChallenge):
1816         (WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
1817         (WebKit::AuthenticationManager::cancelChallenge):
1818         (WebKit::AuthenticationManager::cancelSingleChallenge):
1819         (WebKit::AuthenticationManager::performDefaultHandling):
1820         (WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
1821         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinue):
1822         (WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
1823         (WebKit::AuthenticationManager::AuthenticationManager): Deleted.
1824         * Shared/Authentication/AuthenticationManager.h:
1825
1826 2015-07-31  Joseph Pecoraro  <pecoraro@apple.com>
1827
1828         Unreviewed parameter name typo fix.
1829
1830         * UIProcess/API/Cocoa/WKPreferences.mm:
1831         (-[WKPreferences _setHiddenPageDOMTimerThrottlingEnabled:]):
1832
1833 2015-07-31  Carlos Garcia Campos  <cgarcia@igalia.com>
1834
1835         [GTK] NPAPI code crashes on Wayland
1836         https://bugs.webkit.org/show_bug.cgi?id=147297
1837
1838         Reviewed by Žan Doberšek.
1839
1840         Do not crete NPAPI plugins when runing on Wayland, since they are
1841         not supported. ENABLE_NETSCAPE_PLUGIN_API option used to be
1842         incompatible with building with the Wayland target, but now that
1843         we allow to build X11 and Wayland targets at the same time, we
1844         need runtime checks to avoid creating NPAPI plugins in Wayland.
1845
1846         * UIProcess/API/gtk/WebKitSettings.cpp:
1847         (webkit_settings_set_enable_plugins): Do not allow to change the
1848         setting when running in Wayland.
1849         * UIProcess/gtk/WebPreferencesGtk.cpp:
1850         (WebKit::WebPreferences::platformInitializeStore): Initialize
1851         EnablePlugins preference to false when running in Wayland.
1852
1853 2015-07-30  Joseph Pecoraro  <pecoraro@apple.com>
1854
1855         LayoutTests/inspector frequently run slow and timeout when run in WebKit2 but not WebKit1
1856         https://bugs.webkit.org/show_bug.cgi?id=147456
1857
1858         Reviewed by Timothy Hatcher.
1859
1860         By default, WebKit2 WebPage's on PLATFORM(COCOA) enabling DOM Timer
1861         throttling. Under testing, this ends up impacting Web Inspector
1862         tests that create their own WKWebView which never gets displayed
1863         and so gets throttled. Disable throttling on the Inspector's view
1864         during testing.
1865
1866         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1867         * UIProcess/API/Cocoa/WKPreferences.mm:
1868         (-[WKPreferences _hiddenPageDOMTimerThrottlingEnabled]):
1869         (-[WKPreferences _setHiddenPageDOMTimerThrottlingEnabled:]):
1870         SPI to toggle DOM timer throttling.
1871
1872         * UIProcess/WebInspectorProxy.cpp:
1873         (WebKit::WebInspectorProxy::createInspectorPage):
1874         * UIProcess/WebInspectorProxy.h:
1875         (WebKit::WebInspectorProxy::isUnderTest):
1876         Provide a way to get if we are under test, and set it before
1877         calling into the platform method.
1878
1879         * UIProcess/mac/WebInspectorProxyMac.mm:
1880         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
1881         When testing, disable timer throttling.
1882
1883 2015-07-30  Eric Carlson  <eric.carlson@apple.com>
1884
1885         [iOS] Set AirPlay discovery mode to disabled when page is hidden
1886         https://bugs.webkit.org/show_bug.cgi?id=147455
1887
1888         Reviewed by Enrica Casucci.
1889
1890         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
1891         (-[WKAirPlayRoutePicker _dismissAirPlayRoutePickerIPad]): Set discovery mode to disabled after
1892           the picker has been closed.
1893         (-[WKAirPlayRoutePicker showAirPlayPickerIPhone:]): Ditto.
1894
1895 2015-07-29  Dean Jackson  <dino@apple.com>
1896
1897         Don't use (Details) when exposing SPI
1898         https://bugs.webkit.org/show_bug.cgi?id=147426
1899         <rdar://problem/22062407>
1900
1901         Reviewed by Dan Bernstein.
1902
1903         If we are declaring the interface without any implementation,
1904         we should use class extensions.
1905
1906         * Platform/spi/ios/AssertionServicesSPI.h:
1907         * Platform/spi/ios/CorePDFSPI.h:
1908         * Platform/spi/ios/DataDetectorsUISPI.h:
1909         * Platform/spi/ios/ManagedConfigurationSPI.h:
1910         * Platform/spi/ios/UIKitSPI.h:
1911         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
1912         * Shared/Network/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
1913         * UIProcess/_WKWebViewPrintFormatter.mm:
1914         * UIProcess/mac/WebPageProxyMac.mm:
1915
1916 2015-07-30  Chris Dumez  <cdumez@apple.com>
1917
1918         [WK2][NetworkCache] Stop closing files on the main thread
1919         https://bugs.webkit.org/show_bug.cgi?id=147410
1920
1921         Reviewed by Andreas Kling.
1922
1923         After r186510, we no longer open cache files on the main thread.
1924         However, we still close them on the main thread. This patch makes
1925         sure we close the files on another thread instead.
1926
1927         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1928         (WebKit::NetworkCache::IOChannel::IOChannel):
1929
1930 2015-07-30  Simon Fraser  <simon.fraser@apple.com>
1931
1932         Convert Path applier to use std::function
1933         https://bugs.webkit.org/show_bug.cgi?id=147368
1934
1935         Reviewed by Sam Weinig.
1936
1937         Use std::function for Path::apply().
1938
1939         * Shared/WebCoreArgumentCoders.cpp:
1940         (IPC::pathEncodeApplierFunction):
1941         (IPC::ArgumentCoder<Path>::encode):
1942         (IPC::pathPointCountApplierFunction): Deleted.
1943
1944 2015-07-30  Joonghun Park  <jh718.park@samsung.com>
1945
1946         [EFL] Enable IndexedDB based on DatabaseProcess
1947         https://bugs.webkit.org/show_bug.cgi?id=147221
1948
1949         Reviewed by Csaba Osztrogonác.
1950
1951         * DatabaseProcess/efl/DatabaseProcessMainEfl.cpp: Add ecore_init().
1952         Without this call, it leads to crash when launching DatabaseProcess.
1953         * PlatformEfl.cmake: Add missing include_directory.
1954         * Shared/efl/ProcessExecutablePathEfl.cpp:
1955         (WebKit::executablePathOfDatabaseProcess):
1956         * UIProcess/Launcher/efl/ProcessLauncherEfl.cpp:
1957         (WebKit::ProcessLauncher::launchProcess):
1958         * UIProcess/efl/WebProcessPoolEfl.cpp:
1959         (WebKit::WebProcessPool::legacyPlatformDefaultIndexedDBDatabaseDirectory):
1960         Add default path for indexedDB sqlite3 db file.
1961
1962 2015-07-30  Chris Dumez  <cdumez@apple.com>
1963
1964         Minimize children vector capacity changes in PlatformCALayerRemote::recursiveBuildTransaction()
1965         https://bugs.webkit.org/show_bug.cgi?id=147446
1966
1967         Reviewed by Simon Fraser.
1968
1969         Minimize children vector capacity changes in PlatformCALayerRemote::recursiveBuildTransaction()
1970         by leveraging the fact that we know in advance how many layer IDs are going to be added. We
1971         now set the Vector size from the start, instead of clearing it and then growing the vector
1972         capacity when appending the layer IDs one by one.
1973
1974         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1975         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
1976
1977 2015-07-30  Chris Dumez  <cdumez@apple.com>
1978
1979         Mark more classes as fast allocated
1980         https://bugs.webkit.org/show_bug.cgi?id=147440
1981
1982         Reviewed by Sam Weinig.
1983
1984         Mark more classes as fast allocated for performance. We heap-allocate
1985         objects of those types throughout the code base.
1986
1987         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1988         * NetworkProcess/cache/NetworkCacheStorage.h:
1989         * Platform/IPC/MessageRecorder.h:
1990         * Platform/mac/LayerHostingContext.h:
1991
1992 2015-07-29  Andy VanWagoner  <thetalecrafter@gmail.com>
1993
1994         Implement basic types for ECMAScript Internationalization API
1995         https://bugs.webkit.org/show_bug.cgi?id=146926
1996
1997         Reviewed by Benjamin Poulain.
1998
1999         * Configurations/FeatureDefines.xcconfig: Enabled INTL.
2000
2001 2015-07-29  Chris Dumez  <cdumez@apple.com>
2002
2003         [WK2] Use FastMalloc in IPC::MessageDecoder
2004         https://bugs.webkit.org/show_bug.cgi?id=147425
2005
2006         Reviewed by Sam Weinig.
2007
2008         Use FastMalloc in IPC::MessageDecoder instead of system malloc, for
2009         performance reasons and consistency.
2010
2011         * Platform/IPC/ArgumentDecoder.cpp:
2012         (IPC::ArgumentDecoder::~ArgumentDecoder):
2013         (IPC::ArgumentDecoder::initialize):
2014
2015 2015-07-29  Enrica Casucci  <enrica@apple.com>
2016
2017         Preview should not start if touch handler prevents default.
2018         https://bugs.webkit.org/show_bug.cgi?id=147423
2019         rdar://problem/22061043
2020
2021         Reviewed by Tim Horton.
2022
2023         We need to check if _highlightLongPressCanClick has not been reset before
2024         we allow the preview. It can be reset by a touch handler preventing default.
2025
2026         * UIProcess/ios/WKContentViewInteraction.mm:
2027         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
2028
2029 2015-07-29  Chris Fleizach  <cfleizach@apple.com>
2030
2031         AX: iOS: VoiceOver hangs indefinitely when an JS alert appears
2032         https://bugs.webkit.org/show_bug.cgi?id=147386
2033
2034         Reviewed by Dan Bernstein.
2035
2036         Make sure this also builds on iOS8.
2037
2038         * Platform/IPC/mac/ConnectionMac.mm:
2039
2040 2015-07-29  Michael Catanzaro  <mcatanzaro@igalia.com>
2041
2042         [Seccomp] Further improvements to default web process policy
2043         https://bugs.webkit.org/show_bug.cgi?id=142987
2044
2045         Provide various helper functions to allow more flexible construction of
2046         filesystem access policies.
2047
2048         Reviewed by Žan Doberšek.
2049
2050         Improve the policy. Also, remove ifdefs to reduce potential for breakage in non-default
2051         configurations.
2052
2053         * Shared/linux/SeccompFilters/SyscallPolicy.cpp:
2054         (WebKit::SyscallPolicy::addDefaultWebProcessPolicy):
2055
2056 2015-07-29  Chris Dumez  <cdumez@apple.com>
2057
2058         Avoid unnecessarily constructing PlatformMediaSessionManager on Document destruction
2059         https://bugs.webkit.org/show_bug.cgi?id=147398
2060
2061         Reviewed by Jer Noble.
2062
2063         Only call PlatformMediaSessionManager::stopAllMediaPlaybackForProcess() in
2064         destructors if an PlatformMediaSessionManager instance already exists, to 
2065         avoid constructing one unecessarily at that point.
2066
2067         * WebProcess/WebProcess.cpp:
2068         (WebKit::WebProcess::didClose):
2069
2070 2015-07-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2071
2072         [GTK] Add API to set the maximum number of web processes per WebKitWebContext
2073         https://bugs.webkit.org/show_bug.cgi?id=147108
2074
2075         Reviewed by Gustavo Noronha Silva.
2076
2077         * UIProcess/API/gtk/WebKitWebContext.cpp:
2078         (webkit_web_context_set_web_process_count_limit):
2079         (webkit_web_context_get_web_process_count_limit):
2080         * UIProcess/API/gtk/WebKitWebContext.h:
2081         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2082
2083 2015-07-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2084
2085         [GTK] Fix empty space in popup menus when first item is selected
2086         https://bugs.webkit.org/show_bug.cgi?id=147358
2087
2088         Reviewed by Martin Robinson.
2089
2090         It happens when one of the first elements are selected, because we
2091         try to center the current selection on the combo element. When the
2092         menu is large enough to make the element centered we need to leave
2093         empty space at the beginning. This can be fixed by not scrolling
2094         to center the selected item when it's above the combo
2095         element. This ensure the selected item will always be visible,
2096         even if it's not centered. If the selected item is already
2097         centered or below the combo element, the behaviour doesn't change
2098         and we scroll to center it.
2099
2100         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
2101         (WebKit::WebPopupMenuProxyGtk::showPopupMenu):
2102
2103 2015-07-28  Jincheol Jo  <jincheol.jo@navercorp.com>
2104
2105         [EFL] Fix typos in ewk_extension.cpp
2106         https://bugs.webkit.org/show_bug.cgi?id=147396
2107
2108         Reviewed by Gyuyoung Kim.
2109
2110         Fix from toEwkExtendion to toEwkExtension.
2111
2112         * WebProcess/InjectedBundle/API/efl/ewk_extension.cpp:
2113         (toEwkExtension):
2114         (EwkExtension::didCreatePage):
2115         (EwkExtension::willDestroyPage):
2116         (EwkExtension::didReceiveMessage):
2117         (toEwkExtendion): Deleted.
2118
2119 2015-07-28  Alexey Proskuryakov  <ap@apple.com>
2120
2121         Clean up usesAsyncCallbacks handling in ResourceHandle
2122         https://bugs.webkit.org/show_bug.cgi?id=147342
2123
2124         Reviewed by Darin Adler.
2125
2126         Update for a renaming in WebCore.
2127
2128         * NetworkProcess/NetworkResourceLoader.cpp:
2129         (WebKit::NetworkResourceLoader::cleanup):
2130         * Shared/Downloads/soup/DownloadSoup.cpp:
2131         (WebKit::Download::platformInvalidate):
2132
2133 2015-07-28  Chris Fleizach  <cfleizach@apple.com>
2134
2135         AX: iOS: VoiceOver hangs indefinitely when an JS alert appears
2136         https://bugs.webkit.org/show_bug.cgi?id=147386
2137
2138         Reviewed by Anders Carlsson.
2139
2140         Support the iOS platform API to notify accessibility clients when the WebProcess is about to suspend (because of some modal dialog).
2141         Luckily, we did all the hardwork for OSX a few years ago to support this paradigm.         
2142
2143         * Platform/IPC/mac/ConnectionMac.mm:
2144         (IPC::AccessibilityProcessSuspendedNotification):
2145         (IPC::Connection::willSendSyncMessage):
2146         (IPC::Connection::didReceiveSyncReply):
2147
2148 2015-07-28  Yusuke Suzuki  <utatane.tea@gmail.com>
2149
2150         [ES6] Add ENABLE_ES6_MODULES compile time flag with the default value "false"
2151         https://bugs.webkit.org/show_bug.cgi?id=147350
2152
2153         Reviewed by Sam Weinig.
2154
2155         * Configurations/FeatureDefines.xcconfig:
2156
2157 2015-07-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
2158
2159         [iOS] REGRESSION(r168075): Fullscreen web video doesn't pause on screen lock
2160         https://bugs.webkit.org/show_bug.cgi?id=147269
2161
2162         Reviewed by Andreas Kling.
2163
2164         Media elements should pause when the application is going to EnterBackground
2165         under lock regardless whether it is in full screen or not.
2166
2167         * Platform/spi/ios/UIKitSPI.h: Forward declare [UIApplication isSuspendedUnderLock].
2168
2169         * UIProcess/ios/WebPageProxyIOS.mm:
2170         (WebKit::WebPageProxy::applicationDidEnterBackground):
2171         [UIApp isSuspendedUnderLock] can only be called in the UIProcess. We need
2172         to call it here and pass it to the WebPage in the WebProcess as part of the
2173         ApplicationDidEnterBackground message.
2174         
2175         * WebProcess/WebPage/WebPage.h:
2176         * WebProcess/WebPage/WebPage.messages.in: Add the new parameter:
2177         'isSuspendedUnderLock' to the ApplicationDidEnterBackground message.
2178         
2179         * WebProcess/WebPage/ios/WebPageIOS.mm:
2180         (WebKit::WebPage::applicationDidEnterBackground): On iOS, the WebPage needs
2181         to notify the MediaSessionManagerIOS that it received the message 
2182         ApplicationDidEnterBackground.
2183
2184 2015-07-28  Yongjun Zhang  <yongjun_zhang@apple.com>
2185
2186         Bounds in InteractionInformationAtPosition should be always in main frame coordinate space.
2187         https://bugs.webkit.org/show_bug.cgi?id=147372
2188
2189         When we prepare the bounds for InteractionInformationAtPosition, we should convert the rect to
2190         main frame space since WKContent in UIProcess expects it to be in the web view space.
2191
2192         Reviewed by Tim Horton.
2193
2194         * WebProcess/WebPage/ios/WebPageIOS.mm:
2195         (WebKit::WebPage::getPositionInformation): Convert the bounding rect to main frame space if the element is inside a sub-frame.
2196
2197 2015-07-27  Simon Fraser  <simon.fraser@apple.com>
2198
2199         PathApplierFunction should take a reference to a PathElement
2200         https://bugs.webkit.org/show_bug.cgi?id=147337
2201
2202         Reviewed by Dan Bates.
2203
2204         Convert PathApplierFunction to take a const PathElement&, since it can never be null.
2205
2206         * Shared/WebCoreArgumentCoders.cpp:
2207         (IPC::pathPointCountApplierFunction):
2208         (IPC::pathEncodeApplierFunction):
2209
2210 2015-07-28  Jer Noble  <jer.noble@apple.com>
2211
2212         [iOS] Notify fullscreen controller in UIProcess whether external playback is allowed
2213         https://bugs.webkit.org/show_bug.cgi?id=147343
2214
2215         Reviewed by Brady Eidson.
2216
2217         Pass the boolean property wirelessVideoPlaybackDisabled across the UIProcess/WebProcess boundary.
2218
2219         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2220         (WebKit::WebVideoFullscreenManagerProxy::setWirelessVideoPlaybackDisabled):
2221         * WebProcess/ios/WebVideoFullscreenManager.mm:
2222         (WebKit::WebVideoFullscreenInterfaceContext::setWirelessVideoPlaybackDisabled):
2223         (WebKit::WebVideoFullscreenManager::WebVideoFullscreenManager):
2224         (WebKit::WebVideoFullscreenManager::setWirelessVideoPlaybackDisabled):
2225
2226 2015-07-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2227
2228         [GTK] Use fastMalloc instead of g_slice
2229         https://bugs.webkit.org/show_bug.cgi?id=147357
2230
2231         Reviewed by Sergio Villar Senin.
2232
2233         The use of g_slice is no longer encouraged by glib developers.
2234
2235         * UIProcess/API/gtk/WebKitCredential.cpp:
2236         (webkitCredentialCreate):
2237         (webkit_credential_free):
2238         * UIProcess/API/gtk/WebKitJavascriptResult.cpp:
2239         (webkitJavascriptResultCreate):
2240         (webkit_javascript_result_unref):
2241         * UIProcess/API/gtk/WebKitMimeInfo.cpp:
2242         (webkitMimeInfoCreate):
2243         (webkit_mime_info_unref):
2244         * UIProcess/API/gtk/WebKitNavigationAction.cpp:
2245         (webkitNavigationActionCreate):
2246         (webkit_navigation_action_copy):
2247         (webkit_navigation_action_free):
2248         * UIProcess/API/gtk/WebKitPrivate.h:
2249         * UIProcess/API/gtk/WebKitScriptDialog.cpp:
2250         (webkitScriptDialogCopy):
2251         (webkitScriptDialogFree):
2252         * UIProcess/API/gtk/WebKitUserContent.cpp:
2253         (webkit_user_style_sheet_unref):
2254         (webkit_user_style_sheet_new):
2255         (webkit_user_script_unref):
2256         (webkit_user_script_new):
2257
2258 2015-07-27  Dan Bernstein  <mitz@apple.com>
2259
2260         [iOS] REGRESSION (r187376): Form editing buttons are missing from the Shortcut Bar
2261         https://bugs.webkit.org/show_bug.cgi?id=147351
2262
2263         Reviewed by Adele Peterson.
2264
2265         We were relying on -[WKContentView inputAccessoryView] getting called to initialize the form
2266         accessory view, even when that method would always return nil, as it does on iPad. After
2267         r187376, that method changed to initializing the view only when returning it, which caused
2268         this bug.
2269
2270         * UIProcess/ios/WKContentViewInteraction.mm:
2271         (-[WKContentView _displayFormNodeInputView]): Call the new -_ensureFormAccessoryView from
2272         here, when we are going to need the view.
2273         (-[WKContentView _ensureFormAccessoryView]): Moved initialization code from
2274         -inputAccessoryView here, and removed outdated +instancesRespondToSelector: check.
2275         (-[WKContentView inputAccessoryView]): Now calls through -formAccessoryView.
2276         (-[WKContentView formAccessoryView]): Added call to -_ensureFormAccessoryView here.
2277
2278 2015-07-27  Andreas Kling  <akling@apple.com>
2279
2280         WebsiteDataStore should clean up its storage in the network process when destroyed.
2281         <https://webkit.org/b/147349>
2282         <rdar://problem/21838764>
2283
2284         Reviewed by Darin Adler.
2285
2286         Have ~WebsiteDataStore() send a DestroyPrivateBrowsingSession message to all networking processes
2287         for ephemeral sessions. This plugs a NetworkStorageSession leak that could retain a large
2288         CFNetwork object graph.
2289
2290         This complements r187115 which did the same for network process storage owned by
2291         API::Session objects.
2292
2293         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2294         (WebKit::WebsiteDataStore::~WebsiteDataStore):
2295
2296 2015-07-27  Tim Horton  <timothy_horton@apple.com>
2297
2298         First in-window viewStateChange synchronously blocks despite not previously being in-window
2299         https://bugs.webkit.org/show_bug.cgi?id=147344
2300         <rdar://problem/22021772>
2301
2302         Reviewed by Simon Fraser.
2303
2304         * UIProcess/WebPageProxy.cpp:
2305         (WebKit::WebPageProxy::updateViewState):
2306         (WebKit::WebPageProxy::dispatchViewStateChange):
2307         The whole point of m_viewWasEverInWindow was so that we would not
2308         synchronously wait when a view was added to a window for the first time,
2309         only all subsequent times.
2310
2311         However, since m_viewWasEverInWindow was being set *before* being
2312         checked in dispatchViewStateChange, we were always blocking. This is
2313         a huge waste of main-thread time, because there's no reason to wait
2314         for the first paint if you've never seen the view before (and shouldn't
2315         expect it to have content).
2316
2317         Instead, set the flag after dispatching a view state change, so it becomes
2318         "have we ever sent a view state with IsInWindow set" instead.
2319
2320 2015-07-27  Tim Horton  <timothy_horton@apple.com>
2321
2322         [iOS] Long press or link click can sometimes trigger during/after a preview
2323         https://bugs.webkit.org/show_bug.cgi?id=147338
2324         <rdar://problem/22020770>
2325
2326         Reviewed by Enrica Casucci.
2327
2328         * UIProcess/ios/WKContentViewInteraction.mm:
2329         (-[WKContentView _longPressRecognized:]):
2330         Bail if we're previewing.
2331
2332         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
2333         (-[WKContentView _presentedViewControllerForPreviewItemController:]):
2334         Always avoid allowing clicks and start interaction when previewing a link.
2335
2336 2015-07-27  Andreas Kling  <akling@apple.com>
2337
2338         [iOS] Occasional crashes in WebPage::elementDidBlur()'s async block.
2339         <https://webkit.org/b/147281>
2340         <rdar://problem/21701858>
2341
2342         Reviewed by Anders Carlsson.
2343
2344         Protect the WebPage object until the dispatch_async block has finished.
2345         I have no way to repro this, but there's evidence of some crashing here.
2346
2347         * WebProcess/WebPage/ios/WebPageIOS.mm:
2348         (WebKit::WebPage::elementDidBlur):
2349
2350 2015-07-27  Michael Catanzaro  <mcatanzaro@igalia.com>
2351
2352         [Seccomp] Set appropriate filters when trapping syscalls by default
2353         https://bugs.webkit.org/show_bug.cgi?id=142983
2354
2355         If we trap syscalls by default, we must not set separate filters to trap
2356         anything here, since it will fail causing us to crash.
2357
2358         But also, there are some things we must allow unconditionally even when
2359         trapping by default. sigreturn, obviously. Also, let's whitelist brk
2360         here instead of in platform-specific code.
2361
2362         Reviewed by Žan Doberšek.
2363
2364         * Shared/linux/SeccompFilters/SeccompBroker.cpp:
2365         (WebKit::SeccompBroker::launchProcess): Don't trap sigprocmask or sigaction unless allow is
2366         the default action. Also, allow sigreturn and brk is allow is not the default.
2367         * Shared/linux/SeccompFilters/SeccompFilters.cpp: Added
2368         (WebKit::SeccompFilters::defaultAction):
2369         * Shared/linux/SeccompFilters/SeccompFilters.h: Added defaultAction
2370
2371 2015-07-27  Matthew Daiter  <mdaiter@apple.com>
2372
2373         Renamed duplicate vectors inside UserMediaPermissionRequestProxy
2374         https://bugs.webkit.org/show_bug.cgi?id=147321
2375         <rdar://problem/22011290>
2376
2377         Reviewed by Eric Carlson.
2378
2379         * UIProcess/UserMediaPermissionRequestProxy.cpp:
2380         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
2381         * UIProcess/UserMediaPermissionRequestProxy.h:
2382         (WebKit::UserMediaPermissionRequestProxy::videoDeviceUIDs):
2383         (WebKit::UserMediaPermissionRequestProxy::audioDeviceUIDs):
2384         (WebKit::UserMediaPermissionRequestProxy::deviceUIDsVideo): Deleted.
2385         (WebKit::UserMediaPermissionRequestProxy::deviceUIDsAudio): Deleted.
2386         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2387         (WebKit::UserMediaPermissionRequestManager::startRequest):
2388
2389 2015-07-27  Carlos Garcia Campos  <cgarcia@igalia.com>
2390
2391         [GTK] Pass a GstInstallPluginsContext to gst_install_plugins_async
2392         https://bugs.webkit.org/show_bug.cgi?id=147103
2393
2394         Reviewed by Philippe Normand.
2395
2396         This allows PackageKit to properly position the window and make it
2397         transient to the web view window.
2398
2399         * UIProcess/API/gtk/PageClientImpl.cpp:
2400         (WebKit::PageClientImpl::setCursor): Disambiguate Cursor now that
2401         we include gtkx.h.
2402         (WebKit::PageClientImpl::createGstInstallPluginsContext): Create a
2403         new GstInstallPluginsContext and set the web view window XID when
2404         running on X11.
2405         * UIProcess/API/gtk/PageClientImpl.h:
2406         * UIProcess/PageClient.h:
2407         * UIProcess/efl/WebViewEfl.h:
2408         * UIProcess/gstreamer/WebPageProxyGStreamer.cpp:
2409         (WebKit::WebPageProxy::requestInstallMissingMediaPlugins): Use
2410         PageClient::createGstInstallPluginsContext() to create a new
2411         GstInstallPluginsContext and pass it to gst_install_plugins_async().
2412
2413 2015-07-26  Gwang Yoon Hwang  <yoon@igalia.com>
2414
2415         [ThreadedCompositor] Unreviewed build fix after r186059
2416         https://bugs.webkit.org/show_bug.cgi?id=147315
2417
2418         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2419         (WebKit::ThreadedCompositor::glContext):
2420         Explicitly cast u_int64 to GLNativeWindowType.
2421         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
2422         (WebKit::ThreadedCoordinatedLayerTreeHost::create):
2423         Update declaration to match with modified definition.
2424
2425
2426 2015-07-26  Chris Dumez  <cdumez@apple.com>
2427
2428         [WK2][iOS] WebContent process main thread should have fixed priority
2429         https://bugs.webkit.org/show_bug.cgi?id=147313
2430         <rdar://problem/22003112>
2431
2432         Reviewed by Darin Adler.
2433
2434         WebContent process main thread should have fixed priority on iOS 9.
2435         Priority decay regresses PLT and fixing the main thread's priority
2436         gives up a ~3% progression on warm PLT (tested on iPhone 5s).
2437
2438         * WebProcess/cocoa/WebProcessCocoa.mm:
2439         (WebKit::WebProcess::platformInitializeWebProcess):
2440
2441 2015-07-26  Dan Bernstein  <mitz@apple.com>
2442
2443         Suppressed an Xcode 7 warning about including a nib in an iOS build product.
2444
2445         * Configurations/BaseLegacyProcess.xcconfig: Exclude xib files on iOS.
2446         * Configurations/BaseXPCService.xcconfig: Ditto.
2447
2448 2015-07-24  Ryosuke Niwa  <rniwa@webkit.org>
2449
2450         iOS 8 build fix attempt after r187215.
2451
2452         * UIProcess/API/Cocoa/WKWebView.mm:
2453         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]): Deleted.
2454
2455 2015-07-24  Yongjun Zhang  <yongjun_zhang@apple.com>
2456
2457         Don't create UIWebFormAccessory if we don't require accessory view.
2458         https://bugs.webkit.org/show_bug.cgi?id=147283
2459
2460         Don't try to intialize _formAccessoryView if requiresAccessoryView returns false since we don't
2461         need it yet.
2462
2463         Reviewed by Dan Bernstein.
2464
2465         * UIProcess/ios/WKContentViewInteraction.mm:
2466         (-[WKContentView inputAccessoryView]):
2467
2468 2015-07-24  Anders Carlsson  <andersca@apple.com>
2469
2470         WKWebsiteDataStore remove methods don't properly delete cookies
2471         https://bugs.webkit.org/show_bug.cgi?id=147282
2472         rdar://problem/21948230
2473
2474         Reviewed by Sam Weinig.
2475
2476         * NetworkProcess/NetworkProcess.cpp:
2477         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
2478         Call deleteCookiesForHostnames instead of iterating over each hostname.
2479
2480         * WebProcess/Cookies/WebCookieManager.cpp:
2481         (WebKit::WebCookieManager::deleteCookiesForHostname):
2482         Call deleteCookiesForHostnames.
2483
2484 2015-07-24  Anders Carlsson  <andersca@apple.com>
2485
2486         Networking process crash in NetworkConnectionToWebProcess::convertMainResourceLoadToDownload while attempting to download a blob
2487         https://bugs.webkit.org/show_bug.cgi?id=147276
2488         rdar://problem/21423353
2489
2490         Reviewed by Andreas Kling.
2491
2492         We currently don't support downloading blobs, so for now just bail if we encounter a null loader inside
2493         convertMainResourceLoadToDownload (which happens when trying to download a blob URL).
2494
2495         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2496         (WebKit::NetworkConnectionToWebProcess::didCleanupResourceLoader):
2497         Rewrite the assertion to be more clear - it's fine to do an extra hash lookup in debug builds.
2498
2499         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
2500         Bail if loader is null.
2501
2502 2015-07-24  Yusuke Suzuki  <utatane.tea@gmail.com>
2503
2504         Remove runtime flags for symbols
2505         https://bugs.webkit.org/show_bug.cgi?id=147246
2506
2507         Reviewed by Alex Christensen.
2508
2509         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2510         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2511
2512 2015-07-24  Yusuke Suzuki  <utatane.tea@gmail.com>
2513
2514         Object.getOwnPropertySymbols on large list takes very long
2515         https://bugs.webkit.org/show_bug.cgi?id=146137
2516
2517         Reviewed by Mark Lam.
2518
2519         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
2520         (WebKit::NPJSObject::enumerate):
2521
2522 2015-07-24  Simon Fraser  <simon.fraser@apple.com>
2523
2524         Recode.net gets into a continual resize loop in split fullscreen
2525         https://bugs.webkit.org/show_bug.cgi?id=147266
2526         rdar://problem/21409047
2527
2528         Reviewed by Tim Horton.
2529         
2530         In split fullscreen, we use fixed layout and scale to shrink pages down to
2531         fit a given width. This is re-evaluated every time the document width changes.
2532         However some pages, like recode.net, end up continually resizing because
2533         when laid out unconstrained they use a narrower width than when laid out with
2534         a fixed layout size. In fixed layout, they actually use more width than the fixed
2535         layout size.
2536         
2537         Detect and break this cycle by just not re-scaling when we've done one fixed layout,
2538         and the document is now taking more width than the fixed layout width.
2539
2540         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2541         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
2542
2543 2015-07-24  Carlos Garcia Campos  <cgarcia@igalia.com>
2544
2545         [GStreamer] Crashes during plugin installation
2546         https://bugs.webkit.org/show_bug.cgi?id=144099
2547
2548         Reviewed by Philippe Normand.
2549
2550         Move the missing plugins installation to the UI process, ensuring
2551         there's a single installer running and cancelling the request when
2552         the page is closed or the media player is deleted.
2553
2554         * PlatformEfl.cmake: Add new files to compilation.
2555         * PlatformGTK.cmake: Ditto.
2556         * UIProcess/WebPageProxy.h:
2557         * UIProcess/WebPageProxy.messages.in: Add
2558         RequestInstallMissingMediaPlugins message.
2559         * UIProcess/gstreamer/WebPageProxyGStreamer.cpp: Added.
2560         (WebKit::WebPageProxy::requestInstallMissingMediaPlugins): Call
2561         gst_install_plugins_async() and send
2562         DidEndRequestInstallMissingMediaPlugins message back to the web
2563         process when done.
2564         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2565         (WebKit::WebChromeClient::requestInstallMissingMediaPlugins): Call
2566         WebPage::requestInstallMissingMediaPlugins().
2567         * WebProcess/WebCoreSupport/WebChromeClient.h:
2568         * WebProcess/WebPage/WebPage.cpp:
2569         (WebKit::WebPage::close): Invalidate the install missing plugins
2570         request callback.
2571         * WebProcess/WebPage/WebPage.h:
2572         * WebProcess/WebPage/WebPage.messages.in: Add
2573         DidEndRequestInstallMissingMediaPlugins message.
2574         * WebProcess/WebPage/gstreamer/WebPageGStreamer.cpp: Added.
2575         (WebKit::WebPage::requestInstallMissingMediaPlugins): Send
2576         RequestInstallMissingMediaPlugins to the UI process or complete
2577         the request early if there's already a request in progress.
2578         (WebKit::WebPage::didEndRequestInstallMissingMediaPlugins):
2579         Complete the request.
2580
2581 2015-07-24  Carlos Garcia Campos  <cgarcia@igalia.com>
2582
2583         Unreviewed. Fix the build with MEDIA_STREAM disabled after r187282.
2584
2585         RealtimeMediaSource is only defined when MEDIA_STREAM is enabled.
2586
2587         * UIProcess/UserMediaPermissionRequestProxy.cpp:
2588         * UIProcess/UserMediaPermissionRequestProxy.h:
2589
2590 2015-07-24  Carlos Garcia Campos  <cgarcia@igalia.com>
2591
2592         REGRESSION(r187100): [GTK] ASSERTION FAILED: Attempt to access post layout data before receiving it when typing backspace
2593         https://bugs.webkit.org/show_bug.cgi?id=147196
2594
2595         Reviewed by Žan Doberšek.
2596
2597         Do not try to use the PostLayoutData from EditorState when
2598         isMissingPostLayoutData is true. That happens when there's a
2599         layout pending, and EditorStateChanged is sent again after that
2600         layout with the post layout data. So we can just return early and
2601         wait until the second message.
2602
2603         * UIProcess/API/gtk/WebKitEditorState.cpp:
2604         (webkitEditorStateChanged):
2605         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2606         (webkitWebViewBaseUpdateTextInputState):
2607
2608 2015-07-23  Alex Christensen  <achristensen@webkit.org>
2609
2610         Fix 32-bit build after r187272.
2611
2612         * UIProcess/mac/PageClientImpl.mm:
2613         (WebKit::PageClientImpl::mediaDocumentNaturalSizeChanged):
2614         Added some WK_API_ENABLED.
2615
2616 2015-07-23  Dan Bernstein  <mitz@apple.com>
2617
2618         <rdar://problem/21929532> REGRESSION (r184026): Safari AutoFill with Contact info for phone number is broken
2619         https://bugs.webkit.org/show_bug.cgi?id=147249
2620
2621         Reviewed by Sam Weinig.
2622
2623         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
2624         (encodeObject): Use encodeString only for strings that encode as NSString or
2625         NSMutableString. It can’t encode arbitrary NSString subclasses.
2626         (decodeObject): Use decodeString for NSMutableString as well.
2627
2628 2015-07-23  Zalan Bujtas  <zalan@apple.com>
2629
2630         [iOS] REGRESSION (187131): Loading CuteOverload zooms in to the top left corner.
2631         https://bugs.webkit.org/show_bug.cgi?id=147251
2632         rdar://problem/21953359
2633
2634         Calling zoomToRect() should result in essentially the same zoom scale as if we
2635         called setZoomScale with the new page scale factor.
2636  
2637         Reviewed by Benjamin Poulain.
2638
2639         * UIProcess/API/Cocoa/WKWebView.mm:
2640         (-[WKWebView _didCommitLayerTree:]):
2641
2642 2015-07-23  Matthew Daiter  <mdaiter@apple.com>
2643
2644         Linking WebKit2 to be able to grab media sources from a UID
2645         https://bugs.webkit.org/show_bug.cgi?id=147202
2646         <rdar://problem/21947608>
2647
2648         Reviewed by Brent Fulgham.
2649
2650         * UIProcess/UserMediaPermissionRequestProxy.cpp:
2651         (WebKit::UserMediaPermissionRequestProxy::getDeviceNameForUID):
2652         * UIProcess/UserMediaPermissionRequestProxy.h:
2653
2654 2015-07-23  Alex Christensen  <achristensen@webkit.org>
2655
2656         Remove compile and runtime flags for promises.
2657         https://bugs.webkit.org/show_bug.cgi?id=147244
2658
2659         Reviewed by Yusuke Suzuki.
2660
2661         * Configurations/FeatureDefines.xcconfig:
2662         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2663         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2664
2665 2015-07-21  Jer Noble  <jer.noble@apple.com>
2666
2667         Notify the UI delegate when a MediaDocument's natural size changes
2668         https://bugs.webkit.org/show_bug.cgi?id=147182
2669
2670         Reviewed by Simon Fraser.
2671
2672         Pipe notifications of media document natural size changes up from the chrome client, through
2673         to the UIProcess,  through the page client, through the WKWebView, to the UIDelegate.
2674
2675         * UIProcess/API/APIUIClient.h:
2676         (API::UIClient::mediaDocumentNaturalSizeChanged):
2677         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2678         * UIProcess/API/Cocoa/WKWebView.mm:
2679         (-[WKWebView _mediaDocumentNaturalSizeChanged:]):
2680         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2681         * UIProcess/Cocoa/UIDelegate.h:
2682         * UIProcess/Cocoa/UIDelegate.mm:
2683         (WebKit::UIDelegate::setDelegate):
2684         (WebKit::UIDelegate::UIClient::mediaDocumentNaturalSizeChanged):
2685         * UIProcess/PageClient.h:
2686         * UIProcess/WebPageProxy.cpp:
2687         (WebKit::WebPageProxy::mediaDocumentNaturalSizeChanged):
2688         * UIProcess/WebPageProxy.h:
2689         * UIProcess/WebPageProxy.messages.in:
2690         * UIProcess/ios/PageClientImplIOS.h:
2691         * UIProcess/ios/PageClientImplIOS.mm:
2692         (WebKit::PageClientImpl::mediaDocumentNaturalSizeChanged):
2693         * UIProcess/mac/PageClientImpl.h:
2694         * UIProcess/mac/PageClientImpl.mm:
2695         (WebKit::PageClientImpl::mediaDocumentNaturalSizeChanged):
2696         * WebProcess/WebCoreSupport/WebChromeClient.h:
2697         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2698         (WebKit::WebChromeClient::mediaDocumentNaturalSizeChanged):
2699         * WebProcess/WebPage/WebPage.cpp:
2700         (WebKit::WebPage::mediaDocumentNaturalSizeChanged):
2701         * WebProcess/WebPage/WebPage.h:
2702         * UIProcess/API/gtk/PageClientImpl.h: Add default, empty implementation of new pure-virtual method.
2703         * UIProcess/efl/WebViewEfl.h: Ditto.
2704
2705 2015-07-23  Enrica Casucci  <enrica@apple.com>
2706
2707         Removing one incorrect annotation from the previous change.
2708
2709         Unreviewed.
2710
2711         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2712
2713 2015-07-23  Enrica Casucci  <enrica@apple.com>
2714
2715         [iOS] Add another preview delegate for didDismissPreview.
2716         https://bugs.webkit.org/show_bug.cgi?id=147241
2717         rdar://problem/21664211
2718
2719         Reviewed by Tim Horton and Yongjun Zhang.
2720
2721         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2722         * UIProcess/ios/WKContentViewInteraction.mm:
2723         (-[WKContentView _previewItemController:didDismissPreview:committing:]):
2724
2725 2015-07-23  Dan Bernstein  <mitz@apple.com>
2726
2727         <rdar://problem/21910578> Second pass at [iOS] Keyboard shortcuts that take focus away from the web view end up typing a letter into the newly focused field
2728         https://bugs.webkit.org/show_bug.cgi?id=146732
2729
2730         Reviewed by Darin Adler.
2731
2732         * UIProcess/ios/WKContentViewInteraction.mm:
2733         (-[WKContentView _interpretKeyEvent:isCharEvent:]): Rather than checking if the view is
2734         first responder, which it might still be when the Web Content processes invokes this
2735         callback, check if we are in editable content before forwarding the event to the keyboard.
2736
2737 2015-07-23  Jer Noble  <jer.noble@apple.com>
2738
2739         Unreviewed build fix after r187251; rename flag -> allows.
2740
2741         * UIProcess/WebPageProxy.cpp:
2742         (WebKit::WebPageProxy::setAllowsMediaDocumentInlinePlayback):
2743
2744 2015-07-23  Alex Christensen  <achristensen@webkit.org>
2745
2746         [iOS] Unreviewed build fix after r187251.
2747
2748         * UIProcess/WebPageProxy.cpp:
2749         (WebKit::WebPageProxy::setAllowsMediaDocumentInlinePlayback):
2750         Use the correct name for the boolean to pass along to SetAllowsMediaDocumentInlinePlayback.
2751
2752 2015-07-23  Enrica Casucci  <enrica@apple.com>
2753
2754         One more iOS build fix.
2755
2756         Unreviewed.
2757
2758         * Platform/spi/ios/UIKitSPI.h:
2759         * UIProcess/ios/WKContentViewInteraction.h:
2760
2761 2015-07-23  Matthew Daiter  <mdaiter@apple.com>
2762
2763         Bridged passing lists of devices between the UIProcess and the WebProcess
2764         https://bugs.webkit.org/show_bug.cgi?id=147056
2765         <rdar://problem/21883094>
2766
2767         Reviewed by Brent Fulgham.
2768
2769         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp: Modified file
2770         to reflect changes made to the header in the .messages.in file
2771         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest): Ditto
2772         (WebKit::UserMediaPermissionRequestManagerProxy::didReceiveUserMediaPermissionDecision):
2773         * UIProcess/UserMediaPermissionRequestManagerProxy.h: Ditto
2774         * UIProcess/UserMediaPermissionRequestProxy.cpp: Ditto
2775         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
2776         * UIProcess/UserMediaPermissionRequestProxy.h:
2777         (WebKit::UserMediaPermissionRequestProxy::create):
2778         (WebKit::UserMediaPermissionRequestProxy::deviceUIDsVideo):
2779         (WebKit::UserMediaPermissionRequestProxy::deviceUIDsAudio):
2780         * UIProcess/WebPageProxy.cpp:
2781         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
2782         * UIProcess/WebPageProxy.h:
2783         * UIProcess/WebPageProxy.messages.in: Changed heading
2784         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2785         (WebKit::UserMediaPermissionRequestManager::startRequest):
2786         (WebKit::UserMediaPermissionRequestManager::didReceiveUserMediaPermissionDecision):
2787         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
2788         * WebProcess/WebPage/WebPage.cpp:
2789         (WebKit::WebPage::didReceiveUserMediaPermissionDecision):
2790         * WebProcess/WebPage/WebPage.h:
2791         * WebProcess/WebPage/WebPage.messages.in: Changed heading
2792
2793 2015-07-23  Yongjun Zhang  <yongjun_zhang@apple.com>
2794
2795         Adopt the new _previewItemControllerDidCancelPreview delegate method.
2796         https://bugs.webkit.org/show_bug.cgi?id=147238
2797
2798         Don't allow hightlight long press to trigger tap if the link preview is cancelled because
2799         the link is not preview-able.
2800
2801         Reviewed by Beth Dakin.
2802
2803         * UIProcess/ios/WKContentViewInteraction.mm:
2804         (-[WKContentView _previewItemControllerDidCancelPreview:]): 
2805
2806 2015-07-23  Enrica Casucci  <enrica@apple.com>
2807
2808         iOS build fix after http://trac.webkit.org/changeset/187238.
2809
2810         Unreviewed.
2811
2812         * Platform/spi/ios/UIKitSPI.h:
2813
2814 2015-07-23  Jer Noble  <jer.noble@apple.com>
2815
2816         [WK2] Add a WKWebView property for whether the view is displaying a media document
2817         https://bugs.webkit.org/show_bug.cgi?id=147233
2818
2819         Reviewed by Beth Dakin.
2820
2821         Add a _isDisplayingStandaloneMediaDocument property, which queries the frame for whether
2822         the current MIME type is one which our media engines support.
2823
2824         * UIProcess/API/Cocoa/WKWebView.mm:
2825         (-[WKWebView _isDisplayingStandaloneMediaDocument]):
2826         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2827         * UIProcess/WebFrameProxy.cpp:
2828         (WebKit::WebFrameProxy::isDisplayingStandaloneMediaDocument):
2829         * UIProcess/WebFrameProxy.h:
2830
2831 2015-07-21  Jer Noble  <jer.noble@apple.com>
2832
2833         [iOS] Add an explicit API to allow media documents to (temporarily) play inline
2834         https://bugs.webkit.org/show_bug.cgi?id=147181
2835
2836         Reviewed by Beth Dakin.
2837
2838         Add a WKWebView(Private) API which allows MediaDocuments loaded by the view to play their contents inline, regardless
2839         of whether inline playback is restricted on the current device.
2840
2841         * UIProcess/API/Cocoa/WKWebView.mm:
2842         (-[WKWebView _setRequiresUserActionForMediaPlayback:]): Added. Pass through to WebPageProxy.
2843         (-[WKWebView _allowsMediaDocumentInlinePlayback]): Ditto.
2844         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2845         * UIProcess/WebPageProxy.cpp:
2846         (WebKit::WebPageProxy::allowsMediaDocumentInlinePlayback): Simple getter.
2847         (WebKit::WebPageProxy::setAllowsMediaDocumentInlinePlayback): Set, and conditionally pass the new value to WebPage.
2848         * UIProcess/WebPageProxy.h:
2849         * WebProcess/WebPage/WebPage.cpp:
2850         (WebKit::WebPage::setAllowsMediaDocumentInlinePlayback): Set, and conditionally notify WebCore page of the change.
2851         * WebProcess/WebPage/WebPage.h:
2852         (WebKit::WebPage::allowsMediaDocumentInlinePlayback): Simple getter.
2853         * WebProcess/WebPage/WebPage.messages.in: Add new messages.
2854
2855 2015-07-23  Beth Dakin  <bdakin@apple.com>
2856
2857         Should not allow previews of 1x1 images
2858         https://bugs.webkit.org/show_bug.cgi?id=147237
2859         -and corresponding-
2860         rdar://problem/21968460
2861
2862         Reviewed by Tim Horton.
2863
2864         1x1 images are used on some sites to cover actual images, which leads to a 
2865         misleading preview experience. There is not any reason why you would really 
2866         want to preview an image this small nor any reason to believe that the 
2867         preview would result in anything useful.
2868         * WebProcess/WebPage/ios/WebPageIOS.mm:
2869         (WebKit::WebPage::getPositionInformation):
2870
2871 2015-07-23  Brady Eidson  <beidson@apple.com>
2872
2873         Crash in WebPlatformStrategies::createPingHandle - Deref a null NetworkingContext.
2874         <rdar://problem/21949735> and https://bugs.webkit.org/show_bug.cgi?id=147227
2875
2876         Reviewed by Alexey Proskuryakov.
2877
2878         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2879         (WebKit::WebPlatformStrategies::createPingHandle): Skip it if there's a null NetworkingContext.
2880
2881 2015-07-23  Tim Horton  <timothy_horton@apple.com>
2882
2883         Remove some files that should have been removed with WebKit2 Windows
2884         https://bugs.webkit.org/show_bug.cgi?id=147223
2885
2886         Reviewed by Csaba Osztrogonác.
2887
2888         * Shared/API/c/cf/WKURLRequestCF.cpp: Removed.
2889         * Shared/API/c/cf/WKURLRequestCF.h: Removed.
2890         * Shared/API/c/cf/WKURLResponseCF.cpp: Removed.
2891         * Shared/API/c/cf/WKURLResponseCF.h: Removed.
2892
2893 2015-07-23  Timothy Horton  <timothy_horton@apple.com>
2894
2895         Fix the build
2896
2897         * Platform/spi/ios/UIKitSPI.h:
2898
2899 2015-07-23  Tim Horton  <timothy_horton@apple.com>
2900
2901         Remove files that were meant to be removed in r173929
2902
2903         * WebProcess/WebPage/mac/WebInspectorMac.mm: Removed.
2904
2905 2015-07-23  Tim Horton  <timothy_horton@apple.com>
2906
2907         Remove files that were meant to be removed in r168213
2908
2909         * UIProcess/API/Cocoa/WKErrorRecoveryAttempting.h: Removed.
2910
2911 2015-07-23  Tim Horton  <timothy_horton@apple.com>
2912
2913         Remove files that were meant to be removed in r168229
2914
2915         * UIProcess/API/Cocoa/WKSession.h: Removed.
2916         * UIProcess/API/Cocoa/WKSession.mm: Removed.
2917         * UIProcess/API/Cocoa/WKSessionInternal.h: Removed.
2918
2919 2015-07-23  Tim Horton  <timothy_horton@apple.com>
2920
2921         Remove files that were meant to be removed in r165014
2922
2923         * WebProcess/WebPage/mac/WKAccessibilityWebPageObject.h: Removed.
2924         * WebProcess/WebPage/mac/WKAccessibilityWebPageObject.mm: Removed.
2925
2926 2015-07-23  Carlos Garcia Campos  <cgarcia@igalia.com>
2927
2928         [GTK] Add API to allow executing editing commands that require an argument
2929         https://bugs.webkit.org/show_bug.cgi?id=146781
2930
2931         Reviewed by Gustavo Noronha Silva.
2932
2933         Commands like InsertImage or CreateLink receive an argument, but
2934         we only have webkit_web_view_execute_editing_command() that
2935         doesn't receive any argument. This patch adds
2936         webkit_web_view_execute_editing_command_with_argument() for those
2937         commands. It also adds WEBKIT_EDITING_COMMAND_INSERT_IMAGE and
2938         WEBKIT_EDITING_COMMAND_CREATE_LINK to the predefined editing commands.
2939
2940         * UIProcess/API/gtk/WebKitEditingCommands.h: Add
2941         WEBKIT_EDITING_COMMAND_INSERT_IMAGE and WEBKIT_EDITING_COMMAND_CREATE_LINK.
2942         * UIProcess/API/gtk/WebKitWebView.cpp:
2943         (webkit_web_view_execute_editing_command_with_argument):
2944         * UIProcess/API/gtk/WebKitWebView.h:
2945         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
2946         * UIProcess/WebPageProxy.cpp:
2947         (WebKit::WebPageProxy::executeEditCommand): Pass also the argument
2948         to the message.
2949         * UIProcess/WebPageProxy.h:
2950         * WebProcess/WebPage/WebPage.cpp:
2951         (WebKit::WebPage::executeEditCommand): Add the argument parameter
2952         to the message handler.
2953         * WebProcess/WebPage/WebPage.h:
2954         * WebProcess/WebPage/WebPage.messages.in: Add argument parameter
2955         to ExecuteEditCommand message.
2956
2957 2015-07-22  Sukolsak Sakshuwong  <sukolsak@gmail.com>
2958
2959         Add ENABLE_WEBASSEMBLY feature flag for WebAssembly
2960         https://bugs.webkit.org/show_bug.cgi?id=147212
2961
2962         Reviewed by Filip Pizlo.
2963
2964         * Configurations/FeatureDefines.xcconfig:
2965
2966 2015-07-22  James Savage  <james.savage@apple.com>
2967
2968         Use updated CoreAnimation snapshot SPI.
2969         https://bugs.webkit.org/show_bug.cgi?id=147197
2970         <rdar://problem/21032083>
2971
2972         Reviewed by Tim Horton.
2973         Patch by James Savage.
2974
2975         * Platform/spi/ios/UIKitSPI.h:
2976         * UIProcess/API/Cocoa/WKWebView.mm:
2977         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
2978
2979 2015-07-22  Timothy Horton  <timothy_horton@apple.com>
2980
2981         Fix the build
2982
2983         * UIProcess/ios/WKContentViewInteraction.mm:
2984         (-[WKContentView setupInteraction]):
2985         (-[WKContentView cleanupInteraction]):
2986
2987 2015-07-22  Commit Queue  <commit-queue@webkit.org>
2988
2989         Unreviewed, rolling out r187196.
2990         https://bugs.webkit.org/show_bug.cgi?id=147213
2991
2992         broke all the iOS builds (Requested by thorton on #webkit).
2993
2994         Reverted changeset:
2995
2996         "Use updated CoreAnimation snapshot SPI."
2997         https://bugs.webkit.org/show_bug.cgi?id=147197
2998         http://trac.webkit.org/changeset/187196
2999
3000 2015-07-22  Tim Horton  <timothy_horton@apple.com>
3001
3002         Fix the build
3003
3004         * UIProcess/ios/WKContentViewInteraction.h:
3005
3006 2015-07-22  Tim Horton  <timothy_horton@apple.com>
3007
3008         [iOS] Adjust the preview architecture
3009         https://bugs.webkit.org/show_bug.cgi?id=147203
3010         <rdar://problem/21945775>
3011
3012         Reviewed by Simon Fraser.
3013
3014         * UIProcess/ios/WKContentViewInteraction.mm:
3015         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
3016         Link previews should win over image previews if both are possible.
3017
3018 2015-07-22  James Savage  <james.savage@apple.com>
3019
3020         Use updated CoreAnimation snapshot SPI.
3021         https://bugs.webkit.org/show_bug.cgi?id=147197
3022
3023         Reviewed by Tim Horton.
3024
3025         * Platform/spi/ios/UIKitSPI.h:
3026         * UIProcess/API/Cocoa/WKWebView.mm:
3027         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
3028
3029 2015-07-22  Tim Horton  <timothy_horton@apple.com>
3030
3031         [iOS] Adjust the preview architecture
3032         https://bugs.webkit.org/show_bug.cgi?id=147203
3033         <rdar://problem/21945775>
3034
3035         Reviewed by Beth Dakin.
3036
3037         * Platform/spi/ios/UIKitSPI.h:
3038         * UIProcess/API/Cocoa/WKWebView.mm:
3039         (-[WKWebView _setAllowsLinkPreview:]): Deleted.
3040         * UIProcess/ios/WKContentView.mm:
3041         (-[WKContentView willMoveToWindow:]): Deleted.
3042         * UIProcess/ios/WKContentViewInteraction.h:
3043         * UIProcess/ios/WKContentViewInteraction.mm:
3044         (-[WKContentView setupInteraction]):
3045         (-[WKContentView cleanupInteraction]):
3046         (-[WKContentView _registerPreview]):
3047         (-[WKContentView _unregisterPreview]):
3048         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
3049         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
3050         (-[WKContentView _presentationRectForPreviewItemController:]):
3051         (-[WKContentView _presentedViewControllerForPreviewItemController:]):
3052         (-[WKContentView _previewItemController:commitPreview:]):
3053         (-[WKContentView _previewItemController:willPresentPreview:forPosition:inSourceView:]):
3054         (-[WKContentView _previewItemController:didDismissPreview:committing:]):
3055         (-[WKContentView _presentationSnapshotForPreviewItemController:]):
3056         (-[WKContentView _presentationRectsForPreviewItemController:]):
3057         (-[WKContentView gestureRecognizerShouldBegin:]): Deleted.
3058         (-[WKContentView _registerPreviewInWindow:]): Deleted.
3059         (-[WKContentView _unregisterPreviewInWindow:]): Deleted.
3060         (-[WKContentView previewViewControllerForPosition:inSourceView:]): Deleted.
3061         (-[WKContentView commitPreviewViewController:]): Deleted.
3062         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]): Deleted.
3063         (-[WKContentView didDismissPreviewViewController:committing:]): Deleted.
3064         Register and unregister in setup/cleanupInteraction instead of when moving between windows.
3065         Implement 'shouldBegin' instead of interacting directly with the recognizer.
3066         Make use of system enums instead of our own.
3067         Let UIPreviewItemController handle shrink-wrapping and the indicator view.
3068
3069 2015-07-22  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3070
3071         [EFL] Support indexeddb for WK2
3072         https://bugs.webkit.org/show_bug.cgi?id=145867
3073
3074         Reviewed by Csaba Osztrogonác.
3075
3076         Add stub implementation for indexeddb. Move KeyedDecoder and KeyedEncoder from gtk to glib
3077         in order to share it between GTK and EFL ports.
3078
3079         * DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp:
3080         * DatabaseProcess/efl/DatabaseProcessMainEfl.cpp: Copied from Source/WebKit2/DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp.
3081         (WebKit::DatabaseProcessMainUnix):
3082         * PlatformEfl.cmake:
3083         * PlatformGTK.cmake:
3084         * Shared/glib/KeyedDecoder.cpp: Renamed from Source/WebKit2/Shared/gtk/KeyedDecoder.cpp.
3085         (WebKit::KeyedDecoder::KeyedDecoder):
3086         (WebKit::KeyedDecoder::~KeyedDecoder):
3087         (WebKit::KeyedDecoder::dictionaryFromGVariant):
3088         (WebKit::KeyedDecoder::decodeBytes):
3089         (WebKit::KeyedDecoder::decodeSimpleValue):
3090         (WebKit::KeyedDecoder::decodeBool):
3091         (WebKit::KeyedDecoder::decodeUInt32):
3092         (WebKit::KeyedDecoder::decodeInt32):
3093         (WebKit::KeyedDecoder::decodeInt64):
3094         (WebKit::KeyedDecoder::decodeFloat):
3095         (WebKit::KeyedDecoder::decodeDouble):
3096         (WebKit::KeyedDecoder::decodeString):
3097         (WebKit::KeyedDecoder::beginObject):
3098         (WebKit::KeyedDecoder::endObject):
3099         (WebKit::KeyedDecoder::beginArray):
3100         (WebKit::KeyedDecoder::beginArrayElement):
3101         (WebKit::KeyedDecoder::endArrayElement):
3102         (WebKit::KeyedDecoder::endArray):
3103         * Shared/glib/KeyedDecoder.h: Renamed from Source/WebKit2/Shared/gtk/KeyedDecoder.h.
3104         * Shared/glib/KeyedEncoder.cpp: Renamed from Source/WebKit2/Shared/gtk/KeyedEncoder.cpp.
3105         (WebKit::KeyedEncoder::KeyedEncoder):
3106         (WebKit::KeyedEncoder::~KeyedEncoder):
3107         (WebKit::KeyedEncoder::encodeBytes):
3108         (WebKit::KeyedEncoder::encodeBool):
3109         (WebKit::KeyedEncoder::encodeUInt32):
3110         (WebKit::KeyedEncoder::encodeInt32):
3111         (WebKit::KeyedEncoder::encodeInt64):
3112         (WebKit::KeyedEncoder::encodeFloat):
3113         (WebKit::KeyedEncoder::encodeDouble):
3114         (WebKit::KeyedEncoder::encodeString):
3115         (WebKit::KeyedEncoder::beginObject):
3116         (WebKit::KeyedEncoder::endObject):
3117         (WebKit::KeyedEncoder::beginArray):
3118         (WebKit::KeyedEncoder::beginArrayElement):
3119         (WebKit::KeyedEncoder::endArrayElement):
3120         (WebKit::KeyedEncoder::endArray):
3121         (WebKit::KeyedEncoder::finishEncoding):
3122         * Shared/glib/KeyedEncoder.h: Renamed from Source/WebKit2/Shared/gtk/KeyedEncoder.h.
3123         * UIProcess/Databases/efl/DatabaseProcessProxyEfl.cpp: Copied from Source/WebKit2/DatabaseProcess/EntryPoint/unix/DatabaseProcessMain.cpp.
3124         (WebKit::DatabaseProcessProxy::platformGetLaunchOptions):
3125
3126 2015-07-22  Michael Catanzaro  <mcatanzaro@igalia.com>
3127
3128         [Seccomp] Canonicalize filesystem path when whitelisting it
3129         https://bugs.webkit.org/show_bug.cgi?id=142986
3130
3131         Reviewed by Žan Doberšek.
3132
3133         * Shared/linux/SeccompFilters/SyscallPolicy.cpp:
3134         (WebKit::canonicalizeFileName):
3135         (WebKit::SyscallPolicy::addFilePermission):
3136         (WebKit::SyscallPolicy::addDirectoryPermission):
3137
3138 2015-07-21  Simon Fraser  <simon.fraser@apple.com>
3139
3140         Add logging for TiledCoreAnimationDrawingArea resizing
3141         https://bugs.webkit.org/show_bug.cgi?id=147180
3142
3143         Reviewed by Tim Horton.
3144
3145         Add a "Resize" log channel for WebKit2, and use it to log data in scaleViewToFitDocumentIfNeeded().
3146
3147         * Platform/Logging.h:
3148         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3149         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
3150
3151 2015-07-22  Sam Weinig  <sam@webkit.org>
3152
3153         Encode/Decode underlying errors when serializing NSErrors
3154         <rdar://problem/21818117>
3155         https://bugs.webkit.org/show_bug.cgi?id=147199
3156
3157         Reviewed by Anders Carlsson.
3158
3159         * Shared/mac/WebCoreArgumentCodersMac.mm:
3160         (IPC::ArgumentCoder<CertificateInfo>::decode):
3161         (IPC::encodeNSError):
3162         (IPC::ArgumentCoder<ResourceError>::encodePlatformData):
3163         (IPC::decodeNSError):
3164         (IPC::ArgumentCoder<ResourceError>::decodePlatformData):
3165         Break out encoding/decoding of the NSErrors into a helpers so they can be called
3166         for the underlying error.
3167
3168 2015-07-22  Beth Dakin  <bdakin@apple.com>
3169
3170         Animated images should animate in previews
3171         https://bugs.webkit.org/show_bug.cgi?id=147173
3172         -and corresponding-
3173         rdar://problem/21637698
3174
3175         Reviewed by Dan Bernstein.
3176
3177         InteractionInformationAtPosition needs to know if it’s an animated image.
3178         * Shared/InteractionInformationAtPosition.cpp:
3179         (WebKit::InteractionInformationAtPosition::encode):
3180         (WebKit::InteractionInformationAtPosition::decode):
3181         * Shared/InteractionInformationAtPosition.h:
3182
3183         New delegate method to create a link preview view controller for animated 
3184         images.
3185         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3186
3187         Treat animated images more like link previews.
3188         * UIProcess/ios/WKContentViewInteraction.mm:
3189         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
3190
3191         Set info.isAnimatedImage
3192         * WebProcess/WebPage/ios/WebPageIOS.mm:
3193         (WebKit::WebPage::getPositionInformation):
3194
3195 2015-07-22  Michael Catanzaro  <mcatanzaro@igalia.com>
3196
3197         [Seccomp Filters] Add helpers to get XDG base directory locations
3198         https://bugs.webkit.org/show_bug.cgi?id=142982
3199
3200         Reviewed by Zan Dobersek.
3201
3202         * PlatformEfl.cmake:
3203         * PlatformGTK.cmake:
3204         * Shared/linux/SeccompFilters/XDGBaseDirectory.h: Added.
3205         * Shared/linux/SeccompFilters/XDGBaseDirectoryGLib.cpp: Added.
3206         (WebKit::userHomeDirectory):
3207         (WebKit::userCacheDirectory):
3208         (WebKit::userConfigDirectory):
3209         (WebKit::userDataDirectory):
3210         (WebKit::userRuntimeDirectory):
3211
3212 2015-07-22  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3213
3214         [EFL][WK2] EWK2ContextTestMultipleProcesses.ewk_context_network_process_model fails to pass
3215         https://bugs.webkit.org/show_bug.cgi?id=142967
3216
3217         Reviewed by Csaba Osztrogonác.
3218
3219         Though processIdentifier() can return 0 when a page is not closed, ewk_context_network_process_model has
3220         not been considered process id can be 0. This patch adds a protection logic which doesn't test when process
3221         id is 0 at the moment.
3222
3223         * UIProcess/API/efl/tests/test_ewk2_context.cpp:
3224         (TEST_F):
3225
3226 2015-07-22  Carlos Garcia Campos  <cgarcia@igalia.com>
3227
3228         Unreviewed. Fix some warnings when generating GTK+ HTML API docs.
3229
3230         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add
3231         WebKitWebsiteDataManager and WebKitWebEditor.
3232
3233 2015-07-21  Carlos Garcia Campos  <cgarcia@igalia.com>
3234
3235         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.9.4 release.
3236
3237         * gtk/NEWS: Add release notes for 2.9.4.
3238
3239 2015-07-21  Joseph Pecoraro  <pecoraro@apple.com>
3240
3241         Web Inspector: [Mac] "Open Image In New Window" context menu item does nothing on an image
3242         https://bugs.webkit.org/show_bug.cgi?id=147175
3243
3244         Reviewed by Timothy Hatcher.
3245
3246         * UIProcess/mac/WebInspectorProxyMac.mm:
3247         (WebKit::getContextMenuFromProposedMenu):
3248         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
3249         Remove default context menus that won't work in the inspector page.
3250
3251 2015-07-21  Benjamin Poulain  <benjamin@webkit.org>
3252
3253         [Content Extensions] Use a jump table when consecutive transitions have different targets
3254         https://bugs.webkit.org/show_bug.cgi?id=147099
3255
3256         Reviewed by Alex Christensen.
3257
3258         * UIProcess/API/APIUserContentExtensionStore.h:
3259
3260 2015-07-21  Daniel Bates  <dabates@apple.com>
3261
3262         Fix the build following <https://trac.webkit.org/changeset/187129>
3263         (https://bugs.webkit.org/show_bug.cgi?id=147112)
3264
3265         * UIProcess/WebProcessProxy.cpp:
3266         (WebKit::WebProcessProxy::reinstateNetworkProcessAssertionState): Guard implementation with PLATFORM(IOS)
3267         since this logic is specific to the iOS port.
3268
3269 2015-07-21  Simon Fraser  <simon.fraser@apple.com>
3270
3271         Rename the 'View' log channel to 'Printing'
3272         https://bugs.webkit.org/show_bug.cgi?id=147172
3273
3274         Reviewed by Zalan Bujtas.
3275
3276         "View" was a terrible name for a log channel that was all about printing.
3277         Sort the log channels.
3278
3279         * Platform/Logging.h:
3280         * UIProcess/API/mac/WKView.mm:
3281         (-[WKView drawRect:]):
3282         (-[WKView printOperationWithPrintInfo:forFrame:]):
3283         * UIProcess/mac/WKPrintingView.mm:
3284         (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]):
3285         (pageDidComputePageRects):
3286         (-[WKPrintingView knowsPageRange:]):
3287         (-[WKPrintingView drawRect:]):
3288         (-[WKPrintingView rectForPage:]):
3289         (-[WKPrintingView beginDocument]):
3290         (-[WKPrintingView endDocument]):
3291
3292 2015-07-21  Zalan Bujtas  <zalan@apple.com>
3293
3294         [iOS] Menu drop down such as on nike.com does not stay
3295         https://bugs.webkit.org/show_bug.cgi?id=147047
3296         rdar://problem/21046961
3297
3298         Reviewed by Benjamin Poulain.
3299
3300         This is a workaround for unintended scrolling while scaling.
3301         (Based on Benjamin Poulain's WIP patch for webkit.org/b/136904)
3302
3303         In certain cases when scaling would result in moving the scrollview (which would trigger
3304         a scroll event on WebCore side), zoomRect is called instead of setZoomScale to ensure
3305         that the scroll position stays intact.
3306
3307         * UIProcess/API/Cocoa/WKWebView.mm:
3308         (-[WKWebView _didCommitLayerTree:]):
3309
3310 2015-07-21  Daniel Bates  <dabates@apple.com>
3311
3312         WTFCrash() in WebKit::WebProcess::networkConnection()
3313         https://bugs.webkit.org/show_bug.cgi?id=147112
3314         <rdar://problem/18477459>
3315
3316         Reviewed by Gavin Barraclough.
3317
3318         Fixes an issue where a newly launched network process may be jetsam'd because it has not
3319         taken a process assertion between the time it was launched and the time when a web process
3320         makes use of it.
3321
3322         Initially a network process does not have a process assertion. A process assertion is taken
3323         (if one has not been taken) for the network process when a process assertion is taken for at
3324         least one web process. When the network process crashes a WebProcess may ultimately launch a
3325         new network process in WebProcess::networkConnection(). The new network process may be jetsam'd
3326         immediately when the system is under some measure pressure because it has a low jetsam priority,
3327         0 (since it does not have a process assertion and higher priority implies that a process is less
3328         likely to be jetsam'd). And the logic in WebProcess::networkConnection() explicitly calls
3329         CRASH() if the newly launched network process crashes immediately. Towards preventing the newly
3330         launched network process from being jetsam'd we should obtain a process assertion for it.
3331
3332         * UIProcess/WebProcessPool.cpp:
3333         (WebKit::WebProcessPool::WebProcessPool): Initialize m_didNetworkProcessCrash to false.
3334         (WebKit::WebProcessPool::ensureNetworkProcess): If the network process crashed (m_didNetworkProcessCrash == true)
3335         then tell each process in the pool to reinstate their network activity token for the new network process.
3336         (WebKit::WebProcessPool::networkProcessCrashed): Set m_didNetworkProcessCrash to true when the
3337         network process crashed.
3338         * UIProcess/WebProcessPool.h:
3339         * UIProcess/WebProcessProxy.cpp:
3340         (WebKit::WebProcessProxy::reinstateNetworkProcessAssertionState): Added.
3341         (WebKit::WebProcessProxy::didSetAssertionState): Add assert to ensure we never have both
3342         a background- and foreground- activity token for the network process.
3343         * UIProcess/WebProcessProxy.h:
3344
3345 2015-07-21  Daniel Bates  <dabates@apple.com>
3346
3347         ASSERT(m_suspendMessageCount >= 0) fails in ProcessThrottler::didCancelProcessSuspension()
3348         when WebContent process crashes; Network process may never voluntarily suspend
3349         https://bugs.webkit.org/show_bug.cgi?id=147122
3350         <rdar://problem/21906759>
3351
3352         Reviewed by Chris Dumez.
3353
3354         Fixes an issue where the network process may never voluntarily release its process assertion.
3355
3356         Currently the network process always sends both a ProcessReadyToSuspend and CancelPrepareToSuspend
3357         message in response to receiving a PrepareToSuspend message and CancelPrepareToSuspend message,
3358         respectively. The process throttler expects to receive either a ProcessReadyToSuspend message
3359         or a CancelPrepareToSuspend message (and not both) in response to sending the message sequence
3360         PrepareToSuspend, CancelPrepareToSuspend. When a process throttler receives both messages in
3361         response to this sequence then its internal message count becomes imbalanced and it will
3362         never release the process assertion it manages. One user interaction that can cause such an
3363         imbalance, in the process throttler held by NetworkProcessProxy, is switching tabs.
3364
3365         * NetworkProcess/NetworkProcess.cpp:
3366         (WebKit::NetworkProcess::cancelPrepareToSuspend): Do not send message NetworkProcessProxy::DidCancelProcessSuspension. 
3367         * UIProcess/Network/NetworkProcessProxy.cpp:
3368         (WebKit::NetworkProcessProxy::didCancelProcessSuspension): Deleted.
3369         * UIProcess/Network/NetworkProcessProxy.h:
3370         * UIProcess/Network/NetworkProcessProxy.messages.in: Remove message NetworkProcessProxy::DidCancelProcessSuspension.
3371
3372 2015-07-21  Matthew Daiter  <mdaiter@apple.com>
3373
3374         Make sure to invalidate requests for user media after webpage reset
3375         https://bugs.webkit.org/show_bug.cgi?id=147155
3376         <rdar://problem/21924174>
3377
3378         Reviewed by Brent Fulgham.
3379
3380         * UIProcess/WebPageProxy.cpp:
3381         (WebKit::WebPageProxy::resetState): Added user media reset
3382
3383 2015-07-21  Tim Horton  <timothy_horton@apple.com>
3384
3385         [iOS] Avoid using a TextIndicator if there are non-text things to indicate
3386         https://bugs.webkit.org/show_bug.cgi?id=147152
3387         <rdar://problem/21921061>
3388
3389         Reviewed by Beth Dakin.
3390
3391         * UIProcess/ios/WKContentViewInteraction.mm:
3392         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]):
3393         * WebProcess/WebPage/ios/WebPageIOS.mm:
3394         (WebKit::shouldUseTextIndicatorForLink):
3395         (WebKit::WebPage::getPositionInformation):
3396         Fall back to a rectangular area instead of a TextIndicator if there are any
3397         non-inline elements inside the link.
3398
3399 2015-07-21  Andreas Kling  <akling@apple.com>
3400
3401         API::Session should clean up its storage in the network process when destroyed.
3402         <https://webkit.org/b/147139>
3403         <rdar://problem/21838764>
3404
3405         Reviewed by Anders Carlsson.
3406
3407         Have ~Session() send a DestroyPrivateBrowsingSession message to all networking processes
3408         for ephemeral sessions. This plugs a NetworkStorageSession leak that could retain a large
3409         CFNetwork object graph.
3410
3411         * UIProcess/API/APISession.cpp:
3412         (API::Session::~Session):
3413
3414 2015-07-21  Sungmann Cho  <sungmann.cho@navercorp.com>
3415
3416         Make PluginProxy::handleMouseEvent() asynchronous.
3417         https://bugs.webkit.org/show_bug.cgi?id=146142
3418
3419         Reviewed by Anders Carlsson.
3420
3421         PluginProxy::handleMouseEvent() forwards the generated mouse event to PluginControllerProxy
3422         using a synchronous message, but the recipient always reply immediately with the same value("true")
3423         even before handling the received message. So I think PluginProxy::handleMouseEvent() is perfectly
3424         OK to process its messages asynchronously.
3425
3426         * PluginProcess/PluginControllerProxy.cpp:
3427         (WebKit::PluginControllerProxy::handleMouseEvent):
3428         * PluginProcess/PluginControllerProxy.h:
3429         * PluginProcess/PluginControllerProxy.messages.in:
3430         * WebProcess/Plugins/PluginProxy.cpp:
3431         (WebKit::PluginProxy::handleMouseEvent):
3432
3433 2015-07-20  Carlos Garcia Campos  <cgarcia@igalia.com>
3434
3435         [GTK] Add API to be notified about editor state changes
3436         https://bugs.webkit.org/show_bug.cgi?id=145875
3437
3438         Reviewed by Gustavo Noronha Silva.
3439
3440         Add WebKitEditorState object, that is created on demand by the
3441         WebKitWebView and can be used to get the typing attributes of the
3442         editor at the current position or selection.
3443
3444         * PlatformGTK.cmake:
3445         * Shared/EditorState.cpp: Use part of the PostLayoutData struct
3446         for the GTK port too.
3447         (WebKit::EditorState::encode): Encode PostLayoutData for GTK and
3448         remove our custom cursorRect.
3449         (WebKit::EditorState::decode): Decode PostLayoutData for GTK and
3450         remove our custom cursorRect.
3451         (WebKit::EditorState::PostLayoutData::encode): Reorder it to
3452         reduce the amonut of ifdefs.
3453         (WebKit::EditorState::PostLayoutData::decode): Ditto.
3454         * Shared/EditorState.h: Add AttributeStrikeThrough to
3455         TypingAttributes enum.
3456         * UIProcess/API/gtk/PageClientImpl.cpp:
3457         (WebKit::PageClientImpl::selectionDidChange): Rename
3458         updateTextInputState() to selectionDidChange() and also notify the
3459         WebKitWebView.
3460         * UIProcess/API/gtk/PageClientImpl.h:
3461         * UIProcess/API/gtk/WebKitEditorState.cpp: Added.
3462         (webkitEditorStateGetProperty):
3463         (webkit_editor_state_class_init):
3464         (webkitEditorStateSetTypingAttributes):
3465         (webkitEditorStateCreate):
3466         (webkitEditorStateChanged):
3467         (webkit_editor_state_get_typing_attributes):
3468         * UIProcess/API/gtk/WebKitEditorState.h: Added.
3469         * UIProcess/API/gtk/WebKitEditorStatePrivate.h: Added.
3470         * UIProcess/API/gtk/WebKitWebView.cpp:
3471         (webkitWebViewSelectionDidChange): Notify the WebKitEditorState if
3472         it has already been created.
3473         (webkit_web_view_get_editor_state): Ensure a WebKitEditorState and
3474         return it.
3475         * UIProcess/API/gtk/WebKitWebView.h:
3476         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3477         (webkitWebViewBaseUpdateTextInputState): Get the caret cursor rect
3478         from PostLayoutData.
3479         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
3480         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
3481         * UIProcess/API/gtk/docs/webkit2gtk-4.0.types: Add webkit_editor_state_get_type.
3482         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section for WebKitEditorState.
3483         * UIProcess/API/gtk/webkit2.h: Include WebKitEditorState.h.
3484         * UIProcess/PageClient.h:
3485         * UIProcess/gtk/WebPageProxyGtk.cpp:
3486         (WebKit::WebPageProxy::editorStateChanged): Call PageClientImpl::selectionDidChange().
3487         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
3488         (WebKit::WebPage::platformEditorState): Add typing attributes to EditorState.
3489
3490 2015-07-20  Simon Fraser  <simon.fraser@apple.com>
3491
3492         Fix the iOS build.
3493
3494         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
3495
3496 2015-07-20  Simon Fraser  <simon.fraser@apple.com>
3497
3498         Facebook in tiled fullscreen is slow
3499         https://bugs.webkit.org/show_bug.cgi?id=147134
3500         rdar://problem/21823349
3501
3502         Reviewed by Tim Horton.
3503         
3504         TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded() could cause a page to toggle
3505         between two fixed layout sizes differing by a pixel, because of rounding. This would cause
3506         lots of extra layouts and painting.
3507         
3508         This happened because the the fixed layout size was computed using ceil(m_webPage.size().width() / viewScale)
3509
3510         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3511         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
3512
3513 2015-07-20  Wenson Hsieh  <wenson_hsieh@apple.com>
3514
3515         Fix crash due to RemoteLayerTreeDisplayRefreshMonitor outliving RemoteLayerTreeDrawingArea
3516         https://bugs.webkit.org/show_bug.cgi?id=147124
3517         <rdar://problem/21582858>
3518
3519         Reviewed by Simon Fraser.
3520
3521         Refactors RemoteLayerTreeDisplayRefreshMonitor to use a weak pointer rather than a reference
3522         to its RemoteLayerTreeDrawingArea, since the drawing area may be deallocated before the monitor
3523         in some rare cases. This rarely caused pages using requestAnimationFrame to crash on iOS. However,
3524         this should not be the case: logically, a RemoteLayerTreeDrawingArea should always outlive its
3525         refresh monitors. Refer to https://bugs.webkit.org/show_bug.cgi?id=147128 for more details.
3526
3527         * WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.h:
3528         * WebProcess/WebPage/Cocoa/RemoteLayerTreeDisplayRefreshMonitor.mm:
3529         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::RemoteLayerTreeDisplayRefreshMonitor):
3530         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::~RemoteLayerTreeDisplayRefreshMonitor): On destruction, checks
3531             first to see whether or not the drawing area has been deallocated before telling it to update its monitors.
3532         (WebKit::RemoteLayerTreeDisplayRefreshMonitor::requestRefreshCallback):
3533         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
3534         (WebKit::RemoteLayerTreeDrawingArea::createWeakPtr): Creates and returns a new weak pointer to itself.
3535         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3536         (WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
3537
3538 2015-07-20  Alex Christensen  <achristensen@webkit.org>
3539
3540         [Content Extensions] Cache actions with domains that match everything
3541         https://bugs.webkit.org/show_bug.cgi?id=147050
3542
3543         Reviewed by Benjamin Poulain.
3544
3545         * UIProcess/API/APIUserContentExtensionStore.h:
3546
3547 2015-07-20  Gordon Sheridan  <gordon_sheridan@apple.com>
3548
3549         Support blocking a plug-in for non-security reasons
3550         https://bugs.webkit.org/show_bug.cgi?id=145009
3551
3552         Reviewed by Anders Carlsson.
3553
3554         * Shared/Plugins/PluginModuleInfo.h:
3555         Replace PluginModuleBlocked with separate enum values for blocking for security and compatibility.
3556
3557         * UIProcess/API/C/WKAPICast.h:
3558         (WebKit::toWKPluginLoadPolicy):
3559         Modify to handle change to PluginModuleBlocked enum.
3560
3561         (WebKit::toPluginModuleLoadPolicy):
3562         Ditto.
3563
3564         * UIProcess/API/C/WKPluginLoadPolicy.h:
3565         Added enum value for blocking a plugin for compatibility reasons.
3566
3567         * UIProcess/Plugins/mac/PluginInfoStoreMac.mm:
3568         (WebKit::shouldBlockPlugin):
3569         Check load policy for both reasons a plugin may be blocked.
3570
3571         (WebKit::WKPlugInModuleLoadPolicyToPluginModuleLoadPolicy):
3572         Added function to convert between load policy enum types.
3573
3574         (WebKit::PluginInfoStore::defaultLoadPolicyForPlugin):
3575         Modified to call WKLoadPolicyForPluginVersion() which can distinguish between blocked for security or compatibility.
3576
3577         * UIProcess/WebPageProxy.cpp:
3578         (WebKit::WebPageProxy::findPlugin):
3579         Updated to recognize both PluginModuleBlocked enum values that indicate a plugin is blocked.
3580
3581         * WebProcess/WebPage/WebPage.cpp:
3582         (WebKit::WebPage::createPlugin):
3583         Ditto.
3584
3585         (WebKit::WebPage::canPluginHandleResponse):
3586         Ditto.
3587
3588 2015-07-20  Antti Koivisto  <antti@apple.com>
3589
3590         NSURLCache fallback does not work on iOS due to sandboxing
3591         https://bugs.webkit.org/show_bug.cgi?id=146314
3592         <rdar://problem/21433691>
3593
3594         Reviewed by Anders Carlsson.
3595
3596         This broke with earlier cache path computation changes.
3597
3598         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3599         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
3600
3601             NSURLCache path is relative to the container cache path so "." is sufficient.
3602             This puts the cache files under
3603             <container>/Library/Caches/com.apple.WebKit.Networking/
3604
3605 2015-07-20  Jeremy Jones  <jeremyj@apple.com>
3606
3607         Adopt AVPlayerLayerView
3608         https://bugs.webkit.org/show_bug.cgi?id=146862
3609
3610         Reviewed by Simon Fraser.
3611
3612         The CALayerHost is replaced with WebLayerHostView to be compatible with UIView animations.
3613         videoLayerFrame and videoLayerGravity no longer need to be stored because they are stored
3614         where they are used in the interface. Some animation is improved in the conversion.
3615
3616         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
3617         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
3618         (+[WebLayerHostView layerClass]): Add class WebLayerHostView.
3619         (-[WebLayerHostView contextID]):
3620         (-[WebLayerHostView setContextID:]):
3621         (-[WebLayerHostView layerHost]):
3622         (WebKit::WebVideoFullscreenManagerProxy::invalidate): layer -> view
3623         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
3624         Apply the hostingDeviceScaleFactor transform to -sublayerTransform instead of to
3625         -transform. This more directly inverts the tranform WebProcess and allows -transform
3626         to be used for animation in the UIProcess. This is important because UIView's actions
3627         animate -transform, but not -sublayerTrasform.
3628
3629         (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen): layer -> view
3630         (WebKit::WebVideoFullscreenModelContext::setVideoLayerFrame): Deleted.
3631         (WebKit::WebVideoFullscreenModelContext::videoLayerFrame): Deleted.
3632         (WebKit::WebVideoFullscreenModelContext::setVideoLayerGravity): Deleted.
3633         (WebKit::WebVideoFullscreenModelContext::videoLayerGravity): Deleted.
3634         * WebProcess/ios/WebVideoFullscreenManager.mm:
3635         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
3636         Set initial video layer frame to fix start point of animation.
3637
3638         (WebKit::WebVideoFullscreenManager::didSetupFullscreen):
3639         dispatch_async allows the CATransaction to complete before continuing with the animation.
3640         This prevents a flash during animation.
3641
3642 2015-07-20  Tim Horton  <timothy_horton@apple.com>
3643
3644         REGRESSION (r174287): Flash of black when opening a new web view or navigating to a new page
3645         https://bugs.webkit.org/show_bug.cgi?id=147127
3646         <rdar://problem/21474317>
3647
3648         Reviewed by Simon Fraser.
3649
3650         * WebProcess/WebPage/WebPage.cpp:
3651         (WebKit::WebPage::snapshotAtSize):
3652         Avoid using an invalid documentBackgroundColor, fall back to baseBackgroundColor
3653         like we did before r174287.
3654
3655 2015-07-20  Michael Catanzaro  <mcatanzaro@igalia.com>
3656
3657         [Seccomp] Should be easier to debug blocked syscalls
3658         https://bugs.webkit.org/show_bug.cgi?id=142980
3659
3660         These should be printed even when not running in debug mode. There is no
3661         value in hiding errors from release build users.
3662
3663         Reviewed by Žan Doberšek.
3664
3665         * Shared/linux/SeccompFilters/SeccompBroker.cpp:
3666         (WebKit::SeccompBroker::runLoop): Don't close stderr et. al. in release builds.
3667         * Shared/linux/SeccompFilters/Syscall.cpp:
3668         (WebKit::write_uint): Added.
3669         (WebKit::reportUnexpectedSyscall): Added.
3670         (WebKit::Syscall::createFromContext): Call reportUnexpectedSyscall. Also, no need to crash
3671         here in release builds.
3672         * Shared/linux/SeccompFilters/SyscallPolicy.cpp:
3673         (WebKit::SyscallPolicy::hasPermissionForPath): Print a warning when access is denied.
3674         (WebKit::SyscallPolicy::permissionToString): Added.
3675         * Shared/linux/SeccompFilters/SyscallPolicy.h: Add permissionToString.
3676
3677 2015-07-20  Csaba Osztrogonác  <ossy@webkit.org>
3678
3679         Fix the !ENABLE(VIDEO) build after r186396
3680         https://bugs.webkit.org/show_bug.cgi?id=147116
3681
3682         Reviewed by Brent Fulgham.
3683
3684         * WebProcess/WebProcess.cpp:
3685         (WebKit::WebProcess::didClose):
3686
3687 2015-07-20  Tomas Popela  <tpopela@redhat.com>
3688
3689         [GTK] Add selection-changed signal to the WebKit2 API
3690         https://bugs.webkit.org/show_bug.cgi?id=137116
3691
3692         Reviewed by Carlos Garcia Campos.
3693
3694         Add a new object WebKitWebEditor where the editing capabilities of a
3695         WebPage will be grouped and exposed. Add the selection-changed signal
3696         there (we used the same name as in WK1 API).
3697
3698         * PlatformGTK.cmake:
3699         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
3700         * WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp: Added.
3701         (didChangeSelection):
3702         (webkitWebEditorCreate):
3703         (webkit_web_editor_get_page):
3704         * WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.h: Added.
3705         * WebProcess/InjectedBundle/API/gtk/WebKitWebEditorPrivate.h: Added.
3706         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
3707         (webkitWebPageGetPage):
3708         (webkit_web_page_get_editor):
3709         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h:
3710         * WebProcess/InjectedBundle/API/gtk/WebKitWebPagePrivate.h:
3711         * WebProcess/InjectedBundle/API/gtk/webkit-web-extension.h:
3712
3713 2015-07-16  Anders Carlsson  <andersca@apple.com>
3714
3715         WebsiteDataStore operations need to grab background assertions
3716         https://bugs.webkit.org/show_bug.cgi?id=147015
3717         rdar://problem/21799011
3718
3719         Reviewed by Sam Weinig.
3720
3721         * UIProcess/Network/NetworkProcessProxy.cpp:
3722         (WebKit::NetworkProcessProxy::fetchWebsiteData):
3723         (WebKit::NetworkProcessProxy::deleteWebsiteData):
3724         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
3725         * UIProcess/WebProcessProxy.cpp:
3726         (WebKit::WebProcessProxy::fetchWebsiteData):
3727         (WebKit::WebProcessProxy::deleteWebsiteData):
3728         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
3729
3730 2015-07-19  Michael Catanzaro  <mcatanzaro@igalia.com>
3731
3732         Unreviewed, placate -Wmismatched-tags after r187011
3733
3734         It's basically bug #146990 again. Oops.
3735
3736         * WebProcess/gtk/SeccompFiltersWebProcessGtk.h:
3737
3738 2015-07-19  Michael Catanzaro  <mcatanzaro@igalia.com>
3739
3740         [GTK] Add seccomp filters support
3741         https://bugs.webkit.org/show_bug.cgi?id=110014
3742
3743         Reviewed by Žan Doberšek.
3744
3745         Allow building with ENABLE_SECCOMP_FILTERS=ON. Based on work by Thiago Marcos P. Santos.
3746
3747         * PlatformGTK.cmake: Support ENABLE_SECCOMP_FILTERS build option.
3748         * WebProcess/gtk/SeccompFiltersWebProcessGtk.cpp: Added.
3749         (WebKit::SeccompFiltersWebProcessGtk::SeccompFiltersWebProcessGtk):
3750         (WebKit::SeccompFiltersWebProcessGtk::platformInitialize):
3751         * WebProcess/gtk/SeccompFiltersWebProcessGtk.h: Added.
3752         * WebProcess/soup/WebProcessSoup.cpp:
3753         (WebKit::WebProcess::platformInitializeWebProcess): Initialize default
3754         GTK+ web process seccomp filters.
3755
3756 2015-07-18  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3757
3758         Reduce PassRefPtr in WebKit2 - 3
3759         https://bugs.webkit.org/show_bug.cgi?id=146995
3760
3761         Reviewed by Daniel Bates.
3762
3763         To remove PassRefPtr, this patch reduces use of PassRefPtr in WebKit2.
3764         Because some uses depend on WebCore, WebCore, WK1 ports are modified as well.
3765
3766         * DatabaseProcess/DatabaseProcess.cpp:
3767         (WebKit::DatabaseProcess::getOrCreateUniqueIDBDatabase):
3768         * DatabaseProcess/DatabaseProcess.h:
3769         * PluginProcess/PluginControllerProxy.cpp:
3770         (WebKit::PluginControllerProxy::takeInitializationReply):
3771         * PluginProcess/PluginControllerProxy.h:
3772         * Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
3773         (WebKit::CoordinatedBackingStore::texture):
3774         * Shared/CoordinatedGraphics/CoordinatedBackingStore.h:
3775         (WebKit::CoordinatedBackingStore::create):
3776         * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp:
3777         (WebKit::WebCoordinatedSurface::create):
3778         (WebKit::WebCoordinatedSurface::createWithSurface):
3779         * Shared/CoordinatedGraphics/WebCoordinatedSurface.h:
3780         * UIProcess/API/APILoaderClient.h:
3781         (API::LoaderClient::webCryptoMasterKey):
3782         * UIProcess/API/APINavigationClient.h:
3783         (API::NavigationClient::webCryptoMasterKey):
3784         * UIProcess/API/C/WKPage.cpp:
3785         (WKPageSetPageLoaderClient):
3786         (WKPageSetPageNavigationClient):
3787         * UIProcess/API/gtk/PageClientImpl.cpp:
3788         (WebKit::PageClientImpl::createPopupMenuProxy):
3789         (WebKit::PageClientImpl::createContextMenuProxy):
3790         (WebKit::PageClientImpl::createColorPicker):
3791         * UIProcess/API/gtk/PageClientImpl.h:
3792         * UIProcess/Authentication/WebCredential.h:
3793         * UIProcess/Authentication/WebProtectionSpace.h:
3794         * UIProcess/AutoCorrectionCallback.h:
3795         * UIProcess/Cocoa/NavigationState.h:
3796         * UIProcess/Cocoa/NavigationState.mm:
3797         (WebKit::NavigationState::NavigationClient::webCryptoMasterKey):
3798         * UIProcess/CoordinatedGraphics/WebView.cpp:
3799         (WebKit::WebView::createPopupMenuProxy):
3800         (WebKit::WebView::createContextMenuProxy):
3801         (WebKit::WebView::createColorPicker):
3802         * UIProcess/CoordinatedGraphics/WebView.h:
3803         * UIProcess/PageClient.h:
3804         * UIProcess/WebPageProxy.h:
3805         * UIProcess/efl/WebViewEfl.cpp:
3806         (WebKit::WebViewEfl::createPopupMenuProxy):
3807         (WebKit::WebViewEfl::createContextMenuProxy):
3808         (WebKit::WebViewEfl::createColorPicker):
3809         * UIProcess/efl/WebViewEfl.h:
3810         * UIProcess/ios/PageClientImplIOS.h:
3811         * UIProcess/ios/PageClientImplIOS.mm:
3812         (WebKit::PageClientImpl::createPopupMenuProxy):
3813         (WebKit::PageClientImpl::createContextMenuProxy):
3814         * UIProcess/ios/WebPageProxyIOS.mm:
3815         (WebKit::WebPageProxy::dataSelectionForPasteboard):
3816         * UIProcess/mac/PageClientImpl.h:
3817         * UIProcess/mac/PageClientImpl.mm:
3818         (WebKit::PageClientImpl::createPopupMenuProxy):
3819         (WebKit::PageClientImpl::createContextMenuProxy):
3820         (WebKit::PageClientImpl::createColorPicker):
3821         * UIProcess/mac/WebPageProxyMac.mm:
3822         (WebKit::WebPageProxy::dataSelectionForPasteboard):
3823         * WebProcess/Network/WebResourceLoadScheduler.cpp:
3824         (WebKit::WebResourceLoadScheduler::scheduleSubresourceLoad):
3825         (WebKit::WebResourceLoadScheduler::schedulePluginStreamLoad):
3826         * WebProcess/Network/WebResourceLoadScheduler.h:
3827         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
3828         (WebKit::NetscapePlugin::fromNPP):
3829         (WebKit::NetscapePlugin::snapshot):
3830         (WebKit::NetscapePlugin::liveResourceData):
3831         * WebProcess/Plugins/Netscape/NetscapePlugin.h:
3832         * WebProcess/Plugins/Plugin.h:
3833         * WebProcess/Plugins/PluginProxy.cpp:
3834         (WebKit::PluginProxy::snapshot):
3835         (WebKit::PluginProxy::liveResourceData):
3836         * WebProcess/Plugins/PluginProxy.h:
3837         * WebProcess/Storage/StorageNamespaceImpl.cpp:
3838         (WebKit::StorageNamespaceImpl::storageArea):
3839         (WebKit::StorageNamespaceImpl::copy):
3840         * WebProcess/Storage/StorageNamespaceImpl.h:
3841         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
3842         (WebKit::toHistoryItem):
3843         * WebProcess/WebCoreSupport/SessionStateConversion.h:
3844         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3845         (WebKit::WebChromeClient::createPopupMenu):
3846         (WebKit::WebChromeClient::createSearchPopupMenu):
3847         * WebProcess/WebCoreSupport/WebChromeClient.h:
3848         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3849         (WebKit::WebFrameLoaderClient::createDocumentLoader):
3850         (WebKit::WebFrameLoaderClient::createFrame):
3851         (WebKit::WebFrameLoaderClient::createPlugin):
3852         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3853         * WebProcess/WebPage/WebPage.cpp:
3854         (WebKit::WebPage::create):
3855         (WebKit::WebPage::createDocumentLoader):
3856         * WebProcess/WebPage/WebPage.h:
3857         * WebProcess/WebPage/mac/WebPageMac.mm:
3858         (WebKit::WebPage::lookupTextAtLocation):
3859
3860 2015-07-18  Simon Fraser  <simon.fraser@apple.com>
3861
3862         Scroll position jumps when scrolling scaling pages down in split view
3863         https://bugs.webkit.org/show_bug.cgi?id=147072
3864         rdar://problem/21769577
3865
3866         Reviewed by Sam Weinig.
3867         
3868         When apple.com/music is in Split View at a reduced scale, scrolling the page
3869         can cause unwanted scroll jumps. This happened because we'd enter
3870         TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded() with a pending
3871         layout, so run the autosizing logic. When scrolled near the bottom, the unconstrained
3872         layout resulted in a shorter document, which truncated the scroll position. The
3873         scaled layout then restored the longer document, but it also restored that
3874         truncated scroll position.
3875         
3876         Forcing a layout is sufficient to fix the bug for this page, and doing a single
3877         layout (which will happen anyway) is preferable to running the autosize logic
3878         if layout happens to be dirty.
3879
3880         I was not able to make a test to reproduce the problem. Entering
3881         scaleViewToFitDocumentIfNeeded() with pending layout was triggerable
3882         using a transform transition, but I was not able to reproduce incorrect
3883         scroll position restoration.
3884
3885         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3886         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
3887
3888 2015-07-17  Andy Estes  <aestes@apple.com>
3889
3890         [iOS] Further tighten the sandbox around pages fetched with Content-Disposition: attachment
3891         https://bugs.webkit.org/show_bug.cgi?id=147044
3892         rdar://problem/21567820
3893
3894         Reviewed by Brady Eidson.
3895
3896         * WebProcess/WebPage/WebPage.cpp:
3897         (WebKit::WebPage::WebPage): Enabled Content-Disposition: attachment sandbox on iOS.
3898
3899 2015-07-17  Tim Horton  <timothy_horton@apple.com>
3900
3901         [iOS] TextIndicator has a large forehead when line-height > 1
3902         https://bugs.webkit.org/show_bug.cgi?id=147058
3903         <rdar://problem/21643094>
3904
3905         Reviewed by Dean Jackson.
3906
3907         * WebProcess/WebPage/ios/WebPageIOS.mm:
3908         (WebKit::WebPage::getPositionInformation):
3909         Apply a review comment that I left myself and then forgot about.
3910
3911 2015-07-17  Enrica Casucci  <enrica@apple.com>
3912
3913         [iOS] Implement selectionInteractionAssistant accessor.
3914         https://bugs.webkit.org/show_bug.cgi?id=147054
3915         rdar://problem/20864286
3916
3917         Reviewed by Tim Horton.
3918
3919         One more change to adopt the new selection interaction
3920         model on iOS.
3921
3922         * UIProcess/ios/WKContentViewInteraction.mm:
3923         (-[WKContentView selectionInteractionAssistant]):
3924
3925 2015-07-17  Dan Bernstein  <mitz@apple.com>
3926
3927         REGRESSION (r186964): Crash in WebKit2.CloseFromWithinCreatePage
3928         https://bugs.webkit.org/show_bug.cgi?id=147055
3929
3930         Reviewed by Alex Christensen.
3931
3932         * UIProcess/WebPageProxy.cpp:
3933         (WebKit::WebPageProxy::createNewPage): Grab the main frame’s URL before calling out to the
3934         client, who may destroy the frame.
3935
3936 2015-07-17  Dan Bernstein  <mitz@apple.com>
3937
3938         WebKit2 part of <rdar://problem/21803781> The external URL policy is not reported correctly in navigation actions that create new windows
3939         https://bugs.webkit.org/show_bug.cgi?id=147040
3940
3941         Reviewed by Dean Jackson.
3942
3943         * UIProcess/Cocoa/UIDelegate.mm:
3944         (WebKit::UIDelegate::UIClient::createNewPage): Disallow App Links if the new page is for the
3945         same protocol, host and port as the main frame of this page.
3946
3947         * UIProcess/WebPageProxy.cpp:
3948         (WebKit::WebPageProxy::decidePolicyForNavigationAction): Disallow App Links if
3949         m_shouldSuppressAppLinksInNextNavigationPolicyDecision is set, and reset it. See below for
3950         when we set it.
3951         (WebKit::WebPageProxy::decidePolicyForNewWindowAction): Disallow App Links if the new window
3952         is for the same protocol, host and port as the main frame of this page.
3953         (WebKit::WebPageProxy::createNewPage): Make the new page disallow App Links in the first
3954         policy decision if it is for the same protocol, host and port as the main frame of this
3955         page.
3956         * UIProcess/WebPageProxy.h: Added m_shouldSuppressAppLinksInNextNavigationPolicyDecision
3957         member variable.
3958
3959         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3960         (WebKit::WebChromeClient::createWindow): Pass the shouldOpenExternalURLsPolicy.
3961
3962         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3963         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): Ditto.
3964
3965 2015-07-17  Tim Horton  <timothy_horton@apple.com>
3966
3967         iOS TextIndicators include text that is not supposed to be indicated
3968         https://bugs.webkit.org/show_bug.cgi?id=147028
3969         <rdar://problem/21643094>
3970
3971         Reviewed by Sam Weinig.
3972
3973         * WebProcess/Plugins/PluginView.cpp:
3974         (WebKit::PluginView::shouldCreateTransientPaintingSnapshot):
3975
3976 2015-07-17  Carlos Garcia Campos  <cgarcia@igalia.com>
3977
3978         [GTK] Cleanup PasteboardHelper
3979         https://bugs.webkit.org/show_bug.cgi?id=147035
3980
3981         Reviewed by Žan Doberšek.
3982
3983         Use PasteboardHelper::singleton() instead of
3984         PasteboardHelper::defaultPasteboardHelper().
3985
3986         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3987         (webkitWebViewBaseConstructed):
3988         * UIProcess/gtk/DragAndDropHandler.cpp:
3989         (WebKit::DragAndDropHandler::startDrag):
3990         (WebKit::DragAndDropHandler::fillDragData):
3991         (WebKit::DragAndDropHandler::dataObjectForDropData):
3992         (WebKit::DragAndDropHandler::requestDragData):
3993
3994 2015-07-16  Matt Baker  <mattbaker@apple.com>
3995
3996         [Mac] Web Inspector toolbar can be covered by the Safari tab bar when docked to the right
3997         https://bugs.webkit.org/show_bug.cgi?id=146994
3998
3999         Reviewed by Timothy Hatcher.
4000
4001         WebInspectorProxy contained logic which ignored the next frame change notification from the inspected view,
4002         whenever it updated the frames of both the Inspector view and inspected view. This patch removes that logic,
4003         as it prevented the Inspector's frame from being adjusted after changes to the browser's top content inset.
4004
4005         * UIProcess/mac/WebInspectorProxyMac.mm:
4006         (-[WKWebInspectorProxyObjCAdapter ignoreNextInspectedViewFrameDidChange]): Deleted.
4007         (-[WKWebInspectorProxyObjCAdapter inspectedViewFrameDidChange:]): Deleted.
4008         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange): Deleted.
4009
4010 2015-07-16  Joseph Pecoraro  <pecoraro@apple.com>
4011
4012         Web Inspector: [Mac] Save dialog not working when inspector is docked
4013         https://bugs.webkit.org/show_bug.cgi?id=146991
4014
4015         Reviewed by Sam Weinig.
4016
4017         * UIProcess/mac/WebInspectorProxyMac.mm:
4018         (WebKit::runOpenPanel):
4019         (WebKit::WebInspectorProxy::platformSave):
4020         When the window is nil (docked) use a non-window version of running the dialog.
4021
4022 2015-07-16  Tim Horton  <timothy_horton@apple.com>
4023
4024         Add shrink-wrapped link highlights
4025         https://bugs.webkit.org/show_bug.cgi?id=147021
4026         <rdar://problem/21643094>
4027
4028         Reviewed by Enrica Casucci.
4029
4030         * Shared/InteractionInformationAtPosition.cpp:
4031         (WebKit::InteractionInformationAtPosition::encode):
4032         (WebKit::InteractionInformationAtPosition::decode):
4033         * Shared/InteractionInformationAtPosition.h:
4034         Add a TextIndicator to InteractionInformationAtPosition.
4035         Make use of some new C++ features.
4036
4037         * UIProcess/ios/WKContentViewInteraction.h:
4038         * UIProcess/ios/WKContentViewInteraction.mm:
4039         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]):
4040         (-[WKContentView didDismissPreviewViewController:committing:]):
4041         Make use of the TextIndicator (if we have one) to show a shrink-wrapped
4042         snapshot of the link.
4043
4044         * WebProcess/WebPage/ios/WebPageIOS.mm:
4045         (WebKit::WebPage::getPositionInformation):
4046         Build a TextIndicator for the link if possible.
4047
4048 2015-07-16  Matt Rajca  <mrajca@apple.com>
4049
4050         Media Session: remove plumbing for delivering start/end-of-interruption events
4051         https://bugs.webkit.org/show_bug.cgi?id=147005
4052
4053         Reviewed by Eric Carlson.
4054
4055         Instead of receiving interruptions through WebKit, we will provide platform-specific implementations in WebCore
4056         so the same behavior is available to all clients.
4057
4058         * UIProcess/API/C/WKPage.cpp:
4059         * UIProcess/API/C/WKPagePrivate.h:
4060         * UIProcess/WebPageProxy.cpp:
4061         * UIProcess/WebPageProxy.h:
4062         * WebProcess/WebPage/WebPage.cpp:
4063         * WebProcess/WebPage/WebPage.h:
4064         * WebProcess/WebPage/WebPage.messages.in:
4065
4066 2015-07-16  Michael Catanzaro  <mcatanzaro@igalia.com>
4067
4068         REGRESSION(r186464): [SOUP] ASSERTION FAILED: !m_messageReceiverMapCount when closing any tab
4069         https://bugs.webkit.org/show_bug.cgi?id=147006
4070
4071         Reviewed by Anders Carlsson.
4072
4073         Remove the message receiver before it is deallocated.
4074
4075         * UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp: