NetworkSession: Add NetworkDataTask implementation for blobs
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2016-11-04  Carlos Garcia Campos  <cgarcia@igalia.com>
2
3         NetworkSession: Add NetworkDataTask implementation for blobs
4         https://bugs.webkit.org/show_bug.cgi?id=163939
5
6         Reviewed by Alex Christensen.
7
8         Add NetworkDataTaskBlob to handle blobs when using NetworkSession instead of using ResourceHandle. This patch
9         adds more USE(NETWORK_SESSION) ifdefs to not use ResourceHandle in Downloads and NetworkLoad when NetworkSession
10         is enabled.
11
12         * CMakeLists.txt: Add new files to compilation.
13         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
14         * NetworkProcess/Downloads/BlobDownloadClient.h:
15         * NetworkProcess/Downloads/Download.cpp:
16         (WebKit::Download::Download): Split the constructor again and remove the PlatformDownloadTaskRef
17         definitions. Now Cocoa specific constructor receives a NSURLSessionDownloadTask and the general constructor
18         reveices a NetworkDataTask and is used by Soup backend and blobs.
19         (WebKit::Download::~Download):
20         (WebKit::Download::start):
21         (WebKit::Download::startWithHandle):
22         (WebKit::Download::cancel):
23         (WebKit::Download::didReceiveAuthenticationChallenge):
24         (WebKit::Download::didReceiveData):
25         (WebKit::Download::didFinish):
26         (WebKit::Download::platformCancelNetworkLoad): Rename cancelNetworkLoad() as platformCancelNetworkLoad() since
27         this is now used only by Cocoa platform to cancel the NSURLSessionDownloadTask.
28         * NetworkProcess/Downloads/Download.h:
29         (WebKit::Download::Download):
30         (WebKit::Download::suggestedName):
31         (WebKit::Download::request):
32         * NetworkProcess/Downloads/DownloadManager.cpp:
33         (WebKit::DownloadManager::startDownload): Remove blobs specific code when using NetworkSession.
34         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
35         * NetworkProcess/Downloads/DownloadManager.h:
36         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
37         (WebKit::Download::platformCancelNetworkLoad):
38         * NetworkProcess/Downloads/soup/DownloadSoup.cpp: Removed.
39         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
40         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): Remove blobs specific code when
41         using NetworkSession.
42         * NetworkProcess/NetworkDataTask.cpp:
43         (WebKit::NetworkDataTask::create): If request is a blob, create a NetworkDataTaskBlob.
44         * NetworkProcess/NetworkDataTask.h: Add invalidateAndCancel pure virtual method.
45         * NetworkProcess/NetworkDataTaskBlob.cpp: Added.
46         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
47         (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
48         (WebKit::NetworkDataTaskBlob::clearStream):
49         (WebKit::NetworkDataTaskBlob::resume):
50         (WebKit::NetworkDataTaskBlob::suspend):
51         (WebKit::NetworkDataTaskBlob::cancel):
52         (WebKit::NetworkDataTaskBlob::invalidateAndCancel):
53         (WebKit::NetworkDataTaskBlob::getSizeForNext):
54         (WebKit::NetworkDataTaskBlob::didGetSize):
55         (WebKit::NetworkDataTaskBlob::seek):
56         (WebKit::NetworkDataTaskBlob::didReceiveResponse):
57         (WebKit::NetworkDataTaskBlob::read):
58         (WebKit::NetworkDataTaskBlob::readData):
59         (WebKit::NetworkDataTaskBlob::readFile):
60         (WebKit::NetworkDataTaskBlob::didOpen):
61         (WebKit::NetworkDataTaskBlob::didRead):
62         (WebKit::NetworkDataTaskBlob::consumeData):
63         (WebKit::NetworkDataTaskBlob::setPendingDownloadLocation):
64         (WebKit::NetworkDataTaskBlob::suggestedFilename):
65         (WebKit::NetworkDataTaskBlob::download):
66         (WebKit::NetworkDataTaskBlob::writeDownload):
67         (WebKit::NetworkDataTaskBlob::cleanDownloadFiles):
68         (WebKit::NetworkDataTaskBlob::didFailDownload):
69         (WebKit::NetworkDataTaskBlob::didFinishDownload):
70         (WebKit::NetworkDataTaskBlob::didFail):
71         (WebKit::NetworkDataTaskBlob::didFinish):
72         * NetworkProcess/NetworkDataTaskBlob.h: Added.
73         * NetworkProcess/NetworkLoad.cpp:
74         (WebKit::NetworkLoad::NetworkLoad): Remove blobs specific code when using NetworkSession.
75         (WebKit::NetworkLoad::~NetworkLoad):
76         (WebKit::NetworkLoad::setDefersLoading):
77         (WebKit::NetworkLoad::cancel):
78         (WebKit::NetworkLoad::continueWillSendRequest):
79         (WebKit::NetworkLoad::continueDidReceiveResponse):
80         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
81         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
82         * NetworkProcess/NetworkLoad.h:
83         * NetworkProcess/NetworkSession.cpp:
84         (WebKit::NetworkSession::invalidateAndCancel): Moved from NetworkSessionSoup, since this is now used also by blobs.
85         * NetworkProcess/NetworkSession.h:
86         (WebKit::NetworkSession::registerNetworkDataTask): Ditto.
87         (WebKit::NetworkSession::unregisterNetworkDataTask): Ditto.
88         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Add invalidateAndCancel() implementation that does nothing
89         because in Cocoa all tasks are invalidated and canceled by the network session.
90         * NetworkProcess/mac/NetworkLoadMac.mm:
91         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
92         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
93         (WebKit::NetworkDataTaskSoup::~NetworkDataTaskSoup):
94         (WebKit::NetworkDataTaskSoup::download):
95         * NetworkProcess/soup/NetworkDataTaskSoup.h:
96         * NetworkProcess/soup/NetworkSessionSoup.cpp:
97         * NetworkProcess/soup/NetworkSessionSoup.h:
98         * PlatformEfl.cmake: Remove DownloadSoup.cpp from compilation.
99         * PlatformGTK.cmake: Ditto.
100         * WebKit2.xcodeproj/project.pbxproj: Add new files to compilation.
101
102 2016-11-03  Simon Fraser  <simon.fraser@apple.com>
103
104         Give all the geometry classes a single-argument scale() function for consistency
105         https://bugs.webkit.org/show_bug.cgi?id=164400
106
107         Reviewed by Zalan Bujtas.
108         
109         Use single-argument scale() functions.
110
111         * PluginProcess/PluginControllerProxy.cpp:
112         (WebKit::PluginControllerProxy::paint):
113         * Shared/mac/RemoteLayerBackingStore.mm:
114         (WebKit::RemoteLayerBackingStore::drawInContext):
115         * UIProcess/API/Cocoa/WKWebView.mm:
116         (-[WKWebView _didCommitLayerTree:]):
117         (-[WKWebView _takeViewSnapshot]):
118         (-[WKWebView _scrollToContentScrollPosition:scrollOrigin:]):
119         (-[WKWebView _scrollByContentOffset:]):
120         (-[WKWebView _zoomToFocusRect:selectionRect:fontSize:minimumScale:maximumScale:allowScaling:forceScroll:]):
121         * UIProcess/ios/WKContentView.mm:
122         (-[WKContentView _didCommitLayerTree:]):
123         * UIProcess/ios/WKContentViewInteraction.mm:
124         (-[WKContentView _updateTapHighlight]):
125         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
126         (WebKit::RemoteLayerTreeDrawingAreaProxy::indicatorLocation):
127         (WebKit::RemoteLayerTreeDrawingAreaProxy::updateDebugIndicator):
128         * UIProcess/mac/ViewGestureControllerMac.mm:
129         (WebKit::ViewGestureController::scaledMagnificationOrigin):
130         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
131         (WebKit::InjectedBundleRangeHandle::renderedImage):
132         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
133         (WebKit::NetscapePlugin::snapshot):
134         * WebProcess/Plugins/PDF/PDFPlugin.mm:
135         (WebKit::PDFPlugin::scrollToPoint):
136         * WebProcess/WebPage/WebFrame.cpp:
137         (WebKit::WebFrame::createSelectionSnapshot):
138         * WebProcess/WebPage/WebPage.cpp:
139         (WebKit::WebPage::scalePageInViewCoordinates):
140         (WebKit::WebPage::scaleView):
141         (WebKit::WebPage::snapshotAtSize):
142         (WebKit::WebPage::snapshotNode):
143         (WebKit::WebPage::drawRectToImage):
144         * WebProcess/WebPage/ios/WebPageIOS.mm:
145         (WebKit::WebPage::restorePageState):
146
147 2016-11-03  Chris Dumez  <cdumez@apple.com>
148
149         [WK2][Cocoa] Implement user interface for HTML form validation
150         https://bugs.webkit.org/show_bug.cgi?id=164143
151         <rdar://problem/28944652>
152
153         Reviewed by Simon Fraser.
154
155         Implement the ValidationMessageClient in WebKit2 and have it display
156         a ValidationBubble on Cocoa. ValidationBubble is implemented using
157         native popovers on both Mac and iOS. As a result, Mac and iOS WK2
158         now use native popover for HTML form validation instead of the old
159         Shadow DOM based UI in WebCore.
160
161         The native popover shows at the bottom (or top) of the input and it
162         disapears as soon as the user starts typing or interacts with the
163         view (e.g. tap / scroll / zoom).
164
165         The feature is still disabled at runtime.
166
167         * UIProcess/API/Cocoa/WKWebView.mm:
168         (-[WKWebView _initializeWithConfiguration:]):
169         (-[WKWebView _keyboardWillShow:]):
170         (-[WKWebView _keyboardDidShow:]):
171         (-[WKWebView _contentsOfUserInterfaceItem:]):
172         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
173         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
174         * UIProcess/PageClient.h:
175         * UIProcess/WebPageProxy.cpp:
176         (WebKit::WebPageProxy::handleWheelEvent):
177         (WebKit::WebPageProxy::setPageZoomFactor):
178         (WebKit::WebPageProxy::setPageAndTextZoomFactors):
179         (WebKit::WebPageProxy::pageDidScroll):
180         (WebKit::WebPageProxy::resetState):
181         (WebKit::WebPageProxy::hideValidationMessage):
182         * UIProcess/WebPageProxy.h:
183         (WebKit::WebPageProxy::validationBubble):
184         (WebKit::WebPageProxy::setIsKeyboardAnimatingIn):
185         * UIProcess/WebPageProxy.messages.in:
186         * UIProcess/ios/PageClientImplIOS.h:
187         * UIProcess/ios/PageClientImplIOS.mm:
188         (WebKit::PageClientImpl::createValidationBubble):
189         * UIProcess/ios/WKContentViewInteraction.mm:
190         (-[WKContentView _willStartScrollingOrZooming]):
191         (-[WKContentView scrollViewWillStartPanOrPinchGesture]):
192         (-[WKContentView _didEndScrollingOrZooming]):
193         * UIProcess/ios/WebPageProxyIOS.mm:
194         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
195         (WebKit::WebPageProxy::potentialTapAtPosition):
196         (WebKit::WebPageProxy::showValidationMessage):
197         (WebKit::WebPageProxy::setIsScrollingOrZooming):
198         * UIProcess/mac/PageClientImpl.h:
199         * UIProcess/mac/PageClientImpl.mm:
200         (WebKit::PageClientImpl::createValidationBubble):
201         * UIProcess/mac/WebPageProxyMac.mm:
202         (WebKit::WebPageProxy::showValidationMessage):
203         * WebKit2.xcodeproj/project.pbxproj:
204         * WebProcess/WebCoreSupport/WebValidationMessageClient.cpp: Copied from Tools/DumpRenderTree/mac/UIScriptControllerMac.mm.
205         (WebKit::WebValidationMessageClient::WebValidationMessageClient):
206         (WebKit::WebValidationMessageClient::~WebValidationMessageClient):
207         (WebKit::WebValidationMessageClient::showValidationMessage):
208         (WebKit::WebValidationMessageClient::hideValidationMessage):
209         (WebKit::WebValidationMessageClient::isValidationMessageVisible):
210         * WebProcess/WebCoreSupport/WebValidationMessageClient.h: Copied from Tools/DumpRenderTree/mac/UIScriptControllerMac.mm.
211         * WebProcess/WebPage/WebPage.cpp:
212         (WebKit::m_userInterfaceLayoutDirection):
213
214 2016-11-03  Tim Horton  <timothy_horton@apple.com>
215
216         Printing to PDF should produce internal links when HTML has internal links
217         https://bugs.webkit.org/show_bug.cgi?id=112081
218         <rdar://problem/5955705>
219
220         Reviewed by Simon Fraser.
221
222         * UIProcess/mac/WKPrintingView.h:
223         * UIProcess/mac/WKPrintingView.mm:
224         (linkDestinationName):
225         (-[WKPrintingView _drawPDFDocument:page:atPoint:]):
226         Propagate link-to-destination annotations (and each page's destinations)
227         into the printed PDF.
228         Generate a unique destination name based on the page and position, because
229         we have lost the fragment name information.
230
231         (-[WKPrintingView drawRect:]):
232         Compute all of the destinations for every page, so that we can add them
233         to the context as we paint the pages (we need the page CTM in order to add them).
234
235 2016-11-03  Alex Christensen  <achristensen@webkit.org>
236
237         Unreviewed, rolling out r208298.
238         https://bugs.webkit.org/show_bug.cgi?id=163939
239
240         caused asan crashes
241
242         Reverted changeset:
243
244         "NetworkSession: Add NetworkDataTask implementation for blobs"
245         https://bugs.webkit.org/show_bug.cgi?id=163939
246         http://trac.webkit.org/changeset/208298
247
248 2016-11-03  Ryan Haddad  <ryanhaddad@apple.com>
249
250         Unreviewed, rolling out r208330.
251
252         This change appears to have caused two editing tests to fail
253         on macOS.
254
255         Reverted changeset:
256
257         "Reduce PassRefPtr use in WebKit2"
258         https://bugs.webkit.org/show_bug.cgi?id=164360
259         http://trac.webkit.org/changeset/208330
260
261 2016-11-03  Dan Bernstein  <mitz@apple.com>
262
263         WKWebView’s _observedRenderingProgressEvents not restored after web process crash
264         https://bugs.webkit.org/show_bug.cgi?id=164368
265         <rdar://problem/29091954>
266
267         Reviewed by Anders Carlsson.
268
269         Test: TestWebKitAPI/Tests/WebKit2Cocoa/ObservedRenderingProgressEventsAfterCrash.mm.
270
271         * Shared/WebPageCreationParameters.cpp:
272         (WebKit::WebPageCreationParameters::encode): Encode new observedLayoutMilestones member.
273         (WebKit::WebPageCreationParameters::decode): Decode it.
274         * Shared/WebPageCreationParameters.h: Declared new observedLayoutMilestones member variable.
275
276         * UIProcess/WebPageProxy.cpp:
277         (WebKit::WebPageProxy::WebPageProxy): Removed initializer for
278           m_wantsSessionRestorationRenderTreeSizeThresholdEvent.
279         (WebKit::WebPageProxy::listenForLayoutMilestones): Update new m_observedLayoutMilestones
280           member variable. Don’t update m_wantsSessionRestorationRenderTreeSizeThresholdEvent.
281         (WebKit::WebPageProxy::creationParameters): Set the observedLayoutMilestones member in the
282           creation parameters.
283
284         * UIProcess/WebPageProxy.h: Declared new member variable, deleted
285           m_wantsSessionRestorationRenderTreeSizeThresholdEvent declaration.
286
287         * UIProcess/ios/WebPageProxyIOS.mm:
288         (WebKit::WebPageProxy::didCommitLayerTree): Rather than using
289           m_wantsSessionRestorationRenderTreeSizeThresholdEvent, use m_observedLayoutMilestones.
290
291         * WebProcess/WebPage/WebPage.cpp:
292         (WebKit::WebPage::WebPage): Add the observed layout milestones from the creation parameters.
293
294 2016-11-02  Alex Christensen  <achristensen@webkit.org>
295
296         Reduce PassRefPtr use in WebKit2
297         https://bugs.webkit.org/show_bug.cgi?id=164360
298
299         Reviewed by Tim Horton.
300
301         * Shared/API/APISecurityOrigin.h:
302         (API::SecurityOrigin::SecurityOrigin):
303         * Shared/API/APISerializedScriptValue.h:
304         (API::SerializedScriptValue::create):
305         (API::SerializedScriptValue::SerializedScriptValue):
306         * Shared/API/c/WKSharedAPICast.h:
307         (WebKit::ProxyingRefPtr::ProxyingRefPtr):
308         (WebKit::toAPI):
309         * Shared/APIWebArchive.h:
310         * Shared/APIWebArchive.mm:
311         (API::WebArchive::create):
312         (API::WebArchive::WebArchive):
313         * UIProcess/API/APIHitTestResult.cpp:
314         (API::HitTestResult::create):
315         * UIProcess/API/APIHitTestResult.h:
316         * UIProcess/API/APIUIClient.h:
317         (API::UIClient::createNewPage):
318         * UIProcess/API/C/WKPage.cpp:
319         (WebKit::RunBeforeUnloadConfirmPanelResultListener::create):
320         (WebKit::RunBeforeUnloadConfirmPanelResultListener::RunBeforeUnloadConfirmPanelResultListener):
321         (WebKit::RunJavaScriptAlertResultListener::create):
322         (WebKit::RunJavaScriptAlertResultListener::RunJavaScriptAlertResultListener):
323         (WebKit::RunJavaScriptConfirmResultListener::create):
324         (WebKit::RunJavaScriptConfirmResultListener::RunJavaScriptConfirmResultListener):
325         (WebKit::RunJavaScriptPromptResultListener::create):
326         (WebKit::RunJavaScriptPromptResultListener::RunJavaScriptPromptResultListener):
327         (WKPageSetPageUIClient):
328         * UIProcess/API/Cocoa/WKWebView.mm:
329         (-[WKWebView _takeViewSnapshot]):
330         * UIProcess/API/Cocoa/WKWebViewInternal.h:
331         * UIProcess/Cocoa/UIDelegate.h:
332         * UIProcess/Cocoa/UIDelegate.mm:
333         (WebKit::UIDelegate::UIClient::createNewPage):
334         * UIProcess/ios/WKGeolocationProviderIOS.mm:
335         (-[WKWebAllowDenyPolicyListener initWithPermissionRequestProxy:]):
336         * UIProcess/mac/WKImmediateActionController.mm:
337         (-[WKImmediateActionController _webHitTestResult]):
338         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
339         (contextMenuItems):
340         (WKBundlePageCopyContextMenuItems):
341         (WKBundlePageCopyContextMenuAtPointInWindow):
342         * WebProcess/UserContent/WebUserContentController.cpp:
343         (WebKit::WebUserMessageHandlerDescriptorProxy::create):
344         * WebProcess/WebPage/WebUndoStep.cpp:
345         (WebKit::WebUndoStep::create):
346         * WebProcess/WebPage/WebUndoStep.h:
347         (WebKit::WebUndoStep::WebUndoStep):
348
349 2016-11-01  Gavin Barraclough  <barraclough@apple.com>
350
351         Remove PageThrottler & all related code
352         https://bugs.webkit.org/show_bug.cgi?id=164302
353
354         Reviewed by Ryosuke Niwa.
355
356         All relevant information now available from the ActivityState.
357
358         * PluginProcess/PluginProcess.cpp:
359         (WebKit::PluginProcess::PluginProcess):
360         (WebKit::PluginProcess::createWebProcessConnection):
361         (WebKit::PluginProcess::audioHardwareDidBecomeActive): Deleted.
362         (WebKit::PluginProcess::audioHardwareDidBecomeInactive): Deleted.
363         * PluginProcess/PluginProcess.h:
364         (): Deleted.
365         * PluginProcess/WebProcessConnection.cpp:
366         (WebKit::WebProcessConnection::audioHardwareDidBecomeActive): Deleted.
367         (WebKit::WebProcessConnection::audioHardwareDidBecomeInactive): Deleted.
368         * PluginProcess/WebProcessConnection.h:
369         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
370         (WebKit::NPRuntimeObjectMap::evaluate):
371         * WebProcess/Plugins/Plugin.h:
372         (WebKit::Plugin::audioHardwareActivity): Deleted.
373         * WebProcess/Plugins/PluginProcessConnection.cpp:
374         (WebKit::PluginProcessConnection::PluginProcessConnection):
375         (WebKit::PluginProcessConnection::didReceiveMessage):
376         (WebKit::PluginProcessConnection::audioHardwareDidBecomeActive): Deleted.
377         (WebKit::PluginProcessConnection::audioHardwareDidBecomeInactive): Deleted.
378         * WebProcess/Plugins/PluginProcessConnection.h:
379         (WebKit::PluginProcessConnection::supportsAsynchronousPluginInitialization):
380         (WebKit::PluginProcessConnection::audioHardwareActivity): Deleted.
381         * WebProcess/Plugins/PluginProcessConnection.messages.in:
382         * WebProcess/Plugins/PluginProxy.cpp:
383         (WebKit::PluginProxy::audioHardwareActivity): Deleted.
384         * WebProcess/Plugins/PluginProxy.h:
385         * WebProcess/Plugins/PluginView.cpp:
386         (WebKit::PluginView::audioHardwareActivity): Deleted.
387         * WebProcess/Plugins/PluginView.h:
388         * WebProcess/WebPage/WebPage.cpp:
389
390 2016-11-03  Dan Bernstein  <mitz@apple.com>
391
392         REGRESSION (r206247): Painting milestones can be delayed until the next layer flush
393         https://bugs.webkit.org/show_bug.cgi?id=164340
394         <rdar://problem/29074344>
395
396         Reviewed by Tim Horton.
397
398         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h: Declared new helper function.
399         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
400         (WebKit::TiledCoreAnimationDrawingArea::sendPendingNewlyReachedLayoutMilestones): Helper
401           function that sends the message to the UI process and resets
402           m_pendingNewlyReachedLayoutMilestones.
403         (WebKit::TiledCoreAnimationDrawingArea::flushLayers): Wait until after the commit to get the
404           pending milestones and send them to the UI process. This way we don’t miss milestones that
405           fire during the commit.
406
407 2016-11-02  David Kilzer  <ddkilzer@apple.com>
408
409         Bug 164333: Add logging for "WebKit encountered an internal error" messages due to Network process crashes
410         <https://webkit.org/b/164333>
411         <rdar://problem/29072727>
412
413         Reviewed by Alex Christensen.
414
415         * WebProcess/WebProcess.cpp:
416         (WebKit::WebProcess::logDiagnosticMessageForNetworkProcessCrash):
417         Add private method to log diagnostic message.
418         (WebKit::WebProcess::networkProcessConnectionClosed):
419         Call logDiagnosticMessageForNetworkProcessCrash().
420         * WebProcess/WebProcess.h:
421         (WebKit::WebProcess::logDiagnosticMessageForNetworkProcessCrash):
422         Declare new method.
423
424 2016-11-02  Alex Christensen  <achristensen@webkit.org>
425
426         Remove Battery Status API from the tree
427         https://bugs.webkit.org/show_bug.cgi?id=164213
428
429         Reviewed by Sam Weinig.
430
431         * CMakeLists.txt:
432         * PlatformEfl.cmake:
433         * Shared/API/APIObject.h:
434         * Shared/API/c/WKBase.h:
435         * Shared/WebBatteryStatus.cpp: Removed.
436         * Shared/WebBatteryStatus.h: Removed.
437         * UIProcess/API/C/WKAPICast.h:
438         * UIProcess/API/C/WKBatteryManager.cpp: Removed.
439         * UIProcess/API/C/WKBatteryManager.h: Removed.
440         * UIProcess/API/C/WKBatteryStatus.cpp: Removed.
441         * UIProcess/API/C/WKBatteryStatus.h: Removed.
442         * UIProcess/API/C/WKContext.cpp:
443         (WKContextGetBatteryManager): Deleted.
444         * UIProcess/API/C/WKContext.h:
445         * UIProcess/API/efl/ewk_context.cpp:
446         (EwkContext::EwkContext):
447         * UIProcess/API/efl/ewk_context_private.h:
448         * UIProcess/API/efl/ewk_main.cpp:
449         (WebKit::EwkMain::initialize):
450         (WebKit::EwkMain::finalize):
451         (WebKit::EwkMain::shutdownInitializedEFLModules):
452         * UIProcess/API/gtk/WebKitBatteryProvider.cpp: Removed.
453         * UIProcess/API/gtk/WebKitBatteryProvider.h: Removed.
454         * UIProcess/API/gtk/WebKitWebContext.cpp:
455         (webkitWebContextConstructed):
456         * UIProcess/WebBatteryManagerProxy.cpp: Removed.
457         * UIProcess/WebBatteryManagerProxy.h: Removed.
458         * UIProcess/WebBatteryManagerProxy.messages.in: Removed.
459         * UIProcess/WebBatteryProvider.cpp: Removed.
460         * UIProcess/WebBatteryProvider.h: Removed.
461         * UIProcess/WebProcessPool.cpp:
462         (WebKit::m_hiddenPageThrottlingTimer):
463         * UIProcess/efl/BatteryProvider.cpp: Removed.
464         * UIProcess/efl/BatteryProvider.h: Removed.
465         * WebProcess/Battery: Removed.
466         * WebProcess/Battery/WebBatteryManager.cpp: Removed.
467         * WebProcess/Battery/WebBatteryManager.h: Removed.
468         * WebProcess/Battery/WebBatteryManager.messages.in: Removed.
469         * WebProcess/WebCoreSupport/WebBatteryClient.cpp: Removed.
470         * WebProcess/WebCoreSupport/WebBatteryClient.h: Removed.
471         * WebProcess/WebPage/WebPage.cpp:
472         (WebKit::m_userInterfaceLayoutDirection):
473         * WebProcess/WebProcess.cpp:
474         (WebKit::m_resourceLoadStatisticsStorage):
475
476 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
477
478         NetworkSession: Add NetworkDataTask implementation for blobs
479         https://bugs.webkit.org/show_bug.cgi?id=163939
480
481         Reviewed by Alex Christensen.
482
483         Add NetworkDataTaskBlob to handle blobs when using NetworkSession instead of using ResourceHandle. This patch
484         adds more USE(NETWORK_SESSION) ifdefs to not use ResourceHandle in Downloads and NetworkLoad when NetworkSession
485         is enabled.
486
487         * CMakeLists.txt: Add new files to compilation.
488         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
489         * NetworkProcess/Downloads/BlobDownloadClient.h:
490         * NetworkProcess/Downloads/Download.cpp:
491         (WebKit::Download::Download): Split the constructor again and remove the PlatformDownloadTaskRef
492         definitions. Now Cocoa specific constructor receives a NSURLSessionDownloadTask and the general constructor
493         reveices a NetworkDataTask and is used by Soup backend and blobs.
494         (WebKit::Download::~Download):
495         (WebKit::Download::start):
496         (WebKit::Download::startWithHandle):
497         (WebKit::Download::cancel):
498         (WebKit::Download::didReceiveAuthenticationChallenge):
499         (WebKit::Download::didReceiveData):
500         (WebKit::Download::didFinish):
501         (WebKit::Download::platformCancelNetworkLoad): Rename cancelNetworkLoad() as platformCancelNetworkLoad() since
502         this is now used only by Cocoa platform to cancel the NSURLSessionDownloadTask.
503         * NetworkProcess/Downloads/Download.h:
504         (WebKit::Download::Download):
505         (WebKit::Download::suggestedName):
506         (WebKit::Download::request):
507         * NetworkProcess/Downloads/DownloadManager.cpp:
508         (WebKit::DownloadManager::startDownload): Remove blobs specific code when using NetworkSession.
509         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
510         * NetworkProcess/Downloads/DownloadManager.h:
511         * NetworkProcess/Downloads/cocoa/DownloadCocoa.mm:
512         (WebKit::Download::platformCancelNetworkLoad):
513         * NetworkProcess/Downloads/soup/DownloadSoup.cpp: Removed.
514         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
515         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload): Remove blobs specific code when
516         using NetworkSession.
517         * NetworkProcess/NetworkDataTask.cpp:
518         (WebKit::NetworkDataTask::create): If request is a blob, create a NetworkDataTaskBlob.
519         * NetworkProcess/NetworkDataTask.h: Add invalidateAndCancel pure virtual method.
520         * NetworkProcess/NetworkDataTaskBlob.cpp: Added.
521         (WebKit::NetworkDataTaskBlob::NetworkDataTaskBlob):
522         (WebKit::NetworkDataTaskBlob::~NetworkDataTaskBlob):
523         (WebKit::NetworkDataTaskBlob::clearStream):
524         (WebKit::NetworkDataTaskBlob::resume):
525         (WebKit::NetworkDataTaskBlob::suspend):
526         (WebKit::NetworkDataTaskBlob::cancel):
527         (WebKit::NetworkDataTaskBlob::invalidateAndCancel):
528         (WebKit::NetworkDataTaskBlob::getSizeForNext):
529         (WebKit::NetworkDataTaskBlob::didGetSize):
530         (WebKit::NetworkDataTaskBlob::seek):
531         (WebKit::NetworkDataTaskBlob::didReceiveResponse):
532         (WebKit::NetworkDataTaskBlob::read):
533         (WebKit::NetworkDataTaskBlob::readData):
534         (WebKit::NetworkDataTaskBlob::readFile):
535         (WebKit::NetworkDataTaskBlob::didOpen):
536         (WebKit::NetworkDataTaskBlob::didRead):
537         (WebKit::NetworkDataTaskBlob::consumeData):
538         (WebKit::NetworkDataTaskBlob::setPendingDownloadLocation):
539         (WebKit::NetworkDataTaskBlob::suggestedFilename):
540         (WebKit::NetworkDataTaskBlob::download):
541         (WebKit::NetworkDataTaskBlob::writeDownload):
542         (WebKit::NetworkDataTaskBlob::cleanDownloadFiles):
543         (WebKit::NetworkDataTaskBlob::didFailDownload):
544         (WebKit::NetworkDataTaskBlob::didFinishDownload):
545         (WebKit::NetworkDataTaskBlob::didFail):
546         (WebKit::NetworkDataTaskBlob::didFinish):
547         * NetworkProcess/NetworkDataTaskBlob.h: Added.
548         * NetworkProcess/NetworkLoad.cpp:
549         (WebKit::NetworkLoad::NetworkLoad): Remove blobs specific code when using NetworkSession.
550         (WebKit::NetworkLoad::~NetworkLoad):
551         (WebKit::NetworkLoad::setDefersLoading):
552         (WebKit::NetworkLoad::cancel):
553         (WebKit::NetworkLoad::continueWillSendRequest):
554         (WebKit::NetworkLoad::continueDidReceiveResponse):
555         (WebKit::NetworkLoad::continueCanAuthenticateAgainstProtectionSpace):
556         (WebKit::NetworkLoad::canAuthenticateAgainstProtectionSpaceAsync):
557         * NetworkProcess/NetworkLoad.h:
558         * NetworkProcess/NetworkSession.cpp:
559         (WebKit::NetworkSession::invalidateAndCancel): Moved from NetworkSessionSoup, since this is now used also by blobs.
560         * NetworkProcess/NetworkSession.h:
561         (WebKit::NetworkSession::registerNetworkDataTask): Ditto.
562         (WebKit::NetworkSession::unregisterNetworkDataTask): Ditto.
563         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Add invalidateAndCancel() implementation that does nothing
564         because in Cocoa all tasks are invalidated and canceled by the network session.
565         * NetworkProcess/mac/NetworkLoadMac.mm:
566         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
567         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
568         (WebKit::NetworkDataTaskSoup::~NetworkDataTaskSoup):
569         (WebKit::NetworkDataTaskSoup::download):
570         * NetworkProcess/soup/NetworkDataTaskSoup.h:
571         * NetworkProcess/soup/NetworkSessionSoup.cpp:
572         * NetworkProcess/soup/NetworkSessionSoup.h:
573         * PlatformEfl.cmake: Remove DownloadSoup.cpp from compilation.
574         * PlatformGTK.cmake: Ditto.
575         * WebKit2.xcodeproj/project.pbxproj: Add new files to compilation.
576
577 2016-11-02  Andy Estes  <aestes@apple.com>
578
579         REGRESSION (r199558): File paths selected for upload are stored using the wrong string encoding
580         https://bugs.webkit.org/show_bug.cgi?id=164311
581         <rdar://problem/26995374>
582
583         Reviewed by Tim Horton.
584
585         -[NSURL fileSystemRepresentation] returns a char* in file system representation, which on
586         iOS is UTF-8, but we were implicitly converting it to a String, which assumes a char* is
587         Latin-1 encoded.
588
589         * UIProcess/ios/forms/WKFileUploadPanel.mm:
590         (-[WKFileUploadPanel _chooseFiles:displayString:iconImage:]): Changed to use fromUTF8() to
591         convert fileURL.fileSystemRepresentation to a String.
592
593 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
594
595         NetworkSession: Network process crash when converting main resource to download
596         https://bugs.webkit.org/show_bug.cgi?id=164220
597
598         Reviewed by Alex Christensen.
599
600         Right after the main resource load is converted to a download, the web process deletes the ResourceLoader which
601         sends the RemoveLoadIdentifier to the network process and the load is aborted. Sometimes it happens that
602         NetworkResourceLoader::abort() is called while the NetworkLoad is still deciding the destination of the
603         download. In such case, NetworkResourceLoader::didConvertToDownload() has already been called, but not
604         NetworkResourceLoader::didBecomeDownload(). In NetworkResourceLoader::abort() we already handle the case of
605         having a NetworkLoad after NetworkResourceLoader::didConvertToDownload() has been called, to avoid canceling the
606         load in such case, however cleanup() is always called unconditionally and the NetworkLoad is deleted before
607         NetworkResourceLoader::didBecomeDownload() is called. When the NetworkLoad is destroyed the NetworkDataTask
608         client becomes nullptr, leaving it in a state where both the client is nullptr and the download hasn't been
609         created yet. That's not expected to happen and when the response completion handler is called in the
610         NetworkDataTask it tries to use either the client or the download and it crashes.
611
612         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
613         (WebKit::NetworkConnectionToWebProcess::removeLoadIdentifier): Update ASSERT, because abort doesn't cleanup the
614         resource loader in case it's becoming a download.
615         * NetworkProcess/NetworkResourceLoader.cpp:
616         (WebKit::NetworkResourceLoader::didBecomeDownload): Call cleanup() instead of just deleting the network load.
617         (WebKit::NetworkResourceLoader::isBecomingDownload): Helper method to check if the resource load was converted to a
618         download, but didBecomeDownload() hasn't been called yet.
619         (WebKit::NetworkResourceLoader::abort): If the resource load is becoming a download do not call cleanup()
620         because it will be called by didBecomeDownload() later.
621         * NetworkProcess/NetworkResourceLoader.h:
622
623 2016-11-02  David Kilzer  <ddkilzer@apple.com>
624
625         Add logging for "WebKit encountered an internal error" messages
626         <https://webkit.org/b/164272>
627         <rdar://problem/28546064>
628
629         Reviewed by Alex Christensen.
630
631         * NetworkProcess/NetworkResourceLoader.cpp:
632         (WebKit::NetworkResourceLoader::startNetworkLoad):
633         * WebProcess/Network/WebLoaderStrategy.cpp:
634         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
635         * WebProcess/Network/WebResourceLoader.cpp:
636         (WebKit::WebResourceLoader::didReceiveResource):
637         - Add logging for various internalError() events.
638
639 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
640
641         [GTK] BadDamage X Window System error in WebKit::AcceleratedBackingStoreX11::update when called from WebPageProxy::exitAcceleratedCompositingMode
642         https://bugs.webkit.org/show_bug.cgi?id=164303
643
644         Reviewed by Michael Catanzaro.
645
646         This can happen if the web process exits before the UI process has cleaned up the accelerated surface. Trap
647         BadDrawable and BadDamage X errors and ignore them, while still crashing for any other X error.
648
649         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
650         (WebKit::AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11):
651         (WebKit::AcceleratedBackingStoreX11::update):
652
653 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
654
655         [GTK] Remove FileSystem::filenameToString() and use FileSystem::stringFromFileSystemRepresentation() everywhere instead
656         https://bugs.webkit.org/show_bug.cgi?id=164315
657
658         Reviewed by Michael Catanzaro.
659
660         * Shared/gtk/ProcessExecutablePathGtk.cpp:
661         (WebKit::getExecutablePath):
662         (WebKit::findWebKitProcess):
663         * UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp:
664         (API::WebsiteDataStore::defaultNetworkCacheDirectory):
665         (API::WebsiteDataStore::cacheDirectoryFileSystemRepresentation):
666         (API::WebsiteDataStore::websiteDataDirectoryFileSystemRepresentation):
667         * UIProcess/API/gtk/WebKitWebContext.cpp:
668         (webkitWebContextConstructed):
669         (webkit_web_context_set_favicon_database_directory):
670         (webkit_web_context_set_additional_plugins_directory):
671         (webkit_web_context_set_disk_cache_directory):
672         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
673         (webkitWebsiteDataManagerGetDataStore):
674         * UIProcess/Plugins/gtk/PluginInfoCache.cpp:
675         (WebKit::PluginInfoCache::PluginInfoCache):
676         * UIProcess/gtk/WebProcessPoolGtk.cpp:
677         (WebKit::WebProcessPool::platformDefaultIconDatabasePath):
678         * WebProcess/gtk/WebGtkExtensionManager.cpp:
679         (WebKit::parseUserData):
680
681 2016-11-02  Romain Bellessort  <romain.bellessort@crf.canon.fr>
682
683         [Readable Streams API] Enable creation of ReadableByteStreamController
684         https://bugs.webkit.org/show_bug.cgi?id=164014
685
686         Reviewed by Youenn Fablet.
687
688         Added flag for the byte stream part of Readable Streams API.
689
690         * Configurations/FeatureDefines.xcconfig:
691
692 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
693
694         PluginInfoStore::loadPluginsIfNecessary can still load plugins multiple times
695         https://bugs.webkit.org/show_bug.cgi?id=164103
696
697         Reviewed by Michael Catanzaro.
698
699         Follow symlinks when scanning plugins to avoid duplicates.
700
701         * UIProcess/Plugins/gtk/PluginInfoCache.cpp: Bump the cache version to ensure duplicated plugins are removed
702         from the cache.
703         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
704         (WebKit::PluginInfoStore::pluginPathsInDirectory): Use realpath() to always return the actual file path.
705
706 2016-11-02  Carlos Garcia Campos  <cgarcia@igalia.com>
707
708         [GTK] Plugin process crash in WebKit::NetscapePluginX11::visibilityDidChange with evince browser plugin
709         https://bugs.webkit.org/show_bug.cgi?id=164204
710
711         Reviewed by Michael Catanzaro.
712
713         Check the platform plugin widget is embedded before trying to get its socket window.
714
715         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
716         (WebKit::NetscapePluginX11::geometryDidChange):
717         (WebKit::NetscapePluginX11::visibilityDidChange):
718
719 2016-11-01  Wenson Hsieh  <wenson_hsieh@apple.com>
720
721         Turn the Input Events runtime flag on by default
722         https://bugs.webkit.org/show_bug.cgi?id=164297
723
724         Reviewed by Ryosuke Niwa.
725
726         * Shared/WebPreferencesDefinitions.h:
727
728 2016-11-01  Jaehun Lim  <ljaehun.lim@samsung.com>
729
730         Unreviewed, EFL build fix after r208225
731
732         Rename ViewState to ActivityState
733
734         * UIProcess/efl/WebView.cpp:
735         (WebKit::WebView::setActive):
736         (WebKit::WebView::setFocused):
737         (WebKit::WebView::setVisible):
738
739 2016-11-01  Alex Christensen  <achristensen@webkit.org>
740
741         Fix CMake build.
742
743         * PlatformMac.cmake:
744
745 2016-11-01  Ryosuke Niwa  <rniwa@webkit.org>
746
747         Remove CUSTOM_ELEMENTS build flag
748         https://bugs.webkit.org/show_bug.cgi?id=164267
749
750         Reviewed by Antti Koivisto.
751
752         Removed the build flag.
753
754         * Configurations/FeatureDefines.xcconfig:
755         * WebProcess/InjectedBundle/InjectedBundle.cpp:
756         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
757         * WebProcess/WebPage/WebPage.cpp:
758         (WebKit::WebPage::updatePreferences):
759
760 2016-11-01  Eric Carlson  <eric.carlson@apple.com>
761
762         [MediaStream] restrict media capture secure connections
763         https://bugs.webkit.org/show_bug.cgi?id=164234
764         <rdar://problem/28944906>
765
766         Reviewed by Alex Christensen.
767
768         * Shared/WebPreferencesDefinitions.h:
769    
770         * UIProcess/API/C/WKPreferences.cpp:
771         (WKPreferencesSetMediaCaptureRequiresSecureConnection):
772         (WKPreferencesGetMediaCaptureRequiresSecureConnection):
773         * UIProcess/API/C/WKPreferencesRefPrivate.h:
774    
775         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
776         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Drive by
777          fix: remove some unused parameters in a lambda call.
778
779         * WebProcess/WebPage/WebPage.cpp:
780         (WebKit::WebPage::updatePreferences):
781
782 2016-11-01  Gavin Barraclough  <barraclough@apple.com>
783
784         Add IsAudible, IsLoading to ActivityState
785         https://bugs.webkit.org/show_bug.cgi?id=164286
786
787         Reviewed by Geoff Garen.
788
789         By computing these values in the UIProcess and passing them to WebContent we can
790         more closely unify iOS & macOS throttling, and remove the PageThrottler class.
791
792         * UIProcess/WebPageProxy.cpp:
793         (WebKit::WebPageProxy::updateActivityState):
794             - Added update for IsAudible, IsLoading flags.
795         (WebKit::WebPageProxy::updateThrottleState):
796             - Read IsAudible, IsLoading flags from ActivityState.
797         (WebKit::WebPageProxy::setMuted):
798             - call activityStateDidChange to trigger update.
799         (WebKit::WebPageProxy::isPlayingMediaDidChange):
800             - call activityStateDidChange to trigger update.
801         * UIProcess/WebPageProxy.h:
802         (WebKit::WebPageProxy::isLoadingChanged):
803             - call activityStateDidChange to trigger update.
804
805 2016-10-31  Gavin Barraclough  <barraclough@apple.com>
806
807         Rename ViewState to ActivityState
808         https://bugs.webkit.org/show_bug.cgi?id=164254
809
810         Reviewed by Andreas Kling.
811
812         We plan to add a couple more flags to ViewState that aren't directly related to the view
813         itself - whether there is an ongoing page load, and whether whether there is audio playback.
814         This will allow viewState (now activityState) to fully drive throttling decisions.
815
816         Renaming this bitfield accordingly.
817
818         * Shared/WebPageCreationParameters.cpp:
819         (WebKit::WebPageCreationParameters::encode):
820         (WebKit::WebPageCreationParameters::decode):
821         * Shared/WebPageCreationParameters.h:
822         * UIProcess/API/Cocoa/WKWebView.mm:
823         (-[WKWebView didMoveToWindow]):
824         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
825         (_WebKitWebViewBasePrivate::_WebKitWebViewBasePrivate):
826         (_WebKitWebViewBasePrivate::updateActivityStateTimerFired):
827         (webkitWebViewBaseScheduleUpdateActivityState):
828         (toplevelWindowFocusInEvent):
829         (toplevelWindowFocusOutEvent):
830         (toplevelWindowStateEvent):
831         (webkitWebViewBaseSetToplevelOnScreenWindow):
832         (webkitWebViewBaseMap):
833         (webkitWebViewBaseUnmap):
834         (webkitWebViewBaseSetFocus):
835         (webkitWebViewBaseIsInWindowActive):
836         (webkitWebViewBaseIsFocused):
837         (webkitWebViewBaseIsVisible):
838         (webkitWebViewBaseIsInWindow):
839         (_WebKitWebViewBasePrivate::updateViewStateTimerFired): Deleted.
840         (webkitWebViewBaseScheduleUpdateViewState): Deleted.
841         * UIProcess/Cocoa/WebViewImpl.mm:
842         (WebKit::WebViewImpl::becomeFirstResponder):
843         (WebKit::WebViewImpl::resignFirstResponder):
844         (WebKit::WebViewImpl::windowDidOrderOffScreen):
845         (WebKit::WebViewImpl::windowDidOrderOnScreen):
846         (WebKit::WebViewImpl::windowDidBecomeKey):
847         (WebKit::WebViewImpl::windowDidResignKey):
848         (WebKit::WebViewImpl::windowDidMiniaturize):
849         (WebKit::WebViewImpl::windowDidDeminiaturize):
850         (WebKit::WebViewImpl::windowDidChangeOcclusionState):
851         (WebKit::WebViewImpl::viewDidMoveToWindow):
852         (WebKit::WebViewImpl::viewDidHide):
853         (WebKit::WebViewImpl::viewDidUnhide):
854         (WebKit::WebViewImpl::activeSpaceDidChange):
855         (WebKit::WebViewImpl::endDeferringViewInWindowChanges):
856         (WebKit::WebViewImpl::endDeferringViewInWindowChangesSync):
857         (WebKit::WebViewImpl::prepareForMoveToWindow):
858         * UIProcess/DrawingAreaProxy.h:
859         (WebKit::DrawingAreaProxy::waitForDidUpdateActivityState):
860         (WebKit::DrawingAreaProxy::waitForDidUpdateViewState): Deleted.
861         * UIProcess/WebPageProxy.cpp:
862         (WebKit::WebPageProxy::WebPageProxy):
863         (WebKit::WebPageProxy::reattachToWebProcess):
864         (WebKit::WebPageProxy::setSuppressVisibilityUpdates):
865         (WebKit::WebPageProxy::updateActivityState):
866         (WebKit::WebPageProxy::activityStateDidChange):
867         (WebKit::WebPageProxy::dispatchActivityStateChange):
868         (WebKit::WebPageProxy::updateThrottleState):
869         (WebKit::WebPageProxy::waitForDidUpdateActivityState):
870         (WebKit::WebPageProxy::creationParameters):
871         (WebKit::WebPageProxy::installActivityStateChangeCompletionHandler):
872         (WebKit::WebPageProxy::updateViewState): Deleted.
873         (WebKit::WebPageProxy::viewStateDidChange): Deleted.
874         (WebKit::WebPageProxy::dispatchViewStateChange): Deleted.
875         (WebKit::WebPageProxy::waitForDidUpdateViewState): Deleted.
876         (WebKit::WebPageProxy::installViewStateChangeCompletionHandler): Deleted.
877         * UIProcess/WebPageProxy.h:
878         (WebKit::WebPageProxy::isInWindow):
879         (WebKit::WebPageProxy::didUpdateActivityState):
880         (WebKit::WebPageProxy::isViewVisible):
881         (WebKit::WebPageProxy::didUpdateViewState): Deleted.
882         * UIProcess/WebPageProxy.messages.in:
883         * UIProcess/WebProcessProxy.cpp:
884         (WebKit::WebProcessProxy::windowServerConnectionStateChanged):
885         * UIProcess/efl/WebView.cpp:
886         * UIProcess/ios/WKContentView.mm:
887         (-[WKContentView _applicationDidEnterBackground]):
888         (-[WKContentView _applicationWillEnterForeground]):
889         * UIProcess/ios/WKPDFView.mm:
890         (-[WKPDFView _applicationDidEnterBackground]):
891         (-[WKPDFView _applicationWillEnterForeground]):
892         * UIProcess/ios/WebPageProxyIOS.mm:
893         (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate):
894         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
895         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
896         (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay):
897         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState):
898         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateViewState): Deleted.
899         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
900         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
901         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState):
902         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateViewState): Deleted.
903         * WebProcess/Plugins/PluginView.cpp:
904         (WebKit::PluginView::activityStateDidChange):
905         (WebKit::PluginView::viewStateDidChange): Deleted.
906         * WebProcess/Plugins/PluginView.h:
907         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
908         (WebKit::AcceleratedDrawingArea::activityStateDidChange):
909         (WebKit::AcceleratedDrawingArea::viewStateDidChange): Deleted.
910         * WebProcess/WebPage/AcceleratedDrawingArea.h:
911         * WebProcess/WebPage/DrawingArea.h:
912         (WebKit::DrawingArea::activityStateDidChange):
913         (WebKit::DrawingArea::viewStateDidChange): Deleted.
914         * WebProcess/WebPage/WebPage.cpp:
915         (WebKit::m_userInterfaceLayoutDirection):
916         (WebKit::WebPage::reinitializeWebPage):
917         (WebKit::WebPage::updateIsInWindow):
918         (WebKit::WebPage::setActivityState):
919         (WebKit::WebPage::setViewState): Deleted.
920         * WebProcess/WebPage/WebPage.h:
921         (WebKit::WebPage::isVisible):
922         (WebKit::WebPage::isVisibleOrOccluded):
923         * WebProcess/WebPage/WebPage.messages.in:
924         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
925         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
926         (WebKit::RemoteLayerTreeDrawingArea::activityStateDidChange):
927         (WebKit::RemoteLayerTreeDrawingArea::viewStateDidChange): Deleted.
928         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
929         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
930         (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
931         (WebKit::TiledCoreAnimationDrawingArea::activityStateDidChange):
932         (WebKit::TiledCoreAnimationDrawingArea::didUpdateActivityStateTimerFired):
933         (WebKit::TiledCoreAnimationDrawingArea::viewStateDidChange): Deleted.
934         (WebKit::TiledCoreAnimationDrawingArea::didUpdateViewStateTimerFired): Deleted.
935
936 2016-10-31  Jaehun Lim  <ljaehun.lim@samsung.com>
937
938         Unreviewed, CMake build fix
939
940         Adds #include <WebCore/IDBGetAllRecordsData.h>
941
942         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
943
944 2016-10-31  Simon Fraser  <simon.fraser@apple.com>
945
946         Add basic visual/layout viewport support for fixed position layout
947         https://bugs.webkit.org/show_bug.cgi?id=164261
948
949         Reviewed by Dean Jackson.
950
951         Don't make visualViewportEnabled an experimental feature, because I don't want it enabled
952         by default in WebKitTestRunner (and therefore mismatching DumpRenderTree).
953
954         * Shared/WebPreferencesDefinitions.h:
955
956 2016-10-29  Filip Pizlo  <fpizlo@apple.com>
957
958         JSC should support SharedArrayBuffer
959         https://bugs.webkit.org/show_bug.cgi?id=163986
960
961         Reviewed by Keith Miller.
962         
963         Adds some small things we need for SharedArrayBuffer.
964
965         * UIProcess/API/C/WKPreferencesRefPrivate.h:
966         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
967         * WebProcess/InjectedBundle/InjectedBundle.cpp:
968         (WebKit::InjectedBundle::createWebDataFromUint8Array):
969
970 2016-10-31  Brady Eidson  <beidson@apple.com>
971
972         IndexedDB 2.0: Support IDBObjectStore getAll/getAllKeys.
973         <rdar://problem/28806934> and https://bugs.webkit.org/show_bug.cgi?id=164097
974
975         Reviewed by Darin Adler.
976
977         - Handle moving "Get All" requests to and from the DatabaseProcess.
978         - Handle the additional task of creating/passing Sandbox Extensions for
979           referenced files when necessary. 
980           
981         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
982         (WebKit::WebIDBConnectionToClient::handleGetResult):
983         (WebKit::WebIDBConnectionToClient::didGetAllRecords):
984         (WebKit::WebIDBConnectionToClient::getAllRecords):
985         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
986         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
987         
988         * Shared/WebCoreArgumentCoders.h:
989         
990         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
991         (WebKit::WebIDBConnectionToServer::getAllRecords):
992         (WebKit::preregisterSandboxExtensionsIfNecessary):
993         (WebKit::WebIDBConnectionToServer::didGetAllRecords):
994         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
995         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
996
997 2016-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
998
999         [WK1] Candidate visibility should not update as a result of selection during a dictionary lookup
1000         https://bugs.webkit.org/show_bug.cgi?id=164236
1001         <rdar://problem/28747712>
1002
1003         Reviewed by Beth Dakin.
1004
1005         See WebCore ChangeLog for more detail. Removes m_isGettingDictionaryPopupInfo from the WebPage in favor of
1006         keeping track of the same state in Editor, so that both the WK1 and WK2 cases can share the same codepath.
1007
1008         * WebProcess/WebPage/WebPage.cpp:
1009         (WebKit::WebPage::didChangeSelection):
1010         * WebProcess/WebPage/WebPage.h:
1011         * WebProcess/WebPage/mac/WebPageMac.mm:
1012         (WebKit::WebPage::dictionaryPopupInfoForRange):
1013
1014 2016-10-31  Simon Fraser  <simon.fraser@apple.com>
1015
1016         Implement IntersectionObserver
1017         https://bugs.webkit.org/show_bug.cgi?id=159475
1018
1019         Reviewed by Ryosuke Niwa.
1020
1021         Add ENABLE_INTERSECTION_OBSERVER, enabled by default.
1022
1023         * Configurations/FeatureDefines.xcconfig:
1024
1025 2016-10-31  Ryan Haddad  <ryanhaddad@apple.com>
1026
1027         Unreviewed, rolling out r208154.
1028
1029         This change caused an assertion failure during API tests on
1030         macOS.
1031
1032         Reverted changeset:
1033
1034         "NetworkSession: Network process crash when converting main
1035         resource to download"
1036         https://bugs.webkit.org/show_bug.cgi?id=164220
1037         http://trac.webkit.org/changeset/208154
1038
1039 2016-10-28  Brent Fulgham  <bfulgham@apple.com>
1040
1041         Do a better job of protecting Frame objects in the context of JavaScript calls
1042         https://bugs.webkit.org/show_bug.cgi?id=164163
1043         <rdar://problem/28955249>
1044
1045         Reviewed by Darin Adler.
1046
1047         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
1048         (WebKit::InjectedBundleRangeHandle::renderedImage): Protected the Frame.
1049         * WebProcess/WebPage/WebPage.cpp:
1050         (WebKit::WebPage::insertTextAsync): Ditto.
1051         (WebKit::WebPage::setComposition): Ditto.
1052         * WebProcess/WebPage/mac/WebPageMac.mm:
1053         (WebKit::WebPage::insertDictatedTextAsync): Ditto.
1054
1055 2016-10-31  Carlos Garcia Campos  <cgarcia@igalia.com>
1056
1057         NetworkSession: Network process crash when converting main resource to download
1058         https://bugs.webkit.org/show_bug.cgi?id=164220
1059
1060         Reviewed by Alex Christensen.
1061
1062         Right after the main resource load is converted to a download, the web process deletes the ResourceLoader which
1063         sends the RemoveLoadIdentifier to the network process and the load is aborted. Sometimes it happens that
1064         NetworkResourceLoader::abort() is called while the NetworkLoad is still deciding the destination of the
1065         download. In such case, NetworkResourceLoader::didConvertToDownload() has already been called, but not
1066         NetworkResourceLoader::didBecomeDownload(). In NetworkResourceLoader::abort() we already handle the case of
1067         having a NetworkLoad after NetworkResourceLoader::didConvertToDownload() has been called, to avoid canceling the
1068         load in such case, however cleanup() is always called unconditionally and the NetworkLoad is deleted before
1069         NetworkResourceLoader::didBecomeDownload() is called. When the NetworkLoad is destroyed the NetworkDataTask
1070         client becomes nullptr, leaving it in a state where both the client is nullptr and the download hasn't been
1071         created yet. That's not expected to happen and when the response completion handler is called in the
1072         NetworkDataTask it tries to use either the client or the download and it crashes.
1073
1074         * NetworkProcess/NetworkResourceLoader.cpp:
1075         (WebKit::NetworkResourceLoader::didBecomeDownload): Call cleanup() instead of just deleting the network load.
1076         (WebKit::NetworkResourceLoader::abort): If we still have a network load that was converted to a download, do not
1077         call cleanup() because it will be called by didBecomeDownload() later.
1078
1079 2016-10-31  Darin Adler  <darin@apple.com>
1080
1081         Move ChildNode and ParentNode from ExceptionCode to Exception, add support for ExceptionOr<T&>
1082         https://bugs.webkit.org/show_bug.cgi?id=164214
1083
1084         Reviewed by Alex Christensen.
1085
1086         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
1087         (webkit_dom_document_query_selector): Updated exception handling.
1088         (webkit_dom_document_query_selector_all): Ditto.
1089         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
1090         (webkit_dom_document_fragment_query_selector): Ditto.
1091         (webkit_dom_document_fragment_query_selector_all): Ditto.
1092         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
1093         (webkit_dom_element_query_selector): Ditto.
1094         (webkit_dom_element_query_selector_all): Ditto.
1095
1096 2016-10-31  Darin Adler  <darin@apple.com>
1097
1098         Convert Document from ExceptionCode to Exception
1099         https://bugs.webkit.org/show_bug.cgi?id=164212
1100
1101         Reviewed by Alex Christensen.
1102
1103         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
1104         (webkit_dom_document_create_element): Updated exception handling.
1105         (webkit_dom_document_create_cdata_section): Ditto.
1106         (webkit_dom_document_create_processing_instruction): Ditto.
1107         (webkit_dom_document_create_attribute): Ditto.
1108         (webkit_dom_document_import_node): Ditto.
1109         (webkit_dom_document_create_element_ns): Ditto.
1110         (webkit_dom_document_create_attribute_ns): Ditto.
1111         (webkit_dom_document_adopt_node): Ditto.
1112         (webkit_dom_document_create_event): Ditto.
1113         (webkit_dom_document_set_xml_version): Ditto.
1114         (webkit_dom_document_get_cookie): Ditto.
1115         (webkit_dom_document_set_cookie): Ditto.
1116         (webkit_dom_document_set_body): Ditto.
1117         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm:
1118         (-[WKDOMDocument createElement:]): Ditto.
1119
1120 2016-10-31  Wenson Hsieh  <wenson_hsieh@apple.com>
1121
1122         Holding down a key to choose an accented character should fire "insertReplacementText" input events
1123         https://bugs.webkit.org/show_bug.cgi?id=164209
1124         <rdar://problem/29019305>
1125
1126         Reviewed by Darin Adler.
1127
1128         When replacing text, call Editor::insertText with the correct TextEventInputType so that WebCore will know to
1129         use EditActionInsertReplacement when creating and applying the corresponding TypingCommand. Additional minor
1130         changes in order to support testing replacement text insertion.
1131
1132         * UIProcess/API/Cocoa/WKWebView.mm:
1133         (-[WKWebView _insertText:replacementRange:]):
1134         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1135         * WebProcess/WebPage/WebPage.cpp:
1136         (WebKit::WebPage::insertTextAsync):
1137
1138 2016-10-30  Darin Adler  <darin@apple.com>
1139
1140         Move Element, NamedNodeMap, and DOMStringMap from ExceptionCode to Exception
1141         https://bugs.webkit.org/show_bug.cgi?id=164206
1142
1143         Reviewed by Chris Dumez.
1144
1145         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
1146         (webkit_dom_named_node_map_set_named_item): Updated exception handling.
1147         (webkit_dom_named_node_map_remove_named_item): Ditto.
1148         (webkit_dom_named_node_map_set_named_item_ns): Ditto.
1149         (webkit_dom_named_node_map_remove_named_item_ns): Ditto.
1150         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
1151         (webkit_dom_element_set_attribute): Ditto.
1152         (webkit_dom_element_set_attribute_node): Ditto.
1153         (webkit_dom_element_remove_attribute_node): Ditto.
1154         (webkit_dom_element_set_attribute_ns): Ditto.
1155         (webkit_dom_element_set_attribute_node_ns): Ditto.
1156         (webkit_dom_element_matches): Ditto.
1157         (webkit_dom_element_closest): Ditto.
1158         (webkit_dom_element_webkit_matches_selector): Ditto.
1159         (webkit_dom_element_insert_adjacent_element): Ditto.
1160         (webkit_dom_element_insert_adjacent_html): Ditto.
1161         (webkit_dom_element_insert_adjacent_text): Ditto.
1162         (webkit_dom_element_set_inner_html): Ditto.
1163         (webkit_dom_element_set_outer_html): Ditto.
1164         * WebProcess/InjectedBundle/API/mac/WKDOMElement.mm:
1165         (-[WKDOMElement setAttribute:value:]): Ditto.
1166
1167 2016-10-30  Yusuke Suzuki  <utatane.tea@gmail.com>
1168
1169         [DOM] Introduce WebCore::jsDynamicDowncast
1170         https://bugs.webkit.org/show_bug.cgi?id=164137
1171
1172         Reviewed by Darin Adler.
1173
1174         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1175         (WebKit::WebAutomationSessionProxy::elementForNodeHandle):
1176
1177 2016-10-29  Darin Adler  <darin@apple.com>
1178
1179         Convert more of DOM from ExceptionCode to Exception
1180         https://bugs.webkit.org/show_bug.cgi?id=164173
1181
1182         Reviewed by Ryosuke Niwa.
1183
1184         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
1185         (webkit_dom_character_data_substring_data): Updated since this
1186         now uses ExceptionOr.
1187         (webkit_dom_character_data_insert_data): Ditto.
1188         (webkit_dom_character_data_delete_data): Ditto.
1189         (webkit_dom_character_data_replace_data): Ditto.
1190         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDeprecated.cpp:
1191         (webkit_dom_text_replace_whole_text): Ditto.
1192         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
1193         (webkit_dom_text_split_text): Ditto.
1194
1195 2016-10-28  Darin Adler  <darin@apple.com>
1196
1197         Move all classes in the HTML directory from ExceptionCode to Exception
1198         https://bugs.webkit.org/show_bug.cgi?id=163876
1199
1200         Reviewed by Sam Weinig.
1201
1202         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
1203         (webkit_dom_dom_token_list_add): Updated exception handling.
1204         (webkit_dom_dom_token_list_remove): Ditto.
1205         (webkit_dom_dom_token_list_toggle): Ditto.
1206         (webkit_dom_dom_token_list_replace): Ditto.
1207         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
1208         (webkit_dom_element_remove): Ditto.
1209         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
1210         (webkit_dom_html_element_set_inner_text): Ditto.
1211         (webkit_dom_html_element_set_outer_text): Ditto.
1212         (webkit_dom_html_element_set_content_editable): Ditto.
1213         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
1214         (webkit_dom_html_input_element_set_max_length): Ditto.
1215         (webkit_dom_html_input_element_set_size): Ditto.
1216         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
1217         (webkit_dom_html_select_element_set_length): Ditto.
1218         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
1219         (webkit_dom_html_table_element_insert_row): Ditto.
1220         (webkit_dom_html_table_element_delete_row): Ditto.
1221         (webkit_dom_html_table_element_set_caption): Ditto.
1222         (webkit_dom_html_table_element_set_t_head): Ditto.
1223         (webkit_dom_html_table_element_set_t_foot): Ditto.
1224         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
1225         (webkit_dom_html_table_row_element_insert_cell): Ditto.
1226         (webkit_dom_html_table_row_element_delete_cell): Ditto.
1227         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
1228         (webkit_dom_html_table_section_element_insert_row): Ditto.
1229         (webkit_dom_html_table_section_element_delete_row): Ditto.
1230
1231         * WebProcess/WebPage/WebPage.cpp:
1232         (WebKit::WebPage::editorState): Removed ASSERT_NO_EXCEPTION.
1233
1234         * WebProcess/WebPage/ios/WebPageIOS.mm:
1235         (WebKit::WebPage::setAssistedNodeValueAsNumber): Removed ASSERT_NO_EXCEPTION.
1236
1237         * WebProcess/cocoa/WebPlaybackSessionManager.mm:
1238         (WebKit::WebPlaybackSessionManager::seekableRangesChanged):
1239         Changed the code to use a different interface to TimeRange that does
1240         not involve exceptions.
1241
1242 2016-10-28  Wenson Hsieh  <wenson_hsieh@apple.com>
1243
1244         iOS autocorrection does not trigger an input event of inputType "insertReplacementText"
1245         https://bugs.webkit.org/show_bug.cgi?id=164077
1246         <rdar://problem/28987810>
1247
1248         Reviewed by Simon Fraser.
1249
1250         Small tweak to mark text insertion when autocorrecting as such, as opposed to regular keyboard input.
1251
1252         * WebProcess/WebPage/ios/WebPageIOS.mm:
1253         (WebKit::WebPage::syncApplyAutocorrection):
1254
1255 2016-10-28  Megan Gardner  <megan_gardner@apple.com>
1256
1257         Rename SharedMemoryMac to SharedMemoryCocoa
1258         https://bugs.webkit.org/show_bug.cgi?id=164156
1259
1260         Reviewed by Alex Christensen.
1261
1262         Renamed SharedMemoryMac to SharedMemoryCocoa, as it runs on all cocoa platforms, not exclusively just mac, and
1263         thus should be named to reflect that reality.
1264
1265         * Platform/cocoa: Added.
1266         * Platform/cocoa/SharedMemoryCocoa.cpp: Copied from Source/WebKit2/Platform/mac/SharedMemoryMac.cpp.
1267         * Platform/mac/SharedMemoryMac.cpp: Removed.
1268         * WebKit2.xcodeproj/project.pbxproj:
1269
1270 2016-10-28  Antti Koivisto  <antti@apple.com>
1271
1272         Enable CFNetwork connection cache fast lane for WebKit2
1273         https://bugs.webkit.org/show_bug.cgi?id=164129
1274
1275         Reviewed by Andreas Kling.
1276
1277         The idea of this feature is keep a connection free for higher priority requests so low-priority
1278         image loads can't take all the available connections.
1279
1280         We have this enabled on WK1 but not on WK2. See what enabling it does for performance in bots.
1281
1282         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1283         (WebKit::initializeNetworkSettings):
1284
1285             Based on code inspection setting kHTTPMinimumFastLanePriority is not sufficient to enable this feature,
1286             kHTTPNumFastLanes needs also be set to a non-zero value. Use the same constants as WK1.
1287             Also enable this on Mac to unify behavior.
1288
1289 2016-10-27  Michael Catanzaro  <mcatanzaro@igalia.com>
1290
1291         [GTK] New stable DOM API headers should be included from webkitdom.h
1292         https://bugs.webkit.org/show_bug.cgi?id=164069
1293
1294         Reviewed by Carlos Garcia Campos.
1295
1296         * WebProcess/InjectedBundle/API/gtk/DOM/webkitdom.h:
1297
1298 2016-10-27  Simon Fraser  <simon.fraser@apple.com>
1299
1300         Fix when building against the MacOSX10.12.sdk where "macos" is not recognized
1301         in the availability macros.
1302
1303         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1304
1305 2016-10-27  Megan Gardner  <megan_gardner@apple.com>
1306
1307         Add support for wide gamut for ShareableBitmap for image popovers
1308         https://bugs.webkit.org/show_bug.cgi?id=164001
1309
1310         Reviewed by Simon Fraser.
1311
1312         Added suppport for wide gamut in ShareableBitmap. SharableBitmaps now know the size of their pixels,
1313         and that data is passed back and forth between the processes. The callers of SharedBitmap will determine
1314         if their image should support wide gamut, but ShareableBitmap will override a set flag on a device that
1315         is incapbable of supporting a wide gamut image.
1316         This makes it possible to show wide gamut images in image popovers on iOS.
1317         This is currently untestable, so no tests added.
1318
1319         * Platform/IPC/Decoder.cpp:
1320         (IPC::Decoder::decode):
1321         * Platform/IPC/Decoder.h:
1322         * Platform/IPC/Encoder.cpp:
1323         (IPC::Encoder::encode):
1324         * Platform/IPC/Encoder.h:
1325         * Shared/ShareableBitmap.cpp:
1326         (WebKit::bytesPerPixel):
1327         (WebKit::ShareableBitmap::Handle::encode):
1328         (WebKit::ShareableBitmap::Handle::decode):
1329         (WebKit::ShareableBitmap::Handle::clear):
1330         (WebKit::ShareableBitmap::create):
1331         (WebKit::ShareableBitmap::createShareable):
1332         (WebKit::ShareableBitmap::createHandle):
1333         (WebKit::ShareableBitmap::ShareableBitmap):
1334         * Shared/ShareableBitmap.h:
1335         (WebKit::ShareableBitmap::numBytesForSize):
1336         (WebKit::ShareableBitmap::sizeInBytes):
1337         * Shared/cg/ShareableBitmapCG.cpp:
1338         (WebKit::bitmapInfo):
1339         (WebKit::ShareableBitmap::createGraphicsContext):
1340         (WebKit::ShareableBitmap::createCGImage):
1341         * WebProcess/WebPage/ios/WebPageIOS.mm:
1342         (WebKit::WebPage::getPositionInformation):
1343
1344 2016-10-27  Wenson Hsieh  <wenson_hsieh@apple.com>
1345
1346         Support "insertFromDrop" and "deleteByDrag" for the InputEvent spec
1347         https://bugs.webkit.org/show_bug.cgi?id=163948
1348         <rdar://problem/28921433>
1349
1350         Reviewed by Darin Adler.
1351
1352         Add support for new drag and drop-related EditAction enum values.
1353
1354         * UIProcess/WebEditCommandProxy.cpp:
1355         (WebKit::WebEditCommandProxy::nameForEditAction):
1356
1357 2016-10-26  Chris Dumez  <cdumez@apple.com>
1358
1359         Replace IDBKeyPath with a WTF::Variant
1360         https://bugs.webkit.org/show_bug.cgi?id=163909
1361
1362         Reviewed by Darin Adler.
1363
1364         Add coders to encode / decode IDBKeyPath type for IPC.
1365
1366         * Shared/Databases/IndexedDB/WebIDBResult.cpp:
1367         * Shared/WebCoreArgumentCoders.cpp:
1368         (IPC::ArgumentCoder<IDBKeyPath>::encode):
1369         (IPC::ArgumentCoder<IDBKeyPath>::decode):
1370         * Shared/WebCoreArgumentCoders.h:
1371         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1372
1373 2016-10-26  Brian Burg  <bburg@apple.com>
1374
1375         Web Inspector: remove unused bool return value from FrontendChannel::sendMessageToFrontend
1376         https://bugs.webkit.org/show_bug.cgi?id=164046
1377
1378         Reviewed by Joseph Pecoraro.
1379
1380         * WebProcess/WebPage/WebInspector.cpp:
1381         (WebKit::WebInspector::sendMessageToFrontend):
1382         * WebProcess/WebPage/WebInspector.h:
1383
1384 2016-10-26  Eric Carlson  <eric.carlson@apple.com>
1385
1386         [MediaStream] Add "has capture device" bit to media state flags
1387         https://bugs.webkit.org/show_bug.cgi?id=163952
1388
1389         Unreviewed fix after r207839.
1390
1391         * WebProcess/WebPage/WebPage.cpp:
1392         (WebKit::WebPage::setMuted): Take an MutedStateFlags, not a bool.
1393         * WebProcess/WebPage/WebPage.h:
1394
1395 2016-10-26  Carlos Garcia Campos  <cgarcia@igalia.com>
1396
1397         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.15.1 release.
1398
1399         * gtk/NEWS: Add release notes for 2.15.1.
1400
1401 2016-10-26  Carlos Garcia Campos  <cgarcia@igalia.com>
1402
1403         REGRESSION(r206505) [GTK] Build broken with GTK+ 3.14
1404         https://bugs.webkit.org/show_bug.cgi?id=162776
1405
1406         Reviewed by Xabier Rodriguez-Calvar.
1407
1408         Do not use gtk_widget_get_action_group() when GTK+ < 3.16, use g_object_set instead to attach the action group
1409         to the menu widget.
1410
1411         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
1412         (WebKit::WebContextMenuProxyGtk::append):
1413         (WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk):
1414         (WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk):
1415
1416 2016-10-25  Alex Christensen  <achristensen@webkit.org>
1417
1418         CMake build fix.
1419
1420         * PlatformMac.cmake:
1421         * Shared/WebHitTestResultData.cpp:
1422         (WebKit::WebHitTestResultData::WebHitTestResultData):
1423         Explicitly call AtomicString::string to make the String constructor no longer ambiguous.
1424         It couldn't decide whether to use operator const String& or operator NSString*.
1425
1426 2016-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1427
1428         [SOUP] Network process assertion in NetworkDataTask::continueHTTPRedirection
1429         https://bugs.webkit.org/show_bug.cgi?id=163941
1430
1431         Reviewed by Michael Catanzaro.
1432
1433         equalLettersIgnoringASCIICase() expects the second argument to be the letters to compare in lowercase, so use
1434         "get" instead of "GET".
1435
1436         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1437         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
1438
1439 2016-10-25  Eric Carlson  <eric.carlson@apple.com>
1440
1441         [MediaStream] Add "has capture device" bit to media state flags
1442         https://bugs.webkit.org/show_bug.cgi?id=163952
1443
1444         Reviewed by Sam Weinig.
1445
1446         * UIProcess/API/C/WKPage.cpp:
1447         (WKPageGetMediaState): Support MediaProducer::HasMediaCaptureDevice.
1448         * UIProcess/API/C/WKPagePrivate.h: Define kWKMediaHasCaptureDevice.
1449
1450 2016-10-25  Commit Queue  <commit-queue@webkit.org>
1451
1452         Unreviewed, rolling out r207827 and r207828.
1453         https://bugs.webkit.org/show_bug.cgi?id=163965
1454
1455         Caused LayoutTest webaudio/web-audio-is-playing.html to time
1456         out on macOS. (Requested by ryanhaddad on #webkit).
1457
1458         Reverted changesets:
1459
1460         "[MediaStream] Add "has capture device" bit to media state
1461         flags"
1462         https://bugs.webkit.org/show_bug.cgi?id=163952
1463         http://trac.webkit.org/changeset/207827
1464
1465         "[MediaStream] Add "has capture device" bit to media state
1466         flags"
1467         https://bugs.webkit.org/show_bug.cgi?id=163952
1468         http://trac.webkit.org/changeset/207828
1469
1470 2016-10-25  Eric Carlson  <eric.carlson@apple.com>
1471
1472         [MediaStream] Add "has capture device" bit to media state flags
1473         https://bugs.webkit.org/show_bug.cgi?id=163952
1474
1475         Reviewed by Sam Weinig.
1476
1477         * UIProcess/API/C/WKPage.cpp:
1478         (WKPageGetMediaState): Support MediaProducer::HasMediaCaptureDevice.
1479         * UIProcess/API/C/WKPagePrivate.h: Define kWKMediaHasCaptureDevice.
1480
1481 2016-10-25  Chris Dumez  <cdumez@apple.com>
1482
1483         Unreviewed, rolling out r207494.
1484
1485         iOS SDK has been updated on the bots now so rollout the
1486         rollout
1487
1488         Reverted changeset:
1489
1490         "Unreviewed, rolling out r207413."
1491         https://bugs.webkit.org/show_bug.cgi?id=163547
1492         http://trac.webkit.org/changeset/207494
1493
1494 2016-10-25  Jonathan Bedard  <jbedard@apple.com>
1495
1496         Unreviewed build fix.
1497
1498         * UIProcess/API/Cocoa/WKWebView.mm:
1499         (-[WKWebView _fullscreenDelegate]): Removed unneeded parenthesis.
1500
1501 2016-10-19  Jer Noble  <jer.noble@apple.com>
1502
1503         Add WKWebView fullscreen delegate SPI
1504         https://bugs.webkit.org/show_bug.cgi?id=163674
1505
1506         Reviewed by Anders Carlsson.
1507
1508         Add a new SPI property to WKWebView allowing clients to be notified when fullscreen mode enters and exits.
1509
1510         * UIProcess/API/APIFullscreenClient.h: Added.
1511         (API::FullscreenClient::~FullscreenClient):
1512         (API::FullscreenClient::willEnterFullscreen):
1513         (API::FullscreenClient::didEnterFullscreen):
1514         (API::FullscreenClient::willExitFullscreen):
1515         (API::FullscreenClient::didExitFullscreen):
1516         * UIProcess/API/Cocoa/WKWebView.mm:
1517         (-[WKWebView _initializeWithConfiguration:]):
1518         (-[WKWebView _setFullscreenDelegate:]):
1519         (-[WKWebView _fullscreenDelegate]):
1520         (-[WKWebView _isInFullscreen]):
1521         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1522         * UIProcess/API/Cocoa/_WKFullscreenDelegate.h: Added.
1523         * UIProcess/Cocoa/FullscreenClient.h: Added.
1524         (WebKit::FullscreenClient::~FullscreenClient):
1525         * UIProcess/Cocoa/FullscreenClient.mm: Added.
1526         (WebKit::FullscreenClient::FullscreenClient):
1527         (WebKit::FullscreenClient::delegate):
1528         (WebKit::FullscreenClient::setDelegate):
1529         (WebKit::FullscreenClient::willEnterFullscreen):
1530         (WebKit::FullscreenClient::didEnterFullscreen):
1531         (WebKit::FullscreenClient::willExitFullscreen):
1532         (WebKit::FullscreenClient::didExitFullscreen):
1533         * UIProcess/WebFullScreenManagerProxy.cpp:
1534         (WebKit::WebFullScreenManagerProxy::willEnterFullScreen):
1535         (WebKit::WebFullScreenManagerProxy::didEnterFullScreen):
1536         (WebKit::WebFullScreenManagerProxy::willExitFullScreen):
1537         (WebKit::WebFullScreenManagerProxy::didExitFullScreen):
1538         * UIProcess/WebPageProxy.cpp:
1539         (WebKit::WebPageProxy::WebPageProxy):
1540         (WebKit::WebPageProxy::setFullscreenClient):
1541         (WebKit::WebPageProxy::fullScreenManager): Deleted.
1542         * UIProcess/WebPageProxy.h:
1543         (WebKit::WebPageProxy::fullscreenClient):
1544         * WebKit2.xcodeproj/project.pbxproj:
1545
1546 2016-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1547
1548         Unreviewed. Fix timeouts in 12 GTK+ unit tests after r207812.
1549
1550         * NetworkProcess/NetworkProcessCreationParameters.h: Initialize loadThrottleLatency.
1551
1552 2016-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1553
1554         Unreviewed. Fix Soup based ports debug build after r207813.
1555
1556         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1557         (WebKit::NetworkDataTaskSoup::authenticateCallback):
1558         (WebKit::NetworkDataTaskSoup::requestStartedCallback):
1559
1560 2016-10-25  Andreas Kling  <akling@apple.com>
1561
1562         More PassRefPtr purging in WebCore.
1563         <https://webkit.org/b/163895>
1564
1565         Reviewed by Antti Koivisto.
1566
1567         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.h:
1568         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
1569         (WebKit::PDFPlugin::createScrollbar):
1570
1571 2016-10-25  Carlos Garcia Campos  <cgarcia@igalia.com>
1572
1573         NetworkSession: switch to use subclasses for NetworkSession and NetworkDataTask implementations
1574         https://bugs.webkit.org/show_bug.cgi?id=163777
1575
1576         Reviewed by Alex Christensen.
1577
1578         The subclass model allows us to choose the implementation at run time, so we could add other implementations
1579         like a mock network class to measure performance, and even one for blobs and finally get rid of ResourceHandle
1580         in WebKit2.
1581
1582         * CMakeLists.txt: Add new files to compilation.
1583         * NetworkProcess/NetworkDataTask.cpp: Added.
1584         (WebKit::NetworkDataTask::create): Create a NetworkDataTaskCocoa or NetworkDataTaskSoup.
1585         (WebKit::NetworkDataTask::NetworkDataTask): Move common code from NetworkDataTaskCocoa and NetworkDataTaskSoup
1586         here to handle the early failures.
1587         (WebKit::NetworkDataTask::~NetworkDataTask):
1588         (WebKit::NetworkDataTask::scheduleFailure):
1589         (WebKit::NetworkDataTask::failureTimerFired):
1590         * NetworkProcess/NetworkDataTask.h: Remove platform specific members.
1591         (WebKit::NetworkDataTask::setPendingDownloadLocation): Make it virtual and set the m_pendingDownloadLocation.
1592         (WebKit::NetworkDataTask::suggestedFilename): Make it virtual and const with a default implementation.
1593         (WebKit::NetworkDataTask::setSuggestedFilename): Ditto.
1594         (WebKit::NetworkDataTask::allowsSpecificHTTPSCertificateForHost): Ditto.
1595         * NetworkProcess/NetworkLoad.cpp: Include NetworkDataTaskCocoa.h.
1596         * NetworkProcess/NetworkLoad.h: Include NetworkDataTask.h instead of NetworkSession.h.
1597         * NetworkProcess/NetworkProcess.cpp:
1598         (WebKit::NetworkProcess::NetworkProcess): Use NetworkSessionCocoa.
1599         * NetworkProcess/NetworkSession.cpp:
1600         (WebKit::NetworkSession::create): Create a NetworkSessionCocoa or NetworkSessionSoup.
1601         (WebKit::NetworkSession::defaultSession): In case of cocoa use NetworkSessionCocoa::defaultSession() because of
1602         the custom protocol manager, otherwise simply create a default session.
1603         (WebKit::NetworkSession::networkStorageSession): Move common code from NetworkSessionCocoa and
1604         NetworkSessionSoup here.
1605         (WebKit::NetworkSession::NetworkSession):
1606         (WebKit::NetworkSession::~NetworkSession):
1607         * NetworkProcess/NetworkSession.h: Remove platform specific members.
1608         (WebKit::NetworkSession::invalidateAndCancel): Make it virtual.
1609         (WebKit::NetworkSession::clearCredentials): Ditto.
1610         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp: Include NetworkSession.h.
1611         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h: Added.
1612         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1613         (WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
1614         (WebKit::NetworkDataTaskCocoa::~NetworkDataTaskCocoa):
1615         (WebKit::NetworkDataTaskCocoa::didSendData):
1616         (WebKit::NetworkDataTaskCocoa::didReceiveChallenge):
1617         (WebKit::NetworkDataTaskCocoa::didCompleteWithError):
1618         (WebKit::NetworkDataTaskCocoa::didReceiveResponse):
1619         (WebKit::NetworkDataTaskCocoa::didReceiveData):
1620         (WebKit::NetworkDataTaskCocoa::didBecomeDownload):
1621         (WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
1622         (WebKit::NetworkDataTaskCocoa::setPendingDownloadLocation):
1623         (WebKit::NetworkDataTaskCocoa::tryPasswordBasedAuthentication):
1624         (WebKit::NetworkDataTaskCocoa::transferSandboxExtensionToDownload):
1625         (WebKit::NetworkDataTaskCocoa::allowsSpecificHTTPSCertificateForHost):
1626         (WebKit::NetworkDataTaskCocoa::suggestedFilename):
1627         (WebKit::NetworkDataTaskCocoa::cancel):
1628         (WebKit::NetworkDataTaskCocoa::resume):
1629         (WebKit::NetworkDataTaskCocoa::suspend):
1630         (WebKit::NetworkDataTaskCocoa::state):
1631         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1632         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1633         * NetworkProcess/cocoa/NetworkSessionCocoa.h: Added.
1634         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1635         (-[WKNetworkSessionDelegate initWithNetworkSession:withCredentials:]):
1636         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
1637         (WebKit::configurationForSessionID):
1638         (WebKit::NetworkSessionCocoa::setCustomProtocolManager):
1639         (WebKit::NetworkSessionCocoa::setSourceApplicationAuditTokenData):
1640         (WebKit::NetworkSessionCocoa::setSourceApplicationBundleIdentifier):
1641         (WebKit::NetworkSessionCocoa::setSourceApplicationSecondaryIdentifier):
1642         (WebKit::NetworkSessionCocoa::setCTDataConnectionServiceType):
1643         (WebKit::NetworkSessionCocoa::create):
1644         (WebKit::NetworkSessionCocoa::defaultSession):
1645         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1646         (WebKit::NetworkSessionCocoa::~NetworkSessionCocoa):
1647         (WebKit::NetworkSessionCocoa::invalidateAndCancel):
1648         (WebKit::NetworkSessionCocoa::clearCredentials):
1649         (WebKit::NetworkSessionCocoa::dataTaskForIdentifier):
1650         (WebKit::NetworkSessionCocoa::addDownloadID):
1651         (WebKit::NetworkSessionCocoa::downloadID):
1652         (WebKit::NetworkSessionCocoa::takeDownloadID):
1653         * NetworkProcess/mac/RemoteNetworkingContext.mm:
1654         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession):
1655         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
1656         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
1657         (WebKit::NetworkDataTaskSoup::~NetworkDataTaskSoup):
1658         (WebKit::NetworkDataTaskSoup::suggestedFilename):
1659         (WebKit::NetworkDataTaskSoup::setPendingDownloadLocation):
1660         (WebKit::NetworkDataTaskSoup::createRequest):
1661         (WebKit::NetworkDataTaskSoup::clearRequest):
1662         (WebKit::NetworkDataTaskSoup::resume):
1663         (WebKit::NetworkDataTaskSoup::suspend):
1664         (WebKit::NetworkDataTaskSoup::cancel):
1665         (WebKit::NetworkDataTaskSoup::invalidateAndCancel):
1666         (WebKit::NetworkDataTaskSoup::state):
1667         (WebKit::NetworkDataTaskSoup::timeoutFired):
1668         (WebKit::NetworkDataTaskSoup::startTimeout):
1669         (WebKit::NetworkDataTaskSoup::stopTimeout):
1670         (WebKit::NetworkDataTaskSoup::sendRequestCallback):
1671         (WebKit::NetworkDataTaskSoup::didSendRequest):
1672         (WebKit::NetworkDataTaskSoup::didReceiveResponse):
1673         (WebKit::NetworkDataTaskSoup::tlsErrorsChangedCallback):
1674         (WebKit::NetworkDataTaskSoup::tlsErrorsChanged):
1675         (WebKit::NetworkDataTaskSoup::applyAuthenticationToRequest):
1676         (WebKit::NetworkDataTaskSoup::authenticateCallback):
1677         (WebKit::NetworkDataTaskSoup::authenticate):
1678         (WebKit::NetworkDataTaskSoup::continueAuthenticate):
1679         (WebKit::NetworkDataTaskSoup::skipInputStreamForRedirectionCallback):
1680         (WebKit::NetworkDataTaskSoup::skipInputStreamForRedirection):
1681         (WebKit::NetworkDataTaskSoup::didFinishSkipInputStreamForRedirection):
1682         (WebKit::NetworkDataTaskSoup::shouldStartHTTPRedirection):
1683         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
1684         (WebKit::NetworkDataTaskSoup::readCallback):
1685         (WebKit::NetworkDataTaskSoup::read):
1686         (WebKit::NetworkDataTaskSoup::didRead):
1687         (WebKit::NetworkDataTaskSoup::didFinishRead):
1688         (WebKit::NetworkDataTaskSoup::requestNextPartCallback):
1689         (WebKit::NetworkDataTaskSoup::requestNextPart):
1690         (WebKit::NetworkDataTaskSoup::didRequestNextPart):
1691         (WebKit::NetworkDataTaskSoup::didFinishRequestNextPart):
1692         (WebKit::NetworkDataTaskSoup::gotHeadersCallback):
1693         (WebKit::NetworkDataTaskSoup::didGetHeaders):
1694         (WebKit::NetworkDataTaskSoup::wroteBodyDataCallback):
1695         (WebKit::NetworkDataTaskSoup::didWriteBodyData):
1696         (WebKit::NetworkDataTaskSoup::download):
1697         (WebKit::NetworkDataTaskSoup::writeDownloadCallback):
1698         (WebKit::NetworkDataTaskSoup::writeDownload):
1699         (WebKit::NetworkDataTaskSoup::didWriteDownload):
1700         (WebKit::NetworkDataTaskSoup::didFinishDownload):
1701         (WebKit::NetworkDataTaskSoup::didFailDownload):
1702         (WebKit::NetworkDataTaskSoup::cleanDownloadFiles):
1703         (WebKit::NetworkDataTaskSoup::didFail):
1704         (WebKit::NetworkDataTaskSoup::networkEventCallback):
1705         (WebKit::NetworkDataTaskSoup::networkEvent):
1706         (WebKit::NetworkDataTaskSoup::startingCallback):
1707         (WebKit::NetworkDataTaskSoup::requestStartedCallback):
1708         (WebKit::NetworkDataTaskSoup::didStartRequest):
1709         (WebKit::NetworkDataTaskSoup::restartedCallback):
1710         (WebKit::NetworkDataTaskSoup::didRestart):
1711         * NetworkProcess/soup/NetworkDataTaskSoup.h: Added.
1712         * NetworkProcess/soup/NetworkSessionSoup.cpp:
1713         (WebKit::NetworkSessionSoup::NetworkSessionSoup):
1714         (WebKit::NetworkSessionSoup::~NetworkSessionSoup):
1715         (WebKit::NetworkSessionSoup::soupSession):
1716         (WebKit::NetworkSessionSoup::invalidateAndCancel):
1717         * NetworkProcess/soup/NetworkSessionSoup.h: Added.
1718         * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
1719         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Update to new NetworkSession::create() API.
1720         * PlatformEfl.cmake: Add new files to compilation.
1721         * PlatformGTK.cmake: Ditto.
1722         * WebKit2.xcodeproj/project.pbxproj: Ditto.
1723         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
1724         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Update to new NetworkSession::create() API.
1725         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
1726         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Ditto.
1727
1728 2016-10-25  Antti Koivisto  <antti@apple.com>
1729
1730         Add support for introducing simulated latency in network process
1731         https://bugs.webkit.org/show_bug.cgi?id=163902
1732
1733         Reviewed by Alex Christensen.
1734
1735         For testing purposes it is useful to have a mechanism for simulating high latency.
1736         This patch adds a basic mechanism that introduces a delay to each response in network
1737         process. In Safari it can be used with
1738
1739              defaults write com.apple.Safari WebKitNetworkLoadThrottleLatencyMilliseconds 200
1740
1741         Setting the delay to 0 disables the feature.
1742
1743         * NetworkProcess/NetworkLoad.cpp:
1744         (WebKit::NetworkLoad::Throttle::Throttle):
1745         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
1746         (WebKit::NetworkLoad::notifyDidReceiveResponse):
1747         (WebKit::NetworkLoad::didReceiveData):
1748         (WebKit::NetworkLoad::didCompleteWithError):
1749         (WebKit::NetworkLoad::throttleDelayCompleted):
1750         * NetworkProcess/NetworkLoad.h:
1751         * NetworkProcess/NetworkProcess.cpp:
1752         (WebKit::NetworkProcess::initializeNetworkProcess):
1753         * NetworkProcess/NetworkProcess.h:
1754         (WebKit::NetworkProcess::loadThrottleLatency):
1755         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1756         (WebKit::NetworkProcessCreationParameters::encode):
1757         (WebKit::NetworkProcessCreationParameters::decode):
1758         * NetworkProcess/NetworkProcessCreationParameters.h:
1759         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1760         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1761
1762 2016-10-24  Dan Bernstein  <mitz@apple.com>
1763
1764         REGRESSION (r206410): Sandbox violations beneath WebProcessProxy::platformIsBeingDebugged
1765         https://bugs.webkit.org/show_bug.cgi?id=163879
1766         <rdar://problem/28728735>
1767
1768         Reviewed by Darin Adler.
1769
1770         * UIProcess/Cocoa/WebProcessProxyCocoa.mm:
1771         (WebKit::WebProcessProxy::platformIsBeingDebugged): Check if the current process, which is
1772           the UI process, is sandboxed before trying to find out if the Web process is being
1773           debugged.
1774
1775 2016-10-21  Alex Christensen  <achristensen@webkit.org>
1776
1777         URL::port should return Optional<uint16_t>
1778         https://bugs.webkit.org/show_bug.cgi?id=163806
1779
1780         Reviewed by Darin Adler.
1781
1782         * NetworkProcess/mac/NetworkProcessMac.mm:
1783         (WebKit::overrideSystemProxies):
1784         * Shared/API/APISecurityOrigin.h:
1785         (API::SecurityOrigin::create):
1786         * Shared/API/APIURL.h:
1787         (API::URL::protocol):
1788         * Shared/API/c/WKSecurityOriginRef.cpp:
1789         (WKSecurityOriginGetPort):
1790         * UIProcess/API/Cocoa/WKSecurityOrigin.mm:
1791         (-[WKSecurityOrigin port]):
1792         * WebProcess/WebPage/WebPage.cpp:
1793         (WebKit::WebPage::canHandleRequest):
1794         * WebProcess/cocoa/WebProcessCocoa.mm:
1795         (WebKit::origin):
1796
1797 2016-10-24  Eric Carlson  <eric.carlson@apple.com>
1798
1799         [MediaStream] Separate media capture and audio playback muting
1800         https://bugs.webkit.org/show_bug.cgi?id=163855
1801         <rdar://problem/28827186>
1802
1803         Reviewed by Darin Adler.
1804
1805         * Shared/WebPageCreationParameters.h: Change 'muted' from bool to MutedStateFlags.
1806
1807         * UIProcess/API/C/WKPage.cpp: Change parameter from bool to WKMediaMutedState.
1808         (WKPageSetMuted):
1809         * UIProcess/API/C/WKPagePrivate.h: Define WKMediaMutedState.
1810
1811         * UIProcess/WebPageProxy.cpp:
1812         (WebKit::WebPageProxy::WebPageProxy):
1813         (WebKit::WebPageProxy::setMuted): m_muted -> m_mutedState.
1814         (WebKit::WebPageProxy::creationParameters): Ditto.
1815         * UIProcess/WebPageProxy.h:
1816
1817         * WebProcess/Plugins/PluginView.cpp:
1818         (WebKit::PluginView::isMuted): page.isMuted -> page.mutedState.
1819
1820         * WebProcess/WebPage/WebPage.messages.in: Change SetMuted parameter.
1821
1822 2016-10-24  Youenn Fablet  <youenn@apple.com>
1823
1824         Activate WEB_RTC compilation flags for Mac bots
1825         https://bugs.webkit.org/show_bug.cgi?id=163886
1826
1827         Reviewed by Eric Carlson.
1828
1829         * Configurations/FeatureDefines.xcconfig:
1830
1831 2016-10-24  Brady Eidson  <beidson@apple.com>
1832
1833         IndexedDB 2.0: Support IDBIndex name assignment.
1834         <rdar://problem/28806932> and https://bugs.webkit.org/show_bug.cgi?id=163805
1835
1836         Reviewed by Alex Christensen.
1837
1838         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1839         (WebKit::WebIDBConnectionToClient::didRenameIndex):
1840         (WebKit::WebIDBConnectionToClient::renameIndex):
1841         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
1842         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
1843
1844         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1845         (WebKit::WebIDBConnectionToServer::renameIndex):
1846         (WebKit::WebIDBConnectionToServer::didRenameIndex):
1847         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
1848         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
1849
1850 2016-10-23  Michael Catanzaro  <mcatanzaro@igalia.com>
1851
1852         [GTK] Remove DO NOT MODIFY headers from files that are no longer autogenerated
1853         https://bugs.webkit.org/show_bug.cgi?id=163867
1854
1855         Reviewed by Darin Adler.
1856
1857         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.cpp:
1858         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttr.h:
1859         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMAttrPrivate.h:
1860         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.cpp:
1861         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlob.h:
1862         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMBlobPrivate.h:
1863         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.cpp:
1864         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASection.h:
1865         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCDATASectionPrivate.h:
1866         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.h:
1867         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.cpp:
1868         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleList.h:
1869         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRuleListPrivate.h:
1870         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRulePrivate.h:
1871         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.h:
1872         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclarationPrivate.h:
1873         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.h:
1874         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheetPrivate.h:
1875         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.h:
1876         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValuePrivate.h:
1877         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.cpp:
1878         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterData.h:
1879         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCharacterDataPrivate.h:
1880         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.cpp:
1881         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMComment.h:
1882         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCommentPrivate.h:
1883         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.h:
1884         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementationPrivate.h:
1885         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
1886         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.h:
1887         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelectionPrivate.h:
1888         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.cpp:
1889         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenList.h:
1890         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMTokenListPrivate.h:
1891         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
1892         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.h:
1893         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindowPrivate.h:
1894         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindowUnstable.h:
1895         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.h:
1896         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.cpp:
1897         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragment.h:
1898         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragmentPrivate.h:
1899         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentFragmentUnstable.h:
1900         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentPrivate.h:
1901         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.cpp:
1902         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentType.h:
1903         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentTypePrivate.h:
1904         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocumentUnstable.h:
1905         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.cpp:
1906         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElement.h:
1907         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementPrivate.h:
1908         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMElementUnstable.h:
1909         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.cpp:
1910         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEvent.h:
1911         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMEventPrivate.h:
1912         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.cpp:
1913         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFile.h:
1914         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.cpp:
1915         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileList.h:
1916         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFileListPrivate.h:
1917         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMFilePrivate.h:
1918         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.cpp:
1919         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElement.h:
1920         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAnchorElementPrivate.h:
1921         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.cpp:
1922         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElement.h:
1923         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAppletElementPrivate.h:
1924         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.cpp:
1925         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElement.h:
1926         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLAreaElementPrivate.h:
1927         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.cpp:
1928         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElement.h:
1929         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBRElementPrivate.h:
1930         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.cpp:
1931         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElement.h:
1932         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBaseElementPrivate.h:
1933         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.cpp:
1934         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElement.h:
1935         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLBodyElementPrivate.h:
1936         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.cpp:
1937         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElement.h:
1938         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLButtonElementPrivate.h:
1939         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.cpp:
1940         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElement.h:
1941         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCanvasElementPrivate.h:
1942         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.cpp:
1943         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollection.h:
1944         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLCollectionPrivate.h:
1945         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.cpp:
1946         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElement.h:
1947         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDListElementPrivate.h:
1948         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.cpp:
1949         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElement.h:
1950         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDirectoryElementPrivate.h:
1951         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.cpp:
1952         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElement.h:
1953         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDivElementPrivate.h:
1954         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.cpp:
1955         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocument.h:
1956         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLDocumentPrivate.h:
1957         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.cpp:
1958         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElement.h:
1959         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElementPrivate.h:
1960         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLElementUnstable.h:
1961         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.cpp:
1962         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElement.h:
1963         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLEmbedElementPrivate.h:
1964         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.cpp:
1965         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElement.h:
1966         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFieldSetElementPrivate.h:
1967         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.cpp:
1968         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElement.h:
1969         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFontElementPrivate.h:
1970         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.cpp:
1971         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElement.h:
1972         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFormElementPrivate.h:
1973         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.cpp:
1974         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElement.h:
1975         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameElementPrivate.h:
1976         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.cpp:
1977         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElement.h:
1978         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLFrameSetElementPrivate.h:
1979         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.cpp:
1980         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElement.h:
1981         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHRElementPrivate.h:
1982         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.cpp:
1983         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElement.h:
1984         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadElementPrivate.h:
1985         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.cpp:
1986         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElement.h:
1987         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHeadingElementPrivate.h:
1988         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.cpp:
1989         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElement.h:
1990         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLHtmlElementPrivate.h:
1991         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.cpp:
1992         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElement.h:
1993         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLIFrameElementPrivate.h:
1994         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.cpp:
1995         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElement.h:
1996         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLImageElementPrivate.h:
1997         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.cpp:
1998         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElement.h:
1999         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLInputElementPrivate.h:
2000         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.cpp:
2001         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElement.h:
2002         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLIElementPrivate.h:
2003         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.cpp:
2004         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElement.h:
2005         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLabelElementPrivate.h:
2006         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.cpp:
2007         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElement.h:
2008         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLegendElementPrivate.h:
2009         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.cpp:
2010         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElement.h:
2011         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLLinkElementPrivate.h:
2012         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.cpp:
2013         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElement.h:
2014         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMapElementPrivate.h:
2015         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.cpp:
2016         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElement.h:
2017         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMarqueeElementPrivate.h:
2018         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.cpp:
2019         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElement.h:
2020         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMenuElementPrivate.h:
2021         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.cpp:
2022         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElement.h:
2023         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLMetaElementPrivate.h:
2024         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.cpp:
2025         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElement.h:
2026         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLModElementPrivate.h:
2027         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.cpp:
2028         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElement.h:
2029         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOListElementPrivate.h:
2030         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.cpp:
2031         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElement.h:
2032         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLObjectElementPrivate.h:
2033         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.cpp:
2034         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElement.h:
2035         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptGroupElementPrivate.h:
2036         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.cpp:
2037         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElement.h:
2038         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionElementPrivate.h:
2039         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.cpp:
2040         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollection.h:
2041         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLOptionsCollectionPrivate.h:
2042         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.cpp:
2043         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElement.h:
2044         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParagraphElementPrivate.h:
2045         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.cpp:
2046         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElement.h:
2047         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLParamElementPrivate.h:
2048         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.cpp:
2049         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElement.h:
2050         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPreElementPrivate.h:
2051         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLPrivate.cpp:
2052         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.cpp:
2053         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElement.h:
2054         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLQuoteElementPrivate.h:
2055         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.cpp:
2056         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElement.h:
2057         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLScriptElementPrivate.h:
2058         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
2059         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.h:
2060         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElementPrivate.h:
2061         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.cpp:
2062         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElement.h:
2063         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLStyleElementPrivate.h:
2064         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.cpp:
2065         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElement.h:
2066         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCaptionElementPrivate.h:
2067         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.cpp:
2068         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElement.h:
2069         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableCellElementPrivate.h:
2070         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.cpp:
2071         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElement.h:
2072         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableColElementPrivate.h:
2073         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.cpp:
2074         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElement.h:
2075         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableElementPrivate.h:
2076         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.cpp:
2077         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElement.h:
2078         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableRowElementPrivate.h:
2079         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.cpp:
2080         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElement.h:
2081         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTableSectionElementPrivate.h:
2082         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.cpp:
2083         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElement.h:
2084         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTextAreaElementPrivate.h:
2085         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.cpp:
2086         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElement.h:
2087         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLTitleElementPrivate.h:
2088         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.cpp:
2089         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElement.h:
2090         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLUListElementPrivate.h:
2091         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.cpp:
2092         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEvent.h:
2093         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMKeyboardEventPrivate.h:
2094         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.h:
2095         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaListPrivate.h:
2096         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.cpp:
2097         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEvent.h:
2098         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMouseEventPrivate.h:
2099         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.cpp:
2100         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMap.h:
2101         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNamedNodeMapPrivate.h:
2102         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNode.h:
2103         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.cpp:
2104         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIterator.h:
2105         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeIteratorPrivate.h:
2106         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.cpp:
2107         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeList.h:
2108         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodeListPrivate.h:
2109         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMNodePrivate.h:
2110         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.cpp:
2111         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstruction.h:
2112         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMProcessingInstructionPrivate.h:
2113         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.cpp:
2114         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRange.h:
2115         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRangePrivate.h:
2116         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMRangeUnstable.h:
2117         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.cpp:
2118         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheet.h:
2119         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.cpp:
2120         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetList.h:
2121         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetListPrivate.h:
2122         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMStyleSheetPrivate.h:
2123         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.cpp:
2124         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMText.h:
2125         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTextPrivate.h:
2126         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.cpp:
2127         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalker.h:
2128         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMTreeWalkerPrivate.h:
2129         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.cpp:
2130         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEvent.h:
2131         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMUIEventPrivate.h:
2132         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.cpp:
2133         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEvent.h:
2134         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMWheelEventPrivate.h:
2135         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.cpp:
2136         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.h:
2137         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpressionPrivate.h:
2138         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathNSResolverPrivate.h:
2139         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp:
2140         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.h:
2141         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResultPrivate.h:
2142         * WebProcess/InjectedBundle/API/gtk/DOM/webkitdom.h:
2143         * WebProcess/InjectedBundle/API/gtk/DOM/webkitdomautocleanups.h:
2144         * WebProcess/InjectedBundle/API/gtk/DOM/webkitdomdefines.h:
2145
2146 2016-10-23  Chris Dumez  <cdumez@apple.com>
2147
2148         Another unreviewed attempt to fix the WatchOS / TvOS build after r207585.
2149         <rdar://problem/28902292>
2150
2151         Disable USE_CFURLCONNECTION on newer WatchOS / TvOS.
2152
2153         * config.h:
2154
2155 2016-10-23  Chris Dumez  <cdumez@apple.com>
2156
2157         Unreviewed attempt to fix WatchOS / TvOS build after r207585.
2158         <rdar://problem/28902292>
2159
2160         Enable NETWORK_SESSION on those platforms.
2161
2162         * config.h:
2163
2164 2016-10-22  Dan Bernstein  <mitz@apple.com>
2165
2166         [iOS] _webViewWillEndNavigationGesture:withNavigationToBackForwardListItem: is never called
2167         https://bugs.webkit.org/show_bug.cgi?id=163758
2168
2169         Reviewed by Darin Adler.
2170
2171         * UIProcess/ios/ViewGestureControllerIOS.mm:
2172         (WebKit::ViewGestureController::beginSwipeGesture): Don’t reset the interactive update
2173           handler.
2174
2175 2016-10-21  David Kilzer  <ddkilzer@apple.com>
2176
2177         Bug 163762: IntSize::area() should used checked arithmetic
2178         <https://webkit.org/b/163762>
2179
2180         Reviewed by Darin Adler.
2181
2182         * Shared/ShareableBitmap.cpp:
2183         (WebKit::ShareableBitmap::create): Add overflow check and return
2184         nullptr on overflow.
2185         (WebKit::ShareableBitmap::createShareable): Ditto.
2186         (WebKit::ShareableBitmap::create): Change debug assert for
2187         adequate buffer size check into release check.
2188         * Shared/ShareableBitmap.h:
2189         (WebKit::ShareableBitmap::numBytesForSize): Change to return a
2190         Checked<unsigned, RecordOverflow> value.
2191         (WebKit::ShareableBitmap::sizeInBytes):
2192         * Shared/cairo/ShareableBitmapCairo.cpp:
2193         (WebKit::ShareableBitmap::numBytesForSize): Ditto.
2194         * UIProcess/API/Cocoa/WKWebView.mm:
2195         (-[WKWebView _takeViewSnapshot]): Call unsafeGet().
2196
2197 2016-10-21  Eric Carlson  <eric.carlson@apple.com>
2198
2199         [MediaStream] Dynamically generate media capture sandbox extensions
2200         https://bugs.webkit.org/show_bug.cgi?id=154861
2201         <rdar://problem/24909411>
2202
2203         Reviewed by Tim Horton.
2204
2205         * Shared/SandboxExtension.h:
2206         (WebKit::SandboxExtension::createHandleForGenericExtension):
2207         * Shared/mac/SandboxExtensionMac.mm:
2208         (WebKit::wkSandboxExtensionType): Add case for generic handle.
2209         (WebKit::SandboxExtension::createHandleForGenericExtension): New.
2210
2211         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2212         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Clear the list of extensions granted.
2213         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Extend the web 
2214           process sandbox as necessary.
2215         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2216
2217         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2218         (WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Revoke all
2219           sandbox extensions.
2220         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDevicesSandboxExtension): Consume
2221           sandbox extensions.
2222         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
2223
2224         * WebProcess/WebPage/WebPage.cpp:
2225         (WebKit::WebPage::grantUserMediaDevicesSandboxExtension): Pass-through to user media manager.
2226         * WebProcess/WebPage/WebPage.h:
2227
2228         * WebProcess/WebPage/WebPage.messages.in: Add GrantUserMediaDevicesSandboxExtension.
2229
2230         * WebProcess/com.apple.WebProcess.sb.in: Add rules, defines, and a macro to allow dynamic extensions
2231           for media capture devices.
2232
2233 2016-10-21  Gavin Barraclough  <barraclough@apple.com>
2234
2235         WebPageProxy should not need PageActivityState
2236         https://bugs.webkit.org/show_bug.cgi?id=163821
2237
2238         Reviewed by Geoff Garen.
2239
2240         The PageActivityState is currently plumbed back from WebCore up to the UI process, to
2241         determine whether to enabled process suppression. However the information it contains
2242         (whether a page load is ongoing, whether audio is playing) is already available via
2243         other means. Remove this use of PageActivityState.
2244
2245         * UIProcess/PageLoadState.cpp:
2246         (WebKit::PageLoadState::commitChanges):
2247             - PageLoadState notifies WebPageProxy when loading state changes.
2248         * UIProcess/WebPageProxy.cpp:
2249         (WebKit::WebPageProxy::updateThrottleState):
2250             - Now relies on info from PageLoadState, setMuted, isPlayingMediaDidChange.
2251         (WebKit::WebPageProxy::setMuted):
2252         (WebKit::WebPageProxy::isPlayingMediaDidChange):
2253             - If audio playback state changes we may need to update the throttle state.
2254         (WebKit::WebPageProxy::setPageActivityState): Deleted.
2255             - removed PageActivityState from WK2.
2256         * UIProcess/WebPageProxy.h:
2257         (WebKit::WebPageProxy::isLoadingChanged):
2258             - PageLoadState notifies WebPageProxy when loading state changes.
2259         * UIProcess/WebPageProxy.messages.in:
2260             - removed PageActivityState from WK2.
2261         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2262         (WebKit::WebChromeClient::setPageActivityState): Deleted.
2263             - removed PageActivityState from WK2.
2264         * WebProcess/WebCoreSupport/WebChromeClient.h:
2265             - removed PageActivityState from WK2.
2266         * WebProcess/WebPage/WebPage.cpp:
2267         (WebKit::WebPage::setPageActivityState): Deleted.
2268             - removed PageActivityState from WK2.
2269         * WebProcess/WebPage/WebPage.h:
2270             - removed PageActivityState from WK2.
2271
2272 2016-10-21  Gavin Barraclough  <barraclough@apple.com>
2273
2274         WebPage should take UserActivity directly for user input
2275         https://bugs.webkit.org/show_bug.cgi?id=163813
2276
2277         Reviewed by Anders Carlsson.
2278
2279         When we receive mouse/keyboard events in a page, we want to prevent AppNap. We currently do so
2280         via the PageThrottler. This patch is to just make the WebPage drive the UserActivity directly.
2281
2282         Two reasons to do so: (1) to cleanup & simplify for further refactoring. (2) The current code
2283         isn't really achieving the desired effect. The page setting the flag in the throttler to get
2284         the activity to be set is now a less effective way of achieving this goal, since the
2285         PageActivityState bounces back across to the UI process & then messages back to the WebContent
2286         process to take the UserActivity. These extra hops defeat the purpose of making sure the boost
2287         from the initial message isn't lost.
2288
2289         * WebProcess/WebPage/WebPage.cpp:
2290         (WebKit::m_userActivityHysteresis):
2291             - m_userActivityHysteresis triggers updateUserActivity.
2292         (WebKit::WebPage::setPageSuppressed):
2293             - setPageSuppressed starts/stops m_userActivityHysteresis.
2294         (WebKit::WebPage::updateUserActivity):
2295             - update UserActivity based on state of m_userActivityHysteresis.
2296         (WebKit::WebPage::mouseEvent):
2297         (WebKit::WebPage::wheelEvent):
2298         (WebKit::WebPage::keyEvent):
2299             - input events impulse m_userActivityHysteresis.
2300         * WebProcess/WebPage/WebPage.h:
2301
2302 2016-10-21  Wenson Hsieh  <wenson_hsieh@apple.com>
2303
2304         Support (insertFrom|deleteBy)Composition and (insert|delete)CompositionText inputTypes for InputEvents
2305         https://bugs.webkit.org/show_bug.cgi?id=163460
2306         <rdar://problem/28784142>
2307
2308         Reviewed by Darin Adler.
2309
2310         Handle new EditAction types for inserting/deleting pending/final compositions.
2311
2312         * UIProcess/WebEditCommandProxy.cpp:
2313         (WebKit::WebEditCommandProxy::nameForEditAction):
2314
2315 2016-10-21  Jeremy Jones  <jeremyj@apple.com>
2316
2317         Implement basic pointer lock behavior for WebKit and WebKit2.
2318         https://bugs.webkit.org/show_bug.cgi?id=162745
2319
2320         Reviewed by Simon Fraser.
2321
2322         Enable basic pointer lock functionality by plumbing requests through WebPage IPC.
2323         Pass through mouse movement deltas.
2324         Unlock pointer when view is no longer visible.
2325
2326         * Shared/WebEventConversion.cpp:
2327         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent): Pass along mouse movement.
2328         * UIProcess/WebPageProxy.cpp:
2329         (WebKit::WebPageProxy::dispatchViewStateChange): Unlock pointer when page is not visible.
2330         (WebKit::WebPageProxy::requestPointerLock): Hide and disassociate pointer.
2331         (WebKit::WebPageProxy::requestPointerUnlock): Show and associate pointer.
2332         * UIProcess/WebPageProxy.h:
2333         * UIProcess/WebPageProxy.messages.in: Add methods.
2334         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2335         (WebKit::WebChromeClient::requestPointerLock): Pass along to web page.
2336         (WebKit::WebChromeClient::requestPointerUnlock): Ditto.
2337         * WebProcess/WebCoreSupport/WebChromeClient.h:
2338         * WebProcess/WebPage/WebPage.cpp:
2339         (WebKit::WebPage::didAcquirePointerLock): Forward to PointerLockController.
2340         (WebKit::WebPage::didNotAcquirePointerLock): Ditto.
2341         (WebKit::WebPage::didLosePointerLock): Ditto.
2342         * WebProcess/WebPage/WebPage.h:
2343         * WebProcess/WebPage/WebPage.messages.in: Add methods.
2344
2345 2016-10-21  Wenson Hsieh  <wenson_hsieh@apple.com>
2346
2347         Implement InputEvent.getTargetRanges() for the input events spec
2348         https://bugs.webkit.org/show_bug.cgi?id=162947
2349         <rdar://problem/28853079>
2350
2351         Reviewed by Darin Adler.
2352
2353         Boilerplate change to add a runtime guard for InputEvents-related IDL interfaces. See WebCore ChangeLog entry
2354         for more details.
2355
2356         * WebProcess/WebPage/WebPage.cpp:
2357         (WebKit::WebPage::updatePreferences):
2358
2359 2016-10-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2360
2361         [GTK] Configures but fails to link with ENABLE_OPENGL=OFF
2362         https://bugs.webkit.org/show_bug.cgi?id=163449
2363
2364         Reviewed by Michael Catanzaro.
2365
2366         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
2367         (webkitWebViewBaseRealize): Check TEXTURE_MAPPER_GL instead of TEXTURE_MAPPER and also ensure the current
2368         display is X11.
2369         (webkitWebViewBaseUnrealize): Ditto.
2370         (webkitWebViewBaseDidRelaunchWebProcess): Check TEXTURE_MAPPER_GL instead of TEXTURE_MAPPER.
2371         (webkitWebViewBasePageClosed): Ditto.
2372         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
2373         (WebKit::AcceleratedDrawingAreaProxy::didUpdateBackingStoreState): Ditto.
2374         (WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState): Check EGL is enabled before
2375         trying to use the WaylandCompositor.
2376         * UIProcess/AcceleratedDrawingAreaProxy.h:
2377         * UIProcess/WebProcessPool.cpp:
2378         (WebKit::WebProcessPool::createNewWebProcess): Ditto.
2379         * UIProcess/gtk/AcceleratedBackingStore.cpp:
2380         (WebKit::AcceleratedBackingStore::create): Ditto.
2381         * UIProcess/gtk/AcceleratedBackingStoreWayland.cpp:
2382         * UIProcess/gtk/WaylandCompositor.cpp:
2383         * UIProcess/gtk/WaylandCompositor.h:
2384         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
2385         (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode): Check TEXTURE_MAPPER_GL instead of TEXTURE_MAPPER.
2386         * WebProcess/WebPage/AcceleratedDrawingArea.h:
2387         * WebProcess/WebPage/DrawingArea.h:
2388         * WebProcess/WebPage/DrawingArea.messages.in:
2389         * WebProcess/WebPage/LayerTreeHost.h:
2390
2391 2016-10-20  Chris Dumez  <cdumez@apple.com>
2392
2393         "Download Linked File" context menu action should use 'download' attribute as suggested filename
2394         https://bugs.webkit.org/show_bug.cgi?id=163742
2395         <rdar://problem/28840734>
2396
2397         Reviewed by Darin Adler.
2398
2399         Update "Download Linked File" context menu action to use the anchor
2400         element's 'download' attribute as suggested filename for the download.
2401
2402         * NetworkProcess/NetworkProcess.cpp:
2403         (WebKit::NetworkProcess::downloadRequest):
2404         * NetworkProcess/NetworkProcess.h:
2405         * NetworkProcess/NetworkProcess.messages.in:
2406         * Shared/WebHitTestResultData.cpp:
2407         (WebKit::WebHitTestResultData::WebHitTestResultData):
2408         (WebKit::WebHitTestResultData::encode):
2409         (WebKit::WebHitTestResultData::decode):
2410         * Shared/WebHitTestResultData.h:
2411         * UIProcess/WebPageProxy.cpp:
2412         (WebKit::WebPageProxy::contextMenuItemSelected):
2413         * UIProcess/WebProcessPool.cpp:
2414         (WebKit::WebProcessPool::download):
2415         * UIProcess/WebProcessPool.h:
2416         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
2417         (WebKit::InjectedBundleHitTestResult::linkSuggestedFilename):
2418
2419 2016-10-19  Myles C. Maxfield  <mmaxfield@apple.com>
2420
2421         [macOS] [iOS] Disable variation fonts on macOS El Capitan and iOS 9
2422         https://bugs.webkit.org/show_bug.cgi?id=163374
2423
2424         Reviewed by Darin Adler.
2425
2426         * Configurations/FeatureDefines.xcconfig:
2427
2428 2016-10-20  Brady Eidson  <beidson@apple.com>
2429
2430         IndexedDB 2.0: Support IDBObjectStore name assignment.
2431         <rdar://problem/28806931> and https://bugs.webkit.org/show_bug.cgi?id=163749
2432
2433         Reviewed by Alex Christensen.
2434
2435         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.cpp:
2436         (WebKit::WebIDBConnectionToClient::didRenameObjectStore):
2437         (WebKit::WebIDBConnectionToClient::renameObjectStore):
2438         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.h:
2439         * DatabaseProcess/IndexedDB/WebIDBConnectionToClient.messages.in:
2440
2441         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
2442         (WebKit::WebIDBConnectionToServer::renameObjectStore):
2443         (WebKit::WebIDBConnectionToServer::didRenameObjectStore):
2444         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
2445         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.messages.in:
2446
2447 2016-10-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2448
2449         [GTK] Avoid strstr() when checking (E)GL extensions
2450         https://bugs.webkit.org/show_bug.cgi?id=161958
2451
2452         Reviewed by Žan Doberšek.
2453
2454         Use GLContext::isExtensionSupported() instead of strstr().
2455
2456         * UIProcess/gtk/WaylandCompositor.cpp:
2457         (WebKit::WaylandCompositor::initializeEGL):
2458
2459 2016-10-20  Carlos Garcia Campos  <cgarcia@igalia.com>
2460
2461         Wrong use of EGL_DEPTH_SIZE
2462         https://bugs.webkit.org/show_bug.cgi?id=155536
2463
2464         Reviewed by Michael Catanzaro.
2465
2466         Use XErrorTrapper class instead of the custom XErrorHandler.
2467
2468         * PluginProcess/unix/PluginProcessMainUnix.cpp:
2469         (WebKit::PluginProcessMainUnix):
2470
2471 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2472
2473         [SOUP] Add NetworkSession implementation and switch to use it
2474         https://bugs.webkit.org/show_bug.cgi?id=163597
2475
2476         Reviewed by Alex Christensen.
2477
2478         Basically move the ResourceHandle implementation to the network process, but modernized, cleaned up, and adapted
2479         to the NetworkSession model.
2480
2481         * CMakeLists.txt: Add new files to compilation.
2482         * NetworkProcess/Downloads/Download.cpp:
2483         (WebKit::Download::Download): Use the same code for all ports using NetworkSession and add missing
2484         initialization of m_sessionID.
2485         * NetworkProcess/Downloads/Download.h:
2486         (WebKit::Download::Download): Define PlatformDownloadTaskRef on every platform to make the constructor common to
2487         all ports using NetworkSession.
2488         * NetworkProcess/Downloads/soup/DownloadSoup.cpp:
2489         (WebKit::Download::cancelNetworkLoad):
2490         (WebKit::Download::platformDidFinish):
2491         * NetworkProcess/NetworkDataTask.h:
2492         (WebKit::NetworkDataTask::pendingDownloadID): Make const.
2493         (WebKit::NetworkDataTask::pendingDownload): Ditto.
2494         (WebKit::NetworkDataTask::pendingDownloadLocation): Ditto.
2495         (WebKit::NetworkDataTask::isDownload): Helper to check if the task is a download.
2496         * NetworkProcess/NetworkLoad.cpp:
2497         (WebKit::NetworkLoad::didReceiveResponseNetworkSession): Use NetworkDataTask::isDownload().
2498         * NetworkProcess/NetworkProcess.cpp:
2499         (WebKit::NetworkProcess::NetworkProcess): NetworkSession::setCustomProtocolManager() is Cocoa only.
2500         * NetworkProcess/NetworkSession.h:
2501         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2502         (WebKit::NetworkSession::networkStorageSession): Make const.
2503         * NetworkProcess/soup/NetworkDataTaskSoup.cpp: Added.
2504         (WebKit::NetworkDataTask::NetworkDataTask):
2505         (WebKit::NetworkDataTask::~NetworkDataTask):
2506         (WebKit::NetworkDataTask::scheduleFailure):
2507         (WebKit::NetworkDataTask::failureTimerFired):
2508         (WebKit::NetworkDataTask::suggestedFilename):
2509         (WebKit::NetworkDataTask::setSuggestedFilename):
2510         (WebKit::NetworkDataTask::setPendingDownloadLocation):
2511         (WebKit::NetworkDataTask::allowsSpecificHTTPSCertificateForHost):
2512         (WebKit::NetworkDataTask::createRequest):
2513         (WebKit::NetworkDataTask::clearRequest):
2514         (WebKit::NetworkDataTask::resume):
2515         (WebKit::NetworkDataTask::suspend):
2516         (WebKit::NetworkDataTask::cancel):
2517         (WebKit::NetworkDataTask::invalidateAndCancel):
2518         (WebKit::NetworkDataTask::state):
2519         (WebKit::NetworkDataTask::timeoutFired):
2520         (WebKit::NetworkDataTask::startTimeout):
2521         (WebKit::NetworkDataTask::stopTimeout):
2522         (WebKit::NetworkDataTask::sendRequestCallback):
2523         (WebKit::NetworkDataTask::didSendRequest):
2524         (WebKit::NetworkDataTask::didReceiveResponse):
2525         (WebKit::NetworkDataTask::tlsErrorsChangedCallback):
2526         (WebKit::NetworkDataTask::tlsErrorsChanged):
2527         (WebKit::NetworkDataTask::applyAuthenticationToRequest):
2528         (WebKit::NetworkDataTask::authenticateCallback):
2529         (WebKit::isAuthenticationFailureStatusCode):
2530         (WebKit::NetworkDataTask::authenticate):
2531         (WebKit::NetworkDataTask::continueAuthenticate):
2532         (WebKit::NetworkDataTask::skipInputStreamForRedirectionCallback):
2533         (WebKit::NetworkDataTask::skipInputStreamForRedirection):
2534         (WebKit::NetworkDataTask::didFinishSkipInputStreamForRedirection):
2535         (WebKit::shouldRedirectAsGET):
2536         (WebKit::NetworkDataTask::shouldStartHTTPRedirection):
2537         (WebKit::NetworkDataTask::continueHTTPRedirection):
2538         (WebKit::NetworkDataTask::readCallback):
2539         (WebKit::NetworkDataTask::read):
2540         (WebKit::NetworkDataTask::didRead):
2541         (WebKit::NetworkDataTask::didFinishRead):
2542         (WebKit::NetworkDataTask::requestNextPartCallback):
2543         (WebKit::NetworkDataTask::requestNextPart):
2544         (WebKit::NetworkDataTask::didRequestNextPart):
2545         (WebKit::NetworkDataTask::didFinishRequestNextPart):
2546         (WebKit::NetworkDataTask::gotHeadersCallback):
2547         (WebKit::NetworkDataTask::didGetHeaders):
2548         (WebKit::NetworkDataTask::wroteBodyDataCallback):
2549         (WebKit::NetworkDataTask::didWriteBodyData):
2550         (WebKit::NetworkDataTask::download):
2551         (WebKit::NetworkDataTask::writeDownloadCallback):
2552         (WebKit::NetworkDataTask::writeDownload):
2553         (WebKit::NetworkDataTask::didWriteDownload):
2554         (WebKit::NetworkDataTask::didFinishDownload):
2555         (WebKit::NetworkDataTask::didFailDownload):
2556         (WebKit::NetworkDataTask::cleanDownloadFiles):
2557         (WebKit::NetworkDataTask::didFail):
2558         (WebKit::NetworkDataTask::networkEventCallback):
2559         (WebKit::NetworkDataTask::networkEvent):
2560         (WebKit::NetworkDataTask::startingCallback):
2561         (WebKit::NetworkDataTask::requestStartedCallback):
2562         (WebKit::NetworkDataTask::didStartRequest):
2563         (WebKit::NetworkDataTask::restartedCallback):
2564         (WebKit::NetworkDataTask::didRestart):
2565         * NetworkProcess/soup/NetworkSessionSoup.cpp:
2566         (WebKit::NetworkSession::create):
2567         (WebKit::NetworkSession::defaultSession):
2568         (WebKit::NetworkSession::networkStorageSession):
2569         (WebKit::NetworkSession::NetworkSession):
2570         (WebKit::NetworkSession::~NetworkSession):
2571         (WebKit::NetworkSession::soupSession):
2572         (WebKit::NetworkSession::invalidateAndCancel):
2573         (WebKit::NetworkSession::clearCredentials):
2574         * NetworkProcess/soup/RemoteNetworkingContextSoup.cpp:
2575         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Add implementation matching
2576         WebFrameNetworkingContext::ensurePrivateBrowsingSession().
2577         (WebKit::RemoteNetworkingContext::storageSession): Do not always return the default session if the given one is
2578         in the global map.
2579         * PlatformEfl.cmake: Ad new files to compilation.
2580         * PlatformGTK.cmake: Ditto.
2581         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
2582         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession): Also create a NetworkSession.
2583         * config.h: Enable NetworkSession unconditionally for Soup based ports.
2584
2585 2016-10-19  Alex Christensen  <achristensen@webkit.org>
2586
2587         Revert r207151
2588         https://bugs.webkit.org/show_bug.cgi?id=163675
2589
2590         Reviewed by Brent Fulgham.
2591
2592         * NetworkProcess/Downloads/Download.h:
2593         * NetworkProcess/Downloads/mac/DownloadMac.mm:
2594         * NetworkProcess/NetworkLoad.h:
2595         * NetworkProcess/mac/NetworkLoadMac.mm:
2596         (WebKit::NetworkLoad::willCacheResponseAsync):
2597         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
2598         (WebKit::AuthenticationManager::receivedCredential):
2599         (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
2600         (WebKit::AuthenticationManager::receivedCancellation):
2601         (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
2602         (WebKit::AuthenticationManager::receivedChallengeRejection):
2603         * Shared/WebProcessCreationParameters.cpp:
2604         (WebKit::WebProcessCreationParameters::encode):
2605         (WebKit::WebProcessCreationParameters::decode):
2606         * Shared/WebProcessCreationParameters.h:
2607         * Shared/mac/WebCoreArgumentCodersMac.mm:
2608         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
2609         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
2610         * WebKit2.xcodeproj/project.pbxproj:
2611
2612 2016-10-19  Chris Dumez  <cdumez@apple.com>
2613
2614         [WK2] Expose suggested filename via WKBundleHitTestResult API
2615         https://bugs.webkit.org/show_bug.cgi?id=163693
2616         <rdar://problem/28840734>
2617
2618         Reviewed by Anders Carlsson.
2619
2620         Expose suggested filename via WKBundleHitTestResult API. The implementation
2621         currently relies on the 'download' attribute on anchor / area elements
2622         that we recently started supporting.
2623
2624         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp:
2625         (WKBundleHitTestResultCopyLinkSuggestedFilename):
2626         * WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.h:
2627         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
2628         (WebKit::InjectedBundleHitTestResult::create):
2629         (WebKit::InjectedBundleHitTestResult::mediaType):
2630         (WebKit::InjectedBundleHitTestResult::linkSuggestedFilename):
2631         (WebKit::InjectedBundleHitTestResult::imageRect):
2632         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.h:
2633
2634 2016-10-19  Ryan Haddad  <ryanhaddad@apple.com>
2635
2636         Unreviewed, rolling out r207557.
2637
2638         This change caused animations/font-variations tests to time
2639         out on pre-Sierra Macs.
2640
2641         Reverted changeset:
2642
2643         "[macOS] [iOS] Disable variation fonts on macOS El Capitan and
2644         iOS 9"
2645         https://bugs.webkit.org/show_bug.cgi?id=163374
2646         http://trac.webkit.org/changeset/207557
2647
2648 2016-10-19  Andy Estes  <aestes@apple.com>
2649
2650         Crash in ASCIICaseInsensitiveHash::hash() when a response has a null MIME type
2651         https://bugs.webkit.org/show_bug.cgi?id=163476
2652         <rdar://problem/26941395>
2653
2654         Reviewed by Andreas Kling.
2655
2656         When custom content providers are registered and a response has a null MIME type, WebPage
2657         will pass a null String to HashSet::contains(). This results in a null pointer dereference,
2658         since the String hash functions do not support null Strings and unconditionally dereference
2659         their StringImpls. Fixed by checking that Strings are non-null before calling
2660         HashSet::contains() on m_mimeTypesWithCustomContentProviders.
2661
2662         New API test: WebKit2.LoadDataWithNilMIMEType.
2663
2664         * WebProcess/WebPage/WebPage.cpp:
2665         (WebKit::WebPage::shouldUseCustomContentProviderForResponse): Checked if mimeType is null
2666         before calling m_mimeTypesWithCustomContentProviders.contains().
2667         (WebKit::WebPage::canShowMIMEType): Ditto.
2668         * WebProcess/WebPage/WebPage.h: Made private the declaration of canPluginHandleResponse().
2669
2670 2016-10-19  Chris Dumez  <cdumez@apple.com>
2671
2672         Move HTML Interactive Form Validation behind an experimental flag
2673         https://bugs.webkit.org/show_bug.cgi?id=163673
2674
2675         Reviewed by Daniel Bates.
2676
2677         Move HTML Interactive Form Validation behind an experimental feature flag
2678         and disable by default until by have a better UI.
2679
2680         * Shared/WebPreferencesDefinitions.h:
2681         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2682         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2683
2684 2016-10-19  Damian Kaleta  <dkaleta@apple.com>
2685
2686         https://bugs.webkit.org/show_bug.cgi?id=163292
2687
2688         Reviewed by Brady Eidson.
2689         
2690         Added ability to display context menu asynchronously.
2691
2692         * Shared/API/APIObject.h: Added ContextMenuListener.
2693         * Shared/API/c/WKBase.h: Added WKContextMenuListenerRef struct.
2694         * UIProcess/API/APIContextMenuClient.h:
2695         (API::ContextMenuClient::getContextMenuFromProposedMenuAsync): New method that allows showing context menu asynchronously.
2696         * UIProcess/API/C/WKAPICast.h: Added a new mapping for WebContextMenuListenerProxy.
2697         * UIProcess/API/C/WKContextMenuListener.cpp: Added. New class that allow a client to return results asynchronously.
2698         (WKContextMenuListenerGetTypeID):
2699         (WKContextMenuListenerUseContextMenuItems):
2700         * UIProcess/API/C/WKContextMenuListener.h: Added.
2701         * UIProcess/API/C/WKPage.cpp: Added WKPageContextMenuClientV4.
2702         (WKPageSetPageContextMenuClient):
2703         * UIProcess/API/C/WKPageContextMenuClient.h:
2704         * UIProcess/WebContextMenuListenerProxy.cpp: Copied from Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.h.
2705         (WebKit::WebContextMenuListenerProxy::WebContextMenuListenerProxy):
2706         (WebKit::WebContextMenuListenerProxy::~WebContextMenuListenerProxy):
2707         (WebKit::WebContextMenuListenerProxy::useContextMenuItems): Passes items to m_contextMenuMac.
2708         (WebKit::WebContextMenuListenerProxy::invalidate):
2709         * UIProcess/WebContextMenuListenerProxy.h: Copied from Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.h.
2710         (WebKit::WebContextMenuListenerProxy::create):
2711         * UIProcess/mac/WebContextMenuProxyMac.h:
2712         * UIProcess/mac/WebContextMenuProxyMac.mm:
2713         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems): Shows context menu.
2714         (WebKit::WebContextMenuProxyMac::showContextMenu): Extracted some logic to showContextMenuWithItems().
2715         * WebKit2.xcodeproj/project.pbxproj:
2716
2717 2016-10-19  Myles C. Maxfield  <mmaxfield@apple.com>
2718
2719         [macOS] [iOS] Disable variation fonts on macOS El Capitan and iOS 9
2720         https://bugs.webkit.org/show_bug.cgi?id=163374
2721
2722         Reviewed by Darin Adler.
2723
2724         * Configurations/FeatureDefines.xcconfig:
2725
2726 2016-10-19  Darin Adler  <darin@apple.com>
2727
2728         Move XPath from ExceptionCode to Exception
2729         https://bugs.webkit.org/show_bug.cgi?id=163656
2730
2731         Reviewed by Chris Dumez.
2732
2733         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
2734         (webkit_dom_document_create_expression): Use ExceptionOr.
2735         (webkit_dom_document_evaluate): Ditto.
2736         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathExpression.cpp:
2737         (webkit_dom_xpath_expression_evaluate): Ditto.
2738         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMXPathResult.cpp:
2739         (webkit_dom_xpath_result_iterate_next): Ditto.
2740         (webkit_dom_xpath_result_snapshot_item): Ditto.
2741         (webkit_dom_xpath_result_get_number_value): Ditto.
2742         (webkit_dom_xpath_result_get_string_value): Ditto.
2743         (webkit_dom_xpath_result_get_boolean_value): Ditto.
2744         (webkit_dom_xpath_result_get_single_node_value): Ditto.
2745         (webkit_dom_xpath_result_get_snapshot_length): Ditto.
2746
2747 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2748
2749         NetworkSession: updatedRequest parameter of NetworkProcess::findPendingDownloadLocation is unused since r206988
2750         https://bugs.webkit.org/show_bug.cgi?id=163588
2751
2752         Reviewed by Alex Christensen.
2753
2754         The parameter was used only for the DownloadProxy::DidStart message that is no longer sent from
2755         findPendingDownloadLocation since r206988.
2756
2757         * NetworkProcess/NetworkDataTask.h:
2758         (WebKit::NetworkDataTask::currentRequest): Removed since it's unused now.
2759         * NetworkProcess/NetworkLoad.cpp:
2760         (WebKit::NetworkLoad::convertTaskToDownload): Update the m_currentRequest and pass it to DidStart message.
2761         (WebKit::NetworkLoad::didReceiveResponseNetworkSession):
2762         * NetworkProcess/NetworkProcess.cpp:
2763         (WebKit::NetworkProcess::findPendingDownloadLocation):
2764         * NetworkProcess/NetworkProcess.h:
2765         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: Remove currentRequest() implementation.
2766
2767 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2768
2769         Unreviewed. Fix GTK+ build after r207522.
2770
2771         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMWindow.cpp:
2772         (webkit_dom_dom_window_webkit_message_handlers_post_message): Use new exceptions.
2773
2774 2016-10-19  Carlos Garcia Campos  <cgarcia@igalia.com>
2775
2776         Unreviewed. Fix GTK+ build after r207497.
2777
2778         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMHTMLSelectElement.cpp:
2779         (webkit_dom_html_select_element_add): Update implementation since add() now takes a Variant.
2780
2781 2016-10-18  Simon Fraser  <simon.fraser@apple.com>
2782
2783         Add a MiniBrowser menu item to apply page scale in WK1 and WK2
2784         https://bugs.webkit.org/show_bug.cgi?id=163627
2785
2786         Reviewed by Dean Jackson.
2787
2788         New SPI to set and retrieve page scale.
2789
2790         * UIProcess/API/Cocoa/WKWebView.mm:
2791         (-[WKWebView _setPageScale:withOrigin:]):
2792         (-[WKWebView _pageScale]):
2793         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2794
2795 2016-10-18  Dean Jackson  <dino@apple.com>
2796
2797         Remove CSS_SHAPES feature definition. This should always be on.
2798         https://bugs.webkit.org/show_bug.cgi?id=163628
2799         <rdar://problem/28834613>
2800
2801         Reviewed by Tim Horton.
2802
2803         * Configurations/FeatureDefines.xcconfig:
2804
2805 2016-10-18  Ryan Haddad  <ryanhaddad@apple.com>
2806
2807         Unreviewed, rolling out r207413.
2808
2809         This change broke iOS builds.
2810
2811         Reverted changeset:
2812
2813         "[iOS] Hook up WebPlatformTouchPoint's radiusX / radiusY to
2814         _UIWebTouchPoint.majorRadiusInScreenCoordinates"
2815         https://bugs.webkit.org/show_bug.cgi?id=163547
2816         http://trac.webkit.org/changeset/207413
2817
2818 2016-10-18  Commit Queue  <commit-queue@webkit.org>
2819
2820         Unreviewed, rolling out r207443.
2821         https://bugs.webkit.org/show_bug.cgi?id=163616
2822
2823         "Caused 5% PLT regression" (Requested by krollin on #webkit).
2824
2825         Reverted changeset:
2826
2827         "Crash in ASCIICaseInsensitiveHash::hash() when a response has
2828         a null MIME type"
2829         https://bugs.webkit.org/show_bug.cgi?id=163476
2830         http://trac.webkit.org/changeset/207443
2831
2832 2016-10-18  Megan Gardner  <megan_gardner@apple.com>
2833
2834         Fix build for platforms where HAVE(LINK_PREVIEW) is false
2835         https://bugs.webkit.org/show_bug.cgi?id=163607
2836
2837         Reviewed by Tim Horton.
2838
2839         Added needed # for link preview
2840
2841         * UIProcess/ios/WKContentViewInteraction.mm:
2842         (-[WKContentView _contentsOfUserInterfaceItem:]):
2843
2844 2016-10-18  Joseph Pecoraro  <pecoraro@apple.com>
2845
2846         Remote Web Inspector: Timeline UI not updating while recording
2847         https://bugs.webkit.org/show_bug.cgi?id=163582
2848         <rdar://problem/28766837>
2849
2850         Reviewed by Timothy Hatcher.
2851
2852         * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
2853         (WebKit::RemoteWebInspectorUI::frontendLoaded):
2854         Local inspector windows keep the web view alive and toggle the
2855         WebInspector.visible state depending on whether or not an inspector is
2856         open. Remote Inspector windows go away when closed, so they can always
2857         be marked as open. This matches earlier remote inspector behavior.
2858
2859 2016-10-18  Eric Carlson  <eric.carlson@apple.com>
2860
2861         [MediaStream] Resolve constraints and enumerate devices in the UI process
2862         https://bugs.webkit.org/show_bug.cgi?id=162147
2863         <rdar://problem/28803569>
2864
2865         Reviewed by Darin Adler.
2866         
2867         Restructure gUM constraint validation and MediaDevices.enumerateDevices so all media device
2868         access happens in the UI process.
2869
2870         * Scripts/webkit/messages.py:
2871         (headers_for_type): Special case MediaConstraintsData.
2872
2873         * Shared/WebCoreArgumentCoders.cpp:
2874         (IPC::encodeMediaTrackConstraintSetMap): MediaTrackConstraintSetMap encoder.
2875         (IPC::ArgumentCoder<MediaConstraintsData>::encode): MediaConstraintsData encoder.
2876         (IPC::decodeMediaTrackConstraintSetMap): MediaTrackConstraintSetMap decoder.
2877         (IPC::ArgumentCoder<MediaConstraintsData>::decode): MediaConstraintsData decoder.
2878         (IPC::ArgumentCoder<CaptureDevice>::encode): CaptureDevice enoder.
2879         (IPC::ArgumentCoder<CaptureDevice>::decode): CaptureDevice decoder.
2880         * Shared/WebCoreArgumentCoders.h:
2881
2882         * UIProcess/API/APIUIClient.h:  Remove UserMediaPermissionCheckProxy forward declaration.
2883
2884         * UIProcess/API/C/WKUserMediaPermissionRequest.cpp:
2885         (toWK): Translate UserMediaPermissionRequestDenialReason to UserMediaAccessDenialReason.
2886         (WKUserMediaPermissionRequestDeny): Add "reason" parameter.
2887         * UIProcess/API/C/WKUserMediaPermissionRequest.h:
2888
2889         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2890         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests): Invalidate pending device requests.
2891         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest): Make private.
2892         (WebKit::toWebCore): Map from UserMediaAccessDenialReason to MediaAccessDenialReason, cast to
2893           uint64_t to pass to web process.
2894         (WebKit::UserMediaPermissionRequestManagerProxy::denyRequest): Send to web process.
2895         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Ditto.
2896         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Validate
2897           constraints and make sure gUM is enabled before prompting user.
2898         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): New.
2899         (WebKit::UserMediaPermissionRequestManagerProxy::didCompleteUserMediaPermissionCheck): Send 
2900           results of device enumeration to web process.
2901         (WebKit::UserMediaPermissionRequestManagerProxy::didReceiveUserMediaPermissionDecision): Deleted.
2902         (WebKit::UserMediaPermissionRequestManagerProxy::createUserMediaPermissionCheck): Deleted.
2903         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2904
2905         * UIProcess/UserMediaPermissionRequestProxy.cpp:
2906         (WebKit::UserMediaPermissionRequestProxy::allow):
2907         (WebKit::UserMediaPermissionRequestProxy::deny): Take "reason" parameter.
2908         * UIProcess/UserMediaPermissionRequestProxy.h:
2909
2910         * UIProcess/WebPageProxy.cpp:
2911         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame):
2912         (WebKit::WebPageProxy::enumerateMediaDevicesForFrame):
2913         (WebKit::WebPageProxy::checkUserMediaPermissionForFrame): Deleted.
2914         * UIProcess/WebPageProxy.h:
2915         * UIProcess/WebPageProxy.messages.in:
2916
2917         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2918         (WebKit::UserMediaPermissionRequestManager::startUserMediaRequest): userMediaAccessDenied -> deny.
2919           Pass the audio and video constraints to the UI process.
2920         (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasGranted): 
2921         (WebKit::UserMediaPermissionRequestManager::userMediaAccessWasDenied):
2922         (WebKit::UserMediaPermissionRequestManager::enumerateMediaDevices): Send the enumeration request
2923           to the UI process.
2924         (WebKit::UserMediaPermissionRequestManager::cancelMediaDevicesEnumeration):
2925         (WebKit::UserMediaPermissionRequestManager::didCompleteMediaDeviceEnumeration):
2926         (WebKit::UserMediaPermissionRequestManager::didReceiveUserMediaPermissionDecision): Deleted.
2927         (WebKit::UserMediaPermissionRequestManager::startUserMediaPermissionCheck): Deleted.
2928         (WebKit::UserMediaPermissionRequestManager::cancelUserMediaPermissionCheck): Deleted.
2929         (WebKit::UserMediaPermissionRequestManager::didCompleteUserMediaPermissionCheck): Deleted.
2930         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
2931
2932         * WebProcess/WebCoreSupport/WebUserMediaClient.cpp:
2933         (WebKit::WebUserMediaClient::enumerateMediaDevices): New.
2934         (WebKit::WebUserMediaClient::cancelMediaDevicesEnumerationRequest): New.
2935         (WebKit::WebUserMediaClient::checkUserMediaPermission): Deleted.
2936         (WebKit::WebUserMediaClient::cancelUserMediaPermissionCheck): Deleted.
2937         * WebProcess/WebCoreSupport/WebUserMediaClient.h:
2938
2939         * WebProcess/WebPage/WebPage.cpp:
2940         (WebKit::WebPage::userMediaAccessWasGranted): New.
2941         (WebKit::WebPage::userMediaAccessWasDenied): Ditto.
2942         (WebKit::WebPage::didCompleteMediaDeviceEnumeration):
2943         (WebKit::WebPage::didReceiveUserMediaPermissionDecision): Deleted.
2944         (WebKit::WebPage::didCompleteUserMediaPermissionCheck): Deleted.
2945         * WebProcess/WebPage/WebPage.h:
2946         * WebProcess/WebPage/WebPage.messages.in:
2947
2948 2016-10-17  Antti Koivisto  <antti@apple.com>
2949
2950         Rename setNeedsStyleRecalc to invalidateStyle
2951         https://bugs.webkit.org/show_bug.cgi?id=163542
2952
2953         Reviewed by Darin Adler.
2954
2955         * WebProcess/Plugins/PluginView.cpp:
2956         (WebKit::PluginView::didInitializePlugin):
2957         (WebKit::PluginView::pluginProcessCrashed):
2958
2959 2016-10-17  Carlos Garcia Campos  <cgarcia@igalia.com>
2960
2961         NetworkSession: PendingDownload is leaked if canceled before willDecidePendingDownloadDestination
2962         https://bugs.webkit.org/show_bug.cgi?id=163545
2963
2964         Reviewed by Alex Christensen.
2965
2966         If a download started by DownloadManager::startDownload() is cancelled before
2967         DownloadManager::willDecidePendingDownloadDestination() is called, DownloadManager::cancelDownload() does
2968         nothing, because the Download hasn't been created yet and m_downloadsWaitingForDestination map doesn't contain
2969         the download ID, and the PendingDownload is never removed from the m_pendingDownloads map.
2970
2971         * NetworkProcess/Downloads/DownloadManager.cpp:
2972         (WebKit::DownloadManager::cancelDownload): Always take the PendingDownload from m_pendingDownloads map. Then, if
2973         the download was already in m_downloadsWaitingForDestination map, get the network data task to properly cancel
2974         it and then call the completion handler to ignore the request. Otherwise cancel the pending download if exists.
2975         * NetworkProcess/Downloads/PendingDownload.cpp:
2976         (WebKit::PendingDownload::cancel): Cancel the network load and notify the UI process that the download was canceled.
2977         * NetworkProcess/Downloads/PendingDownload.h:
2978
2979 2016-10-17  Megan Gardner  <megan_gardner@apple.com>
2980
2981         Add test and infrastructure for link popover
2982         https://bugs.webkit.org/show_bug.cgi?id=163406
2983
2984         Reviewed by Simon Fraser.
2985
2986         Add infrastructure to see when a link popover appears, and what URL it has loaded.
2987
2988         * UIProcess/API/Cocoa/WKWebView.mm:
2989         (-[WKWebView didShowForcePressPreview]):
2990         (-[WKWebView didDismissForcePressPreview]):
2991         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2992         * UIProcess/ios/WKContentViewInteraction.mm:
2993         (-[WKContentView _contentsOfUserInterfaceItem:]):
2994         (-[WKContentView _presentedViewControllerForPreviewItemController:]):
2995         (-[WKContentView _previewItemController:didDismissPreview:committing:]):
2996         (-[WKContentView _previewItemControllerDidCancelPreview:]):
2997
2998 2016-10-17  Tim Horton  <timothy_horton@apple.com>
2999
3000         REGRESSION (r169805): WKWebView canGoBack returning YES when nothing is in the back-forward list after restoring session state
3001         https://bugs.webkit.org/show_bug.cgi?id=163573
3002         <rdar://problem/28744549>
3003
3004         Reviewed by Dan Bernstein.
3005
3006         * UIProcess/WebPageProxy.cpp:
3007         (WebKit::WebPageProxy::restoreFromSessionState):
3008         Update PageLoadState's canGoBack/canGoForward bits when restoring from
3009         session state, because in the don't-navigate case, nothing else will make this happen,
3010         and it will remain stale.
3011
3012 2016-10-17  Andy Estes  <aestes@apple.com>
3013
3014         Crash in ASCIICaseInsensitiveHash::hash() when a response has a null MIME type
3015         https://bugs.webkit.org/show_bug.cgi?id=163476
3016         <rdar://problem/26941395>
3017
3018         Reviewed by Tim Horton.
3019
3020         When custom content providers are registered and a response has a null MIME type, WebPage
3021         will pass a null String to HashSet::contains(). This results in a null pointer dereference,
3022         since the String hash functions do not support null Strings and unconditionally dereference
3023         their StringImpls. Fixed by checking that Strings are non-null before calling
3024         HashSet::contains() on m_mimeTypesWithCustomContentProviders.
3025
3026         Rearranging WebPage::shouldUseCustomContentProviderForResponse() to call
3027         canPluginHandleResponse() before checking m_mimeTypesWithCustomContentProviders uncovered a
3028         crash in existing layout tests where WebPage::m_mainFrame can be NULL during WebPage
3029         construction (m_mainFrame isn't yet initialized). Fixed this by passing the main Frame to
3030         canPluginHandleResponseInFrame() instead of relying on m_mainFrame.
3031
3032         New API test: WebKit2.LoadDataWithNilMIMEType.
3033
3034         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3035         (WebKit::WebFrameLoaderClient::transitionToCommittedFromCachedFrame): Passed
3036         m_frame->coreFrame() to shouldUseCustomContentProviderForResponse().
3037         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage): Ditto.
3038         * WebProcess/WebPage/WebPage.cpp:
3039         (WebKit::WebPage::canPluginHandleResponse): Added a mainFrame parameter and used it instead
3040         of m_mainFrame->coreFrame().
3041         (WebKit::WebPage::shouldUseCustomContentProviderForResponse): Passed mainFrame to
3042         canPluginHandleResponse(), and checked if mimeType is null before calling
3043         m_mimeTypesWithCustomContentProviders.contains().
3044         (WebKit::WebPage::canShowMIMEType): Checked if MIMEType is null before calling
3045         m_mimeTypesWithCustomContentProviders.contains().
3046         * WebProcess/WebPage/WebPage.h: Made canPluginHandleResponse() a private declaration.
3047
3048 2016-10-17  Chris Dumez  <cdumez@apple.com>
3049
3050         [WK2][NetworkCache] PendingFrameLoad objects are sometimes leaked
3051         https://bugs.webkit.org/show_bug.cgi?id=163569
3052         <rdar://problem/28810836>
3053
3054         Reviewed by Antti Koivisto.
3055
3056         PendingFrameLoad objects are created to track frame loads and added to
3057         the m_pendingFrameLoads hash map. These objects are supposed to remove
3058         themselves from the hash map once they detect that the page load has
3059         finished by calling PendingFrameLoad::m_loadCompletionHandler().
3060
3061         PendingFrameLoad::m_loadCompletionHandler() is called from
3062         markLoadAsCompleted() when we detect that the page load has finished
3063         via the m_loadHysteresisActivity HysteresisActivity. We call impulse()
3064         on the HysteresisActivity every time a subresource is loaded in the
3065         frame. The issue is that if no subresource is ever loaded, then we
3066         never call impulse() on the HysteresisActivity, which is therefore
3067         never started. If it nevers starts, then it nevers stops and never
3068         calls markLoadAsCompleted(). To address the problem, we now call
3069         impulse() on the HysteresisActivity as soon as we construct it.
3070
3071         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
3072
3073 2016-10-17  Jeremy Jones  <jeremyj@apple.com>
3074
3075         Enable keyboard in fullscreen.
3076         https://bugs.webkit.org/show_bug.cgi?id=163146
3077
3078         Reviewed by Jer Noble.
3079
3080         Allow keyboard in fullscreen.
3081
3082         * UIProcess/WebFullScreenManagerProxy.cpp:
3083         (WebKit::WebFullScreenManagerProxy::supportsFullScreen):
3084
3085 2016-10-17  Chris Dumez  <cdumez@apple.com>
3086
3087         Move form.reportValidity() behind InteractiveFormValidation setting
3088         https://bugs.webkit.org/show_bug.cgi?id=163550
3089
3090         Reviewed by Darin Adler.
3091
3092         Enable InteractiveFormValidation setting by default and link it to
3093         RuntimeEnabledFeatures so we can use it in the IDL.
3094
3095         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3096         * WebProcess/WebPage/WebPage.cpp:
3097         (WebKit::WebPage::updatePreferences):
3098
3099 2016-10-17  Gavin Barraclough  <barraclough@apple.com>
3100
3101         UIProcess should determine throttle state for WebContent process
3102         https://bugs.webkit.org/show_bug.cgi?id=163556
3103
3104         Reviewed by Anders Carlsson.
3105
3106         This is a step towards merging page/process throttling code for mac & iOS.
3107
3108         Previously WebPage determined whether to start a UserActivity based on page activity,
3109         visibility and the preference to disable. Now WebPage passes the activity state across
3110         to WebPageProxy, which makes the decision & explicitly instructs WebPage to start/stop
3111         the UserActivity.
3112
3113         * UIProcess/WebPageProxy.cpp:
3114         (WebKit::WebPageProxy::WebPageProxy):
3115             - updateActivityToken + updateProccessSuppressionState -> updateThrottleState
3116         (WebKit::WebPageProxy::reattachToWebProcess):
3117             - updateActivityToken -> updateThrottleState
3118         (WebKit::WebPageProxy::dispatchViewStateChange):
3119             - updateActivityToken -> updateThrottleState
3120         (WebKit::WebPageProxy::setPageActivityState):
3121             - Record activity state passed from WebPage, and update.
3122         (WebKit::WebPageProxy::preferencesDidChange):
3123             - updateProccessSuppressionState -> updateThrottleState
3124         (WebKit::WebPageProxy::updateActivityToken): Deleted.
3125         (WebKit::WebPageProxy::updateProccessSuppressionState): Deleted.
3126         (WebKit::WebPageProxy::updateThrottleState):
3127             - Merged existing updateActivityToken/updateProccessSuppressionState to unified updateThrottleState.
3128             - Compute whether page should be suppressed, and send SetPageSuppressed message accordingly.
3129         * UIProcess/WebPageProxy.h:
3130             - Merged existing updateActivityToken/updateProccessSuppressionState to unified updateThrottleState.
3131             - Added setPageActivityState/m_activityState to report/record page activity.
3132             - Added m_pageSuppressed to prevent redundant message sends.
3133         * UIProcess/WebPageProxy.messages.in:
3134             - Expose SetPageActivityState message (called by WebPage).
3135         * WebProcess/WebPage/WebPage.cpp:
3136         (WebKit::WebPage::WebPage):
3137             - removed m_processSuppressionEnabled
3138             - updateUserActivity -> setPageSuppressed - explicitly set the page to not be suppressed, until WebPageProxy tells us to do so.
3139         (WebKit::WebPage::setPageActivityState):
3140             - post activity state on to WebPageProxy.
3141         (WebKit::WebPage::setPageSuppressed):
3142             - Start/stop USerActivity accordingly.
3143         (WebKit::WebPage::setViewState):
3144             - No longer need to monitor ViewState changes on the WebProcess side.
3145         (WebKit::WebPage::updatePreferences):
3146             - No longer need to monitor preference changes on the WebProcess side.
3147         (WebKit::WebPage::updateUserActivity): Deleted.
3148             - Only updated on reciept of setPageSuppressed message.
3149         * WebProcess/WebPage/WebPage.h:
3150             - Removed m_activityState, m_processSuppressionEnabled, updateUserActivity.
3151             - Added setPageSuppressed message.
3152         * WebProcess/WebPage/WebPage.messages.in:
3153             - Added SetPageSuppressed message.
3154
3155 2016-10-17  Michael Catanzaro  <mcatanzaro@igalia.com>
3156
3157         REGRESSION(r206189): logs error statements when API::URLRequest is canceled
3158         https://bugs.webkit.org/show_bug.cgi?id=163393
3159
3160         Reviewed by Antti Koivisto.
3161
3162         Print this case at normal logging level, not as an error.
3163
3164         * WebProcess/Network/WebLoaderStrategy.cpp:
3165         (WebKit::WebLoaderStrategy::loadResource):
3166
3167 2016-10-17  Chris Dumez  <cdumez@apple.com>
3168
3169         [iOS] Hook up WebPlatformTouchPoint's radiusX / radiusY to _UIWebTouchPoint.majorRadiusInScreenCoordinates
3170         https://bugs.webkit.org/show_bug.cgi?id=163547
3171
3172         Reviewed by Darin Adler.
3173
3174         Hook up WebPlatformTouchPoint's radiusX / radiusY to _UIWebTouchPoint.majorRadiusInScreenCoordinates
3175         now that it is available in UIKit.
3176
3177         * Platform/spi/ios/UIKitSPI.h:
3178         * Shared/ios/NativeWebTouchEventIOS.mm:
3179         (WebKit::NativeWebTouchEvent::extractWebTouchPoint):
3180
3181 2016-10-17  Konstantin Tokarev  <annulen@yandex.ru>
3182
3183         Eleminate code duplication between ResourceRequest encoding/decoding implementations
3184         https://bugs.webkit.org/show_bug.cgi?id=163507
3185
3186         Reviewed by Carlos Garcia Campos.
3187
3188         ResourceRequestBase::encodeWithoutPlatformData() and Soup implementation of
3189         ArgumentCoder<ResourceRequest>::encodePlatformData() share most of the code,
3190         ditto for decoding implementations.
3191
3192         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
3193         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
3194         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
3195
3196 2016-10-17  Michael Catanzaro  <mcatanzaro@igalia.com>
3197
3198         Move user agent quirks to cross-platform location
3199         https://bugs.webkit.org/show_bug.cgi?id=163508
3200
3201         Reviewed by Carlos Garcia Campos.
3202
3203         #include <WebCore/UserAgent.h> instead of <WebCore/UserAgentGtk.h>.
3204
3205         * UIProcess/API/gtk/WebKitSettings.cpp:
3206         * UIProcess/efl/WebPageProxyEfl.cpp:
3207         * UIProcess/gtk/WebPageProxyGtk.cpp:
3208         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
3209
3210 2016-10-17  Carlos Garcia Campos  <cgarcia@igalia.com>
3211
3212         [SOUP] Downloads should always sniff contents
3213         https://bugs.webkit.org/show_bug.cgi?id=163538
3214
3215         Reviewed by Michael Catanzaro.
3216
3217         It's quite common that downloads have weird filenames with no extension, so it would be better if the loader
3218         sniff the contents to guess the mime type.
3219
3220         * NetworkProcess/Downloads/soup/DownloadSoup.cpp:
3221         (WebKit::Download::startNetworkLoad): Pass true for shouldContentSniff parameter of ResourceHandle::create().
3222
3223 2016-10-17  Carlos Garcia Campos  <cgarcia@igalia.com>
3224
3225         [GTK] Switch to use API::DownloadClient instead of the C API client
3226         https://bugs.webkit.org/show_bug.cgi?id=163537
3227
3228         Reviewed by Michael Catanzaro.
3229
3230         The code is simpler and we avoid all the toImpl/toAPI.
3231
3232         * UIProcess/API/gtk/WebKitDownloadClient.cpp:
3233         (attachDownloadClientToContext):
3234         (didStart):
3235         (didReceiveResponse):
3236         (didReceiveData):
3237         (decideDestinationWithSuggestedFilename):
3238         (didCreateDestination):
3239         (didFail):
3240         (didCancel):
3241         (didFinish):
3242
3243 2016-10-17  Manuel Rego Casasnovas  <rego@igalia.com>
3244
3245         [css-grid] Disable CSS Grid Layout runtime flag by default
3246         https://bugs.webkit.org/show_bug.cgi?id=163432
3247
3248         Reviewed by Darin Adler.
3249
3250         It was enabled in r201042, but now Safari Technology Preview
3251         has a UI to switch runtime flags so it doesn't need to be enabled
3252         by default anymore.
3253
3254         * Shared/WebPreferencesDefinitions.h: Disable grid layout runtime flag
3255         by default.
3256
3257 2016-10-16  Darin Adler  <darin@apple.com>
3258
3259         Move CSS classes from ExceptionCode to Exception
3260         https://bugs.webkit.org/show_bug.cgi?id=163494
3261
3262         Reviewed by Sam Weinig.
3263
3264         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSRule.cpp:
3265         (webkit_dom_css_rule_set_css_text): Updated for ExceptionOr.
3266         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleDeclaration.cpp:
3267         (webkit_dom_css_style_declaration_remove_property): Ditto.
3268         (webkit_dom_css_style_declaration_set_property): Ditto.
3269         (webkit_dom_css_style_declaration_set_css_text): Ditto.
3270         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSStyleSheet.cpp:
3271         (webkit_dom_css_style_sheet_insert_rule): Ditto.
3272         (webkit_dom_css_style_sheet_delete_rule): Ditto.
3273         (webkit_dom_css_style_sheet_add_rule): Ditto.
3274         (webkit_dom_css_style_sheet_remove_rule): Ditto.
3275         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMCSSValue.cpp:
3276         (webkit_dom_css_value_set_css_text): Ditto.
3277         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMMediaList.cpp:
3278         (webkit_dom_media_list_delete_medium): Ditto.
3279         (webkit_dom_media_list_append_medium): Ditto.
3280         (webkit_dom_media_list_set_media_text): Ditto.
3281
3282 2016-10-16  Carlos Garcia Campos  <cgarcia@igalia.com>
3283
3284         [GTK] Default WebKitWebsiteDataManager is always leaked in WebKitWebContext
3285         https://bugs.webkit.org/show_bug.cgi?id=163443
3286
3287         Reviewed by Michael Catanzaro.
3288
3289         Adopt the reference returned by webkitWebsiteDataManagerCreate().
3290
3291         * UIProcess/API/gtk/WebKitWebContext.cpp:
3292         (webkitWebContextConstructed):
3293
3294 2016-10-16  Carlos Garcia Campos  <cgarcia@igalia.com>
3295
3296         [GTK] WebKitWebPage URI not updated after URI is modified by InjectedBundlePageResourceLoadClient::willSendRequestForFrame
3297         https://bugs.webkit.org/show_bug.cgi?id=163389
3298
3299         Reviewed by Michael Catanzaro.
3300
3301         Update the page URI also when the load is committed.
3302
3303         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
3304         (getDocumentLoaderURL):
3305         (didStartProvisionalLoadForFrame):
3306         (didReceiveServerRedirectForProvisionalLoadForFrame):
3307         (didCommitLoadForFrame):
3308         (webkitWebPageCreate):
3309         (getProvisionalURLForFrame): Deleted.
3310
3311 2016-10-15  Simon Fraser  <simon.fraser@apple.com>
3312
3313         Sort the project file.
3314
3315         * WebKit2.xcodeproj/project.pbxproj:
3316
3317 2016-10-14  Anders Carlsson  <andersca@apple.com>
3318
3319         Fix Mac build.
3320
3321         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
3322         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
3323
3324 2016-10-14  Anders Carlsson  <andersca@apple.com>
3325
3326         Pass on networking settings to the PKPaymentRequest
3327         https://bugs.webkit.org/show_bug.cgi?id=163462
3328         rdar://problem/28567629
3329
3330         Reviewed by Dan Bernstein.
3331
3332         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
3333         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3334         (WebKit::toPKPaymentRequest):
3335         * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
3336         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
3337
3338 2016-10-14  Anders Carlsson  <andersca@apple.com>
3339
3340         Clean up BackForwardClient
3341         https://bugs.webkit.org/show_bug.cgi?id=163454
3342
3343         Reviewed by Sam Weinig.
3344
3345         Remove empty iOS only stubs.
3346
3347         * WebKit2.xcodeproj/project.pbxproj:
3348         * WebProcess/WebPage/WebBackForwardListProxy.h:
3349         * WebProcess/WebPage/ios/WebBackForwardListProxyIOS.mm: Removed.
3350
3351 2016-10-14  Brady Eidson  <beidson@apple.com>
3352
3353         Enable Gamepads by default in WK2.
3354         https://bugs.webkit.org/show_bug.cgi?id=163447
3355
3356         Rubberstamped by Sam Weinig.
3357
3358         * Shared/WebPreferencesDefinitions.h:
3359
3360 2016-10-14  Gavin Barraclough  <barraclough@apple.com>
3361
3362         Add API to restrict WebKit processes to background priority
3363         https://bugs.webkit.org/show_bug.cgi?id=163363
3364
3365         Reviewed by Anders Carlson.
3366
3367         Add API on _WKProcessPoolConfiguration to flag a process pool as 'alwaysRunsAtBackgroundPriority'.
3368         WebContent and Networking processes associated with that pool will only run a background priority,
3369         when they otherwise would have run at foreground priority.
3370
3371         * UIProcess/API/APIProcessPoolConfiguration.h:
3372             - Add m_alwaysRunsAtBackgroundPriority flag to pool configuration object.
3373         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h:
3374         * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm:
3375         (-[_WKProcessPoolConfiguration alwaysRunsAtBackgroundPriority]):
3376         (-[_WKProcessPoolConfiguration setAlwaysRunsAtBackgroundPriority:]):
3377             - Expose new configuration property through API.
3378         * UIProcess/Network/NetworkProcessProxy.cpp:
3379         (WebKit::NetworkProcessProxy::alwaysRunsAtBackgroundPriority):
3380         * UIProcess/Network/NetworkProcessProxy.h:
3381             - Support ProcessThrottlerClient interface to check if alwaysRunsAtBackgroundPriority is set.
3382         * UIProcess/ProcessThrottler.cpp:
3383         (WebKit::ProcessThrottler::assertionState):
3384             - When determining whether to take a foreground exception check alwaysRunsAtBackgroundPriority.
3385         * UIProcess/ProcessThrottlerClient.h:
3386             - Add interface to access alwaysRunsAtBackgroundPriority state of WebProcess of NetworkProcess.
3387         * UIProcess/WebProcessPool.cpp:
3388         (WebKit::WebProcessPool::WebProcessPool):
3389         * UIProcess/WebProcessPool.h:
3390             - Add m_alwaysRunsAtBackgroundPriority, set by configuration.
3391         * UIProcess/WebProcessProxy.cpp:
3392         (WebKit::WebProcessProxy::alwaysRunsAtBackgroundPriority):
3393         * UIProcess/WebProcessProxy.h:
3394             - Support ProcessThrottlerClient interface to check if alwaysRunsAtBackgroundPriority is set.
3395
3396 2016-10-14  Youenn Fablet  <youenn@apple.com>
3397
3398         Make NetworkCache aware of fetch cache mode
3399         https://bugs.webkit.org/show_bug.cgi?id=163332
3400
3401         Reviewed by Antti Koivisto.
3402
3403         Adding explicit serialization of ResourceRequest cachePolicy since it does no longer map to platform request cache policy.
3404
3405         Added support for:
3406         - Bypassing entirely the network cache in case cache mode is NoStore.
3407         - requiring revalidation in case of cache hit and cache mode is NoCache.
3408         - Not using any entry if cache mode is Reload (but cache can still be updated)
3409
3410         Also made sure that the ResourceRequest::cachePolicy remains the same throughout redirections.
3411
3412         * NetworkProcess/NetworkResourceLoader.cpp:
3413         (WebKit::NetworkResourceLoader::canUseCache):
3414         (WebKit::NetworkResourceLoader::retrieveCacheEntry):
3415         (WebKit::NetworkResourceLoader::continueWillSendRequest):
3416         * NetworkProcess/cache/NetworkCache.cpp:
3417         (WebKit::NetworkCache::cachePolicyAllowsExpired):
3418         (WebKit::NetworkCache::makeRetrieveDecision):
3419         * Shared/mac/WebCoreArgumentCodersMac.mm:
3420         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
3421         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
3422
3423 2016-10-13  Tim Horton  <timothy_horton@apple.com>
3424
3425         Rename the SPI added in r207292 due to post-landing review comments
3426         https://bugs.webkit.org/show_bug.cgi?id=163364
3427         <rdar://problem/28012494>
3428
3429         Reviewed by Simon Fraser.
3430
3431         * UIProcess/API/APIPageConfiguration.h:
3432         (API::PageConfiguration::waitsForPaintAfterViewDidMoveToWindow):
3433         (API::PageConfiguration::setWaitsForPaintAfterViewDidMoveToWindow):
3434         (API::PageConfiguration::shouldWaitForPaintAfterViewDidMoveToWindow): Deleted.
3435         (API::PageConfiguration::setShouldWaitForPaintAfterViewDidMoveToWindow): Deleted.
3436         * UIProcess/API/Cocoa/WKWebView.mm:
3437         (-[WKWebView _initializeWithConfiguration:]):
3438         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3439         (-[WKWebViewConfiguration init]):
3440         (-[WKWebViewConfiguration copyWithZone:]):
3441         (-[WKWebViewConfiguration _waitsForPaintAfterViewDidMoveToWindow]):
3442         (-[WKWebViewConfiguration _setWaitsForPaintAfterViewDidMoveToWindow:]):
3443         (-[WKWebViewConfiguration _shouldWaitForPaintAfterViewDidMoveToWindow]): Deleted.
3444         (-[WKWebViewConfiguration _setShouldWaitForPaintAfterViewDidMoveToWindow:]): Deleted.
3445         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
3446         * UIProcess/WebPageProxy.cpp:
3447         (WebKit::WebPageProxy::WebPageProxy):
3448         (WebKit::WebPageProxy::dispatchViewStateChange):
3449         * UIProcess/WebPageProxy.h:
3450
3451 2016-10-13  Jonathan Bedard  <jbedard@apple.com>
3452
3453         GTK and EFL on Mac fail to compile WebTextChecker due to missing definition of WKTextCheckerClientBase
3454         https://bugs.webkit.org/show_bug.cgi?id=163346
3455
3456         Reviewed by Daniel Bates.
3457
3458         * UIProcess/API/C/WKTextChecker.cpp: Fixed #ifdefs for GTK and EFL builds on Darwin machines.
3459         * UIProcess/API/C/WKTextChecker.h: Ditto.
3460
3461 2016-10-13  Tim Horton  <timothy_horton@apple.com>
3462
3463         Expose SPI to disable synchronously blocking on painting after parenting a WKWebView
3464         https://bugs.webkit.org/show_bug.cgi?id=163364
3465         <rdar://problem/28012494>
3466
3467         Reviewed by Geoff Garen.
3468
3469         Some clients may not want the default WKWebView behavior where we synchronously
3470         block on the Web process after the first time a WKWebView is re-added to the window,
3471         because they are e.g. parenting re-used WKWebViews while scrolling.
3472
3473         * UIProcess/API/APIPageConfiguration.h:
3474         (API::PageConfiguration::shouldSynchronizeInitialPaintAfterMovingToWindow):
3475         (API::PageConfiguration::setShouldSynchronizeInitialPaintAfterMovingToWindow):
3476         * UIProcess/API/Cocoa/WKWebView.mm:
3477         (-[WKWebView _initializeWithConfiguration:]):
3478         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3479         (-[WKWebViewConfiguration init]):
3480         (-[WKWebViewConfiguration copyWithZone:]):
3481         (-[WKWebViewConfiguration _shouldSynchronizeInitialPaintAfterMovingToWindow]):
3482         (-[WKWebViewConfiguration _setShouldSynchronizeInitialPaintAfterMovingToWindow:]):
3483         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
3484         * UIProcess/WebPageProxy.h:
3485         * UIProcess/WebPageProxy.cpp:
3486         (WebKit::WebPageProxy::WebPageProxy):
3487         Add and plumb a new WKWebView configuration parameter.
3488
3489         (WebKit::WebPageProxy::dispatchViewStateChange):
3490         If the new configuration parameter is set, don't block the main thread when
3491         a view is reparented.
3492
3493 2016-10-12  Chris Dumez  <cdumez@apple.com>
3494
3495         [Web IDL] Drop support for legacy [ConstructorConditional=*]
3496         https://bugs.webkit.org/show_bug.cgi?id=163368
3497
3498         Reviewed by Ryosuke Niwa.
3499
3500         Drop ENABLE_DOM4_EVENTS_CONSTRUCTOR compiler flag.
3501
3502         * Configurations/FeatureDefines.xcconfig:
3503
3504 2016-10-12  Alex Christensen  <achristensen@webkit.org>
3505
3506         Fix assertion after switching to URLParser
3507         https://bugs.webkit.org/show_bug.cgi?id=163350
3508         rdar://problem/28739938
3509
3510         Reviewed by Brady Eidson.
3511         
3512         Covered by a new API test.
3513
3514         * UIProcess/API/Cocoa/_WKUserStyleSheet.mm:
3515         (-[_WKUserStyleSheet initWithSource:forMainFrameOnly:legacyWhitelist:legacyBlacklist:baseURL:userContentWorld:]):
3516         The { } here is not understood by the compiler to mean WebCore::URL(), but rather the empty constructor for the enum ParsedURLStringTag.
3517         We used to be unsafely trusting that the URL was valid and canonicalized, but with URLParser we are canonicalizing it,
3518         and the assertion (url == m_string) in URL.cpp was failing.
3519
3520 2016-10-12  Anders Carlsson  <andersca@apple.com>
3521
3522         Remove an unused function
3523         https://bugs.webkit.org/show_bug.cgi?id=163341
3524
3525         Reviewed by Dan Bernstein.
3526
3527         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
3528         (WebKit::WebBackForwardListProxy::isActive): Deleted.
3529         * WebProcess/WebPage/WebBackForwardListProxy.h:
3530
3531 2016-10-11  Gyuyoung Kim  <gyuyoung.kim@navercorp.com>
3532
3533         [EFL] Update API tests which are passed or failed
3534         https://bugs.webkit.org/show_bug.cgi?id=163322
3535
3536         Unreviewed, simple on/off API test.
3537
3538         *ewk_favicon_database_clear* has been crashed for a long time, however
3539         *ewk_cookie_manager_permanent_storage* is fine now. So the passing test
3540         is enabled again, and disable the failure tests.
3541
3542         * UIProcess/API/efl/tests/test_ewk2_cookie_manager.cpp:
3543         (TEST_F):
3544         * UIProcess/API/efl/tests/test_ewk2_favicon_database.cpp:
3545         (TEST_F):
3546
3547 2016-10-11  Daniel Bates  <dabates@apple.com>
3548
3549         Attempt to fix the Apple Internal Mac build following r207159
3550         (https://bugs.webkit.org/show_bug.cgi?id=163244)
3551
3552         * UIProcess/API/Cocoa/WKWebView.mm:
3553         (shouldRequireUserGestureToLoadVideo):
3554
3555 2016-10-11  Anders Carlsson  <andersca@apple.com>
3556
3557         Clean up WebPageGroup somewhat
3558         https://bugs.webkit.org/show_bug.cgi?id=163299
3559
3560         Reviewed by Tim Horton.
3561
3562         * Shared/API/c/WKDeprecatedFunctions.cpp:
3563         (WKPageGroupCopyIdentifier):
3564         Move this here from WKPageGroup.
3565
3566         (WKPageGroupAddUserContentFilter):
3567         (WKPageGroupRemoveUserContentFilter):
3568         (WKPageGroupRemoveAllUserContentFilters):
3569         Just call directly into the user content controller.
3570
3571         * UIProcess/API/C/WKPageGroup.cpp:
3572         (WKPageGroupAddUserStyleSheet):
3573         (WKPageGroupRemoveAllUserStyleSheets):
3574         (WKPageGroupAddUserScript):
3575         (WKPageGroupRemoveAllUserScripts):
3576         Just call directly into the user content controller.
3577
3578         * UIProcess/API/C/WKPageGroup.h:
3579         * UIProcess/WebPageGroup.cpp:
3580         (WebKit::WebPageGroup::addUserStyleSheet): Deleted.
3581         (WebKit::WebPageGroup::addUserScript): Deleted.
3582         (WebKit::WebPageGroup::removeAllUserStyleSheets): Deleted.
3583         (WebKit::WebPageGroup::removeAllUserScripts): Deleted.
3584         (WebKit::WebPageGroup::removeAllUserContent): Deleted.
3585         (WebKit::WebPageGroup::addUserContentExtension): Deleted.
3586         (WebKit::WebPageGroup::removeUserContentExtension): Deleted.
3587         (WebKit::WebPageGroup::removeAllUserContentExtensions): Deleted.
3588         Get rid of these, all their callers just call into the user content controller now.
3589
3590         * UIProcess/WebPageGroup.h:
3591         (WebKit::WebPageGroup::identifier): Deleted.
3592         (WebKit::WebPageGroup::sendToAllProcessesInGroup): Deleted.
3593         Remove unused code.
3594
3595 2016-10-11  Daniel Bates  <dabates@apple.com>
3596
3597         [iOS] REGRESSION (r197953): User gesture required to load video in iOS 9-built apps
3598         https://bugs.webkit.org/show_bug.cgi?id=163244
3599         <rdar://problem/27250015>
3600
3601         Reviewed by Jer Noble.
3602
3603         Enable or disable the Setting::requiresUserGestureToLoadVideo() in WebKit depending on the
3604         version of iOS SDK that the app was linked against. We require a user gesture to begin
3605         loading a video as of iOS 10.
3606
3607         * Shared/WebPreferencesDefinitions.h:
3608         * UIProcess/API/Cocoa/WKWebView.mm:
3609         (shouldRequireUserGestureToLoadVideo): Added.
3610         (-[WKWebView _initializeWithConfiguration:]): Set the requiresUserGestureToLoadVideo preference.
3611         * WebProcess/WebPage/WebPage.cpp:
3612         (WebKit::WebPage::updatePreferences): Modified to pass the WebKit requiresUserGestureToLoadVideo
3613         preference to WebCore.
3614
3615 2016-10-11  Alex Christensen  <achristensen@webkit.org>
3616
3617         Remove dead networking code
3618         https://bugs.webkit.org/show_bug.cgi?id=163263
3619
3620         Reviewed by Daniel Bates.
3621
3622         * NetworkProcess/Downloads/Download.h:
3623         * NetworkProcess/Downloads/ios/DownloadIOS.mm: Removed.
3624         * NetworkProcess/Downloads/mac/DownloadMac.mm:
3625         * NetworkProcess/NetworkLoad.h:
3626         * NetworkProcess/mac/NetworkLoadMac.mm:
3627         (WebKit::NetworkLoad::willCacheResponseAsync): Deleted.
3628         * Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
3629         (WebKit::AuthenticationManager::receivedCredential):
3630         (WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
3631         (WebKit::AuthenticationManager::receivedCancellation):
3632         (WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
3633         (WebKit::AuthenticationManager::receivedChallengeRejection):
3634         * Shared/WebProcessCreationParameters.cpp:
3635         (WebKit::WebProcessCreationParameters::encode):
3636         (WebKit::WebProcessCreationParameters::decode):
3637         * Shared/WebProcessCreationParameters.h:
3638         * Shared/mac/WebCoreArgumentCodersMac.mm:
3639         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
3640         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
3641         * WebKit2.xcodeproj/project.pbxproj:
3642
3643 2016-10-11  Anders Carlsson  <andersca@apple.com>
3644
3645         Move no longer used functions to WKDeprecatedFunctions.cpp
3646         https://bugs.webkit.org/show_bug.cgi?id=163290
3647
3648         Reviewed by Dan Bernstein.
3649
3650         * Shared/API/c/WKDeprecatedFunctions.cpp:
3651         (WKPageGroupAddUserContentFilter):
3652         (WKPageGroupRemoveUserContentFilter):
3653         (WKPageGroupRemoveAllUserContentFilters):
3654         (WKContextSetProcessModel): Deleted.
3655         * UIProcess/API/C/WKPageGroup.cpp:
3656         (WKPageGroupRemoveAllUserScripts):
3657         (WKPageGroupAddUserContentFilter): Deleted.
3658         (WKPageGroupRemoveUserContentFilter): Deleted.
3659         (WKPageGroupRemoveAllUserContentFilters): Deleted.
3660         * UIProcess/API/C/WKPageGroup.h:
3661
3662 2016-10-11  Konstantin Tokarev  <annulen@yandex.ru>
3663
3664         Use modern for loops for iterating supplement maps
3665         https://bugs.webkit.org/show_bug.cgi?id=163274
3666
3667         Reviewed by Alex Christensen.
3668
3669         * NetworkProcess/NetworkProcess.cpp:
3670         (WebKit::NetworkProcess::initializeNetworkProcess):
3671         (WebKit::NetworkProcess::initializeConnection):
3672         * UIProcess/WebProcessPool.cpp:
3673         (WebKit::WebProcessPool::~WebProcessPool):
3674         (WebKit::WebProcessPool::networkProcessCrashed):
3675         (WebKit::WebProcessPool::databaseProcessCrashed): Iterate by values()
3676         like in other places.
3677
3678 2016-10-11  Wenson Hsieh  <wenson_hsieh@apple.com>
3679
3680         The "Input Events" experimental feature runtime flag should not be on by default
3681         https://bugs.webkit.org/show_bug.cgi?id=163278
3682
3683         Reviewed by Zalan Bujtas.
3684
3685         This was intended to be off by default.
3686
3687         * Shared/WebPreferencesDefinitions.h:
3688
3689 2016-10-10  Zan Dobersek  <zdobersek@igalia.com>
3690
3691         Add ENABLE_ENCRYPTED_MEDIA configuration option
3692         https://bugs.webkit.org/show_bug.cgi?id=163219
3693
3694         Reviewed by Darin Adler.
3695
3696         * Configurations/FeatureDefines.xcconfig:
3697         Add the ENABLE_ENCRYPTED_MEDIA configuration option. It will be used
3698         to enable or disable the new EME implementation at build-time.
3699
3700 2016-10-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3701
3702         NetworkSession: NetworkDataTask is leaked if download finishes in didReceiveResponse completion handler
3703         https://bugs.webkit.org/show_bug.cgi?id=163204
3704
3705         Reviewed by Alex Christensen.
3706
3707         After the completion handler a reference of the NetworkDataTask is saved in m_downloadsAfterDestinationDecided.
3708         If the download failed or was canceled DownloadManager::dataTaskBecameDownloadTask is never called and the data
3709         task is kept in the download manager forever. This patch exposes NSURLSessionTask state property in
3710         NetworkDataTask, so that the download manager can check the task state after the completion handler and return
3711         early if the download finished or was cancelled.
3712
3713         * NetworkProcess/Downloads/DownloadManager.cpp:
3714         (WebKit::DownloadManager::continueDecidePendingDownloadDestination):
3715         * NetworkProcess/NetworkDataTask.h:
3716         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
3717         (WebKit::NetworkDataTask::state):
3718
3719 2016-10-10  Konstantin Tokarev  <annulen@yandex.ru>
3720
3721         Added final specifier to WebInspectorServer and to its overridden methods
3722         https://bugs.webkit.org/show_bug.cgi?id=163228
3723
3724         Reviewed by Darin Adler.
3725
3726         * UIProcess/InspectorServer/WebInspectorServer.h:
3727
3728 2016-10-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3729
3730         [GTK] 2.14.0 Compile Errors: GTK 3.22.1
3731         https://bugs.webkit.org/show_bug.cgi?id=163190
3732
3733         Reviewed by Alex Christensen.
3734
3735         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp: Include gtk.h since we are using gtk_widget_queue_draw().
3736
3737 2016-10-10  Gyuyoung Kim  <gyuyoung.kim@navercorp.com>
3738
3739         [EFL] ewk_context_preferred_languages has been failed since r206949
3740         https://bugs.webkit.org/show_bug.cgi?id=163211
3741
3742         Reviewed by Chris Dumez.
3743
3744         r206949 changed to return value of navigator.language from en-us to en-US
3745         in order to match other browsers and w3c spec. So ewk_context_preferred_languages
3746         needs to change the expected result as well.
3747
3748         * UIProcess/API/efl/tests/test_ewk2_context.cpp:
3749         (TEST_F):
3750
3751 2016-10-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3752
3753         NetworkSession: downloads started by startDownload() can fail before starting from the API point of view
3754         https://bugs.webkit.org/show_bug.cgi?id=163107
3755
3756         Reviewed by Alex Christensen.
3757
3758         In the network process we use a PendingDownload in this case, but in the UI process we always have a single
3759         download proxy. If an error happens before the pending download is converted inot a real download, the DidFail
3760         messages is received in the download proxy before the DidStart one. This is problematic at least for the GTK+
3761         API, because it's common to connect to the started signal and connect to all other signals from there, but in
3762         this case the started signal is never emitted, and then the failed one is not handled. This is not a problem for
3763         downloads started by convertTaskToDownload, because in that case those loads are not considered a download by
3764         the UI process when those early errors happen, and then the web page handles them.
3765
3766         * NetworkProcess/Downloads/PendingDownload.cpp:
3767         (WebKit::PendingDownload::PendingDownload): Send DidStart message right after the network load starts like the
3768         non network session code does.
3769         * NetworkProcess/NetworkLoad.cpp:
3770         (WebKit::NetworkLoad::convertTaskToDownload): Send DidStart message now that the normal load has been converted
3771         into a download.
3772         * NetworkProcess/NetworkProcess.cpp:
3773         (WebKit::NetworkProcess::findPendingDownloadLocation): Do not send DidStart message here.
3774
3775 2016-10-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3776
3777         Network Session: PendingDownload is always nullptr in DownloadManager::dataTaskBecameDownloadTask
3778         https://bugs.webkit.org/show_bug.cgi?id=163006
3779
3780         Reviewed by Alex Christensen.
3781
3782         In DownloadManager::dataTaskBecameDownloadTask() we are supposed to have either a pending download, or a network
3783         data task depending on whether the download was started by startDownload() or convertTaskToDownload. However, in
3784         both cases we do have a data task and never a pending download. In the case of startDownload() the pending
3785         download is removed from m_pendingDownloads in willDecidePendingDownloadDestination(). The task is always
3786         added to m_downloadsWaitingForDestination in willDecidePendingDownloadDestination() and to
3787         m_downloadsAfterDestinationDecided in continueDecidePendingDownloadDestination() in both cases.
3788
3789         * NetworkProcess/Downloads/DownloadManager.cpp:
3790         (WebKit::DownloadManager::dataTaskBecameDownloadTask): Add an ASSERT to ensure we don't have a pending download
3791         at this point and that the download is not already in the map. Remove the download from the
3792         m_downloadsAfterDestinationDecided map, but don't check its result because it might not bein that map if
3793         dataTaskBecameDownloadTask is called synchronously from the didReceiveResponse completion handler.
3794         (WebKit::DownloadManager::willDecidePendingDownloadDestination): Do not take the pending download here, wait
3795         until didReceiveResponse completion handler is called.
3796         (WebKit::DownloadManager::continueDecidePendingDownloadDestination): Take the pending download here ensuring
3797         it's alive while the didReceiveResponse completion handler is called. Also remove invalid early return when
3798         either networkDataTask or completionHandler are nullptr because we are using both unconditionally, we should
3799         return early if both are nullptr to avoid crashes. However, we are checking that the download is in the
3800         m_downloadsWaitingForDestination and in that case we should always have both, so better add asserts there. If
3801         the download is already in the map after the completion handler it means that dataTaskBecameDownloadTask() has
3802         alrady been called, so we can just return in that case.
3803         * NetworkProcess/Downloads/DownloadManager.h:
3804         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3805         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]): Protect the NetworkDataTask that can
3806         be deleted by dataTaskBecameDownloadTask().
3807
3808 2016-10-10  Tim Horton  <timothy_horton@apple.com>
3809
3810         Share more code between iOS and macOS ViewGestureController
3811         https://bugs.webkit.org/show_bug.cgi?id=163158
3812
3813         Reviewed by Simon Fraser.
3814
3815         Share canSwipeInDirection() and the (unused on Mac) alternate back-forward list mechanism.
3816         Make ViewGestureController operate in terms of WebPageProxy, not WKWebView,
3817         because it shouldn't know anything about WKWebView.
3818         Refactor scrollEventCanBecomeSwipe a bit to be less repetitive.
3819
3820         * UIProcess/API/Cocoa/WKWebView.mm:
3821         (-[WKWebView setAllowsBackForwardNavigationGestures:]):
3822         * UIProcess/Cocoa/ViewGestureController.cpp:
3823         (WebKit::ViewGestureController::ViewGestureController):
3824         (WebKit::ViewGestureController::setAlternateBackForwardListSourcePage):
3825         (WebKit::ViewGestureController::canSwipeInDirection):
3826         (WebKit::ViewGestureController::gestureControllerForPage): Deleted.
3827         * UIProcess/Cocoa/ViewGestureController.h:
3828         * UIProcess/WebPageProxy.cpp:
3829         (WebKit::WebPageProxy::WebPageProxy):
3830         * UIProcess/WebPageProxy.h:
3831         (WebKit::WebPageProxy::createWeakPtr):
3832         * UIProcess/ios/ViewGestureControllerIOS.mm:
3833         (WebKit::ViewGestureController::beginSwipeGesture):
3834         (WebKit::ViewGestureController::setAlternateBackForwardListSourceView): Deleted.
3835         (WebKit::ViewGestureController::canSwipeInDirection): Deleted.
3836         * UIProcess/mac/ViewGestureControllerMac.mm:
3837         (WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker):
3838         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
3839         (WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe):
3840
3841 2016-10-10  Tomas Popela  <tpopela@redhat.com>
3842
3843         [GTK] UIProcess crashes when using Japanese IM
3844         https://bugs.webkit.org/show_bug.cgi?id=163011
3845
3846         We have to reference the current GdkEventKey before we try process it
3847         as later when the lambda body is reached the event could be already
3848         freed.
3849
3850         Reviewed by Carlos Garcia Campos.
3851
3852         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
3853         (webkitWebViewBaseKeyPressEvent):
3854         (webkitWebViewBaseKeyReleaseEvent):
3855         * UIProcess/gtk/InputMethodFilter.h:
3856         Use non-copyable Function so we can use WTFMove to pass the event to
3857         lambda.
3858
3859 2016-10-09  Wenson Hsieh  <wenson_hsieh@apple.com>
3860
3861         Support InputEvent.inputType for the new InputEvent spec
3862         https://bugs.webkit.org/show_bug.cgi?id=163025
3863         <rdar://problem/28658092>
3864
3865         Reviewed by Darin Adler.
3866
3867         Accounts for some changes to the EditAction enum in nameForEditAction. Some former edit
3868         actions, such as EditActionTyping, have been split out into its more specific subtypes,
3869         so we preserve shipping behavior by treating all of the new subtypes the same way as the
3870         original type.
3871
3872         * UIProcess/WebEditCommandProxy.cpp:
3873         (WebKit::WebEditCommandProxy::nameForEditAction):
3874
3875 2016-10-08  Emanuele Aina  <emanuele.aina@collabora.com>
3876
3877         [GTK] Drop redundant wl_display_flush_clients() call
3878         https://bugs.webkit.org/show_bug.cgi?id=161904
3879
3880         Reviewed by Michael Catanzaro.
3881
3882         The Wayland GSource::prepare() function already calls
3883         wl_display_flush_clients() at every mainloop iteration, so there's no
3884         need to further call it on Surface::commit().
3885
3886         * UIProcess/gtk/WaylandCompositor.cpp:
3887         (WebKit::WaylandCompositor::Surface::commit):
3888         * UIProcess/gtk/WaylandCompositor.h:
3889
3890 2016-10-06  Darin Adler  <darin@apple.com>
3891
3892         Next step on moving to modern way to return DOM exceptions
3893         https://bugs.webkit.org/show_bug.cgi?id=163016
3894
3895         Reviewed by Ryosuke Niwa.
3896
3897         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMImplementation.cpp:
3898         (webkit_dom_dom_implementation_create_document_type): Updated for name change
3899         from takeReturnValue to releaseReturnValue.
3900         (webkit_dom_dom_implementation_create_document): Ditto.
3901         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDOMSelection.cpp:
3902         (webkit_dom_dom_selection_collapse_to_end): Use ExceptionOr instead of ExceptionCode.
3903         (webkit_dom_dom_selection_collapse_to_start): Ditto.
3904         (webkit_dom_dom_selection_extend): Ditto.
3905         (webkit_dom_dom_selection_get_range_at): Ditto.
3906
3907 2016-10-08  Commit Queue  <commit-queue@webkit.org>
3908
3909         Unreviewed, rolling out r206950.
3910         https://bugs.webkit.org/show_bug.cgi?id=163169
3911
3912         broke an API test (Requested by thorton on #webkit).
3913
3914         Reverted changeset:
3915
3916         "Share more code between iOS and macOS ViewGestureController"
3917         https://bugs.webkit.org/show_bug.cgi?id=163158
3918         http://trac.webkit.org/changeset/206950
3919
3920 2016-10-08  Tim Horton  <timothy_horton@apple.com>
3921
3922         Share more code between iOS and macOS ViewGestureController
3923         https://bugs.webkit.org/show_bug.cgi?id=163158
3924
3925         Reviewed by Simon Fraser.
3926
3927         Share canSwipeInDirection() and the (unused on Mac) alternate back-forward list mechanism.
3928         Make ViewGestureController operate in terms of WebPageProxy, not WKWebView,
3929         because it shouldn't know anything about WKWebView.
3930         Refactor scrollEventCanBecomeSwipe a bit to be less repetitive.
3931
3932         * UIProcess/API/Cocoa/WKWebView.mm:
3933         (-[WKWebView setAllowsBackForwardNavigationGestures:]):
3934         * UIProcess/Cocoa/ViewGestureController.cpp:
3935         (WebKit::ViewGestureController::ViewGestureController):
3936         (WebKit::ViewGestureController::setAlternateBackForwardListSourcePage):
3937         (WebKit::ViewGestureController::canSwipeInDirection):
3938         (WebKit::ViewGestureController::gestureControllerForPage): Deleted.
3939         * UIProcess/Cocoa/ViewGestureController.h:
3940         * UIProcess/WebPageProxy.cpp:
3941         (WebKit::WebPageProxy::WebPageProxy):
3942         * UIProcess/WebPageProxy.h:
3943         (WebKit::WebPageProxy::createWeakPtr):
3944         * UIProcess/ios/ViewGestureControllerIOS.mm:
3945         (WebKit::ViewGestureController::beginSwipeGesture):
3946         (WebKit::ViewGestureController::setAlternateBackForwardListSourceView): Deleted.
3947         (WebKit::ViewGestureController::canSwipeInDirection): Deleted.
3948         * UIProcess/mac/ViewGestureControllerMac.mm:
3949         (WebKit::ViewGestureController::PendingSwipeTracker::PendingSwipeTracker):
3950         (WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
3951         (WebKit::ViewGestureController::PendingSwipeTracker::tryToStartSwipe):
3952
3953 2016-10-07  Anders Carlsson  <andersca@apple.com>
3954
3955         Get rid of API::Session and WKSessionRef
3956         https://bugs.webkit.org/show_bug.cgi?id=163140
3957
3958         Reviewed by Tim Horton.
3959
3960         This API is no longer used.
3961
3962         * CMakeLists.txt:
3963         * Shared/API/APIObject.h:
3964         * Shared/API/c/WKSharedAPICast.h:
3965       &nbs