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