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