Expose _WKVisitedLinkProvider in a header
[WebKit.git] / Source / WebKit2 / ChangeLog
1 2017-02-28  Alexey Proskuryakov  <ap@apple.com>
2
3         Expose _WKVisitedLinkProvider in a header
4         https://bugs.webkit.org/show_bug.cgi?id=168955
5
6         Reviewed by Tim Horton.
7
8         * UIProcess/API/Cocoa/_WKVisitedLinkProvider.mm:
9         * UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
10         The class needs to be visible in a header, as it is exported SPI.
11
12 2017-02-28  Brady Eidson  <beidson@apple.com>
13
14         Move resolving symlinks of some WebsiteDataStore paths from WebProcessPool to... WebsiteDataStore!.
15         https://bugs.webkit.org/show_bug.cgi?id=168696.
16
17         Reviewed by Alex Christensen.
18
19         * UIProcess/WebProcessPool.cpp:
20         (WebKit::WebProcessPool::createNewWebProcess):
21
22         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
23         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
24         * UIProcess/WebsiteData/WebsiteDataStore.h:
25         (WebKit::WebsiteDataStore::resolvedApplicationCacheDirectory):
26         (WebKit::WebsiteDataStore::resolvedMediaCacheDirectory):
27         (WebKit::WebsiteDataStore::resolvedMediaKeysDirectory):
28         (WebKit::WebsiteDataStore::resolvedDatabaseDirectory):
29
30 2017-02-28  Alex Christensen  <achristensen@webkit.org>
31
32         LibWebRTCProvider should check existence of libwebrtc.dylib
33         https://bugs.webkit.org/show_bug.cgi?id=168986
34
35         Reviewed by Youenn Fablet.
36
37         * Shared/WebPreferencesDefinitions.h:
38         * Shared/WebPreferencesStore.cpp:
39         * UIProcess/WebPreferences.cpp:
40         (WebKit::checkWebRTCAvailability): Deleted.
41
42 2017-02-28  Wenson Hsieh  <wenson_hsieh@apple.com>
43
44         Unreviewed, build fix after r213176.
45
46         * Platform/spi/ios/UIKitSPI.h:
47
48 2017-02-28  Tim Horton  <timothy_horton@apple.com>
49
50         [iOS] Getting QLPreviewProtocol slows down first navigation in Web process
51         https://bugs.webkit.org/show_bug.cgi?id=168940
52         <rdar://problem/29468999>
53
54         Reviewed by Simon Fraser.
55
56         * WebProcess/Network/WebLoaderStrategy.cpp:
57         (WebKit::WebLoaderStrategy::scheduleLoad):
58         Make use of isQuickLookPreviewURL.
59
60 2017-02-28  Brady Eidson  <beidson@apple.com>
61
62         Fix API test regression(s):
63         REGRESSION (r213168): API test WKUserContentController.ScriptMessageHandlerMultipleHandlerRemoval crashing
64         https://bugs.webkit.org/show_bug.cgi?id=168991
65
66         Unreviewed.
67
68         * UIProcess/WebProcessPool.cpp:
69         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
70
71 2017-02-28  Wenson Hsieh  <wenson_hsieh@apple.com>
72
73         Data interaction should support attachment elements
74         https://bugs.webkit.org/show_bug.cgi?id=168916
75         <rdar://problem/30664519>
76
77         Reviewed by Ryosuke Niwa.
78
79         Teaches WKContentView to recognize attachment elements as data interactive content, and add an internal hook to
80         adjust the list of item providers before initiating data interaction.
81
82         * Platform/spi/ios/UIKitSPI.h:
83         * UIProcess/API/Cocoa/WKWebView.mm:
84         (-[WKWebView _adjustedDataInteractionItemProviders:]):
85         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
86         * UIProcess/ios/WKContentViewInteraction.mm:
87         (-[WKContentView pointIsInDataInteractionContent:]):
88
89 2017-02-28  Yongjun Zhang  <yongjun_zhang@apple.com>
90
91         Add delegate method to handle images with alternate data.
92         https://bugs.webkit.org/show_bug.cgi?id=168785
93         <rdar://problem/28776219>
94
95         Add delegate methods to WKUIDelegatePrivate so that a WebKit client can provide alternate URL or data for an image
96         before long-press or preview. When an image has alternate URL or data, we can change the actions accordingly.
97
98         Reviewed by Enrica Casucci.
99
100         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Add two delegate methods _webView:getAlternateURLFromImage:completionHandler:
101             and _webView:alternateURLFromImage:userInfo;
102         * UIProcess/API/Cocoa/_WKActivatedElementInfo.h: Add an readonly property userInfo so that alternate data can be
103             carried by _WKActivatedElementInfo and be processed by WebKit client.
104         * UIProcess/API/Cocoa/_WKActivatedElementInfo.mm:
105         (-[_WKActivatedElementInfo _initWithType:URL:location:title:ID:rect:image:]):
106         (-[_WKActivatedElementInfo _initWithType:URL:location:title:ID:rect:image:userInfo:]): A new initializer that also takes userInfo.
107         (-[_WKActivatedElementInfo userInfo]):
108         * UIProcess/API/Cocoa/_WKActivatedElementInfoInternal.h: A new delegate method for WKActionSheetAssistantDelegate to fetch
109             alternate data before showing image sheet.
110         * UIProcess/ios/WKActionSheetAssistant.h:
111         * UIProcess/ios/WKActionSheetAssistant.mm:
112         (-[WKActionSheetAssistant showImageSheet]): Before showing the image sheet, if the image doesn't have linked URL (i.e. not a image
113             link), try to fetch its alternate URL and data.
114         (-[WKActionSheetAssistant defaultActionsForImageSheet:]): Drive-by fix. We always use positionInformation's URL to populate the
115             actions, however, we should use elementInfo's URL since the two URLs could mismatch.
116         * UIProcess/ios/WKContentViewInteraction.mm:
117         (-[WKContentView actionSheetAssistant:getAlternateURLForImage:completion:]):
118         (-[WKContentView _presentedViewControllerForPreviewItemController:]): Before previewing an image, synchronously get alternate
119             data for the image and update the actions accordingly.
120
121 2017-02-28  Brady Eidson  <beidson@apple.com>
122         
123         Refactor WebViewImpl creation in preparation for supporting multiple WebsiteDataStores.
124         https://bugs.webkit.org/show_bug.cgi?id=168676
125
126         Reviewed by Alex Christensen and Sam Weinig.
127
128         * UIProcess/WebProcessPool.cpp:
129         (WebKit::WebProcessPool::createNewWebProcess):
130         (WebKit::WebProcessPool::warmInitialProcess):
131         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
132         (WebKit::WebProcessPool::createWebPage):
133         * UIProcess/WebProcessPool.h:
134
135 2017-02-28  Youenn Fablet  <youenn@apple.com>
136
137         [WebRTC] Limit libwebrtc logging in Debug build
138         https://bugs.webkit.org/show_bug.cgi?id=168974
139
140         Reviewed by Alex Christensen.
141
142         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
143         (WebKit::NetworkRTCProvider::NetworkRTCProvider):
144         * Platform/Logging.h:
145
146 2017-02-28  Youenn Fablet  <youenn@apple.com>
147
148         [WebRTC] NetworkRTCProvider should stop the network thread from the main thread
149         https://bugs.webkit.org/show_bug.cgi?id=168972
150
151         Reviewed by Alex Christensen.
152
153         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
154         (WebKit::NetworkRTCProvider::close): Ensuring to stop the network thread from the main thread when provider is
155         getting closed.
156
157 2017-02-24  Matt Rajca  <mrajca@apple.com>
158
159         Media: notify clients when autoplayed media ends without being paused
160         https://bugs.webkit.org/show_bug.cgi?id=168852
161
162         Reviewed by Alex Christensen.
163
164         * UIProcess/API/C/WKPageUIClient.h:
165
166 2017-02-28  Csaba Osztrogonác  <ossy@webkit.org>
167
168         Remove EFL leftover from WebPageProxy.messages.in
169         https://bugs.webkit.org/show_bug.cgi?id=168828
170
171         Reviewed by Gyuyoung Kim.
172
173         * UIProcess/WebPageProxy.messages.in:
174
175 2017-02-28  Alex Christensen  <achristensen@webkit.org>
176
177         Main resource requests need cachePartition
178         https://bugs.webkit.org/show_bug.cgi?id=168806
179
180         Reviewed by Brady Eidson.
181
182         * NetworkProcess/NetworkResourceLoader.cpp:
183         (WebKit::NetworkResourceLoader::continueWillSendRequest):
184
185 2017-02-27  Alex Christensen  <achristensen@webkit.org>
186
187         Begin enabling WebRTC on 64-bit
188         https://bugs.webkit.org/show_bug.cgi?id=168915
189
190         Reviewed by Eric Carlson.
191
192         * Configurations/FeatureDefines.xcconfig:
193
194 2017-02-27  Alexey Proskuryakov  <ap@apple.com>
195
196         Remove _WKWebsiteDataRecord.h
197         https://bugs.webkit.org/show_bug.cgi?id=168954
198
199         Reviewed by Dan Bernstein.
200
201         This doesn't seem to have ever been used, so better to remove it than to add an
202         implementation.
203
204         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h: Removed.
205         * WebKit2.xcodeproj/project.pbxproj:
206
207 2017-02-27  Alexey Proskuryakov  <ap@apple.com>
208
209         WKPageIsPlayingVideoInEnhancedFullscreen availability mismatch
210         https://bugs.webkit.org/show_bug.cgi?id=168952
211
212         Reviewed by Dan Bernstein.
213
214         * UIProcess/API/C/mac/WKPagePrivateMac.h: TARGET_OS_MAC is not the right thing to
215         check, as it's true on both macOS and iOS.
216
217 2017-02-27  Alexey Proskuryakov  <ap@apple.com>
218
219         Export WKPluginInformationBundleShortVersionKey
220         https://bugs.webkit.org/show_bug.cgi?id=168951
221
222         Reviewed by Dan Bernstein.
223
224         * Shared/API/c/WKPluginInformation.h: It was accidentally not exported when added.
225
226 2017-02-27  Youenn Fablet  <youenn@apple.com>
227
228         [WebRTC] Add support for libwebrtc TCP incoming connections
229         https://bugs.webkit.org/show_bug.cgi?id=168748
230
231         Reviewed by Alex Christensen.
232
233         Covered by added layout tests.
234
235         When a libwebrtc server socket is signalling a new connnection through SignalNewConnection, we do:
236         - Wrap the incoming socket into a LibWebRTCSocketClient
237         - Store it into a pending socket map with an identifier
238         - Send a message to the web process of a new connection with the server socket identifier and new connection socket identifier.
239         The Web process then creates a WebRTCSocket wrapper around it by sendinig a WrapNewTCPConnection message.
240         It then propagates the SignalNewConnection to libwebrtc code path.
241
242         * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
243         (WebKit::LibWebRTCSocketClient::LibWebRTCSocketClient):
244         (WebKit::LibWebRTCSocketClient::signalReadPacket):
245         (WebKit::LibWebRTCSocketClient::signalSentPacket):
246         (WebKit::LibWebRTCSocketClient::signalNewConnection):
247         (WebKit::LibWebRTCSocketClient::signalAddressReady):
248         (WebKit::LibWebRTCSocketClient::signalConnect):
249         (WebKit::LibWebRTCSocketClient::signalClose):
250         * NetworkProcess/webrtc/LibWebRTCSocketClient.h:
251         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
252         (WebKit::NetworkRTCProvider::wrapNewTCPConnection):
253         (WebKit::NetworkRTCProvider::newConnection):
254         * NetworkProcess/webrtc/NetworkRTCProvider.h:
255         * NetworkProcess/webrtc/NetworkRTCProvider.messages.in:
256         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
257         (WebKit::LibWebRTCSocket::signalNewConnection):
258         * WebProcess/Network/webrtc/LibWebRTCSocket.h:
259         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
260         (WebKit::LibWebRTCSocketFactory::createNewConnectionSocket):
261         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.h:
262         * WebProcess/Network/webrtc/WebRTCSocket.cpp:
263         (WebKit::WebRTCSocket::signalNewConnection):
264         * WebProcess/Network/webrtc/WebRTCSocket.h:
265         * WebProcess/Network/webrtc/WebRTCSocket.messages.in:
266
267 2017-02-27  Brent Fulgham  <bfulgham@apple.com>
268
269         [Mac] Don't use undefined sandbox rule on macOS 10.11 or earlier
270         https://bugs.webkit.org/show_bug.cgi?id=168942
271         <rdar://problem/30743376>
272
273         Reviewed by Ryosuke Niwa.
274
275         * WebProcess/com.apple.WebProcess.sb.in:
276
277 2017-02-27  Wenson Hsieh  <wenson_hsieh@apple.com>
278
279         Unreviewed, roll out r213065.
280
281         * UIProcess/ios/WKContentViewInteraction.h:
282
283 2017-02-27  Alexey Proskuryakov  <ap@apple.com>
284
285         Remove some deprecated WKPage plug-in information functions
286         https://bugs.webkit.org/show_bug.cgi?id=168897
287
288         Reviewed by Tim Horton.
289
290         * UIProcess/API/C/WKPage.cpp:
291         (WKPageGetProcessIdentifier):
292         (WKPageGetPluginInformationBundleIdentifierKey): Deleted.
293         (WKPageGetPluginInformationBundleVersionKey): Deleted.
294         (WKPageGetPluginInformationDisplayNameKey): Deleted.
295         (WKPageGetPluginInformationFrameURLKey): Deleted.
296         (WKPageGetPluginInformationMIMETypeKey): Deleted.
297         (WKPageGetPluginInformationPageURLKey): Deleted.
298         (WKPageGetPluginInformationPluginspageAttributeURLKey): Deleted.
299         (WKPageGetPluginInformationPluginURLKey): Deleted.
300         * UIProcess/API/C/WKPage.h:
301
302 2017-02-27  Alexey Proskuryakov  <ap@apple.com>
303
304         Stop exporting C++ member variables from class extensions in WKDOMInternals.h
305         https://bugs.webkit.org/show_bug.cgi?id=168886
306
307         Reviewed by Tim Horton.
308
309         * WebProcess/InjectedBundle/API/mac/WKDOMInternals.h: These are @package variables.
310
311 2017-02-27  Alex Christensen  <achristensen@webkit.org>
312
313         Optimize checkWebRTCAvailability
314         https://bugs.webkit.org/show_bug.cgi?id=168913
315
316         Reviewed by Darin Adler.
317
318         We can optimize startup time by using RTLD_LAZY instead of RTLD_NOW because we don't need to load all the symbols.
319         We just need to check whether libwebrtc.dylib can be found and is a valid dylib for the current architecture.
320         Also, initialize a static bool so it only needs to be checked once.  Right now it's only used when initializing settings,
321         but if we use it for other things in the future there will be no need to reopen the dylib.
322
323         * UIProcess/WebPreferences.cpp:
324         (WebKit::checkWebRTCAvailability):
325
326 2017-02-26  Wenson Hsieh  <wenson_hsieh@apple.com>
327
328         Unreviewed, revert all temporary build fixes for data interaction
329
330         Rolls out r212990, r212988 and r212984.
331
332         * UIProcess/ios/WKContentViewInteraction.h:
333
334 2017-02-27  Carlos Garcia Campos  <cgarcia@igalia.com>
335
336         [GTK] Rendering artifacts when resizing the window in X11 with AC mode enabled
337         https://bugs.webkit.org/show_bug.cgi?id=168728
338
339         Reviewed by Žan Doberšek.
340
341         This happens because the pixmap we create from the redirected window is uninitialized until the threaded
342         compositor renders into it. We should always initialize the pixmap right after it's created.
343
344         * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.cpp:
345         (WebKit::defaultVisual): Helper static method to get the default GdkVisual.
346         (WebKit::AcceleratedSurfaceX11::AcceleratedSurfaceX11): Use createPixmap().
347         (WebKit::AcceleratedSurfaceX11::createPixmap): Create and initialize the pixmap.
348         (WebKit::AcceleratedSurfaceX11::resize): Use createPixmap().
349         * WebProcess/WebPage/gtk/AcceleratedSurfaceX11.h:
350
351 2017-02-27  Carlos Garcia Campos  <cgarcia@igalia.com>
352
353         [GTK] Flickering when leaving accelerated compositing mode
354         https://bugs.webkit.org/show_bug.cgi?id=168911
355
356         Reviewed by Žan Doberšek.
357
358         It doesn't always happen, and it's too fast, more noticeable in websites with a dark background, because we are
359         drawing a single white frame. This happens when we leave AC mode during the layer flush that schedules an update
360         on the compositor, which at that point only clears the area and renders nothing. However,
361         CoordinatedGraphicsScene::paintToCurrentGLContext() always renders a white background when no web view color has
362         been set. And that's the white frame we get. We could prevent that last update from happening by checking if we
363         still have a graphics root layer after syncDisplayState() in the layer flush, the same way we check the layer
364         tree host is still valid.
365
366         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
367         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
368         (WebKit::CoordinatedLayerTreeHost::layerFlushTimerFired):
369
370 2017-02-27  Alex Christensen  <achristensen@webkit.org>
371
372         [libwebrtc] Enable WebRTC in some Production Builds
373         https://bugs.webkit.org/show_bug.cgi?id=168858
374
375         * Configurations/FeatureDefines.xcconfig:
376
377 2017-02-27  Andy Estes  <aestes@apple.com>
378
379         Links cannot be activated when running Mobile Safari with external SDK build of WebKit for iOS Simulator
380         https://bugs.webkit.org/show_bug.cgi?id=141906
381
382         Reviewed by Tim Horton.
383
384         Even if Touch Events are disabled, we still need to register a
385         UIWebTouchEventsGestureRecognizer to record the layer tree transaction ID when a touch
386         begins. Click events are only generated for touches that occur after the current frame's
387         load has committed, and we use the transaction ID from when the touch began to implement
388         this check.
389
390         * UIProcess/WebPageProxy.cpp:
391         (WebKit::WebPageProxy::handleTouchEventSynchronously):
392         (WebKit::WebPageProxy::resetState):
393         * UIProcess/WebPageProxy.h:
394         * UIProcess/ios/WKContentViewInteraction.h: Declared _layerTreeTransactionIdAtLastTouchStart.
395         * UIProcess/ios/WKContentViewInteraction.mm:
396         (-[WKContentView setupInteraction]): Register a UIWebTouchEventsGestureRecognizer even if
397         Touch Events are disabled.
398         (-[WKContentView cleanupInteraction]): Reset _layerTreeTransactionIdAtLastTouchStart to 0.
399         (-[WKContentView _webTouchEventsRecognized:]): Update _layerTreeTransactionIdAtLastTouchStart
400         when a touch begins, even if Touch Events are disabled.
401         (-[WKContentView _singleTapCommited:]): Passed _layerTreeTransactionIdAtLastTouchStart to
402         WebPageProxy::commitPotentialTap().
403         (-[WKContentView _attemptClickAtLocation:]): Ditto for WebPageProxy::handleTap().
404         * UIProcess/ios/WebPageProxyIOS.mm:
405         (WebKit::WebPageProxy::commitPotentialTap):
406         (WebKit::WebPageProxy::handleTap):
407
408 2017-02-26  Zan Dobersek  <zdobersek@igalia.com>
409
410         [CoordinatedGraphics] Remove CoordinatedGraphicsScene::paintToGraphicsContext()
411         https://bugs.webkit.org/show_bug.cgi?id=168903
412
413         Reviewed by Carlos Garcia Campos.
414
415         Remove the CoordinatedGraphicsScene::paintToGraphicsContext() method as it
416         is not used anywhere. Also enables removing the GraphicsContext pointer
417         member from the TextureMapper class.
418
419         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
420         (WebKit::CoordinatedGraphicsScene::paintToGraphicsContext): Deleted.
421         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
422
423 2017-02-26  Carlos Garcia Campos  <cgarcia@igalia.com>
424
425         [GTK] Hangs when showing Google search results
426         https://bugs.webkit.org/show_bug.cgi?id=168699
427
428         Reviewed by Žan Doberšek.
429
430         Connection::sendOutgoingMessage() can poll forever if sendmsg fails with EAGAIN or EWOULDBLOCK. For example if
431         socket read buffers are full, poll will be blocked until we read the pending data, but we can't read because
432         the thread is blocked in the poll. In case of EAGAIN/EWOULDBLOCK we should poll using the run loop, to allow
433         reads to happen in thread while we wait for the socket to be writable again. In the GTK+ port we use
434         GSocketMonitor to poll socket file descriptor without blocking, using the run loop. This patch renames the
435         socket monitor as readSocketMonitor and adds another one for polling output. When sendmsg fails with
436         EAGAIN/EWOULDBLOCK, the pending message is saved and the write monitor starts polling. Once the socket is
437         writable again we send the pending message. Helper class MessageInfo and a new one UnixMessage have been moved
438         to its own header file to be able to use std::unique_ptr member to save the pending message.
439
440         * Platform/IPC/Connection.cpp: Include UnixMessage.h as required by std::unique_ptr.
441         * Platform/IPC/Connection.h: Add write socket monitor and also keep the GSocket as a member to reuse it.
442         * Platform/IPC/glib/GSocketMonitor.cpp: Use Function instead of std::function.
443         (IPC::GSocketMonitor::start):
444         * Platform/IPC/glib/GSocketMonitor.h:
445         * Platform/IPC/unix/ConnectionUnix.cpp:
446         (IPC::Connection::platformInitialize): Initialize the GSocket here since we rely on it to take the ownership of
447         the descriptor. We were leaking it if the connection was invalidated without being opened.
448         (IPC::Connection::platformInvalidate): Destroy the GSocket even when not connected. Also stop the write monitor.
449         (IPC::Connection::processMessage):
450         (IPC::Connection::open):
451         (IPC::Connection::platformCanSendOutgoingMessages): Return false if we have a pending message to ensure
452         Connection doesn't try to send more messages until the pending message is dispatched. We don't need to check
453         m_isConnected because the caller already checks that.
454         (IPC::Connection::sendOutgoingMessage): Split it in two. This creates and prepares a UnixMessage and then calls
455         sendOutputMessage() to do the rest.
456         (IPC::Connection::sendOutputMessage): Send the message, or save it if sendmsg fails with EAGAIN or EWOULDBLOCK
457         to be sent later when the socket is writable.
458         * Platform/IPC/unix/UnixMessage.h: Added.
459         (IPC::MessageInfo::MessageInfo):
460         (IPC::MessageInfo::setMessageBodyIsOutOfLine):
461         (IPC::MessageInfo::isMessageBodyIsOutOfLine):
462         (IPC::MessageInfo::bodySize):
463         (IPC::MessageInfo::attachmentCount):
464         (IPC::UnixMessage::UnixMessage):
465         (IPC::UnixMessage::~UnixMessage):
466         (IPC::UnixMessage::attachments):
467         (IPC::UnixMessage::messageInfo):
468         (IPC::UnixMessage::body):
469         (IPC::UnixMessage::bodySize):
470         (IPC::UnixMessage::appendAttachment):
471         * PlatformGTK.cmake:
472
473 2017-02-26  Devin Rousso  <dcrousso+webkit@gmail.com>
474
475         Web Inspector: RTL: Docking Left doesn't constrain the page width
476         https://bugs.webkit.org/show_bug.cgi?id=168862
477
478         Reviewed by Brian Burg.
479
480         * UIProcess/mac/WebInspectorProxyMac.mm:
481         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
482         Calculate the inspectedViewFrame to be the remaining space after WebInspector is opened
483         instead of using the original page size.
484
485 2017-02-26  Alexey Proskuryakov  <ap@apple.com>
486
487         Stop exporting C++ member variables from WKDOMTextIterator
488         https://bugs.webkit.org/show_bug.cgi?id=168885
489
490         Reviewed by Dan Bernstein.
491
492         * WebProcess/InjectedBundle/API/mac/WKDOMTextIterator.mm:
493
494 2017-02-26  Alexey Proskuryakov  <ap@apple.com>
495
496         Add preprocessor guards to Mac specific files that are exposed as private headers on iOS
497         https://bugs.webkit.org/show_bug.cgi?id=168878
498
499         Reviewed by Dan Bernstein.
500
501         * UIProcess/API/C/WKInspector.h:
502         * WebProcess/InjectedBundle/API/c/mac/WKBundlePageBannerMac.h:
503
504 2017-02-26  Alexey Proskuryakov  <ap@apple.com>
505
506         Remove spurious C++ include from _WKTestingDelegate.h
507         https://bugs.webkit.org/show_bug.cgi?id=168877
508
509         Reviewed by Dan Bernstein.
510
511         * UIProcess/API/Cocoa/_WKTestingDelegate.h:
512
513 2017-02-26  Alexey Proskuryakov  <ap@apple.com>
514
515         Remove unimplemented WKResourceLoadStatisticsManagerSetReducedTimestampResolution
516         https://bugs.webkit.org/show_bug.cgi?id=168880
517
518         Reviewed by Dan Bernstein.
519
520         * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
521
522 2017-02-26  Alexey Proskuryakov  <ap@apple.com>
523
524         Remove leftover WebKit2 C API function declarations
525         https://bugs.webkit.org/show_bug.cgi?id=168879
526
527         Reviewed by Tim Horton.
528
529         * UIProcess/API/C/WKPreferencesRefPrivate.h:
530
531 2017-02-26  Alexey Proskuryakov  <ap@apple.com>
532
533         Remove some old WKSecurityOrigin binary compatibility stubs
534         https://bugs.webkit.org/show_bug.cgi?id=168881
535
536         Reviewed by Dan Bernstein.
537
538         * Shared/API/c/WKSecurityOriginRef.cpp:
539         (WKSecurityOriginGetHost): Deleted.
540         (WKSecurityOriginGetProtocol): Deleted.
541
542 2017-02-26  Wenson Hsieh  <wenson_hsieh@apple.com>
543
544         REGRESSION (r211312): Double-clicking a word selects it along with the space that follows it
545         https://bugs.webkit.org/show_bug.cgi?id=168821
546         <rdar://problem/30690431>
547
548         Reviewed by Tim Horton.
549
550         Actually encode and decode smartInsertDeleteEnabled when sending WebPageCreationParameters over XPC.
551
552         * Shared/WebPageCreationParameters.cpp:
553         (WebKit::WebPageCreationParameters::encode):
554         (WebKit::WebPageCreationParameters::decode):
555
556 2017-02-26  Chris Dumez  <cdumez@apple.com>
557
558         HitTestResult's linkSuggestedFilename should sanitize download attribute
559         https://bugs.webkit.org/show_bug.cgi?id=168856
560         <rdar://problem/30683109>
561
562         Reviewed by Antti Koivisto.
563
564         HitTestResult's linkSuggestedFilename should sanitize download attribute.
565         This is used by the context menu's "Download Linked File" & "Download Linked
566         File As..." actions.
567
568         * Shared/WebHitTestResultData.cpp:
569         (WebKit::WebHitTestResultData::WebHitTestResultData):
570         * WebProcess/InjectedBundle/InjectedBundleHitTestResult.cpp:
571         (WebKit::InjectedBundleHitTestResult::linkSuggestedFilename):
572
573 2017-02-25  Michael Catanzaro  <mcatanzaro@igalia.com>
574
575         [GTK] Unreviewed, document deficiency in webkit_website_data_manager_clear() API
576
577         Document that this function cannot currently delete cookie data for a particular period of
578         time.
579
580         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
581
582 2017-02-24  Joseph Pecoraro  <pecoraro@apple.com>
583
584         [Resource Timing] Gather timing information with reliable responseEnd time
585         https://bugs.webkit.org/show_bug.cgi?id=168351
586
587         Reviewed by Alex Christensen.
588
589         Change from an unused `double finishTime` to a complete WebCore::NetworkLoadMetrics
590         object in the didFinishLoad ResourceLoader path. We may also extend this in the
591         didFail path later on. This allows the NetworkProcess to give complete timing
592         information, and more final metrics about the load, to WebCore.
593
594         * NetworkProcess/NetworkDataTask.h:
595         (WebKit::NetworkDataTaskClient::didCompleteWithError):
596         Give the NetworkDataTaskClient a basic didCompleteWithError for a completion
597         without metrics. For loads that complete with an error, or haven't populated
598         any metrics, this will pass empty metrics onward.
599
600         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
601         (WebKit::BlobDownloadClient::didFinishLoading):
602         * NetworkProcess/Downloads/BlobDownloadClient.h:
603         * NetworkProcess/Downloads/PendingDownload.h:
604         * NetworkProcess/PingLoad.h:
605         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
606         (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
607         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
608         * NetworkProcess/NetworkDataTaskBlob.cpp:
609         (WebKit::NetworkDataTaskBlob::didFail):
610         * NetworkProcess/NetworkLoad.cpp:
611         (WebKit::NetworkLoad::continueWillSendRequest):
612         (WebKit::NetworkLoad::didCompleteWithError):
613         (WebKit::NetworkLoad::didFinishLoading):
614         * NetworkProcess/NetworkLoad.h:
615         * NetworkProcess/NetworkLoadClient.h:
616         * NetworkProcess/NetworkResourceLoader.cpp:
617         (WebKit::NetworkResourceLoader::didFinishLoading):
618         (WebKit::NetworkResourceLoader::sendResultForCacheEntry):
619         * NetworkProcess/NetworkResourceLoader.h:
620         * WebProcess/Network/WebResourceLoader.cpp:
621         (WebKit::WebResourceLoader::didFinishResourceLoad):
622         (WebKit::WebResourceLoader::didReceiveResource):
623         * WebProcess/Network/WebResourceLoader.h:
624         * WebProcess/Network/WebResourceLoader.messages.in:
625         Change didFinishLoad paths to take a NetworkLoadMetrics object instead of finishTime.
626         Change didCompleteWithError pathes to include a NetworkLoadMetrics object instead of finishTime.
627
628         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
629         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
630         (WebKit::NetworkDataTaskCocoa::didCompleteWithError):
631         Own a NetworkLoadTiming that will be populated with the load.
632
633         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
634         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
635         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
636         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
637         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
638         Populate NetworkLoadMetrics in the didFinishCollectingMetrics NSURLSessionTaskDelegate method.
639
640         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
641         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
642         (WebKit::NetworkDataTaskSoup::timeoutFired):
643         (WebKit::NetworkDataTaskSoup::didSendRequest):
644         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
645         (WebKit::NetworkDataTaskSoup::dispatchDidCompleteWithError):
646         (WebKit::NetworkDataTaskSoup::tlsErrorsChanged):
647         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
648         (WebKit::NetworkDataTaskSoup::didFinishRead):
649         (WebKit::NetworkDataTaskSoup::didFinishRequestNextPart):
650         (WebKit::NetworkDataTaskSoup::didFailDownload):
651         (WebKit::NetworkDataTaskSoup::didFail):
652         (WebKit::NetworkDataTaskSoup::networkEvent):
653         (WebKit::NetworkDataTaskSoup::didStartRequest):
654         (WebKit::NetworkDataTaskSoup::didRestart):
655         * NetworkProcess/soup/NetworkDataTaskSoup.h:
656         Instead of populating the NetworkLoadMetrics on the ResourceResponse, populate
657         a member variable during the entire load and dispatch didFinishCollectingMetrics
658         right before didCompleteLoadWithError.
659
660 2017-02-24  Chris Dumez  <cdumez@apple.com>
661
662         Unreviewed, rolling out r212944.
663
664         Caused a lot of failures on the debug bots
665
666         Reverted changeset:
667
668         "[Resource Timing] Gather timing information with reliable
669         responseEnd time"
670         https://bugs.webkit.org/show_bug.cgi?id=168351
671         http://trac.webkit.org/changeset/212944
672
673 2017-02-24  Wenson Hsieh  <wenson_hsieh@apple.com>
674
675         Unreviewed, fix the internal build
676
677         * UIProcess/ios/WKContentViewInteraction.h:
678
679 2017-02-24  Matt Rajca  <mrajca@apple.com>
680
681         Media: notify clients when autoplay is denied
682         https://bugs.webkit.org/show_bug.cgi?id=168840
683
684         Reviewed by Alex Christensen.
685
686         * UIProcess/API/APIUIClient.h:
687         (API::UIClient::handleAutoplayEvent):
688         (API::UIClient::didPlayMediaPreventedFromPlayingWithoutUserGesture): Deleted.
689         * UIProcess/API/C/WKPage.cpp:
690         (WKPageSetPageUIClient):
691         * UIProcess/API/C/WKPageUIClient.h:
692         * UIProcess/WebPageProxy.cpp:
693         (WebKit::WebPageProxy::handleAutoplayEvent):
694         (WebKit::WebPageProxy::didPlayMediaPreventedFromPlayingWithoutUserGesture): Deleted.
695         * UIProcess/WebPageProxy.h:
696         * UIProcess/WebPageProxy.messages.in:
697         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
698         (WebKit::WebChromeClient::handleAutoplayEvent):
699         (WebKit::WebChromeClient::didPlayMediaPreventedFromPlayingWithoutUserGesture): Deleted.
700         * WebProcess/WebCoreSupport/WebChromeClient.h:
701
702 2017-02-20  Wenson Hsieh  <wenson_hsieh@apple.com>
703
704         Refactor data interaction to use new WKDataInteraction SPI
705         https://bugs.webkit.org/show_bug.cgi?id=168602
706         Work towards <rdar://problem/30313681>
707
708         Reviewed by Tim Horton.
709
710         Adjust testing SPI to match new data interaction interfaces.
711
712         * Platform/spi/ios/UIKitSPI.h:
713         * UIProcess/API/Cocoa/WKWebView.mm:
714         (-[WKWebView _simulateDataInteractionEntered:]):
715         (-[WKWebView _simulateDataInteractionUpdated:]):
716         (-[WKWebView _simulateDataInteractionPerformOperation:]):
717         (-[WKWebView _simulateDataInteractionEnded:]):
718         (-[WKWebView _simulateDataInteractionSessionDidEnd:]):
719         (-[WKWebView _simulateWillBeginDataInteractionWithSession:]):
720         (-[WKWebView _simulatedItemsForSession:]):
721         (-[WKWebView _simulatePrepareForDataInteractionSession:completion:]):
722         (-[WKWebView _simulateDataInteractionSessionDidEnd:withOperation:]): Deleted.
723         (-[WKWebView _simulateFailedDataInteractionWithIndex:]): Deleted.
724         (-[WKWebView _simulateWillBeginDataInteractionWithIndex:withSession:]): Deleted.
725         (-[WKWebView _simulatedItemsForDataInteractionWithIndex:]): Deleted.
726         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
727         * UIProcess/ios/WKContentViewInteraction.h:
728         * UIProcess/ios/WKContentViewInteraction.mm:
729         (-[WKContentView _positionInformationDidChange:]):
730         * UIProcess/ios/WKScrollView.h:
731         * UIProcess/ios/WKScrollView.mm:
732
733 2017-02-20  Wenson Hsieh  <wenson_hsieh@apple.com>
734
735         Remove the data interaction gesture recognizer
736         https://bugs.webkit.org/show_bug.cgi?id=168600
737         <rdar://problem/30313681>
738
739         Reviewed by Anders Carlsson.
740
741         The data interaction gesture recognizer will no longer be needed moving forward.
742
743         * UIProcess/API/Cocoa/WKWebView.mm:
744         (-[WKWebView _simulateDataInteractionGestureRecognized]): Deleted.
745         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
746         * UIProcess/ios/WKContentViewInteraction.h:
747         * UIProcess/ios/WKContentViewInteraction.mm:
748         (-[WKContentView setupInteraction]):
749         (-[WKContentView cleanupInteraction]):
750         (-[WKContentView _removeDefaultGestureRecognizers]):
751         (-[WKContentView _addDefaultGestureRecognizers]):
752         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
753         (-[WKContentView gestureRecognizerShouldBegin:]):
754         (-[WKContentView _dataInteractionGestureRecognizer]): Deleted.
755
756 2017-02-24  Chris Dumez  <cdumez@apple.com>
757
758         [iOS][WK2] Disable network cache speculative revalidation / loading in low power mode
759         https://bugs.webkit.org/show_bug.cgi?id=168832
760         <rdar://problem/30697911>
761
762         Reviewed by Antti Koivisto.
763
764         Disable network cache speculative revalidation / loading in low power mode on iOS to
765         save battery.
766
767         * NetworkProcess/cache/NetworkCache.cpp:
768         (WebKit::NetworkCache::Cache::initialize):
769         * NetworkProcess/cache/NetworkCache.h:
770
771 2017-02-24  John Wilander  <wilander@apple.com>
772
773         Resource Load Statistics: Add alternate classification method
774         https://bugs.webkit.org/show_bug.cgi?id=168347
775         <rdar://problem/30352793>
776         <rdar://problem/30646710>
777         <rdar://problem/30660708>
778
779         Reviewed by Alex Christensen.
780
781         This patch adds a CorePrediction-based classifier to the WebResourceLoadStatisticsStore.
782         The CorePrediction framework is introduced as a dependency for macOS and iOS. The patch
783         also adds functions to support layout tests of the feature.
784
785         * Platform/Logging.h:
786             Added channel ResourceLoadStatistics.
787         * Platform/classifier/ResourceLoadStatisticsClassifier.h: Added.
788             Pulls in the Cocoa-specific classifier for Cocoa-based platforms.
789         (WebKit::ResourceLoadStatisticsClassifier::ResourceLoadStatisticsClassifier):
790         * Platform/classifier/ResourceLoadStatisticsClassifierBase.cpp: Added.
791         (WebKit::ResourceLoadStatisticsClassifierBase::hasPrevalentResourceCharacteristics):
792             Shared classifier logic.
793         (WebKit::ResourceLoadStatisticsClassifierBase::classifyWithVectorThreshold):
794             Fallback classifier for when we don't have CorePrediction.
795         * Platform/classifier/ResourceLoadStatisticsClassifierBase.h: Added.
796         (WebKit::ResourceLoadStatisticsClassifierBase::ResourceLoadStatisticsClassifierBase):
797         (WebKit::ResourceLoadStatisticsClassifierBase::~ResourceLoadStatisticsClassifierBase):
798         * Platform/classifier/cocoa/CorePredictionSoftLink.h: Added.
799             Soft links to CorePrediction and the two functions we use from it.
800         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp: Added.
801         (WebKit::ResourceLoadStatisticsClassifier::classify):
802         (WebKit::ResourceLoadStatisticsClassifier::storagePath):
803         (WebKit::ResourceLoadStatisticsClassifier::shouldUseCorePredictionAndHaveModelLoaded):
804         (WebKit::ResourceLoadStatisticsClassifier::singletonPredictionModel):
805             The new classifier for Cocoa platforms.
806         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h: Added.
807         * PlatformGTK.cmake:
808             Added Platform/classifier directory and ResourceLoadStatisticsClassifierBase.cpp.
809         * PlatformMac.cmake:
810             Added Platform/classifier and Platform/classifier/cocoa directories, and
811             source files ResourceLoadStatisticsClassifierBase.cpp and
812             ResourceLoadStatisticsClassifierCocoa.cpp
813         * Resources/ResourceLoadStatistics/corePrediction_model: Added.
814             Model file to load into CorePrediction.
815         * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
816         (WKResourceLoadStatisticsManagerSetSubframeUnderTopFrameOrigin):
817         (WKResourceLoadStatisticsManagerSetSubresourceUnderTopFrameOrigin):
818         (WKResourceLoadStatisticsManagerSetSubresourceUniqueRedirectTo):
819             Test infrastructure.
820         * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
821         * UIProcess/WebResourceLoadStatisticsManager.cpp:
822         (WebKit::WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin):
823         (WebKit::WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin):
824         (WebKit::WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo):
825             Test infrastructure.
826         * UIProcess/WebResourceLoadStatisticsManager.h:
827         * UIProcess/WebResourceLoadStatisticsStore.cpp:
828         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
829             Renamed m_storagePath to m_statisticsStoragePath for clarity.
830         (WebKit::WebResourceLoadStatisticsStore::classifyResource):
831             Now calls the classifier through its ResourceLoadStatisticsClassifier
832             member variable.
833         (WebKit::WebResourceLoadStatisticsStore::persistentStoragePath):
834             Renamed m_storagePath to m_statisticsStoragePath for clarity.
835         (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
836             Renamed m_storagePath to m_statisticsStoragePath for clarity.
837         (WebKit::WebResourceLoadStatisticsStore::hasPrevalentResourceCharacteristics): Deleted.
838         * UIProcess/WebResourceLoadStatisticsStore.h:
839         * WebKit2.xcodeproj/project.pbxproj:
840             Added the new classifier source files under Platform/classifier and the
841             corePrediction_model file under Resources/ResourceLoadStatistics.
842
843 2017-02-23  Joseph Pecoraro  <pecoraro@apple.com>
844
845         [Resource Timing] Add Experimental Feature Flag
846         https://bugs.webkit.org/show_bug.cgi?id=167147
847
848         Reviewed by Ryosuke Niwa.
849
850         * Shared/WebPreferencesDefinitions.h:
851         Move ResourceTiming to experimental section.
852         Disable it for El Capitan due to known issues.
853
854 2017-02-23  Joseph Pecoraro  <pecoraro@apple.com>
855
856         [Resource Timing] Gather timing information with reliable responseEnd time
857         https://bugs.webkit.org/show_bug.cgi?id=168351
858
859         Reviewed by Alex Christensen.
860
861         Change from an unused `double finishTime` to a complete WebCore::NetworkLoadMetrics
862         object in the didFinishLoad ResourceLoader path. We may also extend this in the
863         didFail path later on. This allows the NetworkProcess to give complete timing
864         information, and more final metrics about the load, to WebCore.
865
866         * NetworkProcess/NetworkDataTask.h:
867         (WebKit::NetworkDataTaskClient::didCompleteWithError):
868         Give the NetworkDataTaskClient a basic didCompleteWithError for a completion
869         without metrics. For loads that complete with an error, or haven't populated
870         any metrics, this will pass empty metrics onward.
871
872         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
873         (WebKit::BlobDownloadClient::didFinishLoading):
874         * NetworkProcess/Downloads/BlobDownloadClient.h:
875         * NetworkProcess/Downloads/PendingDownload.h:
876         * NetworkProcess/PingLoad.h:
877         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
878         (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
879         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.h:
880         * NetworkProcess/NetworkDataTaskBlob.cpp:
881         (WebKit::NetworkDataTaskBlob::didFail):
882         * NetworkProcess/NetworkLoad.cpp:
883         (WebKit::NetworkLoad::continueWillSendRequest):
884         (WebKit::NetworkLoad::didCompleteWithError):
885         (WebKit::NetworkLoad::didFinishLoading):
886         * NetworkProcess/NetworkLoad.h:
887         * NetworkProcess/NetworkLoadClient.h:
888         * NetworkProcess/NetworkResourceLoader.cpp:
889         (WebKit::NetworkResourceLoader::didFinishLoading):
890         (WebKit::NetworkResourceLoader::sendResultForCacheEntry):
891         * NetworkProcess/NetworkResourceLoader.h:
892         * WebProcess/Network/WebResourceLoader.cpp:
893         (WebKit::WebResourceLoader::didFinishResourceLoad):
894         (WebKit::WebResourceLoader::didReceiveResource):
895         * WebProcess/Network/WebResourceLoader.h:
896         * WebProcess/Network/WebResourceLoader.messages.in:
897         Change didFinishLoad paths to take a NetworkLoadMetrics object instead of finishTime.
898         Change didCompleteWithError pathes to include a NetworkLoadMetrics object instead of finishTime.
899
900         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
901         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
902         (WebKit::NetworkDataTaskCocoa::didCompleteWithError):
903         Own a NetworkLoadTiming that will be populated with the load.
904
905         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
906         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
907         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
908         (-[WKNetworkSessionDelegate URLSession:task:didFinishCollectingMetrics:]):
909         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
910         Populate NetworkLoadMetrics in the didFinishCollectingMetrics NSURLSessionTaskDelegate method.
911
912         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
913         (WebKit::NetworkDataTaskSoup::NetworkDataTaskSoup):
914         (WebKit::NetworkDataTaskSoup::timeoutFired):
915         (WebKit::NetworkDataTaskSoup::didSendRequest):
916         (WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse):
917         (WebKit::NetworkDataTaskSoup::dispatchDidCompleteWithError):
918         (WebKit::NetworkDataTaskSoup::tlsErrorsChanged):
919         (WebKit::NetworkDataTaskSoup::continueHTTPRedirection):
920         (WebKit::NetworkDataTaskSoup::didFinishRead):
921         (WebKit::NetworkDataTaskSoup::didFinishRequestNextPart):
922         (WebKit::NetworkDataTaskSoup::didFailDownload):
923         (WebKit::NetworkDataTaskSoup::didFail):
924         (WebKit::NetworkDataTaskSoup::networkEvent):
925         (WebKit::NetworkDataTaskSoup::didStartRequest):
926         (WebKit::NetworkDataTaskSoup::didRestart):
927         * NetworkProcess/soup/NetworkDataTaskSoup.h:
928         Instead of populating the NetworkLoadMetrics on the ResourceResponse, populate
929         a member variable during the entire load and dispatch didFinishCollectingMetrics
930         right before didCompleteLoadWithError.
931
932 2017-02-23  Beth Dakin  <bdakin@apple.com> + Dan Saunders  <dasau@microsoft.com>
933
934         No reliable way to get a snapshot of WKWebView
935         https://bugs.webkit.org/show_bug.cgi?id=161450
936         -and corresponding-
937         <rdar://problem/23846039>
938
939         Reviewed by Tim Horton.
940
941         This patch adds a new API to WKWebView to snapshot a rect:
942         takeSnapshotWithConfiguration:completionHandler:
943
944         It also adds a new API object WKSnapshotConfiguration.
945
946         * UIProcess/API/Cocoa/WKSnapshotConfiguration.h: Added.
947         * UIProcess/API/Cocoa/WKSnapshotConfiguration.mm: Added.
948         (-[WKSnapshotConfiguration copyWithZone:]):
949         * UIProcess/API/Cocoa/WKWebView.h:
950         * UIProcess/API/Cocoa/WKWebView.mm:
951         (-[WKWebView takeSnapshotWithConfiguration:completionHandler:]):
952         * WebKit2.xcodeproj/project.pbxproj:
953
954 2017-02-23  Jer Noble  <jer.noble@apple.com>
955
956         ASSERT in RTCNetwork::IPAddress::decode()
957         https://bugs.webkit.org/show_bug.cgi?id=168792
958
959         Reviewed by Tim Horton.
960
961         An ASSERT added to RTCNetwork::IPAddress::decode in r212781 was hit due to a bad encode of SocketAddress; an
962         extra boolean value was added to the encoder unnecessarily, leading to garbage data being decoded in the following
963         IPAddress.
964
965         Drive-by-fix: allow the IPAddress encoder/decoder to pass through a value of AF_UNSPEC for an IPAddress to support
966         passing through an "empty" IPAddress value.
967
968         * Shared/RTCNetwork.cpp:
969         (WebKit::RTCNetwork::IPAddress::decode):
970         (WebKit::RTCNetwork::IPAddress::encode):
971         (WebKit::RTCNetwork::SocketAddress::encode):
972
973 2017-02-23  Eric Carlson  <eric.carlson@apple.com>
974
975         [WebRTC][Mac][WebKit2] WebRTC requires media capture
976         https://bugs.webkit.org/show_bug.cgi?id=168782
977         <rdar://problem/30675242>
978
979         Reviewed by Youenn Fablet.
980
981         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
982         (WebKit::WebProcessPool::platformInitializeWebProcess): Extend the sanbox to allow microphone access
983         if media stream OR WebRTC is enabled.
984
985 2017-02-23  Brent Fulgham  <bfulgham@apple.com>
986
987         [Mac] Remove unneeded sandbox exceptions for media elements
988         https://bugs.webkit.org/show_bug.cgi?id=168767
989
990         Reviewed by Alex Christensen.
991
992         Remove several sandbox exceptions that have not been needed for the past four
993         or five macOS releases.
994         
995         * WebProcess/com.apple.WebProcess.sb.in:
996
997 2017-02-23  Brent Fulgham  <bfulgham@apple.com>
998
999         [Mac] Remove com.apple.audio.VDCAssistant from sandboxes
1000         https://bugs.webkit.org/show_bug.cgi?id=168764
1001         <rdar://problem/16736919>
1002
1003         Reviewed by Alex Christensen.
1004
1005         Remove unneeded sandbox class.
1006
1007         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
1008         * WebProcess/com.apple.WebProcess.sb.in:
1009
1010 2017-02-22  Wenson Hsieh  <wenson_hsieh@apple.com>
1011
1012         Data interaction causes selection to fall out of sync between web/UI processes
1013         https://bugs.webkit.org/show_bug.cgi?id=168735
1014         <rdar://problem/30657817>
1015
1016         Reviewed by Tim Horton.
1017
1018         Fixes a bug with data interaction causing selection state to fall out of sync between the UI and web processes,
1019         and also introduces testing infrastructure and tests for grabbing UI-side selection view rects in TestWebKitAPI.
1020         While performing a data interaction operation, we now lift restrictions for assisting the focused node.
1021
1022         * UIProcess/ios/WKContentViewInteraction.h:
1023         * UIProcess/ios/WKContentViewInteraction.mm:
1024         (-[WKContentView cleanupInteraction]):
1025         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
1026
1027 2017-02-23  Carlos Garcia Campos  <cgarcia@igalia.com>
1028
1029         [GTK] Crash attempting to load Flash plugin in Wayland
1030         https://bugs.webkit.org/show_bug.cgi?id=163159
1031
1032         Reviewed by Michael Catanzaro.
1033
1034         The problem is that we check if the current diplay is X11 or Wayland also in the plugin process, but with GTK2
1035         plugins the display is always X11. We should early reject plugins requiring GTK2 in the UI process when the
1036         current display is Wayland.
1037
1038         * UIProcess/Plugins/unix/PluginInfoStoreUnix.cpp:
1039         (WebKit::PluginInfoStore::getPluginInfo):
1040         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
1041         (WebKit::PluginProcessProxy::scanPlugin):
1042         * UIProcess/gtk/WebPageProxyGtk.cpp:
1043         (WebKit::WebPageProxy::createPluginContainer): Add an assert to ensure this message is never received on a
1044         non-X11 display.
1045         * WebProcess/Plugins/PluginView.cpp:
1046         (WebKit::PluginView::createPluginContainer): Never send CreatePluginContainer message to the UI process if the
1047         display is not X11.
1048
1049 2017-02-23  Eric Carlson  <eric.carlson@apple.com>
1050
1051         [MediaStream iOS] Allow web process sandbox to be extended for media capture
1052         https://bugs.webkit.org/show_bug.cgi?id=168756
1053
1054         Reviewed by Brent Fulgham.
1055
1056         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Add rules to dynamically
1057         extend the sandbox to allow access to the camera and/or microphone.
1058
1059 2017-02-23  Tomas Popela  <tpopela@redhat.com>
1060
1061         [GTK] Drag and drop is always moving the content even if copy is requested
1062         https://bugs.webkit.org/show_bug.cgi?id=168424
1063
1064         Reviewed by Carlos Garcia Campos.
1065
1066         Drag and drop is always moving the content around even if the copy is
1067         requested (i.e. by pressing the Control key).
1068
1069         * UIProcess/gtk/DragAndDropHandler.cpp:
1070         (WebKit::DragAndDropHandler::drop):
1071
1072 2017-02-22  Carlos Garcia Campos  <cgarcia@igalia.com>
1073
1074         Better handle Thread and RunLoop initialization
1075         https://bugs.webkit.org/show_bug.cgi?id=167828
1076
1077         Reviewed by Yusuke Suzuki.
1078
1079         Remove unnecessary call to WTF::initializeMainThread().
1080
1081         * Shared/WebKit2Initialize.cpp:
1082         (WebKit::InitializeWebKit2):
1083
1084 2017-02-22  Chris Dumez  <cdumez@apple.com>
1085
1086         Unreviewed, drop console logging landed by mistake as part of r212832.
1087
1088         * UIProcess/BackgroundProcessResponsivenessTimer.cpp:
1089         (WebKit::BackgroundProcessResponsivenessTimer::timerFired):
1090
1091 2017-02-22  Brent Fulgham  <bfulgham@apple.com>
1092
1093         [Mac] Tighten sandbox to deny process-info* access
1094         https://bugs.webkit.org/show_bug.cgi?id=168704
1095         <rdar://problem/16371441>
1096
1097         Reviewed by Alex Christensen.
1098
1099         Tighten the various WebKit sandboxes by denying access to process-info.
1100         Add back specific features needed to run WebKit tests and to do browsing
1101         of websites (including plugins).
1102
1103         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
1104         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1105         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
1106         * WebProcess/com.apple.WebProcess.sb.in:
1107
1108 2017-02-22  Anders Carlsson  <andersca@apple.com>
1109
1110         Crash if there's a mismatch between the WebKit used by the UI process and child processes respectively
1111         https://bugs.webkit.org/show_bug.cgi?id=168739
1112         Part of rdar://problem/30631411.
1113
1114         Reviewed by Geoffrey Garen.
1115
1116         If the UI process and web process for some reason end up using different versions of the WebKit framework, weird things happen
1117         because the message format is different between versions. To avoid this, send along the WebKit bundle version from the UI process
1118         in the XPC bootstrap message, check that it matches inside the XPC main functions. If there's a mismatch, crash.
1119
1120         * Shared/Cocoa/ChildProcessCocoa.mm:
1121         (WebKit::ChildProcess::didReceiveInvalidMessage):
1122         Fix parameters.
1123
1124         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
1125         (main):
1126         Check for the bundle version and crash if it's not what we expect.
1127
1128         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
1129         (WebKit::ProcessLauncher::launchProcess):
1130         Initialize the bundle version.
1131
1132         * WebProcess/cocoa/WebProcessCocoa.mm:
1133         (WebKit::_WKSetCrashReportApplicationSpecificInformation):
1134         Export this so we can call it from the XPC services without having to link WKSI.
1135
1136 2017-02-22  Chris Dumez  <cdumez@apple.com>
1137
1138         [WK2] Call processDidBecomeUnresponsive delegate when a background process is unresponsive
1139         https://bugs.webkit.org/show_bug.cgi?id=168683
1140         <rdar://problem/30558745>
1141
1142         Reviewed by Dan Bernstein.
1143
1144         Call processDidBecomeUnresponsive delegate when a background process is unresponsive
1145         instead of killing it on WebKit side. This gives the client the choice about what it
1146         wants to do about this process.
1147
1148         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1149         (API::ProcessPoolConfiguration::copy):
1150         * UIProcess/API/APIProcessPoolConfiguration.h:
1151         * UIProcess/API/C/WKContext.cpp:
1152         * UIProcess/API/C/WKContextPrivate.h:
1153         * UIProcess/BackgroundProcessResponsivenessTimer.cpp: Renamed from Source/WebKit2/UIProcess/UnresponsiveWebProcessTerminator.cpp.
1154         (WebKit::BackgroundProcessResponsivenessTimer::BackgroundProcessResponsivenessTimer):
1155         (WebKit::BackgroundProcessResponsivenessTimer::updateState):
1156         (WebKit::BackgroundProcessResponsivenessTimer::timerFired):
1157         * UIProcess/BackgroundProcessResponsivenessTimer.h: Renamed from Source/WebKit2/UIProcess/UnresponsiveWebProcessTerminator.h.
1158         * UIProcess/WebPageProxy.cpp:
1159         (WebKit::WebPageProxy::reattachToWebProcess):
1160         (WebKit::WebPageProxy::dispatchActivityStateChange):
1161         (WebKit::WebPageProxy::terminateProcess):
1162         * UIProcess/WebPageProxy.h:
1163         * UIProcess/WebProcessProxy.cpp:
1164         (WebKit::m_backgroundResponsivenessTimer):
1165         * UIProcess/WebProcessProxy.h:
1166         * WebKit2.xcodeproj/project.pbxproj:
1167
1168 2017-02-22  Carlos Garcia Campos  <cgarcia@igalia.com>
1169
1170         NetworkProcess: Stop disabling buffering when NETWORK_CACHE is disabled in build
1171         https://bugs.webkit.org/show_bug.cgi?id=168637
1172
1173         Reviewed by Alex Christensen.
1174
1175         It was added in r193752 as part of bug #137692 to fix an infinite loop in network process that happened in EFL
1176         because they didn't enable the network cache at that time. I think that was actually a workaround, and it was
1177         added without any comment so it has stayed there even when EFL enabled disk cache, and now that is gone. Looking
1178         at current code I see no reason why buffering can't work with the disk cache disabled, so I think it's time to
1179         remove that workaround.
1180
1181         * WebProcess/Network/WebLoaderStrategy.cpp:
1182         (WebKit::maximumBufferingTime):
1183
1184 2017-02-21  Youenn Fablet  <youenn@apple.com>
1185
1186         [WebRTC][Mac] Activate libwebrtc
1187         https://bugs.webkit.org/show_bug.cgi?id=167293
1188         <rdar://problem/30401864>
1189
1190         Reviewed by Alex Christensen.
1191
1192         Activating PeerConnection runtime flag based on successful loading of libwebrtc.dylib.
1193
1194         * Configurations/WebKit.xcconfig:
1195         * Configurations/FeatureDefines.xcconfig:
1196         * Shared/WebPreferencesDefinitions.h:
1197         * UIProcess/WebPreferences.cpp:
1198         (WebKit::checkWebRTCAvailability):
1199
1200 2017-02-21  Commit Queue  <commit-queue@webkit.org>
1201
1202         Unreviewed, rolling out r212786.
1203         https://bugs.webkit.org/show_bug.cgi?id=168710
1204
1205         It broke GTK+ port when using single shared process model
1206         (Requested by KaL on #webkit).
1207
1208         Reverted changeset:
1209
1210         "Refactor WebViewImpl creation in preparation for supporting
1211         multiple WebsiteDataStores."
1212         https://bugs.webkit.org/show_bug.cgi?id=168676
1213         http://trac.webkit.org/changeset/212786
1214
1215 2017-02-21  Brady Eidson  <beidson@apple.com>
1216
1217         Refactor WebViewImpl creation in preparation for supporting multiple WebsiteDataStores.
1218         https://bugs.webkit.org/show_bug.cgi?id=168676
1219
1220         Reviewed by Alex Christensen.
1221
1222         * UIProcess/API/Cocoa/WKWebView.mm:
1223         (-[WKWebView _initializeWithConfiguration:]): Allow for WebViewImpl creation to fail.
1224
1225         * UIProcess/API/mac/WKView.mm:
1226         (-[WKView initWithFrame:processPool:configuration:]): Ditto.
1227
1228         * UIProcess/Cocoa/WebViewImpl.h:
1229         * UIProcess/Cocoa/WebViewImpl.mm:
1230         (WebKit::WebViewImpl::maybeCreate):
1231         (WebKit::WebViewImpl::WebViewImpl):
1232
1233         * UIProcess/WebPageProxy.cpp:
1234         (WebKit::WebPageProxy::reattachToWebProcess): New WebProcess creation might fail. Handle it.
1235         * UIProcess/WebProcessPool.cpp:
1236         (WebKit::WebProcessPool::createNewWebProcess):
1237         (WebKit::WebProcessPool::warmInitialProcess):
1238         (WebKit::WebProcessPool::maybeCreateNewWebProcessRespectingProcessCountLimit): This can now fail
1239           if the process will have a non-default WebsiteDataStore but we've already reached the process cap.
1240         (WebKit::WebProcessPool::createWebPage):
1241         (WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit): Deleted.
1242         * UIProcess/WebProcessPool.h:
1243
1244 2017-02-21  Youenn Fablet  <youenn@apple.com>
1245
1246         [WebRTC] WebKit2 should assert that libwebrtc transmitted IP addresses family is IP4 or IP6
1247         https://bugs.webkit.org/show_bug.cgi?id=168691
1248
1249         Reviewed by Alex Christensen.
1250
1251         Adding some asserts that family is IPv4 or IPv6.
1252
1253         * Shared/RTCNetwork.cpp:
1254         (WebKit::RTCNetwork::IPAddress::decode):
1255         (WebKit::RTCNetwork::IPAddress::encode):
1256
1257 2017-02-20  Simon Fraser  <simon.fraser@apple.com>
1258
1259         Add support to PlatformCALayer/GraphicsLayerCA for subpixel-antialiased text, with a Setting and a MiniBrowser switch
1260         https://bugs.webkit.org/show_bug.cgi?id=168620
1261         <rdar://problem/30617772>
1262
1263         Reviewed by Tim Horton.
1264
1265         Add a Setting for subpixel-antialiased layer text. Plumb this through GraphicsLayerCA and
1266         PlatformCALayer, where it ultimately affects the layer contents format.
1267         
1268         This is not supported with UI-side compositing.
1269
1270         * Shared/WebPreferencesDefinitions.h:
1271         * UIProcess/API/C/WKPreferences.cpp:
1272         (WKPreferencesSetSubpixelAntialiasedLayerTextEnabled):
1273         (WKPreferencesGetSubpixelAntialiasedLayerTextEnabled):
1274         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1275         * UIProcess/API/Cocoa/WKPreferences.mm:
1276         (-[WKPreferences _subpixelAntialiasedLayerTextEnabled]):
1277         (-[WKPreferences _setSubpixelAntialiasedLayerTextEnabled:]):
1278         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
1279         * WebProcess/WebPage/WebPage.cpp:
1280         (WebKit::WebPage::updatePreferences):
1281         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1282         (WebKit::PlatformCALayerRemote::supportsSubpixelAntialiasedText):
1283         (WebKit::PlatformCALayerRemote::setSupportsSubpixelAntialiasedText):
1284         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
1285         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
1286         (WebKit::PlatformCALayerRemoteTiledBacking::supportsSubpixelAntialiasedText):
1287         (WebKit::PlatformCALayerRemoteTiledBacking::setSupportsSubpixelAntialiasedText):
1288         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
1289
1290 2017-02-21  John Wilander  <wilander@apple.com>
1291
1292         Resource Load Statistics: Only scan website data store once per session ID + reinstate removal counting
1293         https://bugs.webkit.org/show_bug.cgi?id=168541
1294
1295         Reviewed by Alex Christensen.
1296
1297         * UIProcess/WebProcessProxy.cpp:
1298         (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyOwnedDomainsInAllPersistentDataStores):
1299             The CallbackAggregator now merges a list of domains for which we
1300             have removed data records and eventually reports this back to the
1301             caller.
1302         * UIProcess/WebProcessProxy.h:
1303         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1304         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
1305             Now reports back to its WebCore::ResourceLoadStatisticsStore
1306             which domains have had data records removed.
1307         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1308         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyOwnedDomains):
1309             The completion handler now handles data record removal counting.
1310         (WebKit::WebsiteDataStore::removeDataForTopPrivatelyOwnedDomains):
1311             The completion handler now handles data record removal counting.
1312         * UIProcess/WebsiteData/WebsiteDataStore.h:
1313
1314 2017-02-21  Alex Christensen  <achristensen@webkit.org>
1315
1316         Fix CMake build.
1317
1318         * PlatformMac.cmake:
1319
1320 2017-02-21  Youenn Fablet  <youenn@apple.com>
1321
1322         [WebRTC][Mac] Network process sandbox does not allow WebRTC networking
1323         https://bugs.webkit.org/show_bug.cgi?id=168594
1324
1325         Reviewed by Brent Fulgham.
1326
1327         UIProcess was passing a boolean to know whether WebRTC networking is allowed or not to the network process.
1328         This boolean was known to late for the sandbox to be relaxed.
1329         A sandbox extension is now used instead to relax the sandbox.
1330
1331         * NetworkProcess/NetworkProcess.h:
1332         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1333         (WebKit::NetworkProcessCreationParameters::encode):
1334         (WebKit::NetworkProcessCreationParameters::decode):
1335         * NetworkProcess/NetworkProcessCreationParameters.h:
1336         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1337         (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
1338         * NetworkProcess/mac/NetworkProcessMac.mm:
1339         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
1340         (WebKit::NetworkProcess::initializeSandbox):
1341         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1342         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1343         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1344
1345 2017-02-21  Youenn Fablet  <youenn@apple.com>
1346
1347         [WebRTC] ICE candidates should be filtered according a policy
1348         https://bugs.webkit.org/show_bug.cgi?id=168348
1349
1350         Reviewed by Alex Christensen.
1351
1352         Adding the possibility for the UI process to control the ICE candidate filtering and whether libwebrtc can
1353         enumerate all interfaces or not.
1354
1355         Disabling ICE candidate filtering for the moment.
1356         Enabling to enumerate all interfaces for the moment.
1357
1358         In the future, ICE candidate filtering should be tied to getUserMedia.
1359         Interface enumeration should be disabled with the default configuration.
1360         We should do that once we have sufficient testing in various network infrastructures.
1361
1362         * UIProcess/WebPageProxy.cpp:
1363         (WebKit::WebPageProxy::initializeWebPage):
1364         * WebKit2.xcodeproj/project.pbxproj:
1365         * WebProcess/WebPage/WebPage.h:
1366         (WebKit::WebPage::disableICECandidateFiltering):
1367         (WebKit::WebPage::enableICECandidateFiltering):
1368         (WebKit::WebPage::disableEnumeratingAllNetworkInterfaces):
1369         (WebKit::WebPage::enableEnumeratingAllNetworkInterfaces):
1370         * WebProcess/WebPage/WebPage.messages.in:
1371
1372 2017-02-21  Youenn Fablet  <youenn@apple.com>
1373
1374         [WebRTC] NetworkRTCMonitor should ensure clearing its manager only once
1375         https://bugs.webkit.org/show_bug.cgi?id=168661
1376
1377         Reviewed by Alex Christensen.
1378
1379         Making sure NetworkRTCMonitor manager is cleared only once.
1380         ALso ensuring that manager does not get destroyed as part of NetworkRTCMonitor destructor.
1381         The manager needs to be destroyed in the RTC network thread.
1382
1383         * NetworkProcess/webrtc/NetworkRTCMonitor.cpp:
1384         (WebKit::NetworkRTCMonitor::~NetworkRTCMonitor):
1385         (WebKit::NetworkRTCMonitor::stopUpdating):
1386         * NetworkProcess/webrtc/NetworkRTCMonitor.h:
1387
1388 2017-02-21  Brent Fulgham  <bfulgham@apple.com>
1389
1390         [WebRTC][Mac][WebKit2] Revise sandbox to limit connections to UDP and TCP
1391         https://bugs.webkit.org/show_bug.cgi?id=168664
1392         <rdar://problem/30600587>
1393
1394         Reviewed by Youenn Fablet.
1395
1396         Add filters to the WebRTC rule to limit network traffic to UDP and TCP.
1397
1398         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1399
1400 2017-02-21  Maureen Daum  <mdaum@apple.com>
1401
1402         Check what LocalStorage data exists in deleteDatabasesModifiedSince() before attempting deletion.
1403         https://bugs.webkit.org/show_bug.cgi?id=168659
1404         rdar://problem/22781730
1405
1406         Reviewed by Brady Eidson.
1407
1408         Check what LocalStorage data exists in deleteDatabasesModifiedSince() before attempting deletion.
1409         It is possible that another process has caused information to be added to LocalStorage
1410         after we created this LocalStorageDatabaseTracker instance, so we should update our
1411         internal state by checking the contents of StorageTracker.db and the other local
1412         storage files so we know what databases actually exist. By calling importOriginIdentifiers()
1413         at the start of deleteDatabasesModifiedSince(), m_origins will now have the up-to-date
1414         list of origins LocalStorage contains data for.
1415
1416         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
1417         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
1418
1419 2017-02-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1420
1421         Reduce platform ifdefs in WebKit2 custom protocols implementation
1422         https://bugs.webkit.org/show_bug.cgi?id=165028
1423
1424         Reviewed by Darin Adler.
1425
1426         Make mac implementation use the APICustomProtocolManagerClient to share more code with the soup based ports.
1427
1428         * CMakeLists.txt: Add CustomProtocolManagerProxy.cpp.
1429         * PlatformEfl.cmake: Remove CustomProtocolManagerProxySoup.cpp.
1430         * PlatformGTK.cmake: Ditto.
1431         * PlatformMac.cmake: Remove CustomProtocolManagerProxyMac.mm.
1432         * UIProcess/API/APICustomProtocolManagerClient.h:
1433         (API::CustomProtocolManagerClient::startLoading): Make it void, since we were always returning true and the
1434         returned value was ignored.
1435         * UIProcess/API/efl/ewk_url_scheme_request.cpp:
1436         (EwkUrlSchemeRequest::finish): Update to new CustomProtocolManagerProxy API.
1437         * UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp:
1438         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
1439         (webkitURISchemeRequestReadCallback): Ditto.
1440         * UIProcess/Cocoa/CustomProtocolManagerClient.h: Added.
1441         * UIProcess/Cocoa/CustomProtocolManagerClient.mm: Added.
1442         (-[WKCustomProtocolLoader initWithCustomProtocolManagerProxy:customProtocolID:request:]):
1443         (-[WKCustomProtocolLoader dealloc]):
1444         (-[WKCustomProtocolLoader connection:didFailWithError:]):
1445         (-[WKCustomProtocolLoader connection:didReceiveResponse:]):
1446         (-[WKCustomProtocolLoader connection:didReceiveData:]):
1447         (-[WKCustomProtocolLoader connection:willSendRequest:redirectResponse:]):
1448         (-[WKCustomProtocolLoader connectionDidFinishLoading:]):
1449         (WebKit::CustomProtocolManagerClient::startLoading):
1450         (WebKit::CustomProtocolManagerClient::stopLoading):
1451         (WebKit::CustomProtocolManagerClient::invalidate):
1452         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1453         (WebKit::WebProcessPool::platformInitialize): Set the CustomProtocolManagerClient.
1454         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Remove code that is now shared.
1455         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.cpp: Added.
1456         (WebKit::CustomProtocolManagerProxy::startLoading):
1457         (WebKit::CustomProtocolManagerProxy::processDidClose):
1458         (WebKit::CustomProtocolManagerProxy::wasRedirectedToRequest):
1459         (WebKit::CustomProtocolManagerProxy::didReceiveResponse):
1460         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
1461         * UIProcess/WebProcessPool.cpp:
1462         (WebKit::globalURLSchemesWithCustomProtocolHandlers): Just moved here to use it from ensureNetworkProcess().
1463         (WebKit::WebProcessPool::WebProcessPool): Remove soup ifdefs.
1464         (WebKit::WebProcessPool::setCustomProtocolManagerClient): Moved from the soup implementation.
1465         (WebKit::WebProcessPool::ensureNetworkProcess): Initialize custom protocols parameters.
1466         (WebKit::WebProcessPool::registerSchemeForCustomProtocol): Register the protocol if not already registered globally.
1467         (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): Remove soup ifdefs.
1468         * UIProcess/WebProcessPool.h: Remove soup ifdefs.
1469         * UIProcess/efl/RequestManagerClientEfl.cpp:
1470         * UIProcess/soup/WebProcessPoolSoup.cpp:
1471         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Remove code that is now shared.
1472         * WebKit2.xcodeproj/project.pbxproj:
1473
1474 2017-02-21  Daewoong Jang  <daewoong.jang@navercorp.com>
1475
1476         Remove unused files.
1477         https://bugs.webkit.org/show_bug.cgi?id=168656.
1478
1479         Reviewed by Csaba Osztrogonác.
1480
1481         Remove files which became unused after removal of EFL port.
1482
1483         * UIProcess/CoordinatedGraphics/PageViewportController.cpp: Removed.
1484         * UIProcess/CoordinatedGraphics/PageViewportController.h: Removed.
1485         * UIProcess/PageViewportControllerClient.h: Removed.
1486
1487 2017-02-21  Youenn Fablet  <youenn@apple.com>
1488
1489         [WebRTC] LibWebRTCSocket::SendTo message should have a correct SocketAddress
1490         https://bugs.webkit.org/show_bug.cgi?id=168636
1491
1492         Reviewed by Eric Carlson.
1493
1494         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
1495         (WebKit::LibWebRTCSocket::SendTo): Ensuring address remains valid during SendTo message lifetime.
1496
1497 2017-02-21  Alex Christensen  <achristensen@webkit.org>
1498
1499         Unreviewed, rolling out r212699.
1500
1501         Internal build not ready
1502
1503         Reverted changeset:
1504
1505         "[WebRTC][Mac] Activate libwebrtc"
1506         https://bugs.webkit.org/show_bug.cgi?id=167293
1507         http://trac.webkit.org/changeset/212699
1508
1509 2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1510
1511         Remove ENABLE_THREADED_COMPOSITOR build option
1512         https://bugs.webkit.org/show_bug.cgi?id=168606
1513
1514         Reviewed by Michael Catanzaro.
1515
1516         Now that we have AC mode on demand with the threaded compositor there's no reason to keep the old AC code.
1517
1518         * PlatformGTK.cmake:
1519         * WebProcess/WebPage/LayerTreeHost.cpp:
1520         (WebKit::LayerTreeHost::create):
1521         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp: Removed.
1522         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h: Removed.
1523
1524 2017-02-20  Youenn Fablet  <youenn@apple.com>
1525
1526         [WebRTC][Mac] Activate libwebrtc
1527         https://bugs.webkit.org/show_bug.cgi?id=167293
1528         <rdar://problem/30401864>
1529
1530         Reviewed by Alex Christensen.
1531
1532         Activating PeerConnection runtime flag based on successful loading of libwebrtc.dylib.
1533
1534         * Configurations/WebKit.xcconfig:
1535         * Shared/WebPreferencesDefinitions.h:
1536         * UIProcess/WebPreferences.cpp:
1537         (WebKit::checkWebRTCAvailability):
1538
1539 2017-02-20  Ryan Haddad  <ryanhaddad@apple.com>
1540
1541         Unreviewed, rolling out r212685.
1542
1543         This change broke the 32-bit Sierra build.
1544
1545         Reverted changeset:
1546
1547         "Resource Load Statistics: Add alternate classification
1548         method"
1549         https://bugs.webkit.org/show_bug.cgi?id=168347
1550         http://trac.webkit.org/changeset/212685
1551
1552 2017-02-20  John Wilander  <wilander@apple.com>
1553
1554         Resource Load Statistics: Add alternate classification method
1555         https://bugs.webkit.org/show_bug.cgi?id=168347
1556         <rdar://problem/30352793>
1557
1558         Reviewed by Alex Christensen.
1559
1560         This patch adds a CorePrediction-based classifier to the WebResourceLoadStatisticsStore.
1561         The CorePrediction framework is introduced as a dependency for macOS and iOS. The patch
1562         also adds functions to support layout tests of the feature.
1563
1564         * Configurations/BaseTarget.xcconfig:
1565         * Configurations/WebKit.xcconfig:
1566             Added dependency on CorePrediction.
1567         * Platform/classifier: Added.
1568         * Platform/classifier/ResourceLoadStatisticsClassifier.h: Added.
1569             Pulls in the Cocoa-specific classifier for Cocoa-based platforms.
1570         (WebKit::ResourceLoadStatisticsClassifier::ResourceLoadStatisticsClassifier):
1571         * Platform/classifier/ResourceLoadStatisticsClassifierBase.cpp: Added.
1572         (WebKit::ResourceLoadStatisticsClassifierBase::hasPrevalentResourceCharacteristics):
1573             Shared classifier logic.
1574         (WebKit::ResourceLoadStatisticsClassifierBase::classifyWithVectorThreshold):
1575             Fallback classifier for when we don't have CorePrediction.
1576         * Platform/classifier/ResourceLoadStatisticsClassifierBase.h: Added.
1577         (WebKit::ResourceLoadStatisticsClassifierBase::ResourceLoadStatisticsClassifierBase):
1578         (WebKit::ResourceLoadStatisticsClassifierBase::~ResourceLoadStatisticsClassifierBase):
1579         * Platform/classifier/cocoa: Added.
1580         * Platform/classifier/cocoa/CorePredictionSPI.h: Added.
1581             Includes CorePrediction if available, otherwise declares needed symbols.
1582             Always redeclares the functions so we'll get a build error if
1583             CorePrediction changes.
1584         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.cpp: Added.
1585         (WebKit::ResourceLoadStatisticsClassifier::classify):
1586         (WebKit::ResourceLoadStatisticsClassifier::storagePath):
1587         (WebKit::ResourceLoadStatisticsClassifier::shouldUseCorePrediction):
1588             The new classifier for Cocoa platforms.
1589         * Platform/classifier/cocoa/ResourceLoadStatisticsClassifierCocoa.h: Added.
1590         (WebKit::ResourceLoadStatisticsClassifier::ResourceLoadStatisticsClassifier):
1591         * PlatformGTK.cmake:
1592            Added Platform/classifier directory and ResourceLoadStatisticsClassifierBase.cpp.
1593         * PlatformMac.cmake:
1594            Added Platform/classifier and Platform/classifier/cocoa directories, and
1595            source files ResourceLoadStatisticsClassifierBase.cpp and
1596            ResourceLoadStatisticsClassifierCocoa.cpp
1597         * Resources/ResourceLoadStatistics: Added.
1598         * Resources/ResourceLoadStatistics/corePrediction_model: Added.
1599             Model file to load into CorePrediction.
1600         * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp:
1601         (WKResourceLoadStatisticsManagerSetSubframeUnderTopFrameOrigin):
1602         (WKResourceLoadStatisticsManagerSetSubresourceUnderTopFrameOrigin):
1603         (WKResourceLoadStatisticsManagerSetSubresourceUniqueRedirectTo):
1604             Test infrastructure.
1605         * UIProcess/API/C/WKResourceLoadStatisticsManager.h:
1606         * UIProcess/WebResourceLoadStatisticsManager.cpp:
1607         (WebKit::WebResourceLoadStatisticsManager::setSubframeUnderTopFrameOrigin):
1608         (WebKit::WebResourceLoadStatisticsManager::setSubresourceUnderTopFrameOrigin):
1609         (WebKit::WebResourceLoadStatisticsManager::setSubresourceUniqueRedirectTo):
1610             Test infrastructure.
1611         * UIProcess/WebResourceLoadStatisticsManager.h:
1612         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1613         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
1614             Renamed m_storagePath to m_statisticsStoragePath for clarity.
1615         (WebKit::WebResourceLoadStatisticsStore::classifyResource):
1616             Now calls the classifier through its ResourceLoadStatisticsClassifier
1617             member variable.
1618         (WebKit::WebResourceLoadStatisticsStore::persistentStoragePath):
1619             Renamed m_storagePath to m_statisticsStoragePath for clarity.
1620         (WebKit::WebResourceLoadStatisticsStore::writeEncoderToDisk):
1621             Renamed m_storagePath to m_statisticsStoragePath for clarity.
1622         (WebKit::WebResourceLoadStatisticsStore::hasPrevalentResourceCharacteristics): Deleted.
1623         * UIProcess/WebResourceLoadStatisticsStore.h:
1624         * WebKit2.xcodeproj/project.pbxproj:
1625             Added the new classifier source files under Platform/classifier and the
1626             corePrediction_model file under Resources/ResourceLoadStatistics.
1627
1628 2017-02-20  Wenson Hsieh  <wenson_hsieh@apple.com>
1629
1630         Add plumbing to the UI process for TextIndicatorData when computing the drag image
1631         https://bugs.webkit.org/show_bug.cgi?id=168583
1632         Work towards <rdar://problem/30313681>
1633
1634         Reviewed by Tim Horton.
1635
1636         Changes the SetDragImage IPC message to send TextIndicatorData over to the UI process. Also changes the boolean
1637         isLink parameter to be a DragSourceAction instead, leaving it up to the receiving end (in the UI process) to
1638         special case links.
1639
1640         Additionally, renames hasDataInteractionAtPosition to hasSelectionAtPosition to better reflect its purpose.
1641
1642         These changes are only infrastructural should not alter any behaviors.
1643
1644         * Shared/ios/InteractionInformationAtPosition.h:
1645         * Shared/ios/InteractionInformationAtPosition.mm:
1646         (WebKit::InteractionInformationAtPosition::encode):
1647         (WebKit::InteractionInformationAtPosition::decode):
1648         * UIProcess/API/Cocoa/WKWebView.mm:
1649         (-[WKWebView _simulateDataInteractionGestureRecognized]):
1650         (-[WKWebView _simulateDataInteractionEntered:]):
1651         (-[WKWebView _simulateDataInteractionUpdated:]):
1652         (-[WKWebView _simulateDataInteractionPerformOperation:]):
1653         (-[WKWebView _simulateDataInteractionEnded:]):
1654         (-[WKWebView _simulateDataInteractionSessionDidEnd:withOperation:]):
1655         (-[WKWebView _simulateFailedDataInteractionWithIndex:]):
1656         (-[WKWebView _simulateWillBeginDataInteractionWithIndex:withSession:]):
1657         (-[WKWebView _simulatedItemsForDataInteractionWithIndex:]):
1658         * UIProcess/API/Cocoa/_WKTestingDelegate.h:
1659         * UIProcess/PageClient.h:
1660         * UIProcess/WebPageProxy.h:
1661         * UIProcess/WebPageProxy.messages.in:
1662         * UIProcess/ios/PageClientImplIOS.h:
1663         * UIProcess/ios/PageClientImplIOS.mm:
1664         (WebKit::PageClientImpl::setDragImage):
1665         (WebKit::PageClientImpl::startDataInteractionWithImage):
1666         * UIProcess/ios/WKContentViewInteraction.h:
1667         * UIProcess/ios/WKContentViewInteraction.mm:
1668         (-[WKContentView hasSelectablePositionAtPoint:]):
1669         (-[WKContentView pointIsInDataInteractionContent:]):
1670         (-[WKContentView _dataInteractionGestureRecognizer]):
1671         (-[WKContentView pointIsInAssistedNode:]):
1672         * UIProcess/mac/PageClientImpl.h:
1673         * UIProcess/mac/PageClientImpl.mm:
1674         (WebKit::PageClientImpl::setDragImage):
1675         * UIProcess/mac/WebPageProxyMac.mm:
1676         (WebKit::WebPageProxy::setDragImage):
1677         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
1678         (WebKit::WebDragClient::startDrag):
1679         * WebProcess/WebPage/ios/WebPageIOS.mm:
1680         (WebKit::WebPage::getPositionInformation):
1681
1682 2017-02-20  David Quesada  <david_quesada@apple.com>
1683
1684         Don’t set NSURLSessionConfiguration’s _sourceApplicationAuditTokenData if _sourceApplicationBundleIdentifier is also set.
1685         https://bugs.webkit.org/show_bug.cgi?id=168607
1686
1687         rdar://problem/30239618
1688
1689         Reviewed by Geoffrey Garen.
1690
1691         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1692         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1693         If the process pool configuration sets a source application bundle identifier, don't give the NSURLSession configuration
1694         the audit token from the UI process, as it may be associated with an application with a conflicting bundle identifier.
1695
1696 2017-02-20  Ryan Haddad  <ryanhaddad@apple.com>
1697
1698         Unreviewed, rolling out r212632.
1699
1700         This change appears to have caused API test failures.
1701
1702         Reverted changeset:
1703
1704         "Reduce platform ifdefs in WebKit2 custom protocols
1705         implementation"
1706         https://bugs.webkit.org/show_bug.cgi?id=165028
1707         http://trac.webkit.org/changeset/212632
1708
1709 2017-02-20  Youenn Fablet  <youenn@apple.com>
1710
1711         [WebRTC] Fix some memory leaks in libwebrtc binding code
1712         https://bugs.webkit.org/show_bug.cgi?id=168596
1713
1714         Reviewed by Eric Carlson.
1715
1716         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
1717         (WebKit::NetworkRTCProvider::OnMessage):
1718
1719 2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1720
1721         Remove code under USE(GRAPHICS_SURFACE)
1722         https://bugs.webkit.org/show_bug.cgi?id=168592
1723
1724         Reviewed by Michael Catanzaro.
1725
1726         This was only used by EFL port.
1727
1728         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
1729         (IPC::ArgumentCoder<CoordinatedGraphicsLayerState>::encode):
1730         (IPC::ArgumentCoder<CoordinatedGraphicsLayerState>::decode):
1731         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.h:
1732         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1733         (WebKit::CoordinatedGraphicsScene::syncPlatformLayerIfNeeded):
1734         (WebKit::CoordinatedGraphicsScene::deleteLayer):
1735         (WebKit::CoordinatedGraphicsScene::assignImageBackingToLayer):
1736         (WebKit::CoordinatedGraphicsScene::purgeGLResources):
1737         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1738         * Shared/CoordinatedGraphics/WebCoordinatedSurface.cpp:
1739         (WebKit::WebCoordinatedSurface::Handle::encode):
1740         (WebKit::WebCoordinatedSurface::Handle::decode):
1741         (WebKit::WebCoordinatedSurface::create):
1742         (WebKit::WebCoordinatedSurface::createGraphicsContext):
1743         (WebKit::WebCoordinatedSurface::createHandle):
1744         (WebKit::WebCoordinatedSurface::copyToTexture):
1745         * Shared/CoordinatedGraphics/WebCoordinatedSurface.h:
1746
1747 2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1748
1749         Reduce platform ifdefs in WebKit2 custom protocols implementation
1750         https://bugs.webkit.org/show_bug.cgi?id=165028
1751
1752         Reviewed by Darin Adler.
1753
1754         Make mac implementation use the APICustomProtocolManagerClient to share more code with the soup based ports.
1755
1756         * CMakeLists.txt: Add CustomProtocolManagerProxy.cpp.
1757         * PlatformEfl.cmake: Remove CustomProtocolManagerProxySoup.cpp.
1758         * PlatformGTK.cmake: Ditto.
1759         * PlatformMac.cmake: Remove CustomProtocolManagerProxyMac.mm.
1760         * UIProcess/API/APICustomProtocolManagerClient.h:
1761         (API::CustomProtocolManagerClient::startLoading): Make it void, since we were always returning true and the
1762         returned value was ignored.
1763         * UIProcess/API/efl/ewk_url_scheme_request.cpp:
1764         (EwkUrlSchemeRequest::finish): Update to new CustomProtocolManagerProxy API.
1765         * UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp:
1766         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
1767         (webkitURISchemeRequestReadCallback): Ditto.
1768         * UIProcess/Cocoa/CustomProtocolManagerClient.h: Added.
1769         * UIProcess/Cocoa/CustomProtocolManagerClient.mm: Added.
1770         (-[WKCustomProtocolLoader initWithCustomProtocolManagerProxy:customProtocolID:request:]):
1771         (-[WKCustomProtocolLoader dealloc]):
1772         (-[WKCustomProtocolLoader connection:didFailWithError:]):
1773         (-[WKCustomProtocolLoader connection:didReceiveResponse:]):
1774         (-[WKCustomProtocolLoader connection:didReceiveData:]):
1775         (-[WKCustomProtocolLoader connection:willSendRequest:redirectResponse:]):
1776         (-[WKCustomProtocolLoader connectionDidFinishLoading:]):
1777         (WebKit::CustomProtocolManagerClient::startLoading):
1778         (WebKit::CustomProtocolManagerClient::stopLoading):
1779         (WebKit::CustomProtocolManagerClient::invalidate):
1780         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1781         (WebKit::WebProcessPool::platformInitialize): Set the CustomProtocolManagerClient.
1782         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Remove code that is now shared.
1783         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.cpp: Added.
1784         (WebKit::CustomProtocolManagerProxy::startLoading):
1785         (WebKit::CustomProtocolManagerProxy::processDidClose):
1786         (WebKit::CustomProtocolManagerProxy::wasRedirectedToRequest):
1787         (WebKit::CustomProtocolManagerProxy::didReceiveResponse):
1788         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
1789         * UIProcess/WebProcessPool.cpp:
1790         (WebKit::globalURLSchemesWithCustomProtocolHandlers): Just moved here to use it from ensureNetworkProcess().
1791         (WebKit::WebProcessPool::WebProcessPool): Remove soup ifdefs.
1792         (WebKit::WebProcessPool::setCustomProtocolManagerClient): Moved from the soup implementation.
1793         (WebKit::WebProcessPool::ensureNetworkProcess): Initialize custom protocols parameters.
1794         (WebKit::WebProcessPool::registerSchemeForCustomProtocol): Register the protocol if not already registered globally.
1795         (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): Remove soup ifdefs.
1796         * UIProcess/WebProcessPool.h: Remove soup ifdefs.
1797         * UIProcess/efl/RequestManagerClientEfl.cpp:
1798         * UIProcess/soup/WebProcessPoolSoup.cpp:
1799         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Remove code that is now shared.
1800         * WebKit2.xcodeproj/project.pbxproj:
1801
1802 2017-02-20  Manuel Rego Casasnovas  <rego@igalia.com>
1803
1804         [css-grid] Remove compilation flag ENABLE_CSS_GRID_LAYOUT
1805         https://bugs.webkit.org/show_bug.cgi?id=167693
1806
1807         Reviewed by Sergio Villar Senin.
1808
1809         * Configurations/FeatureDefines.xcconfig:
1810         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1811         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1812         * WebProcess/WebPage/WebPage.cpp:
1813         (WebKit::WebPage::updatePreferences):
1814
1815 2017-02-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1816
1817         REGRESSION(r212345): [GTK] ASSERT(cookieChangeCallbackMap().contains(jar)) failed in WebCore::stopObservingCookieChanges:54
1818         https://bugs.webkit.org/show_bug.cgi?id=168375
1819
1820         Reviewed by Alex Christensen.
1821
1822         Simplify the cookies change notification. The current approach of the UI process telling the network process
1823         when to start and stop observing cookie changes is quite fragile and error prone. In the GTK+ port we always
1824         observe cookies, so our cookie manager always calls start in the constructor and stop in the destructor.
1825         Everything would be a lot simpler if the network process always monitored cookies.
1826
1827         * NetworkProcess/soup/NetworkSessionSoup.cpp:
1828         (WebKit::NetworkSessionSoup::NetworkSessionSoup): Set cookies observer handler for the session.
1829         (WebKit::NetworkSessionSoup::~NetworkSessionSoup): Remove the cookies observer handler.
1830         * UIProcess/API/gtk/WebKitCookieManager.cpp:
1831         (_WebKitCookieManagerPrivate::~_WebKitCookieManagerPrivate): Remove the cookies observer callback.
1832         (webkit_cookie_manager_class_init): Remove dispose implementation that is no longer needed.
1833         (webkitCookieManagerCreate): Set the cookies observer callback.
1834         (webkit_cookie_manager_set_persistent_storage): Remove code to start/stop observing cookies when the jar
1835         changes, the network process deals with that now.
1836         (webkitCookieManagerDispose): Deleted.
1837         * UIProcess/WebCookieManagerProxy.cpp:
1838         (WebKit::WebCookieManagerProxy::startObservingCookieChanges): Remove the optional callback method in favor of an
1839         explicit method to the set the callback that doesn't send the StartObservingCookieChanges message to the network
1840         process.
1841         (WebKit::WebCookieManagerProxy::stopObservingCookieChanges): Do not change the callback map here.
1842         (WebKit::WebCookieManagerProxy::setCookieObserverCallback): Add the callback to the map or remove the session if
1843         nullptr is given.
1844         * UIProcess/WebCookieManagerProxy.h:
1845         * WebProcess/Cookies/WebCookieManager.cpp:
1846         (WebKit::WebCookieManager::notifyCookiesDidChange): Send CookiesDidChange message to the UI process.
1847         (WebKit::WebCookieManager::startObservingCookieChanges): Use notifyCookiesDidChange().
1848         * WebProcess/Cookies/WebCookieManager.h:
1849         * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
1850         (WebKit::WebCookieManager::platformSetHTTPCookieAcceptPolicy): Set the policy on all sessions. Code moved from
1851         WebFrameNetworkingContext since it doesn't belong there.
1852         (WebKit::WebCookieManager::setCookiePersistentStorage): Use new method to set the cookie storage in the
1853         NetworkStorageSession.
1854         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
1855         (WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts): Deleted.
1856         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
1857
1858 2017-02-19  Chris Dumez  <cdumez@apple.com>
1859
1860         [WK2] Support termination of unresponsive WebContent processes that are in the background
1861         https://bugs.webkit.org/show_bug.cgi?id=168479
1862         <rdar://problem/30558745>
1863
1864         Reviewed by Antti Koivisto.
1865
1866         Support termination of unresponsive WebContent processes that are in the background.
1867         This protects us against cases where a background tab is unresponsive and has high CPU
1868         usage, thus draining the battery without the user knowing about it (e.g.
1869         <rdar://problem/29808005>).
1870
1871         The feature works as follows:
1872         - If a WebProcessProxy has pages but none of them are visible, then it will check
1873           regularly if its associated WebContent process is still responsive.
1874         - Every time we find that the WebContent process is responsive, we exponentially
1875           back off the timer to avoid waking up the process too often. The timer initially
1876           uses a 20 seconds interval and can back off up to 8 hours.
1877         - If the WebContent process is unresponsive, then we terminate it. No notification
1878           is shown to the user and the termination is not immediately observable since the
1879           tab is not visible and its title remains. The tab is not immediately reloaded
1880           so as to avoid getting back into a bad state in the background (and have a
1881           yo-yo effect).
1882         - If the user switches to a tab that was previously killed for being unresponsive
1883           while in the background, we will then reload the tab in a fresh WebContent
1884           process. The crash banner will only be shown if the tab has ever been visible.
1885           If it wasn't ever visible (e.g. session restore case), then it will look as if
1886           the tab loads for the first time when the user switches to it.
1887
1888         The functionality is disabled by default and can be enabled by the client via the new
1889         WKContextSetUnresponsiveBackgroundProcessesTerminationEnabled() private API.
1890
1891         * CMakeLists.txt:
1892         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1893         (API::ProcessPoolConfiguration::copy):
1894         * UIProcess/API/APIProcessPoolConfiguration.h:
1895         * UIProcess/API/C/WKContext.cpp:
1896         (WKContextSetUnresponsiveBackgroundProcessesTerminationEnabled):
1897         * UIProcess/API/C/WKContextPrivate.h:
1898         * UIProcess/UnresponsiveWebProcessTerminator.cpp: Added.
1899         (WebKit::UnresponsiveWebProcessTerminator::UnresponsiveWebProcessTerminator):
1900         (WebKit::UnresponsiveWebProcessTerminator::updateState):
1901         (WebKit::pagesCopy):
1902         (WebKit::UnresponsiveWebProcessTerminator::timerFired):
1903         * UIProcess/UnresponsiveWebProcessTerminator.h: Added.
1904         (WebKit::UnresponsiveWebProcessTerminator::shouldBeActive):
1905         * UIProcess/WebPageProxy.cpp:
1906         (WebKit::WebPageProxy::reattachToWebProcess):
1907         (WebKit::WebPageProxy::reloadAfterBeingKilledInBackground):
1908         (WebKit::WebPageProxy::dispatchActivityStateChange):
1909         (WebKit::WebPageProxy::terminateProcess):
1910         (WebKit::WebPageProxy::resetStateAfterProcessExited):
1911         * UIProcess/WebPageProxy.h:
1912         * UIProcess/WebProcessProxy.cpp:
1913         (WebKit::WebProcessProxy::WebProcessProxy):
1914         (WebKit::m_backgroundResponsivenessTimer):
1915         (WebKit::WebProcessProxy::createWebPage):
1916         (WebKit::WebProcessProxy::addExistingWebPage):
1917         (WebKit::WebProcessProxy::removeWebPage):
1918         (WebKit::WebProcessProxy::updateBackgroundResponsivenessTimer):
1919         * UIProcess/WebProcessProxy.h:
1920         (WebKit::WebProcessProxy::visiblePageCount):
1921         * WebKit2.xcodeproj/project.pbxproj:
1922
1923 2017-02-18  Michael Catanzaro  <mcatanzaro@igalia.com>
1924
1925         Remove COORDINATED_GRAPHICS_MULTIPROCESS
1926         https://bugs.webkit.org/show_bug.cgi?id=168514
1927
1928         Reviewed by Darin Adler.
1929
1930         * Shared/DrawingAreaInfo.h:
1931         * UIProcess/API/C/CoordinatedGraphics/WKView.cpp:
1932         (WKViewFindZoomableAreaForRect):
1933         * UIProcess/AcceleratedDrawingAreaProxy.cpp:
1934         (WebKit::AcceleratedDrawingAreaProxy::AcceleratedDrawingAreaProxy):
1935         * UIProcess/AcceleratedDrawingAreaProxy.h:
1936         (WebKit::AcceleratedDrawingAreaProxy::coordinatedLayerTreeHostProxy): Deleted.
1937         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.cpp: Removed.
1938         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.h: Removed.
1939         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in: Removed.
1940         * UIProcess/CoordinatedGraphics/PageViewportController.cpp:
1941         (WebKit::PageViewportController::pageTransitionViewportReady):
1942         * UIProcess/CoordinatedGraphics/WebPageProxyCoordinatedGraphics.cpp: Removed.
1943         * UIProcess/DrawingAreaProxy.h:
1944         * UIProcess/PageClient.h:
1945         * UIProcess/WebPageProxy.cpp:
1946         (WebKit::WebPageProxy::pageDidRequestScroll): Deleted.
1947         (WebKit::WebPageProxy::pageTransitionViewportReady): Deleted.
1948         (WebKit::WebPageProxy::didRenderFrame): Deleted.
1949         (WebKit::WebPageProxy::commitPageTransitionViewport): Deleted.
1950         * UIProcess/WebPageProxy.h:
1951         * UIProcess/WebPageProxy.messages.in:
1952         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
1953         (WebKit::AcceleratedDrawingArea::AcceleratedDrawingArea):
1954         (WebKit::AcceleratedDrawingArea::updateBackingStoreState):
1955         (WebKit::AcceleratedDrawingArea::didReceiveCoordinatedLayerTreeHostMessage): Deleted.
1956         * WebProcess/WebPage/AcceleratedDrawingArea.h:
1957         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
1958         (WebKit::CoordinatedLayerTreeHost::CoordinatedLayerTreeHost):
1959         (WebKit::CoordinatedLayerTreeHost::commitSceneState):
1960         (WebKit::CoordinatedLayerTreeHost::createCoordinatedSurface):
1961         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1962         * WebProcess/WebPage/CoordinatedGraphics/WebPageCoordinatedGraphics.cpp: Removed.
1963         * WebProcess/WebPage/DrawingArea.cpp:
1964         (WebKit::DrawingArea::create):
1965         * WebProcess/WebPage/DrawingArea.h:
1966         * WebProcess/WebPage/LayerTreeHost.cpp:
1967         (WebKit::LayerTreeHost::create):
1968         * WebProcess/WebPage/LayerTreeHost.h:
1969         * WebProcess/WebPage/WebPage.cpp:
1970         (WebKit::WebPage::~WebPage):
1971         (WebKit::WebPage::pageDidRequestScroll):
1972         (WebKit::WebPage::didCompletePageTransition):
1973         (WebKit::WebPage::didReceiveMessage):
1974         (WebKit::WebPage::commitPageTransitionViewport): Deleted.
1975         * WebProcess/WebPage/WebPage.h:
1976         * WebProcess/WebPage/WebPage.messages.in:
1977
1978 2017-02-18  Michael Catanzaro  <mcatanzaro@igalia.com>
1979
1980         [GTK] Cannot paste primary selection into web view in Wayland
1981         https://bugs.webkit.org/show_bug.cgi?id=166949
1982
1983         Reviewed by Carlos Garcia Campos.
1984
1985         Once upon a time, primary selection (middle-click paste) was not supported in Wayland. At
1986         the time, I changed this function to report that primary selection was unsupported. But
1987         nowadays, primary selection works fine in all GTK+ applications except WebKit. All we have
1988         to do to make it work in WebKit is change this return value.
1989
1990         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1991         (WebKit::WebEditorClient::supportsGlobalSelection):
1992
1993 2017-02-17  Brian Burg  <bburg@apple.com>
1994
1995         Web Inspector: RTL: Inspector window should dock to the left when using RTL layout direction
1996         https://bugs.webkit.org/show_bug.cgi?id=168273
1997         <rdar://problem/29949325>
1998
1999         Reviewed by Matt Baker.
2000
2001         Add the ability to dock Web Inspector to the left of the inspected view.
2002         The frontend decides whether the Dock to Side button docks left or right
2003         based on the current layout direction.
2004
2005         * UIProcess/WebInspectorProxy.cpp:
2006         (WebKit::WebInspectorProxy::attachLeft):
2007         (WebKit::WebInspectorProxy::attach):
2008         (WebKit::WebInspectorProxy::createInspectorPage):
2009         * UIProcess/WebInspectorProxy.h:
2010         * UIProcess/WebInspectorProxy.messages.in:
2011         Add plumbing for new dock configuration.
2012
2013         * UIProcess/mac/WebInspectorProxyMac.mm:
2014         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2015         (WebKit::WebInspectorProxy::inspectedViewFrameDidChange):
2016         (WebKit::WebInspectorProxy::platformAttach):
2017         Adapt existing sizing logic to work for docking to left.
2018
2019         * WebProcess/WebPage/WebInspectorUI.cpp:
2020         (WebKit::WebInspectorUI::requestSetDockSide):
2021         (WebKit::WebInspectorUI::setDockSide):
2022         * WebProcess/WebPage/WebInspectorUI.h:
2023         (WebKit::WebInspectorUI::attachedLeft):
2024         * WebProcess/WebPage/WebInspectorUI.messages.in:
2025         Add plumbing for new dock configuration.
2026
2027 2017-02-16  Simon Fraser  <simon.fraser@apple.com>
2028
2029         Allow PlatformCALayers to specify that they want deep color backing store
2030         https://bugs.webkit.org/show_bug.cgi?id=168495
2031
2032         Reviewed by Tim Horton.
2033
2034         Currently capable iOS devices get deep color backing store by virtue of a supports
2035         check in PlatformCALayerCocoa::PlatformCALayerCocoa(), and LegacyTileGridTile.
2036
2037         Future work will make layer contents format selection more complex, so express the need
2038         for deep color on PlatformCALayer, and have the creators of PlatformCALayer (mainly the
2039         flavors of GraphicsLayerCA) choose for them to support deep color. A bit of special-casing
2040         is needed to propagte the state to TileControllers.
2041         
2042         The deep-colorness now propagates from PlatformCALayerRemote to RemoteLayerBackingStore,
2043         instead of RemoteLayerBackingStore looking at the properties of the screen directly.
2044
2045         Remove PlatformCALayer::LayerTypeWebTiledLayer which was only used for the old CATiledLayers
2046         that we no longer use.
2047
2048         * Shared/mac/RemoteLayerBackingStore.h:
2049         * Shared/mac/RemoteLayerBackingStore.mm:
2050         (WebKit::RemoteLayerBackingStore::ensureBackingStore):
2051         (WebKit::RemoteLayerBackingStore::bytesPerPixel):
2052         (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
2053         (WebKit::RemoteLayerBackingStore::drawInContext):
2054         (WebKit::RemoteLayerBackingStore::surfaceBufferFormat):
2055         (WebKit::bufferFormat): Deleted.
2056         * WebProcess/WebPage/mac/GraphicsLayerCARemote.cpp:
2057         (WebKit::GraphicsLayerCARemote::createPlatformCALayer):
2058         * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
2059         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
2060         (WebKit::PlatformCALayerRemote::PlatformCALayerRemote):
2061         (WebKit::PlatformCALayerRemote::updateBackingStore):
2062         (WebKit::PlatformCALayerRemote::wantsDeepColorBackingStore):
2063         (WebKit::PlatformCALayerRemote::setWantsDeepColorBackingStore):
2064         * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
2065         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.cpp:
2066         (WebKit::PlatformCALayerRemoteTiledBacking::wantsDeepColorBackingStore):
2067         (WebKit::PlatformCALayerRemoteTiledBacking::setWantsDeepColorBackingStore):
2068         * WebProcess/WebPage/mac/PlatformCALayerRemoteTiledBacking.h:
2069
2070 2017-02-17  Wenson Hsieh  <wenson_hsieh@apple.com>
2071
2072         [WK2] Action sheet should not dismiss when a DDAction with user interface is being presented
2073         https://bugs.webkit.org/show_bug.cgi?id=168528
2074         <rdar://problem/30515324>
2075
2076         Reviewed by Beth Dakin.
2077
2078         After r211643, -[WKActionSheet doneWithSheet] now dismisses the presenting view controller. This is called when
2079         interaction with the sheet is finished and is a reasonable thing to do in most cases. However, when using data
2080         detectors, we don't want to dismiss the presenting view controller, since DataDetector handles dismissing on its
2081         own and expects that its completion handler will be invoked.
2082
2083         To fix this, we add a parameter to doneWithSheet: to indicate whether or not we should additionally dismiss the
2084         presenting view controller, and pass in NO in the case where we are handing control over to DataDetector.
2085
2086         * UIProcess/ios/WKActionSheet.h:
2087         * UIProcess/ios/WKActionSheet.mm:
2088         (-[WKActionSheet doneWithSheet:]):
2089         (-[WKActionSheet doneWithSheet]): Deleted.
2090         * UIProcess/ios/WKActionSheetAssistant.mm:
2091         (-[WKActionSheetAssistant showDataDetectorsSheet]):
2092         (-[WKActionSheetAssistant cleanupSheet]):
2093
2094 2017-02-17  Michael Catanzaro  <mcatanzaro@igalia.com>
2095
2096         Remove EFL from WebKit2
2097         https://bugs.webkit.org/show_bug.cgi?id=168511
2098
2099         Reviewed by Alex Christensen.
2100
2101         * Platform/IPC/unix/ConnectionUnix.cpp:
2102         (IPC::Connection::platformInvalidate):
2103         (IPC::Connection::open):
2104         * Platform/Module.h:
2105         * PlatformEfl.cmake: Removed.
2106         * PluginProcess/unix/PluginProcessMainUnix.cpp:
2107         * Shared/API/APIObject.h:
2108         * Shared/API/c/WKBase.h:
2109         * Shared/API/c/WKSharedAPICast.h:
2110         (WebKit::toAPI):
2111         (WebKit::toImpl):
2112         * Shared/NativeWebKeyboardEvent.h:
2113         (WebKit::NativeWebKeyboardEvent::isFakeEventForComposition):
2114         (WebKit::NativeWebKeyboardEvent::isFiltered): Deleted.
2115         * Shared/NativeWebMouseEvent.h:
2116         (WebKit::NativeWebMouseEvent::nativeEvent):
2117         (WebKit::NativeWebMouseEvent::NativeWebMouseEvent): Deleted.
2118         * Shared/NativeWebTouchEvent.h:
2119         (WebKit::NativeWebTouchEvent::nativeEvent):
2120         * Shared/NativeWebWheelEvent.h:
2121         (WebKit::NativeWebWheelEvent::nativeEvent):
2122         * Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp:
2123         (WebKit::NetscapePluginModule::determineQuirks):
2124         * Shared/WebPreferencesDefinitions.h:
2125         * UIProcess/API/APIWebsiteDataStore.cpp:
2126         * UIProcess/API/C/WKAPICast.h:
2127         * UIProcess/API/C/WKTextChecker.cpp:
2128         * UIProcess/API/C/WKTextChecker.h:
2129         * UIProcess/ChildProcessProxy.cpp:
2130         (WebKit::ChildProcessProxy::getLaunchOptions):
2131         * UIProcess/CoordinatedGraphics/PageViewportController.cpp:
2132         (WebKit::PageViewportController::pixelAlignedFloatPoint):
2133         * UIProcess/InspectorServer/WebInspectorServer.h:
2134         * UIProcess/Launcher/ProcessLauncher.h:
2135         * UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp:
2136         * UIProcess/PageClient.h:
2137         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
2138         (WebKit::PluginProcessProxy::scanPlugin):
2139         * UIProcess/WebInspectorProxy.h:
2140         * UIProcess/WebPageProxy.h:
2141         * WebKit2.xcodeproj/project.pbxproj:
2142         * WebProcess/InjectedBundle/InjectedBundle.h:
2143         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
2144         (WebKit::getPluginDisplay):
2145         (WebKit::x11Screen):
2146         (WebKit::displayDepth):
2147         (WebKit::rootWindowID):
2148         (WebKit::NetscapePluginX11::paint):
2149         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2150         (WebKit::WebChromeClient::selectItemWritingDirectionIsNatural):
2151         (WebKit::WebChromeClient::pageExtendedBackgroundColorDidChange):
2152         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2153         (WebKit::WebEditorClient::shouldEraseMarkersAfterChangeSelection):
2154         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2155         (WebKit::WebFrameLoaderClient::saveViewStateToItem):
2156         (WebKit::WebFrameLoaderClient::restoreViewState):
2157         (WebKit::WebFrameLoaderClient::dispatchDidClearWindowObjectInWorld):
2158         * WebProcess/WebPage/WebPage.cpp:
2159         (WebKit::WebPage::WebPage):
2160         * WebProcess/WebPage/WebPage.h:
2161         * WebProcess/WebPage/WebPage.messages.in:
2162         * config.h:
2163
2164 2017-02-15  Brady Eidson  <beidson@apple.com>
2165
2166         Stop backing up localStorage databases to iCloud by default.
2167         <rdar://problem/29045531> and https://bugs.webkit.org/show_bug.cgi?id=168388
2168
2169         Reviewed by Geoffrey Garen.
2170
2171         * UIProcess/Cocoa/VersionChecks.h:
2172
2173         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
2174         (WebKit::LocalStorageDatabaseTracker::databasePath):
2175         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
2176         * UIProcess/Storage/ios/LocalStorageDatabaseTrackerIOS.mm: Copied from Source/WebKit2/UIProcess/Cocoa/VersionChecks.h.
2177         (WebKit::LocalStorageDatabaseTracker::platformExcludeFromBackup):
2178
2179         * WebKit2.xcodeproj/project.pbxproj:
2180
2181 2017-02-16  Aakash Jain  <aakash_jain@apple.com>
2182
2183         Remove unused methods WKPageGetDebugPaintFlags and WKPageSetDebugPaintFlags
2184         https://bugs.webkit.org/show_bug.cgi?id=168464
2185
2186         Reviewed by Alexey Proskuryakov.
2187
2188         * UIProcess/API/C/WKPagePrivate.h:
2189
2190 2017-02-16  Youenn Fablet  <youenn@apple.com>
2191
2192         [WebRTC] libwebrtc socket addresses should not be passed as strings
2193         https://bugs.webkit.org/show_bug.cgi?id=168474
2194
2195         Reviewed by Alex Christensen.
2196
2197         Removing all seralization of socket addresses as strings.
2198         Instead, a dedicated serialization is provided.
2199         This allows proper handling of various cases like addresses with both hostnames and resolved IPs.
2200
2201         * NetworkProcess/webrtc/LibWebRTCSocketClient.cpp:
2202         (WebKit::LibWebRTCSocketClient::signalReadPacket):
2203         (WebKit::LibWebRTCSocketClient::signalSentPacket):
2204         (WebKit::LibWebRTCSocketClient::signalAddressReady):
2205         * NetworkProcess/webrtc/NetworkRTCProvider.cpp:
2206         (WebKit::NetworkRTCProvider::createUDPSocket):
2207         (WebKit::NetworkRTCProvider::createServerTCPSocket):
2208         (WebKit::NetworkRTCProvider::createClientTCPSocket):
2209         * NetworkProcess/webrtc/NetworkRTCProvider.h:
2210         * NetworkProcess/webrtc/NetworkRTCProvider.messages.in:
2211         * NetworkProcess/webrtc/NetworkRTCSocket.cpp:
2212         (WebKit::NetworkRTCSocket::sendTo):
2213         * NetworkProcess/webrtc/NetworkRTCSocket.h:
2214         * NetworkProcess/webrtc/NetworkRTCSocket.messages.in:
2215         * Shared/RTCNetwork.cpp:
2216         (WebKit::RTCNetwork::SocketAddress::decode):
2217         (WebKit::RTCNetwork::SocketAddress::encode):
2218         * Shared/RTCNetwork.h:
2219         (WebKit::RTCNetwork::SocketAddress::SocketAddress):
2220         * WebProcess/Network/webrtc/LibWebRTCSocket.cpp:
2221         (WebKit::LibWebRTCSocket::signalAddressReady):
2222         (WebKit::LibWebRTCSocket::SendTo):
2223         * WebProcess/Network/webrtc/LibWebRTCSocket.h:
2224         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
2225         (WebKit::LibWebRTCSocketFactory::CreateServerTcpSocket):
2226         (WebKit::LibWebRTCSocketFactory::CreateUdpSocket):
2227         (WebKit::LibWebRTCSocketFactory::CreateClientTcpSocket):
2228         * WebProcess/Network/webrtc/WebRTCSocket.cpp:
2229         (WebKit::WebRTCSocket::signalAddressReady):
2230         * WebProcess/Network/webrtc/WebRTCSocket.h:
2231         * WebProcess/Network/webrtc/WebRTCSocket.messages.in:
2232
2233 2017-02-16  Daniel Bates  <dabates@apple.com>
2234
2235         Remove Chromium-specific code to call FrameLoaderClient::redirectDataToPlugin(nullptr)
2236         https://bugs.webkit.org/show_bug.cgi?id=168417
2237         <rdar://problem/30541748>
2238
2239         Reviewed by Brent Fulgham.
2240
2241         Update override of FrameLoaderClient::redirectDataToPlugin() to take a Widget& instead of a
2242         Widget* as it is always called with a valid Widget.
2243
2244         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2245         (WebKit::WebFrameLoaderClient::redirectDataToPlugin):
2246         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2247         * mac/WebKit2.order: Remove symbol for WebFrameLoaderClient::redirectDataToPlugin() that took a Widget*
2248         as it no longer exists. I am unclear if this file is still meaningful as it was last modified in
2249         r180570 (2 years ago) though Xcode still references this ordering file (why?).
2250
2251 2017-02-16  Alex Christensen  <achristensen@webkit.org>
2252
2253         Remove EFL-specific files in WebKit2.
2254
2255         Rubber-stamped by Anders Carlsson
2256
2257         * DatabaseProcess/efl: Removed.
2258         * DatabaseProcess/efl/DatabaseProcessMainEfl.cpp: Removed.
2259         * NetworkProcess/Downloads/efl: Removed.
2260         * NetworkProcess/Downloads/efl/DownloadSoupErrorsEfl.cpp: Removed.
2261         * NetworkProcess/efl: Removed.
2262         * NetworkProcess/efl/NetworkProcessMainEfl.cpp: Removed.
2263         * Platform/efl: Removed.
2264         * Platform/efl/ModuleEfl.cpp: Removed.
2265         * Shared/API/c/efl: Removed.
2266         * Shared/API/c/efl/WKArrayEfl.cpp: Removed.
2267         * Shared/API/c/efl/WKArrayEfl.h: Removed.
2268         * Shared/API/c/efl/WKBaseEfl.h: Removed.
2269         * Shared/efl: Removed.
2270         * Shared/efl/NativeWebKeyboardEventEfl.cpp: Removed.
2271         * Shared/efl/NativeWebTouchEventEfl.cpp: Removed.
2272         * Shared/efl/NativeWebWheelEventEfl.cpp: Removed.
2273         * Shared/efl/ProcessExecutablePathEfl.cpp: Removed.
2274         * Shared/efl/WebEventFactory.cpp: Removed.
2275         * Shared/efl/WebEventFactory.h: Removed.
2276         * UIProcess/API/C/efl: Removed.
2277         * UIProcess/API/C/efl/WKAPICastEfl.h: Removed.
2278         * UIProcess/API/C/efl/WKColorPickerResultListener.cpp: Removed.
2279         * UIProcess/API/C/efl/WKColorPickerResultListener.h: Removed.
2280         * UIProcess/API/C/efl/WKEventEfl.cpp: Removed.
2281         * UIProcess/API/C/efl/WKEventEfl.h: Removed.
2282         * UIProcess/API/C/efl/WKViewEfl.cpp: Removed.
2283         * UIProcess/API/C/efl/WKViewEfl.h: Removed.
2284         * UIProcess/API/cpp/efl: Removed.
2285         * UIProcess/API/cpp/efl/WKEinaSharedString.cpp: Removed.
2286         * UIProcess/API/cpp/efl/WKEinaSharedString.h: Removed.
2287         * UIProcess/API/efl: Removed.
2288         * UIProcess/API/efl/APIWebsiteDataStoreEfl.cpp: Removed.
2289         * UIProcess/API/efl/EWebKit2.h.in: Removed.
2290         * UIProcess/API/efl/EwkView.cpp: Removed.
2291         * UIProcess/API/efl/EwkView.h: Removed.
2292         * UIProcess/API/efl/EwkViewCallbacks.h: Removed.
2293         * UIProcess/API/efl/GestureRecognizer.cpp: Removed.
2294         * UIProcess/API/efl/GestureRecognizer.h: Removed.
2295         * UIProcess/API/efl/SnapshotImageGL.cpp: Removed.
2296         * UIProcess/API/efl/SnapshotImageGL.h: Removed.
2297         * UIProcess/API/efl/WebAccessibility.cpp: Removed.
2298         * UIProcess/API/efl/WebAccessibility.h: Removed.
2299         * UIProcess/API/efl/ewk_application_cache_manager.cpp: Removed.
2300         * UIProcess/API/efl/ewk_application_cache_manager.h: Removed.
2301         * UIProcess/API/efl/ewk_application_cache_manager_private.h: Removed.
2302         * UIProcess/API/efl/ewk_auth_request.cpp: Removed.
2303         * UIProcess/API/efl/ewk_auth_request.h: Removed.
2304         * UIProcess/API/efl/ewk_auth_request_private.h: Removed.
2305         * UIProcess/API/efl/ewk_back_forward_list.cpp: Removed.
2306         * UIProcess/API/efl/ewk_back_forward_list.h: Removed.
2307         * UIProcess/API/efl/ewk_back_forward_list_item.cpp: Removed.
2308         * UIProcess/API/efl/ewk_back_forward_list_item.h: Removed.
2309         * UIProcess/API/efl/ewk_back_forward_list_item_private.h: Removed.
2310         * UIProcess/API/efl/ewk_back_forward_list_private.h: Removed.
2311         * UIProcess/API/efl/ewk_color_picker.cpp: Removed.
2312         * UIProcess/API/efl/ewk_color_picker.h: Removed.
2313         * UIProcess/API/efl/ewk_color_picker_private.h: Removed.
2314         * UIProcess/API/efl/ewk_context.cpp: Removed.
2315         * UIProcess/API/efl/ewk_context.h: Removed.
2316         * UIProcess/API/efl/ewk_context_menu.cpp: Removed.
2317         * UIProcess/API/efl/ewk_context_menu.h: Removed.
2318         * UIProcess/API/efl/ewk_context_menu_item.cpp: Removed.
2319         * UIProcess/API/efl/ewk_context_menu_item.h: Removed.
2320         * UIProcess/API/efl/ewk_context_menu_item_private.h: Removed.
2321         * UIProcess/API/efl/ewk_context_menu_private.h: Removed.
2322         * UIProcess/API/efl/ewk_context_private.h: Removed.
2323         * UIProcess/API/efl/ewk_cookie_manager.cpp: Removed.
2324         * UIProcess/API/efl/ewk_cookie_manager.h: Removed.
2325         * UIProcess/API/efl/ewk_cookie_manager_private.h: Removed.
2326         * UIProcess/API/efl/ewk_database_manager.cpp: Removed.
2327         * UIProcess/API/efl/ewk_database_manager.h: Removed.
2328         * UIProcess/API/efl/ewk_database_manager_private.h: Removed.
2329         * UIProcess/API/efl/ewk_download_job.cpp: Removed.
2330         * UIProcess/API/efl/ewk_download_job.h: Removed.
2331         * UIProcess/API/efl/ewk_download_job_private.h: Removed.
2332         * UIProcess/API/efl/ewk_error.cpp: Removed.
2333         * UIProcess/API/efl/ewk_error.h: Removed.
2334         * UIProcess/API/efl/ewk_error_private.h: Removed.
2335         * UIProcess/API/efl/ewk_favicon_database.cpp: Removed.
2336         * UIProcess/API/efl/ewk_favicon_database.h: Removed.
2337         * UIProcess/API/efl/ewk_favicon_database_private.h: Removed.
2338         * UIProcess/API/efl/ewk_file_chooser_request.cpp: Removed.
2339         * UIProcess/API/efl/ewk_file_chooser_request.h: Removed.
2340         * UIProcess/API/efl/ewk_file_chooser_request_private.h: Removed.
2341         * UIProcess/API/efl/ewk_form_submission_request.cpp: Removed.
2342         * UIProcess/API/efl/ewk_form_submission_request.h: Removed.
2343         * UIProcess/API/efl/ewk_form_submission_request_private.h: Removed.
2344         * UIProcess/API/efl/ewk_intro.h: Removed.
2345         * UIProcess/API/efl/ewk_main.cpp: Removed.
2346         * UIProcess/API/efl/ewk_main.h: Removed.
2347         * UIProcess/API/efl/ewk_main_private.h: Removed.
2348         * UIProcess/API/efl/ewk_navigation_data.cpp: Removed.
2349         * UIProcess/API/efl/ewk_navigation_data.h: Removed.
2350         * UIProcess/API/efl/ewk_navigation_data_private.h: Removed.
2351         * UIProcess/API/efl/ewk_navigation_policy_decision.cpp: Removed.
2352         * UIProcess/API/efl/ewk_navigation_policy_decision.h: Removed.
2353         * UIProcess/API/efl/ewk_navigation_policy_decision_private.h: Removed.
2354         * UIProcess/API/efl/ewk_object.cpp: Removed.
2355         * UIProcess/API/efl/ewk_object.h: Removed.
2356         * UIProcess/API/efl/ewk_object_private.h: Removed.
2357         * UIProcess/API/efl/ewk_page_group.cpp: Removed.
2358         * UIProcess/API/efl/ewk_page_group.h: Removed.
2359         * UIProcess/API/efl/ewk_page_group_private.h: Removed.
2360         * UIProcess/API/efl/ewk_popup_menu.cpp: Removed.
2361         * UIProcess/API/efl/ewk_popup_menu.h: Removed.
2362         * UIProcess/API/efl/ewk_popup_menu_item.cpp: Removed.
2363         * UIProcess/API/efl/ewk_popup_menu_item.h: Removed.
2364         * UIProcess/API/efl/ewk_popup_menu_item_private.h: Removed.
2365         * UIProcess/API/efl/ewk_popup_menu_private.h: Removed.
2366         * UIProcess/API/efl/ewk_security_origin.cpp: Removed.
2367         * UIProcess/API/efl/ewk_security_origin.h: Removed.
2368         * UIProcess/API/efl/ewk_security_origin_private.h: Removed.
2369         * UIProcess/API/efl/ewk_settings.cpp: Removed.
2370         * UIProcess/API/efl/ewk_settings.h: Removed.
2371         * UIProcess/API/efl/ewk_settings_private.h: Removed.
2372         * UIProcess/API/efl/ewk_storage_manager.cpp: Removed.
2373         * UIProcess/API/efl/ewk_storage_manager.h: Removed.
2374         * UIProcess/API/efl/ewk_storage_manager_private.h: Removed.
2375         * UIProcess/API/efl/ewk_text_checker.cpp: Removed.
2376         * UIProcess/API/efl/ewk_text_checker.h: Removed.
2377         * UIProcess/API/efl/ewk_text_checker_private.h: Removed.
2378         * UIProcess/API/efl/ewk_touch.h: Removed.
2379         * UIProcess/API/efl/ewk_url_request.cpp: Removed.
2380         * UIProcess/API/efl/ewk_url_request.h: Removed.
2381         * UIProcess/API/efl/ewk_url_request_private.h: Removed.
2382         * UIProcess/API/efl/ewk_url_response.cpp: Removed.
2383         * UIProcess/API/efl/ewk_url_response.h: Removed.
2384         * UIProcess/API/efl/ewk_url_response_private.h: Removed.
2385         * UIProcess/API/efl/ewk_url_scheme_request.cpp: Removed.
2386         * UIProcess/API/efl/ewk_url_scheme_request.h: Removed.
2387         * UIProcess/API/efl/ewk_url_scheme_request_private.h: Removed.
2388         * UIProcess/API/efl/ewk_view.cpp: Removed.
2389         * UIProcess/API/efl/ewk_view.h: Removed.
2390         * UIProcess/API/efl/ewk_view_configuration.cpp: Removed.
2391         * UIProcess/API/efl/ewk_view_configuration.h: Removed.
2392         * UIProcess/API/efl/ewk_view_configuration_private.h: Removed.
2393         * UIProcess/API/efl/ewk_view_private.h: Removed.
2394         * UIProcess/API/efl/ewk_window_features.cpp: Removed.
2395         * UIProcess/API/efl/ewk_window_features.h: Removed.
2396         * UIProcess/API/efl/ewk_window_features_private.h: Removed.
2397         * UIProcess/API/efl/tests: Removed.
2398         * UIProcess/API/efl/tests/UnitTestUtils: Removed.
2399         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.cpp: Removed.
2400         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestBase.h: Removed.
2401         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.cpp: Removed.
2402         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.h: Removed.
2403         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestMain.cpp: Removed.
2404         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestServer.cpp: Removed.
2405         * UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestServer.h: Removed.
2406         * UIProcess/API/efl/tests/extensions: Removed.
2407         * UIProcess/API/efl/tests/extensions/extension_sample.cpp: Removed.
2408         * UIProcess/API/efl/tests/resources: Removed.
2409         * UIProcess/API/efl/tests/resources/Page1.html: Removed.
2410         * UIProcess/API/efl/tests/resources/Page2.html: Removed.
2411         * UIProcess/API/efl/tests/resources/Page3.html: Removed.
2412         * UIProcess/API/efl/tests/resources/blank.ico: Removed.
2413         * UIProcess/API/efl/tests/resources/default_test_page.html: Removed.
2414         * UIProcess/API/efl/tests/resources/empty_theme.edj: Removed.
2415         * UIProcess/API/efl/tests/resources/file_chooser.html: Removed.
2416         * UIProcess/API/efl/tests/resources/frame_flattening_test.html: Removed.
2417         * UIProcess/API/efl/tests/resources/frame_flattening_test_subframe.html: Removed.
2418         * UIProcess/API/efl/tests/resources/local_file_access.html: Removed.
2419         * UIProcess/API/efl/tests/resources/redirect_url_to_default.html: Removed.
2420         * UIProcess/API/efl/tests/resources/resultMHTML.mht: Removed.
2421         * UIProcess/API/efl/tests/resources/same_page_navigation.html: Removed.
2422         * UIProcess/API/efl/tests/resources/spelling_selection_tests.html: Removed.
2423         * UIProcess/API/efl/tests/resources/spelling_test.html: Removed.
2424         * UIProcess/API/efl/tests/resources/test.pdf: Removed.
2425         * UIProcess/API/efl/tests/resources/window_move_resize.html: Removed.
2426         * UIProcess/API/efl/tests/test_ewk2_accessibility.cpp: Removed.
2427         * UIProcess/API/efl/tests/test_ewk2_application_cache_manager.cpp: Removed.
2428         * UIProcess/API/efl/tests/test_ewk2_auth_request.cpp: Removed.
2429         * UIProcess/API/efl/tests/test_ewk2_back_forward_list.cpp: Removed.
2430         * UIProcess/API/efl/tests/test_ewk2_color_picker.cpp: Removed.
2431         * UIProcess/API/efl/tests/test_ewk2_context.cpp: Removed.
2432         * UIProcess/API/efl/tests/test_ewk2_context_history_callbacks.cpp: Removed.
2433         * UIProcess/API/efl/tests/test_ewk2_context_menu.cpp: Removed.
2434         * UIProcess/API/efl/tests/test_ewk2_cookie_manager.cpp: Removed.
2435         * UIProcess/API/efl/tests/test_ewk2_database_manager.cpp: Removed.
2436         * UIProcess/API/efl/tests/test_ewk2_download_job.cpp: Removed.
2437         * UIProcess/API/efl/tests/test_ewk2_eina_shared_string.cpp: Removed.
2438         * UIProcess/API/efl/tests/test_ewk2_favicon_database.cpp: Removed.
2439         * UIProcess/API/efl/tests/test_ewk2_file_chooser_request.cpp: Removed.
2440         * UIProcess/API/efl/tests/test_ewk2_javascript_binding.cpp: Removed.
2441         * UIProcess/API/efl/tests/test_ewk2_object.cpp: Removed.
2442         * UIProcess/API/efl/tests/test_ewk2_page.cpp: Removed.
2443         * UIProcess/API/efl/tests/test_ewk2_page_group.cpp: Removed.
2444         * UIProcess/API/efl/tests/test_ewk2_popup_menu.cpp: Removed.
2445         * UIProcess/API/efl/tests/test_ewk2_settings.cpp: Removed.
2446         * UIProcess/API/efl/tests/test_ewk2_ssl.cpp: Removed.
2447         * UIProcess/API/efl/tests/test_ewk2_storage_manager.cpp: Removed.
2448         * UIProcess/API/efl/tests/test_ewk2_text_checker.cpp: Removed.
2449         * UIProcess/API/efl/tests/test_ewk2_view.cpp: Removed.
2450         * UIProcess/API/efl/tests/test_ewk2_view_configuration.cpp: Removed.
2451         * UIProcess/API/efl/tests/test_ewk2_window_features.cpp: Removed.
2452         * UIProcess/InspectorServer/efl: Removed.
2453         * UIProcess/InspectorServer/efl/WebInspectorServerEfl.cpp: Removed.
2454         * UIProcess/Launcher/efl: Removed.
2455         * UIProcess/Launcher/efl/ProcessLauncherEfl.cpp: Removed.
2456         * UIProcess/efl: Removed.
2457         * UIProcess/efl/ContextHistoryClientEfl.cpp: Removed.
2458         * UIProcess/efl/ContextHistoryClientEfl.h: Removed.
2459         * UIProcess/efl/ContextMenuClientEfl.cpp: Removed.
2460         * UIProcess/efl/ContextMenuClientEfl.h: Removed.
2461         * UIProcess/efl/DownloadManagerEfl.cpp: Removed.
2462         * UIProcess/efl/DownloadManagerEfl.h: Removed.
2463         * UIProcess/efl/EasingCurves.cpp: Removed.
2464         * UIProcess/efl/EasingCurves.h: Removed.
2465         * UIProcess/efl/EwkDebug.h: Removed.
2466         * UIProcess/efl/EwkTouchEvent.cpp: Removed.
2467         * UIProcess/efl/EwkTouchEvent.h: Removed.
2468         * UIProcess/efl/EwkTouchPoint.cpp: Removed.
2469         * UIProcess/efl/EwkTouchPoint.h: Removed.
2470         * UIProcess/efl/FindClientEfl.cpp: Removed.
2471         * UIProcess/efl/FindClientEfl.h: Removed.
2472         * UIProcess/efl/FormClientEfl.cpp: Removed.
2473         * UIProcess/efl/FormClientEfl.h: Removed.
2474         * UIProcess/efl/InputMethodContextEfl.cpp: Removed.
2475         * UIProcess/efl/InputMethodContextEfl.h: Removed.
2476         * UIProcess/efl/PageLoadClientEfl.cpp: Removed.
2477         * UIProcess/efl/PageLoadClientEfl.h: Removed.
2478         * UIProcess/efl/PagePolicyClientEfl.cpp: Removed.
2479         * UIProcess/efl/PagePolicyClientEfl.h: Removed.
2480         * UIProcess/efl/PageUIClientEfl.cpp: Removed.
2481         * UIProcess/efl/PageUIClientEfl.h: Removed.
2482         * UIProcess/efl/PageViewportControllerClientEfl.cpp: Removed.
2483         * UIProcess/efl/PageViewportControllerClientEfl.h: Removed.
2484         * UIProcess/efl/RequestManagerClientEfl.cpp: Removed.
2485         * UIProcess/efl/RequestManagerClientEfl.h: Removed.
2486         * UIProcess/efl/TextCheckerClientEfl.cpp: Removed.
2487         * UIProcess/efl/TextCheckerClientEfl.h: Removed.
2488         * UIProcess/efl/TextCheckerEfl.cpp: Removed.
2489         * UIProcess/efl/VibrationClientEfl.cpp: Removed.
2490         * UIProcess/efl/VibrationClientEfl.h: Removed.
2491         * UIProcess/efl/ViewClientEfl.cpp: Removed.
2492         * UIProcess/efl/ViewClientEfl.h: Removed.
2493         * UIProcess/efl/WebColorPickerClient.cpp: Removed.
2494         * UIProcess/efl/WebColorPickerClient.h: Removed.
2495         * UIProcess/efl/WebColorPickerEfl.cpp: Removed.
2496         * UIProcess/efl/WebColorPickerEfl.h: Removed.
2497         * UIProcess/efl/WebColorPickerResultListenerProxy.cpp: Removed.
2498         * UIProcess/efl/WebColorPickerResultListenerProxy.h: Removed.
2499         * UIProcess/efl/WebContextMenuProxyEfl.cpp: Removed.
2500         * UIProcess/efl/WebContextMenuProxyEfl.h: Removed.
2501         * UIProcess/efl/WebInspectorProxyEfl.cpp: Removed.
2502         * UIProcess/efl/WebPageProxyEfl.cpp: Removed.
2503         * UIProcess/efl/WebPopupItemEfl.cpp: Removed.
2504         * UIProcess/efl/WebPopupItemEfl.h: Removed.
2505         * UIProcess/efl/WebPopupMenuProxyEfl.cpp: Removed.
2506         * UIProcess/efl/WebPopupMenuProxyEfl.h: Removed.
2507         * UIProcess/efl/WebPreferencesEfl.cpp: Removed.
2508         * UIProcess/efl/WebProcessPoolEfl.cpp: Removed.
2509         * UIProcess/efl/WebView.cpp: Removed.
2510         * UIProcess/efl/WebView.h: Removed.
2511         * UIProcess/efl/WebViewClient.cpp: Removed.
2512         * UIProcess/efl/WebViewClient.h: Removed.
2513         * WebProcess/InjectedBundle/API/efl: Removed.
2514         * WebProcess/InjectedBundle/API/efl/EWebKit_Extension.h: Removed.
2515         * WebProcess/InjectedBundle/API/efl/ewk_extension.cpp: Removed.
2516         * WebProcess/InjectedBundle/API/efl/ewk_extension.h: Removed.
2517         * WebProcess/InjectedBundle/API/efl/ewk_extension_private.h: Removed.
2518         * WebProcess/InjectedBundle/API/efl/ewk_page.cpp: Removed.
2519         * WebProcess/InjectedBundle/API/efl/ewk_page.h: Removed.
2520         * WebProcess/InjectedBundle/API/efl/ewk_page_private.h: Removed.
2521         * WebProcess/InjectedBundle/efl: Removed.
2522         * WebProcess/InjectedBundle/efl/InjectedBundleEfl.cpp: Removed.
2523         * WebProcess/WebCoreSupport/efl: Removed.
2524         * WebProcess/WebCoreSupport/efl/WebContextMenuClientEfl.cpp: Removed.
2525         * WebProcess/WebCoreSupport/efl/WebEditorClientEfl.cpp: Removed.
2526         * WebProcess/WebCoreSupport/efl/WebErrorsEfl.cpp: Removed.
2527         * WebProcess/WebCoreSupport/efl/WebPopupMenuEfl.cpp: Removed.
2528         * WebProcess/WebPage/efl: Removed.
2529         * WebProcess/WebPage/efl/WebInspectorUIEfl.cpp: Removed.
2530         * WebProcess/WebPage/efl/WebPageEfl.cpp: Removed.
2531         * WebProcess/efl: Removed.
2532         * WebProcess/efl/ExtensionManagerEfl.cpp: Removed.
2533         * WebProcess/efl/ExtensionManagerEfl.h: Removed.
2534         * WebProcess/efl/WebInjectedBundleMainEfl.cpp: Removed.
2535         * WebProcess/efl/WebProcessMainEfl.cpp: Removed.
2536         * efl: Removed.
2537         * efl/EWebKit2Config.cmake.in: Removed.
2538         * efl/EWebKit2ConfigVersion.cmake.in: Removed.
2539         * efl/ewebkit2-extension.pc.in: Removed.
2540         * efl/ewebkit2.pc.in: Removed.
2541
2542 2017-02-16  Alex Christensen  <achristensen@webkit.org>
2543
2544         Remove old URL parser
2545         https://bugs.webkit.org/show_bug.cgi?id=168483
2546
2547         Reviewed by Tim Horton.
2548
2549         * NetworkProcess/NetworkProcess.cpp:
2550         (WebKit::NetworkProcess::initializeNetworkProcess):
2551         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2552         (WebKit::NetworkProcessCreationParameters::encode):
2553         (WebKit::NetworkProcessCreationParameters::decode):
2554         * NetworkProcess/NetworkProcessCreationParameters.h:
2555         * PlatformEfl.cmake:
2556         * PlatformGTK.cmake:
2557         * PlatformMac.cmake:
2558         * Shared/Cocoa/WebKit2InitializeCocoa.mm: Removed.
2559         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
2560         (WebKit::XPCServiceInitializer):
2561         * Shared/WebKit2Initialize.cpp:
2562         (WebKit::InitializeWebKit2):
2563         * Shared/WebKit2Initialize.h:
2564         (): Deleted.
2565         * Shared/WebProcessCreationParameters.cpp:
2566         (WebKit::WebProcessCreationParameters::encode):
2567         (WebKit::WebProcessCreationParameters::decode):
2568         * Shared/WebProcessCreationParameters.h:
2569         * Shared/efl/WebKit2InitializeEFL.cpp: Removed.
2570         * Shared/gtk/WebKit2InitializeGTK.cpp: Removed.
2571         * UIProcess/WebProcessPool.cpp:
2572         (WebKit::WebProcessPool::ensureNetworkProcess):
2573         (WebKit::WebProcessPool::createNewWebProcess):
2574         * WebKit2.xcodeproj/project.pbxproj:
2575         * WebProcess/WebProcess.cpp:
2576         (WebKit::WebProcess::initializeWebProcess):
2577
2578 2017-02-16  Wenson Hsieh  <wenson_hsieh@apple.com>
2579
2580         [WK2] Add additional test infrastructure and unit tests for data interaction
2581         https://bugs.webkit.org/show_bug.cgi?id=168439
2582         <rdar://problem/30557942>
2583
2584         Reviewed by Tim Horton.
2585
2586         Adds two new _WKTestingDelegate protocol methods that are fired when a 'start data interaction' request has been
2587         sent to the web process, and when a response has been received. See Tools/ChangeLog for more details.
2588
2589         * UIProcess/API/Cocoa/_WKTestingDelegate.h:
2590
2591 2017-02-16  Aakash Jain  <aakash_jain@apple.com>
2592
2593         Remove unused method WKBundlePageCopyContextMenuItemTitle
2594         https://bugs.webkit.org/show_bug.cgi?id=168456
2595
2596         Reviewed by Dan Bernstein.
2597
2598         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h: Removed WKBundlePageCopyContextMenuItemTitle.
2599
2600 2017-02-16  Aakash Jain  <aakash_jain@apple.com>
2601
2602         Remove unused WKContextGetProcessSuppressionEnabled and WKContextSetProcessSuppressionEnabled
2603         https://bugs.webkit.org/show_bug.cgi?id=168460
2604
2605         Reviewed by Dan Bernstein.
2606
2607         * UIProcess/API/C/mac/WKContextPrivateMac.h:
2608
2609 2017-02-16  Aakash Jain  <aakash_jain@apple.com>
2610
2611         Removed unused method WKContextGetProcessModel
2612         https://bugs.webkit.org/show_bug.cgi?id=168457
2613
2614         Reviewed by Dan Bernstein.
2615
2616         * UIProcess/API/C/WKContext.h: Removed WKContextGetProcessModel.
2617
2618 2017-02-16  Tim Horton  <timothy_horton@apple.com>
2619
2620         WKWebView inside a UICollectionView flashes when items are inserted above it
2621         https://bugs.webkit.org/show_bug.cgi?id=168376
2622         <rdar://problem/29322051>
2623
2624         Reviewed by Simon Fraser.
2625
2626         Previously, we would immediately send visible content rect updates
2627         whenever we scrolled, or our frame or bounds changed, or ... a whole
2628         bunch of other things. This message would be immediately sent to the
2629         Web Content process, and coalesced at the whims of the Web Content process
2630         main thread. However, if we received multiple such updates within the
2631         same runloop cycle in the UI process, the Web Content process could
2632         send back layer tree commits for intermediate states that would
2633         never make it to the screen.
2634
2635         In the UICollectionView case, UIKit would first scroll to the new location
2636         (potentially putting the WKWebView totally off-screen), and then update
2637         our frame (back on screen), and we would get two layer tree commits;
2638         one, with less tile coverage than needed to cover the area, and another
2639         with full coverage.
2640
2641         Instead, wait until just before we commit the UI-side layer tree (and
2642         thus everyone is done moving things around) to push the new visible 
2643         rect info to the Web Content process.
2644
2645         So far, I have not found a way to test that reliably fails before
2646         and reliably passes after without adding a ton of supporting code to WebKit.
2647
2648         * UIProcess/API/Cocoa/WKWebView.mm:
2649         (-[WKWebView _didInvokeUIScrollViewDelegateCallback]):
2650         (-[WKWebView _didCommitLayerTree:]):
2651         (-[WKWebView _didFinishScrolling]):
2652         (-[WKWebView scrollViewDidScroll:]):
2653         (-[WKWebView scrollViewDidZoom:]):
2654         (-[WKWebView scrollViewDidEndZooming:withView:atScale:]):
2655         (-[WKWebView _scrollViewDidInterruptDecelerating:]):
2656         (-[WKWebView _didScroll]):
2657         (-[WKWebView _enclosingScrollerScrollingEnded:]):
2658         (-[WKWebView _frameOrBoundsChanged]):
2659         (-[WKWebView _scheduleVisibleContentRectUpdate]):
2660         (-[WKWebView _scrollViewIsInStableState:]):
2661         (-[WKWebView _scheduleVisibleContentRectUpdateAfterScrollInView:]):
2662         (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
2663         (-[WKWebView _setObscuredInsets:]):
2664         (-[WKWebView _endInteractiveObscuredInsetsChange]):
2665         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
2666         (-[WKWebView _endAnimatedResize]):
2667         (-[WKWebView _updateVisibleContentRects]): Deleted.
2668         (-[WKWebView _updateVisibleContentRectAfterScrollInView:]): Deleted.
2669         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2670         * UIProcess/ios/WKContentView.mm:
2671         (-[WKContentView _didCommitLayerTree:]):
2672         * UIProcess/ios/WKContentViewInteraction.mm:
2673         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
2674         (-[WKContentView _stopAssistingNode]):
2675         * UIProcess/ios/WKScrollView.mm:
2676         (-[WKScrollView setContentInset:]):
2677         Have existing callers of _updateVisibleContentRect* instead call
2678         _scheduleVisibleContentRectUpdate*.
2679
2680         In _scheduleVisibleContentRectUpdate, schedule a pre-commit callback
2681         in which we will compute the new visible content rect information
2682         and send it to the Web Content process.
2683
2684         Keep track of the stable state of the scroll view which most recently
2685         scheduled an update, and use that to inform _updateVisibleContentRects.
2686         This matches the previous behavior where the updates might get coalesced
2687         in the Web Content process, and the most recent update wins.
2688
2689         Make a few callers of _updateVisibleContentRectAfterScrollInView
2690         that passed in our scroll view just use _scheduleVisibleContentRectUpdate instead.
2691
2692 2017-02-16  Brent Fulgham  <bfulgham@apple.com>
2693
2694         [WebRTC][Mac] Conditionally add sandbox extensions to the Network Process
2695         https://bugs.webkit.org/show_bug.cgi?id=168010
2696         <rdar://problem/30245503>
2697
2698         Reviewed by Youenn Fablet.
2699
2700         Conditionally add sandbox extensions to the Network Process when the WebRTC/Media Capture
2701         features are enabled.
2702
2703         * NetworkProcess/NetworkProcess.h:
2704         * NetworkProcess/NetworkProcessCreationParameters.cpp:
2705         (WebKit::NetworkProcessCreationParameters::encode): Serialize new process configuration flag.
2706         (WebKit::NetworkProcessCreationParameters::decode): Ditto.
2707         * NetworkProcess/NetworkProcessCreationParameters.h:
2708         * NetworkProcess/mac/NetworkProcessMac.mm:
2709         (WebKit::NetworkProcess::platformInitializeNetworkProcess):  Remember state of WebRTC for when the
2710         sandbox is established.
2711         (WebKit::NetworkProcess::initializeSandbox): Add ENABLE_WEB_RTC parameter to sandbox launch state.
2712         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in: Add conditional sandbox expansion to allow
2713         bidirectional network access when the ENABLE_LIBWEBRTC flag is present in the sandbox launch parameters.
2714         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2715         (WebKit::WebProcessPool::platformInitializeWebProcess): Use proper compile guards and check media stream
2716         preference, rather than the peer connection preference.
2717         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Notify NetworkProcess at launch time whether the
2718         user wants WebRTC support.
2719
2720 2017-02-16  Brent Fulgham  <bfulgham@apple.com>
2721
2722         [WebRTC][Mac][WebKit2] Initial WebProcess does not support WebRTC
2723         https://bugs.webkit.org/show_bug.cgi?id=168438
2724         <rdar://problem/30401818>
2725
2726         Reviewed by Youenn Fablet.
2727
2728         The sandbox extension for microphone access does not take effect until the second WebProcess
2729         is created, causing the initial browser tab to lack microphone support.
2730
2731         This patch checks the setting earlier in the boot process so that the initial WebProcess
2732         instance gets the correct setting.
2733
2734         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2735         (WebKit::WebProcessPool::platformInitializeWebProcess): Move microphone sandbox extension here, so that the
2736         initial WebProcess has the correct microphone access.
2737         * UIProcess/WebProcessPool.cpp:
2738         (WebKit::WebProcessPool::createNewWebProcess): Move microphone sandbox extension from here to platform-specific file.
2739         (WebKit::WebProcessPool::createWebPage): Remove unneeded preference checks.
2740
2741 2017-02-16  Eric Carlson  <eric.carlson@apple.com>
2742
2743         Add WebRTC as an off-by-default experimental feature menu item.
2744         https://bugs.webkit.org/show_bug.cgi?id=167972
2745         <rdar://problem/30293429>
2746
2747         Reviewed by Alex Christensen.
2748
2749         * Shared/WebPreferencesDefinitions.h:
2750         * UIProcess/WebPreferences.cpp:
2751         (WebKit::WebPreferences::setPeerConnectionAndMediaStreamEnabled): We need to enable/disable
2752         peer connection and media stream preferences at the same time, so special case them.
2753         (WebKit::WebPreferences::setEnabledForFeature):
2754         * UIProcess/WebPreferences.h:
2755
2756 2017-02-15  Alex Christensen  <achristensen@webkit.org>
2757
2758         Unreviewed, rolling out r212394.
2759
2760         Fixed iOS WebInspector
2761
2762         Reverted changeset:
2763
2764         "Unreviewed, rolling out r212169."
2765         https://bugs.webkit.org/show_bug.cgi?id=166681
2766         http://trac.webkit.org/changeset/212394
2767
2768 2017-02-15  Eric Carlson  <eric.carlson@apple.com>
2769
2770         [MediaStream] delete CaptureDeviceInfo struct
2771         https://bugs.webkit.org/show_bug.cgi?id=168395
2772
2773         Reviewed by Sam Weinig.
2774
2775         * Shared/WebCoreArgumentCoders.cpp:
2776         (IPC::ArgumentCoder<CaptureDevice>::encode):
2777         (IPC::ArgumentCoder<CaptureDevice>::decode):
2778
2779 2017-02-15  Anders Carlsson  <andersca@apple.com>
2780
2781         Try again.
2782
2783         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
2784         (WebKit::WebDragClient::startDrag):
2785
2786 2017-02-15  Anders Carlsson  <andersca@apple.com>
2787
2788         Attempt to fix the GTK+ build.
2789
2790         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
2791         (WebKit::WebDragClient::startDrag):
2792
2793 2017-02-15  Simon Fraser  <simon.fraser@apple.com>
2794
2795         Clean up WebProcessCreationParameters a little
2796         https://bugs.webkit.org/show_bug.cgi?id=168349
2797
2798         Reviewed by Alex Christensen.
2799
2800         Initialize the data members better, and rearrange to group the types in a slightly more space-efficient manner.
2801
2802         * Shared/WebProcessCreationParameters.cpp:
2803         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters):
2804         * Shared/WebProcessCreationParameters.h:
2805
2806 2017-02-15  Jer Noble  <jer.noble@apple.com>
2807
2808         REGRESSION(r183937): Fullscreen Exit animation missing mask
2809         https://bugs.webkit.org/show_bug.cgi?id=168360
2810
2811         Reviewed by Eric Carlson.
2812
2813         In r183937, the fullscreen window's clip layer has it's mask removed when the enter
2814         fullscreen animation completes, allowing low-power video playback mode to be entered. But
2815         this breaks the exit fullscreen animaiton, which assumes a mask is present. Abstract the
2816         mask creation code out into a static helper method, and use it at the beginning of the exit
2817         fullscreen animation to re-create the mask before adding animations to it.
2818
2819         * UIProcess/mac/WKFullScreenWindowController.mm:
2820         (createMask):
2821         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
2822         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]):
2823
2824 2017-02-15  Alex Christensen  <achristensen@webkit.org>
2825
2826         Unreviewed, rolling out r212169.
2827
2828         Broke iOS WebInspector
2829
2830         Reverted changeset:
2831
2832         "WebInspector: refactor RemoteInspector to move cocoa specific
2833         code to their own files"
2834         https://bugs.webkit.org/show_bug.cgi?id=166681
2835         http://trac.webkit.org/changeset/212169
2836
2837 2017-02-15  Anders Carlsson  <andersca@apple.com>
2838
2839         Modernize DragClient::startDrag somewhat
2840         https://bugs.webkit.org/show_bug.cgi?id=168379
2841
2842         Reviewed by Tim Horton.
2843
2844         Update for WebCore changes.
2845
2846         * WebProcess/WebCoreSupport/WebDragClient.cpp:
2847         (WebKit::WebDragClient::startDrag):
2848         * WebProcess/WebCoreSupport/WebDragClient.h:
2849         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2850         (WebKit::WebDragClient::startDrag):
2851
2852 2017-02-15  Aakash Jain  <aakash_jain@apple.com>
2853
2854         Remove WebIOSEvent interface
2855         https://bugs.webkit.org/show_bug.cgi?id=168368
2856
2857         Reviewed by Tim Horton.
2858
2859         * Shared/NativeWebKeyboardEvent.h: Using WebEvent from WebCore instead of WebIOSEvent.
2860         * Shared/ios/NativeWebKeyboardEventIOS.mm: Ditto.
2861         * Shared/ios/WebIOSEventFactory.h: Ditto.
2862         * Shared/ios/WebIOSEventFactory.mm: Ditto.
2863         * UIProcess/ios/WKContentViewInteraction.h: Ditto.
2864         * UIProcess/ios/WKContentViewInteraction.mm: Ditto.
2865         * UIProcess/API/C/WKPage.cpp: Using WebEvent from WebKit.
2866
2867 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
2868
2869         [GTK] Update cookie manager API to properly work with ephemeral sessions
2870         https://bugs.webkit.org/show_bug.cgi?id=168230
2871
2872         Reviewed by Michael Catanzaro.
2873
2874         WebKitCookieManager is associated to a particular WebKitWebContext and uses the default session ID
2875         unconditionally. It should be associated to a WebKitWebsiteDataManager instead and use its session ID. This
2876         patch also adds support for handling cookies with WebKitWebsiteDataManager and deprecates
2877         webkit_cookie_manager_get_domains_with_cookies(), webkit_cookie_manager_delete_cookies_for_domain() and
2878         webkit_cookie_manager_delete_all_cookies(). It also adds API to get the the WebKitWebsiteDataManager of a
2879         WebKitWebView, since it's the only way to get the WebKitCookieManager associated to an ephemeral web view.
2880
2881         * UIProcess/API/gtk/WebKitCookieManager.cpp:
2882         (webkitCookieManagerDispose): Stop observing cookie changes.
2883         (webkit_cookie_manager_class_init): Add dispose implementation.
2884         (webkitCookieManagerCreate): Create the WebKitCookieManager with a WebKitWebsiteDataManager.
2885         (webkit_cookie_manager_set_persistent_storage): Work with all contexts having the session.
2886         (webkit_cookie_manager_set_accept_policy): Ditto.
2887         (webkit_cookie_manager_get_accept_policy): Use any context having the session.
2888         (webkit_cookie_manager_get_domains_with_cookies): Deprecate and implement using WebKitWebsiteDataManager.
2889         (webkit_cookie_manager_get_domains_with_cookies_finish): Ditto.
2890         (webkit_cookie_manager_delete_cookies_for_domain): Ditto.
2891         (webkit_cookie_manager_delete_all_cookies): Ditto.
2892         * UIProcess/API/gtk/WebKitCookieManager.h:
2893         * UIProcess/API/gtk/WebKitCookieManagerPrivate.h:
2894         * UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp:
2895         (attachCustomProtocolManagerClientToContext):
2896         * UIProcess/API/gtk/WebKitDownloadClient.cpp:
2897         (attachDownloadClientToContext):
2898         * UIProcess/API/gtk/WebKitInjectedBundleClient.cpp:
2899         (attachInjectedBundleClientToContext):
2900         * UIProcess/API/gtk/WebKitSecurityManager.cpp:
2901         (registerSecurityPolicyForURIScheme):
2902         * UIProcess/API/gtk/WebKitWebContext.cpp:
2903         (webkitWebContextConstructed): Call webkitWebsiteDataManagerAddProcessPool.
2904         (webkitWebContextDispose): Call webkitWebsiteDataManagerRemoveProcessPool.
2905         (webkit_web_context_get_cookie_manager): Return the WebKitCookieManager of the WebKitWebsiteDataManager.
2906         (webkitWebContextGetProcessPool): Make it return a reference.
2907         * UIProcess/API/gtk/WebKitWebContextPrivate.h:
2908         * UIProcess/API/gtk/WebKitWebView.cpp:
2909         (webkitWebViewConstructed): Call webkitWebsiteDataManagerAddProcessPool when creating a ephemeral web view.
2910         (webkitWebViewDispose): Call webkitWebsiteDataManagerRemoveProcessPool if needed.
2911         (webkit_web_view_get_website_data_manager): Return the WebKitWebsiteDataManager or the context one.
2912         * UIProcess/API/gtk/WebKitWebView.h:
2913         * UIProcess/API/gtk/WebKitWebsiteData.cpp: Add support for Cookies type.
2914         (recordContainsSupportedDataTypes):
2915         (toWebKitWebsiteDataTypes):
2916         * UIProcess/API/gtk/WebKitWebsiteData.h:
2917         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
2918         (_WebKitWebsiteDataManagerPrivate::~_WebKitWebsiteDataManagerPrivate): Ensure all contexts were unregistered.
2919         (webkitWebsiteDataManagerAddProcessPool): Register the process pool in the session.
2920         (webkitWebsiteDataManagerRemoveProcessPool): Unregister the process poll from the session.
2921         (webkitWebsiteDataManagerGetProcessPools): Return the list of proces pools registered.
2922         (webkit_website_data_manager_get_cookie_manager): Return the WebKitCookieManager.
2923         (toWebsiteDataTypes): Add Cookies.
2924         * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
2925         * UIProcess/API/gtk/WebKitWebsiteDataManagerPrivate.h:
2926         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
2927         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
2928         (WebKit::WebsiteDataRecord::displayNameForCookieHostName): Handle localhost as a special case here for backwards
2929         compatibility.
2930
2931 2017-02-14  Wenson Hsieh  <wenson_hsieh@apple.com>
2932
2933         [WK2] Support data interaction on links
2934         https://bugs.webkit.org/show_bug.cgi?id=168331
2935         <rdar://problem/30200837>
2936
2937         Reviewed by Tim Horton.
2938
2939         Adds support for data interaction on links at the client layer for WebKit2. This involves several changes,
2940         detailed in the per-method changes below:
2941
2942         * Shared/ios/InteractionInformationAtPosition.h:
2943         * Shared/ios/InteractionInformationAtPosition.mm:
2944         (WebKit::InteractionInformationAtPosition::encode):
2945         (WebKit::InteractionInformationAtPosition::decode):
2946
2947         Add adjustedPointForNodeRespondingToClickEvents (the request point, adjusted to take nodeRespondingToClickEvents
2948         into account) to InteractionInformationAtPosition. The web process sends this adjusted point over to the UI
2949         process so that the UI process will be able to begin a data interaction at the adjusted point rather than the
2950         request point, which is necessary for small clickable (and data-interactive) elements such as links.
2951
2952         * UIProcess/ios/WKActionSheet.h:
2953         * UIProcess/ios/WKActionSheet.mm:
2954         (-[WKActionSheet presentSheet:]):
2955         (-[WKActionSheet _presentationRectForStyle:]):
2956         (-[WKActionSheet updateSheetPosition]):
2957         * UIProcess/ios/WKActionSheetAssistant.h:
2958         * UIProcess/ios/WKActionSheetAssistant.mm:
2959         (-[WKActionSheetAssistant presentationRectForElementUsingClosestIndicatedRect]):
2960         (-[WKActionSheetAssistant presentationRectForIndicatedElement]):
2961         (-[WKActionSheetAssistant showImageSheet]):
2962         (-[WKActionSheetAssistant _shouldPresentAtTouchLocationForElementRect:]):
2963         (-[WKActionSheetAssistant needsLinkIndicator]):
2964         (-[WKActionSheetAssistant showLinkSheet]):
2965         (-[WKActionSheetAssistant cleanupSheet]):
2966         (-[WKActionSheetAssistant _presentationStyleForImageAtElementRect:]): Deleted.
2967
2968         Add support for the WKActionSheetPresentAtClosestIndicatorRect style of presenting an action sheet. When
2969         showing the action sheet for a link and there is space along the margins to show a popover in the first place,
2970         we will now target the popover rect to the bounding rect of the set of adjacent (or nearly-adjacent) element
2971         rects closest to the user's touch location. This covers cases where the link is split into multiple rects due to
2972         a line break, when the link is on multiple lines with a jagged rect per line, and when both of the above are
2973         true.
2974
2975         * UIProcess/ios/WKContentViewInteraction.mm:
2976         (-[WKContentView pointIsInDataInteractionContent:]):
2977         (-[WKContentView _positionInformationDidChange:]):
2978         (-[WKContentView positionInformationForActionSheetAssistant:]):
2979         (-[WKContentView updatePositionInformationForActionSheetAssistant:]):
2980
2981         Include link indicator data in the position information request if needed. As the FIXME suggests, this can be
2982         improved by asynchronously presenting the action sheet assistant after the request returns, and is something we
2983         should address in the future.
2984
2985         * WebProcess/WebPage/ios/WebPageIOS.mm:
2986         (WebKit::WebPage::getPositionInformation):
2987
2988 2017-02-14  Jason Rinn  <jrinn@apple.com>
2989
2990         Add new WKWebKit Cocoa API for getContentsAsString.
2991         https://bugs.webkit.org/show_bug.cgi?id=168147
2992         <rdar://problem/30502539>
2993
2994         Reviewed by Tim Horton.
2995
2996         * UIProcess/API/Cocoa/WKWebView.mm:
2997         (-[WKWebView _getContentsAsStringWithCompletionHandler:]): New API for getContentsAsString.
2998         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2999
3000 2017-02-14  Chris Dumez  <cdumez@apple.com>
3001
3002         HTML Form Validation bubble should take minimum font size setting into consideration
3003         https://bugs.webkit.org/show_bug.cgi?id=168271
3004         <rdar://problem/29869869>
3005
3006         Reviewed by Simon Fraser.
3007
3008         * UIProcess/API/Cocoa/WKWebView.mm:
3009         (-[WKWebView _contentsOfUserInterfaceItem:]):
3010         Return font size used in the validation bubble.
3011
3012         * UIProcess/PageClient.h:
3013         * UIProcess/ios/PageClientImplIOS.h:
3014         * UIProcess/ios/PageClientImplIOS.mm:
3015         (WebKit::PageClientImpl::createValidationBubble):
3016         * UIProcess/ios/WebPageProxyIOS.mm:
3017         (WebKit::WebPageProxy::showValidationMessage):
3018         * UIProcess/mac/PageClientImpl.h:
3019         * UIProcess/mac/PageClientImpl.mm:
3020         (WebKit::PageClientImpl::createValidationBubble):
3021         * UIProcess/mac/WebPageProxyMac.mm:
3022         (WebKit::WebPageProxy::showValidationMessage):
3023         Pass minimum font size setting when constructing the form validation bubble.
3024
3025 2017-02-14  Commit Queue  <commit-queue@webkit.org>
3026
3027         Unreviewed, rolling out r211879.
3028         https://bugs.webkit.org/show_bug.cgi?id=168330
3029
3030         Not ready for the menu yet (Requested by eric_car_ on
3031         #webkit).
3032
3033         Reverted changeset:
3034
3035         "Add WebRTC as an off-by-default experimental feature menu
3036         item."
3037         https://bugs.webkit.org/show_bug.cgi?id=167972
3038         http://trac.webkit.org/changeset/211879
3039
3040 2017-02-14  Simon Fraser  <simon.fraser@apple.com>
3041
3042         Add logging and defensive fixes to try to detect problems causing blank tabs
3043         https://bugs.webkit.org/show_bug.cgi?id=168270
3044         rdar://problem/30505482
3045
3046         Reviewed by Jon Lee.
3047         
3048         Add release logging when -[WKWebView _beginAnimatedResizeWithUpdates:] and -[WKWebView _endAnimatedResize]
3049         are unbalanced across a commit, to detect cases where _endAnimatedResize wasn't called enough times.
3050         
3051         Also log when RemoteLayerTreeHost::updateLayerTree() fails to find a root layer, which should never happen.
3052         
3053         In WebPageProxy, clear m_firstLayerTreeTransactionIdAfterDidCommitLoad on a web process crash.
3054
3055         * Platform/Logging.h:
3056         * UIProcess/API/Cocoa/WKWebView.mm:
3057         (-[WKWebView _didCommitLayerTree:]):
3058         (-[WKWebView _beginAnimatedResizeWithUpdates:]):
3059         (-[WKWebView _endAnimatedResize]):
3060         * UIProcess/WebPageProxy.cpp:
3061         (WebKit::WebPageProxy::resetState):
3062         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
3063         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
3064         (WebKit::RemoteLayerTreeDrawingAreaProxy::isAlwaysOnLoggingAllowed):
3065         * UIProcess/mac/RemoteLayerTreeHost.mm:
3066         (WebKit::RemoteLayerTreeHost::updateLayerTree):
3067         (WebKit::RemoteLayerTreeHost::clearLayers):
3068         * WebProcess/WebPage/WebFrame.cpp:
3069         (WebKit::WebFrame::WebFrame):
3070         * WebProcess/WebPage/WebFrame.h:
3071
3072 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3073
3074         Allow to use stored credentials also for downloads started by DownloadManager::startDownload
3075         https://bugs.webkit.org/show_bug.cgi?id=167584
3076
3077         Reviewed by Michael Catanzaro.
3078
3079         Cliking on a link that triggers a download works on an already HTTP authenticated site works, but right clicking
3080         and downloading from the context menu shows the HTTP auth dialog again. This is because PendingDownload uses
3081         DoNotAllowStoredCredentials unconditionally. We want to allow using cached credentials at least for
3082         non-ephemeral sessions.
3083
3084         * NetworkProcess/Downloads/DownloadManager.cpp:
3085         (WebKit::DownloadManager::startDownload):
3086
3087 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3088
3089         [GTK] Make DragImageRef a RefPtr instead of a plain pointer
3090         https://bugs.webkit.org/show_bug.cgi?id=168296
3091
3092         Reviewed by Sergio Villar Senin.
3093
3094         * WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
3095         (WebKit::WebDragClient::startDrag):
3096
3097 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3098
3099         [SOUP] Ensure a response MIME type when Content-Type is missing and sniffing not allowed
3100         https://bugs.webkit.org/show_bug.cgi?id=168299
3101
3102         Reviewed by Sergio Villar Senin.
3103
3104         Sniffing is not allowed but we can try to guess the MIME using the response path, or at least fallback to
3105         default MIME type instead of leaving an empty string. This matches what mac port does.
3106
3107         Fixes: http/tests/inspector/network/fetch-response-body.html
3108                http/tests/inspector/network/xhr-response-body.html
3109
3110         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3111         (WebKit::NetworkDataTaskSoup::didSendRequest):
3112
3113 2017-02-14  Carlos Garcia Campos  <cgarcia@igalia.com>
3114
3115         CookieManager only works with the default session
3116         https://bugs.webkit.org/show_bug.cgi?id=168229
3117
3118         Reviewed by Alex Christensen.
3119
3120         Make CookieManager session aware by adding a SessionID parameter to all its functions, and update all the callers
3121         to pass the default session ID, preserving the current
3122         behavior. WebCookieManagerProxy::startObservingCookieChanges() now also receives an optional callback to be
3123         called on every change.
3124
3125         * UIProcess/API/C/WKCookieManager.cpp:
3126         (WKCookieManagerGetHostnamesWithCookies):
3127         (WKCookieManagerDeleteCookiesForHostname):
3128         (WKCookieManagerDeleteAllCookies):
3129         (WKCookieManagerDeleteAllCookiesModifiedAfterDate):
3130         (WKCookieManagerStartObservingCookieChanges):
3131         (WKCookieManagerStopObservingCookieChanges):
3132         * UIProcess/API/gtk/WebKitCookieManager.cpp:
3133         (_WebKitCookieManagerPrivate::~_WebKitCookieManagerPrivate):
3134         (webkitCookieManagerCreate):
3135         (webkit_cookie_manager_set_persistent_storage):
3136         (webkit_cookie_manager_get_domains_with_cookies):
3137         (webkit_cookie_manager_delete_cookies_for_domain):
3138         (webkit_cookie_manager_delete_all_cookies):
3139         * UIProcess/Automation/WebAutomationSession.cpp:
3140         (WebKit::WebAutomationSession::addSingleCookie):
3141         (WebKit::WebAutomationSession::deleteAllCookies):
3142         * UIProcess/WebCookieManagerProxy.cpp:
3143         (WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
3144         (WebKit::WebCookieManagerProxy::deleteCookiesForHostname):
3145         (WebKit::WebCookieManagerProxy::deleteAllCookies):
3146         (WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince):
3147         (WebKit::WebCookieManagerProxy::addCookie):
3148         (WebKit::WebCookieManagerProxy::startObservingCookieChanges):
3149         (WebKit::WebCookieManagerProxy::stopObservingCookieChanges):
3150         (WebKit::WebCookieManagerProxy::cookiesDidChange):
3151         * UIProcess/WebCookieManagerProxy.h:
3152         * UIProcess/WebCookieManagerProxy.messages.in:
3153         * WebProcess/Cookies/WebCookieManager.cpp:
3154         (WebKit::WebCookieManager::WebCookieManager):
3155         (WebKit::WebCookieManager::getHostnamesWithCookies):
3156         (WebKit::WebCookieManager::deleteCookiesForHostname):
3157         (WebKit::WebCookieManager::deleteAllCookies):
3158         (WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
3159         (WebKit::WebCookieManager::addCookie):
3160         (WebKit::WebCookieManager::startObservingCookieChanges):
3161         (WebKit::WebCookieManager::stopObservingCookieChanges):
3162         * WebProcess/Cookies/WebCookieManager.h:
3163         * WebProcess/Cookies/WebCookieManager.messages.in:
3164
3165 2017-02-14  Tomas Popela  <tpopela@redhat.com>
3166
3167         Unreviewed, fix documentation typo
3168
3169         * UIProcess/API/gtk/WebKitEditingCommands.h:
3170
3171 2017-02-12  Brian Burg  <bburg@apple.com>
3172
3173         Web Inspector: expose system user interface layout direction through InspectorFrontendHost
3174         https://bugs.webkit.org/show_bug.cgi?id=168209
3175         <rdar://problem/11573736>
3176
3177         Reviewed by Joseph Pecoraro.
3178
3179         Forward the UserInterfaceLayoutDirection of the inspector page. If the WebKit client has
3180         properly set the UI directionality from system settings in PageClient, this will get inherited
3181         automatically by the Inspector's WebPage instance.
3182
3183         * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
3184         (WebKit::RemoteWebInspectorUI::userInterfaceLayoutDirection):
3185         * WebProcess/WebPage/RemoteWebInspectorUI.h:
3186         * WebProcess/WebPage/WebInspectorUI.cpp:
3187         (WebKit::WebInspectorUI::userInterfaceLayoutDirection):
3188         * WebProcess/WebPage/WebInspectorUI.h:
3189
3190 2017-02-13  Youenn Fablet  <youennf@gmail.com>
3191
3192         [WebRTC] Creating RTCPeerConnection with libwebrtc backend is crashing on rwt
3193         https://bugs.webkit.org/show_bug.cgi?id=168250
3194
3195         Reviewed by Alex Christensen.
3196
3197         * WebProcess/Network/webrtc/LibWebRTCProvider.cpp:
3198         (WebKit::LibWebRTCProvider::createPeerConnection):
3199         * WebProcess/Network/webrtc/LibWebRTCProvider.h:
3200         * WebProcess/Network/webrtc/LibWebRTCSocket.h:
3201         * WebProcess/Network/webrtc/WebRTCMonitor.cpp:
3202         (WebKit::WebRTCMonitor::StartUpdating):
3203         (WebKit::WebRTCMonitor::networksChanged):
3204         * WebProcess/Network/webrtc/WebRTCMonitor.h:
3205         * WebProcess/Network/webrtc/WebRTCResolver.cpp:
3206         (WebKit::WebRTCResolver::setResolvedAddress):
3207         (WebKit::WebRTCResolver::resolvedAddressError):
3208         * WebProcess/Network/webrtc/WebRTCSocket.cpp:
3209         (WebKit::WebRTCSocket::signalOnNetworkThread):
3210
3211 2017-02-13  Megan Gardner  <megan_gardner@apple.com>
3212
3213         Implement Drag cancels
3214         https://bugs.webkit.org/show_bug.cgi?id=168266
3215
3216         Reviewed by Wenson Hsieh.
3217
3218         Adds support for the UI Process to cancel already started drag events.
3219
3220         * UIProcess/WebPageProxy.cpp:
3221         (WebKit::WebPageProxy::cancelledDrag):
3222         * UIProcess/WebPageProxy.h:
3223         * WebProcess/WebPage/WebPage.h:
3224         (WebKit::WebPage::cancelledDrag):
3225         * WebProcess/WebPage/WebPage.messages.in:
3226
3227 2017-02-13  Simon Fraser  <simon.fraser@apple.com>
3228
3229         Call WKDestroyRenderingResources() on iOS when tabs are backgrounded
3230         https://bugs.webkit.org/show_bug.cgi?id=168261
3231         rdar://problem/30481079
3232
3233         Reviewed by Tim Horton.
3234
3235         There's code to call CABackingStoreCollectBlocking() on a 10s timer that exists for Mac, but on iOS
3236         the web processes are suspended before this timer fires. So call CABackingStoreCollectBlocking()
3237         from WebProcess::actualPrepareToSuspend(), which is where we also trigger the markAllLayersVolatile()
3238         code.
3239
3240         Also add CABackingStoreCollectBlocking() to QuartzCoreSPI.h so we can use it without using WKSI.
3241
3242         Release-log how long this takes, in case we get reports of bad performance. In my testing it could be up to 10ms.
3243
3244         * WebProcess/WebProcess.cpp:
3245         (WebKit::WebProcess::actualPrepareToSuspend):
3246         * WebProcess/cocoa/WebProcessCocoa.mm:
3247         (WebKit::WebProcess::destroyRenderingResources):
3248
3249 2017-02-13  Brady Eidson  <beidson@apple.com>
3250
3251         Followup to: Replace all WebKit Library Version checks in WK2 with SDK version checks.
3252         https://bugs.webkit.org/show_bug.cgi?id=168124
3253
3254         Reviewed by Geoffrey Garen.
3255
3256         * UIProcess/Cocoa/VersionChecks.h: 
3257
3258 2017-02-13  Wenson Hsieh  <wenson_hsieh@apple.com>
3259
3260         [WK2] Add test infrastructure and unit tests for data interaction
3261         https://bugs.webkit.org/show_bug.cgi?id=168159
3262         <rdar://problem/30477634>
3263
3264         Reviewed by Tim Horton.
3265
3266         Adds support at the WebKit2 layer for testing data interaction. Introduces the _WKTestingDelegate, which a
3267         protocol which can specified for a WKWebView and used to install mock objects and simulate the state of the
3268         platform. By default, this delegate is nil, which results in normal behavior. For data interaction, we are able
3269         to specify a mock data interaction gesture recognizer for use by the WKContentView to simulate firing a long
3270         press and subsequent movement. This gesture recognizer is used in place of the regular data interaction gesture
3271         recognizer, and allows for TestWebKitAPI to drive interaction without actually sending events through the
3272         UIApplication. The _WKTestingDelegate also contains optional method hooks which are invoked at key points in
3273         time when performing a data interaction gesture.
3274
3275         Since all methods of the testing delegate are optional, the testing delegate can be easily extended to support
3276         testing for other features -- the idea is that leaving all but the relevant methods in the protocol
3277         unimplemented will result in default behavior for everything other than those methods, so a client need only
3278         implement and add WebKit2 hooks for a few methods to support testing for a new feature.
3279
3280         * UIProcess/API/Cocoa/WKWebView.mm:
3281         (-[WKWebView _testingDelegate]):
3282         (-[WKWebView _setTestingDelegate:]):
3283
3284         Specify the testing delegate to use for this WKWebView (see above for more details).
3285
3286         (-[WKWebView _simulateDataInteractionGestureRecognized]):
3287         (-[WKWebView _simulateDataInteractionEntered:]):
3288         (-[WKWebView _simulateDataInteractionUpdated:]):
3289         (-[WKWebView _simulateDataInteractionPerformOperation:]):
3290         (-[WKWebView _simulateDataInteractionEnded:]):
3291         (-[WKWebView _simulateDataInteractionSessionDidEnd:withOperation:]):
3292         (-[WKWebView _simulateFailedDataInteractionWithIndex:]):
3293         (-[WKWebView _simulateWillBeginDataInteractionWithIndex:withSession:]):
3294         (-[WKWebView _simulatedItemsForDataInteractionWithIndex:]):
3295
3296         Used by TestWebKitAPI to drive data interaction tests. See DataInteractionTests.mm.
3297
3298         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3299         * UIProcess/API/Cocoa/_WKTestingDelegate.h: Added.
3300         * UIProcess/ios/WKContentViewInteraction.h:
3301         * UIProcess/ios/WKContentViewInteraction.mm:
3302         (-[WKContentView setupInteraction]):
3303         (-[WKContentView _dataInteractionGestureRecognizer]):
3304         * WebKit2.xcodeproj/project.pbxproj:
3305
3306 2017-02-13  Eric Carlson  <eric.carlson@apple.com>
3307
3308         [MediaStream Mac] Video capture needs access to /Library/CoreMediaIO/Plug-Ins/DAL/
3309         https://bugs.webkit.org/show_bug.cgi?id=168244
3310         <rdar://problem/30461158>
3311
3312         Reviewed by Brady Eidson.
3313
3314         * WebProcess/com.apple.WebProcess.sb.in: Grant read-access to the video capture
3315         plug-in directory when enabling video capture.
3316
3317 2017-02-13  Antti Koivisto  <antti@apple.com>
3318
3319         Disable mmap'd cache files if container is class A
3320         https://bugs.webkit.org/show_bug.cgi?id=168241
3321         <rdar://problem/23676252>
3322
3323         Reviewed by JF Bastien and Chris Dumez.
3324
3325         If the mmap'd cache file gets evicted and the device is locked,
3326         then WebContent won't be able to bring the file back in under
3327         class A, causing SIGBUS.
3328
3329         In those circumstances, don't use mmap'd files.
3330
3331         * NetworkProcess/cache/NetworkCache.h:
3332         (WebKit::NetworkCache::Cache::canUseSharedMemoryForBodyData):
3333         * NetworkProcess/cache/NetworkCacheEntry.cpp:
3334         (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord):
3335
3336             Don't initialize the shareable resource handle for the map if forbidden.
3337
3338         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
3339         (WebKit::NetworkCache::canUseSharedMemoryForPath):
3340
3341             Query the system for the protection status of the cache path.
3342
3343         * NetworkProcess/cache/NetworkCacheFileSystem.h:
3344         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3345         (WebKit::NetworkCache::Storage::Storage):
3346         * NetworkProcess/cache/NetworkCacheStorage.h:
3347         (WebKit::NetworkCache::Storage::canUseSharedMemoryForBodyData):
3348
3349 2017-02-13  Youenn Fablet  <youennf@gmail.com>
3350
3351         [WebRTC] libwebrtc socket factory is not assigning the right socket type
3352         https://bugs.webkit.org/show_bug.cgi?id=168233
3353
3354         Reviewed by Brent Fulgham.
3355
3356         * WebProcess/Network/webrtc/LibWebRTCSocketFactory.cpp:
3357         (WebKit::LibWebRTCSocketFactory::CreateUdpSocket):
3358         (WebKit::LibWebRTCSocketFactory::CreateClientTcpSocket):
3359
3360 2017-02-13  Michael Catanzaro  <mcatanzaro@igalia.com>
3361
3362         [GTK] Unreviewed, add missing precondition check
3363
3364         * WebProcess/InjectedBundle/API/gtk/WebKitWebEditor.cpp:
3365         (webkit_web_editor_get_page):
3366
3367 2017-02-13  Michael Catanzaro  <mcatanzaro@igalia.com>
3368
3369         Unreviewed, fix another docs typo.
3370
3371         * UIProcess/API/gtk/WebKitEditingCommands.h:
3372
3373 2017-02-12  Michael Catanzaro  <mcatanzaro@igalia.com>
3374
3375         [GTK] Improve documentation of webkit_context_menu_set_user_data()
3376         https://bugs.webkit.org/show_bug.cgi?id=168214
3377
3378         Reviewed by Carlos Garcia Campos.
3379
3380         * UIProcess/API/gtk/WebKitContextMenu.cpp:
3381
3382 2017-02-12  Dan Bernstein  <mitz@apple.com>
3383
3384         Tried to fix USE(APPLE_INTERNAL_SDK) builds after r212211.
3385
3386         * UIProcess/mac/WebContextMenuProxyMac.mm:
3387         (WebKit::WebContextMenuProxyMac::createShareMenuItem): Use non-deprecated method.
3388
3389 2017-02-12  Dan Bernstein  <mitz@apple.com>
3390
3391         [Cocoa] Some -respondsToSelector: checks are unnecessary
3392         https://bugs.webkit.org/show_bug.cgi?id=168183
3393
3394         Reviewed by Tim Horton.
3395
3396         * Platform/mac/LayerHostingContext.mm:
3397         (WebKit::LayerHostingContext::setColorMatchUntaggedContent): Removed unnecessary
3398           -respondsToSelector: check.
3399         (WebKit::LayerHostingContext::colorMatchUntaggedContent): Ditto.
3400
3401         * Platform/mac/MenuUtilities.mm:
3402         (WebKit::menuItemTitleForTelephoneNumberGroup): Ditto.
3403
3404         * Platform/spi/ios/UIKitSPI.h: Moved declaration of
3405           -[UIScrollView _isInterruptingDeceleration] from WKWebView.mm to the
3406           !USE(APPLE_INTERNAL_SDK) section here.
3407
3408         * Shared/mac/ChildProcessMac.mm:
3409         (WebKit::ChildProcess::setSharedHTTPCookieStorage): Removed unnecessary -respondsToSelector:
3410           check.
3411
3412         * Shared/mac/WebEventFactory.mm:
3413         (WebKit::typeForEvent): Ditto.
3414
3415         * UIProcess/API/Cocoa/WKWebView.mm:
3416         (-[WKWebView _updateVisibleContentRectAfterScrollInView:]): Ditto.
3417
3418         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
3419         (WebKit::WebPaymentCoordinatorProxy::platformOpenPaymentSetup): Ditto.
3420
3421         * UIProcess/Cocoa/WebViewImpl.mm:
3422         (WebKit::WebViewImpl::dismissContentRelativeChildWindowsFromViewOnly): Ditto.
3423
3424         * UIProcess/WKImagePreviewViewController.mm:
3425         (-[WKImagePreviewViewController previewActions]): Removed check whether _WKElementAction
3426           responds to -runActionWithElementInfo:.
3427
3428         * UIProcess/ios/WKActionSheetAssistant.mm:
3429         (-[WKActionSheetAssistant showDataDetectorsSheet]): Ditto.
3430
3431         * UIProcess/ios/WKContentViewInteraction.mm:
3432         (-[WKContentView _lookup:]): Ditto.
3433         (-[WKContentView _share:]): Ditto.
3434         (-[WKContentView _addShortcut:]): Ditto.
3435         (-[WKContentView _promptForReplace:]): Ditto.
3436         (-[WKContentView _transliterateChinese:]): Ditto.
3437         (-[WKContentView _didHandleKeyEvent:eventWasHandled:]): Removed call to
3438           -[UIKeyboardImpl didHandleWebKeyEvent], which is a no-op.
3439         (-[WKContentView _interpretKeyEvent:isCharEvent:]): Removed unnecessary -respondsToSelector:
3440           check.
3441         (-[WKContentView _dataForPreviewItemController:atPosition:type:]): Ditto.
3442
3443         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
3444         (WebKit::TiledCoreAnimationDrawingAreaProxy::createFence): Ditto.
3445
3446         * UIProcess/mac/WKImmediateActionController.mm:
3447         (-[WKImmediateActionController _animationControllerForDataDetectedText]): Ditto.
3448
3449         * UIProcess/mac/WebContextMenuProxyMac.mm:
3450         (WebKit::WebContextMenuProxyMac::createShareMenuItem): Ditto.
3451
3452 2017-02-12  Michael Catanzaro  <mcatanzaro@igalia.com>
3453
3454         [GTK] Unreviewed, minor documentation improvements
3455
3456         * UIProcess/API/gtk/WebKitWebView.cpp:
3457         (webkit_web_view_class_init):
3458         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
3459         (webkit_web_page_class_init):
3460
3461 2017-02-12  Carlos Garcia Campos  <cgarcia@igalia.com>
3462
3463         [SOUP] Downloads fail when the given destination is not a URI
3464         https://bugs.webkit.org/show_bug.cgi?id=168187
3465
3466         Reviewed by Michael Catanzaro.
3467
3468         It always expects a uri, and fails if a local path is given.
3469
3470         Fixes: http/tests/download/anchor-download-no-extension.html
3471                http/tests/download/area-download.html
3472                http/tests/security/anchor-download-allow-data.html
3473                http/tests/security/anchor-download-allow-sameorigin.html
3474
3475         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3476         (WebKit::NetworkDataTaskSoup::download): Use g_file_new_for_path() if the pending destination is a path instead
3477         of a URI.
3478
3479 2017-02-12  Carlos Garcia Campos  <cgarcia@igalia.com>
3480
3481         [GTK] Handle caps lock indicator in event modifiers
3482         https://bugs.webkit.org/show_bug.cgi?id=168186
3483
3484         Reviewed by Michael Catanzaro.
3485
3486         Use PlatformKeyboardEvent::modifiersContainCapsLock() to check if modifiers contain the caps lock and add
3487         Modifiers::CapsLockKey in that case.
3488
3489         * Shared/gtk/WebEventFactory.cpp:
3490         (WebKit::modifiersForEvent):
3491         * UIProcess/API/gtk/WebKitPrivate.cpp:
3492         (wkEventModifiersToGdkModifiers):
3493         (toGdkModifiers):
3494
3495 2017-02-12  Andy Estes  <aestes@apple.com>
3496
3497         [iOS] PDF page number indicator can show "0 of n" on short pages
3498         https://bugs.webkit.org/show_bug.cgi?id=168185
3499
3500         Reviewed by Tim Horton.
3501
3502         When viewing a PDF with a last page that is shorter than the frame height, it's possible
3503         (thanks to rubber-banding) to scroll down until the page no longer intersects the rect we
3504         use to determine the center page. When this happens, the page number indicator displays
3505         "0 of n".
3506
3507         Fix this by handling cases where the first page starts below the center page rect or the
3508         last page ends above it.
3509
3510         * UIProcess/ios/WKPDFView.mm:
3511         (-[WKPDFView _revalidateViews]):
3512
3513 2017-02-11  Alex Christensen  <achristensen@webkit.org>
3514
3515         Fix crashes after [NSURLSession invalidateAndCancel]
3516         https://bugs.webkit.org/show_bug.cgi?id=168181
3517         <rdar://problem/29813868>
3518
3519         Reviewed by Brady Eidson.
3520
3521         When we call NetworkSessionCocoa::invalidateAndCancel, we intend for the session to immediately
3522         become invalid and stop doing things. [NSURLSession invalidateAndCancel] asynchronously cancels
3523         everything and then calls the delegate's didBecomeInvalidWithError, so before this change there
3524         is a time when we have torn down the session with SessionTracker::destroySession but we can still
3525         get a delegate callback which assumes the session and its NetworkStorageSession exists.  If we
3526         get any delegate callbacks after a NetworkSession has been invalidated, we will want to ignore them.
3527
3528         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
3529         (-[WKNetworkSessionDelegate sessionInvalidated]):
3530         (-[WKNetworkSessionDelegate URLSession:didBecomeInvalidWithError:]):
3531         (-[WKNetworkSessionDelegate URLSession:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:]):
3532         (-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
3533         (-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
3534         (-[WKNetworkSessionDelegate URLSession:task:didReceiveChallenge:completionHandler:]):
3535         (-[WKNetworkSessionDelegate URLSession:task:didCompleteWithError:]):
3536         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveResponse:completionHandler:]):
3537         (-[WKNetworkSessionDelegate URLSession:dataTask:didReceiveData:]):
3538         (-[WKNetworkSessionDelegate URLSession:downloadTask:didFinishDownloadingToURL:]):
3539         (-[WKNetworkSessionDelegate URLSession:downloadTask:didWriteData:totalBytesWritten:totalBytesExpectedToWrite:]):
3540         (-[WKNetworkSessionDelegate URLSession:downloadTask:didResumeAtOffset:expectedTotalBytes:]):
3541         (-[WKNetworkSessionDelegate URLSession:dataTask:didBecomeDownloadTask:]):
3542         The pointer to the NetworkSessionCocoa can now be null. We need to check it.
3543         (WebKit::NetworkSessionCocoa::invalidateAndCancel):
3544         Synchronously remove the connection between the delegates and the NetworkSessionCocoa.
3545
3546 2017-02-10  John Wilander  <wilander@apple.com>
3547
3548         Updates to Resource Load Statistics: Get the right website data store and introduce timeout for user interaction
3549         https://bugs.webkit.org/show_bug.cgi?id=167474
3550         <rdar://problem/24681808>
3551         <rdar://problem/24703286>
3552         <rdar://problem/30290270>
3553
3554         This patch does the following:
3555         1. Gets the right website data store. API::WebsiteDataStore::defaultDataStore()
3556             does not provide the right data store.
3557         2. Introduces timeout for user interaction. A domain needs interaction every 30
3558             days to stay in that category.
3559         3. Adds grandfathered to the statistics model in preparation for grandfathering of
3560             existing data records.
3561         4. Adds test infrastructure to allow testing of the various rules in place for
3562             data records removal.
3563         5. Fixes various smaller bugs that were found as part of setting up the tests.
3564         6. Regresses the data records removal counting. We need to come up with a thread
3565             safe way of gathering removal statistics from more than one data store now
3566             that we potentially interact with multiple stores.
3567         7. Adds a first set of layout tests for resource load statistics.
3568
3569         Reviewed by Andy Estes.
3570
3571         * PlatformEfl.cmake:
3572             Added UIProcess/WebResourceLoadStatisticsManager.cpp and
3573             UIProcess/API/C/WKResourceLoadStatisticsManager.cpp.
3574         * PlatformGTK.cmake:
3575             Added UIProcess/WebResourceLoadStatisticsManager.cpp and
3576             UIProcess/API/C/WKResourceLoadStatisticsManager.cpp.
3577         * PlatformMac.cmake:
3578             Added UIProcess/WebResourceLoadStatisticsManager.cpp and
3579             UIProcess/API/C/WKResourceLoadStatisticsManager.cpp.
3580         * Shared/API/APIObject.h:
3581             Adds WebResourceLoadStatisticsManager to the Type enum.
3582         * Shared/API/c/WKBase.h:
3583             Typedef of WKResourceLoadStatisticsManagerRef.
3584         * Shared/WebCoreArgumentCoders.cpp:
3585         (IPC::ArgumentCoder<ResourceLoadStatistics>::encode):
3586         (IPC::ArgumentCoder<ResourceLoadStatistics>::decode):
3587             Adds support for statistics mostRecentUserInteraction, grandfathered, and
3588             dataRecordsRemoved.
3589         * UIProcess/API/C/WKAPICast.h:
3590             Adds API mapping between WKResourceLoadStatisticsManagerRef and 
3591             WebResourceLoadStatisticsManager.
3592         * UIProcess/API/C/WKResourceLoadStatisticsManager.cpp: Added.
3593         (WKResourceLoadStatisticsManagerGetTypeID):
3594         (WKResourceLoadStatisticsManagerSetPrevalentResource):
3595         (WKResourceLoadStatisticsManagerIsPrevalentResource):
3596         (WKResourceLoadStatisticsManagerSetHasHadUserInteraction):
3597         (WKResourceLoadStatisticsManagerIsHasHadUserInteraction):
3598         (WKResourceLoadStatisticsManagerSetTimeToLiveUserInteraction):
3599         (WKResourceLoadStatisticsManagerFireDataModificationHandler):
3600         (WKResourceLoadStatisticsManagerSetNotifyPagesWhenDataRecordsWereScanned):
3601         (WKResourceLoadStatisticsManagerSetShouldClassifyResourcesBeforeDataRecordsRemoval):
3602         (WKResourceLoadStatisticsManagerSetMinimumTimeBetweeenDataRecordsRemoval):
3603         (WKResourceLoadStatisticsManagerResetToConsistentState):
3604             API level bridge to WebResourceLoadStatisticsManager functions.
3605         * UIProcess/API/C/WKResourceLoadStatisticsManager.h: Added.
3606         * UIProcess/WebProcessProxy.cpp:
3607         (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyOwnedDomainsInAllPersistentDataStores):
3608             A way to delete website data in persistent store(s) configured by the 
3609             embedding client. API::WebsiteDataStore::defaultDataStore() does not 
3610             do this which caused us to skip session storage.
3611         * UIProcess/WebProcessProxy.h:
3612         * UIProcess/WebResourceLoadStatisticsManager.cpp: Added.
3613         (WebKit::WebResourceLoadStatisticsManager::setPrevalentResource):
3614         (WebKit::WebResourceLoadStatisticsManager::isPrevalentResource):
3615         (WebKit::WebResourceLoadStatisticsManager::setHasHadUserInteraction):
3616         (WebKit::WebResourceLoadStatisticsManager::hasHadUserInteraction):
3617         (WebKit::WebResourceLoadStatisticsManager::setTimeToLiveUserInteraction):
3618         (WebKit::WebResourceLoadStatisticsManager::fireDataModificationHandler):
3619         (WebKit::WebResourceLoadStatisticsManager::setNotifyPagesWhenDataRecordsWereScanned):
3620         (WebKit::WebResourceLoadStatisticsManager::setShouldClassifyResourcesBeforeDataRecordsRemoval):
3621         (WebKit::WebResourceLoadStatisticsManager::setMinimumTimeBetweeenDataRecordsRemoval):
3622         (WebKit::WebResourceLoadStatisticsManager::resetToConsistentState):
3623             Static functions to manage the state and behavior of the UI process' 
3624             resource load statistics store.
3625         * UIProcess/WebResourceLoadStatisticsManager.h: Added.
3626         (WebKit::WebResourceLoadStatisticsManager::create):
3627         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3628         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
3629             An effect of a member variable rename. See header file comment below.
3630         (WebKit::WebResourceLoadStatisticsStore::setNotifyPagesWhenDataRecordsWereScanned):
3631         (WebKit::WebResourceLoadStatisticsStore::setShouldClassifyResourcesBeforeDataRecordsRemoval):
3632         (WebKit::WebResourceLoadStatisticsStore::setMinimumTimeBetweeenDataRecordsRemoval):
3633             Three static functions for controlling the behavior of the store.
3634         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
3635             Changes:
3636             1. Covers all data record types.
3637             2. Allows data removal when m_lastTimeDataRecordsWereRemoved is not set.
3638             3. Moves the heavy lifting to WebsiteDataStore (see below).
3639             4. No longer counts removed data regressions.
3640         (WebKit::WebResourceLoadStatisticsStore::processStatisticsAndDataRecords):
3641             See next comment.
3642         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
3643             WebResourceLoadStatisticsStore::processStatisticsAndDataRecords() is 
3644             broken out of WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated
3645             to allow for statistics processing without prior classification.
3646             Tests need to set statistics and a run of the classifier may
3647             reset the data.
3648         (WebKit::WebResourceLoadStatisticsStore::registerSharedResourceLoadObserver):
3649             Sets the notification callback which calls 
3650             WebResourceLoadStatisticsStore::processStatisticsAndDataRecords().
3651         * UIProcess/WebResourceLoadStatisticsStore.h:
3652         (WebKit::WebResourceLoadStatisticsStore::coreStore):
3653             Renamed m_resourceStatisticsStore to m_resourceLoadStatisticsStore to
3654             harmonize with other naming.
3655         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3656         (WebKit::WebsiteDataStore::fetchDataForTopPrivatelyOwnedDomains):
3657             This is now where matching is made between prevalent resources
3658             and data records. This function is used by 
3659             WebsiteDataStore::removeDataForTopPrivatelyOwnedDomains().
3660         (WebKit::WebsiteDataStore::removeDataForTopPrivatelyOwnedDomains):
3661             The function WebResourceLoadStatisticsStore::removeDataRecords()
3662             calls to get data records removed in all persistent stores.
3663         * UIProcess/WebsiteData/WebsiteDataStore.h:
3664         * WebKit2.xcodeproj/project.pbxproj:
3665         * WebProcess/WebProcess.cpp:
3666         (WebKit::m_resourceLoadStatisticsStore):
3667         (WebKit::WebProcess::statisticsChangedTimerFired):
3668         (WebKit::m_resourceLoadStatisticsStorage): Deleted.
3669             Renamed m_resourceLoadStatisticsStorage to m_resourceLoadStatisticsStore 
3670             to harmonize with other naming.
3671         * WebProcess/WebProcess.h:
3672
3673 2017-02-10  Simon Fraser  <simon.fraser@apple.com>
3674
3675         Zero out some WKWebView state in the case of a web content crash
3676         https://bugs.webkit.org/show_bug.cgi?id=168157
3677
3678         Reviewed by Tim Horton.
3679
3680         Reset some bits of state in WKWebView when the web content process crashes, in
3681         to try to avoid states that might cause the web view to stay blank.
3682
3683         * UIProcess/API/Cocoa/WKWebView.mm:
3684         (-[WKWebView _processDidExit]):
3685
3686 2017-02-10  Daniel Bates  <dabates@apple.com>
3687
3688         Detach frame from document when entering page cache
3689         https://bugs.webkit.org/show_bug.cgi?id=166774
3690         <rdar://problem/29904368>
3691
3692         Reviewed by Chris Dumez.
3693
3694         * Shared/WebPreferencesDefinitions.h:
3695         * UIProcess/API/C/WKPreferences.cpp:
3696         (WKPreferencesSetAllowsPageCacheWithWindowOpener): Deleted.
3697         (WKPreferencesGetAllowsPageCacheWithWindowOpener): Deleted.
3698         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3699         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3700         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
3701         * WebProcess/WebPage/WebPage.cpp:
3702         (WebKit::WebPage::updatePreferences):
3703
3704 2017-02-10  Carlos Garcia Campos  <cgarcia@igalia.com>
3705
3706         WebInspector: refactor RemoteInspector to move cocoa specific code to their own files
3707         https://bugs.webkit.org/show_bug.cgi?id=166681
3708
3709         Reviewed by Michael Catanzaro.
3710
3711         * WebProcess/WebProcess.cpp:
3712         (WebKit::WebProcess::initializeWebProcess): Add PLATFORM(COCOA) to the ifdef.
3713
3714 2017-02-10  Tim Horton  <timothy_horton@apple.com>
3715
3716         Infinite UI process hang under ensurePositionInformationIsUpToDate
3717         https://bugs.webkit.org/show_bug.cgi?id=168154
3718         <rdar://problem/30428673>
3719
3720         Reviewed by Simon Fraser.
3721
3722         * UIProcess/ios/WKContentViewInteraction.mm:
3723         (-[WKContentView cleanupInteraction]):
3724         If the web process crashes or we're being torn down for another reason,
3725         assume that we aren't ever going to receive any pending async interaction
3726         information update. Otherwise, ensurePositionInformationIsUpToDate can end
3727         up waiting for it forever.
3728
3729 2017-02-10  Andrew Gold  <agold@apple.com>
3730
3731         Add mediaStreamEnabled property to WKPreferences for Cocoa.
3732         https://bugs.webkit.org/show_bug.cgi?id=168080
3733
3734         Reviewed by Tim Horton.
3735
3736         * UIProcess/API/Cocoa/WKWebView.mm:
3737         (-[WKWebView _initializeWithConfiguration:]): Sets the pageConfiguration's mediaStreamEnabled preference value.
3738
3739         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3740         (-[WKWebViewConfiguration copyWithZone:]): Copies the mediaStreamEnabled property.
3741         (-[WKWebViewConfiguration _mediaStreamEnabled]): Gets the mediaStreamEnabled property.
3742         (-[WKWebViewConfiguration _setMediaStreamEnabled:]): Sets the mediaStreamEnabled property.
3743         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
3744
3745 2017-02-10  Olivier Blin  <olivier.blin@softathome.com>
3746
3747         WebProcess: remove unused m_inDidClose
3748         https://bugs.webkit.org/show_bug.cgi?id=168121
3749
3750         Reviewed by Alex Christensen.
3751
3752         * WebProcess/WebProcess.cpp:
3753         (WebKit::WebProcess::didClose):
3754         * WebProcess/WebProcess.h:
3755         m_inDidClose has been unused since r83774
3756
3757 2017-02-10  Joseph Pecoraro  <pecoraro@apple.com>
3758
3759         [Resource Timing] Enable Resource Timing by default in Tests
3760         https://bugs.webkit.org/show_bug.cgi?id=168145
3761
3762         Reviewed by Ryosuke Niwa.
3763
3764         * Shared/WebPreferencesDefinitions.h:
3765         * UIProcess/API/C/WKPreferences.cpp:
3766         (WKPreferencesSetResourceTimingEnabled):
3767         (WKPreferencesGetResourceTimingEnabled):
3768         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3769         * WebProcess/WebPage/WebPage.cpp:
3770         (WebKit::WebPage::updatePreferences):
3771
3772 2017-02-10  Dan Bernstein  <mitz@apple.com>
3773
3774         [Cocoa] Add shouldChangeSelectedRange to WKWebProcessPlugInEditingDelegate
3775         https://bugs.webkit.org/show_bug.cgi?id=168097
3776
3777         Reviewed by Tim Horton.
3778
3779         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
3780           Declared new delegate method.
3781         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3782         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): Dispatch new delegate
3783           method.
3784
3785         * WebProcess/WebPage/ios/WebPageIOS.mm:
3786         (WebKit::WebPage::selectWithGesture): Pass UserTriggered whan calling
3787           WebCore::Frame::Selection::setSelectedRange, so that the delegate is consulted.
3788         (WebKit::WebPage::changeBlockSelection): Ditto.
3789         (WebKit::WebPage::updateSelectionWithTouches): Ditto.
3790         (WebKit::WebPage::selectWithTwoTouches): Ditto.
3791         (WebKit::WebPage::extendSelection): Ditto.
3792         (WebKit::WebPage::selectWordBackward): Ditto,
3793         (WebKit::WebPage::moveSelectionByOffset): Ditto.
3794         (WebKit::WebPage::selectPositionAtPoint): Ditto.
3795         (WebKit::WebPage::selectPositionAtBoundaryWithDirection): Ditto.
3796         (WebKit::WebPage::moveSelectionAtBoundaryWithDirection): Ditto.
3797         (WebKit::WebPage::selectTextWithGranularityAtPoint): Ditto.
3798         (WebKit::WebPage::updateSelectionWithExtentPointAndBoundary): Ditto.
3799         (WebKit::WebPage::updateSelectionWithExtentPoint): Ditto.
3800
3801 2017-02-10  Brady Eidson  <beidson@apple.com>
3802
3803         Replace all WebKit Library Version checks in WK2 with SDK version checks.
3804         https://bugs.webkit.org/show_bug.cgi?id=168124
3805
3806         Reviewed by Geoffrey Garen.
3807
3808         This change gets rid of WebKit Library Version checks and replaces them with SDK version checks.
3809         
3810         To allow our tools to still be able to test new behaviors even when built against older SDKs,
3811         it also opts them into an SPI default to have "linkedOnOrAfter()" always return true.
3812         
3813         * Shared/Cocoa/CompletionHandlerCallChecker.mm:
3814         (WebKit::shouldThrowExceptionForDuplicateCompletionHandlerCall):
3815         
3816         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3817         (-[WKWebViewConfiguration init]):
3818         
3819         * UIProcess/Cocoa/VersionChecks.h:
3820         (WebKit::linkedOnOrAfter): Deleted.
3821         * UIProcess/Cocoa/VersionChecks.mm:
3822         (WebKit::linkedOnOrAfter):
3823         
3824         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3825         (WebKit::WebProcessPool::isNetworkCacheEnabled):
3826
3827 2017-02-10  Brian Burg  <bburg@apple.com>
3828
3829         [Cocoa] Web Inspector: generate an NS_ENUM containing platforms supported by the protocol code generator
3830         https://bugs.webkit.org/show_bug.cgi?id=168019
3831         <rdar://problem/28718990>
3832
3833         Reviewed by Joseph Pecoraro.
3834
3835         * UIProcess/Automation/Automation.json: Fix the platform values to be lowercase.
3836
3837 2017-02-10  Brian Burg  <bburg@apple.com>
3838
3839         Web Automation: fail gracefully when a screenshot cannot be encoded as base64
3840         https://bugs.webkit.org/show_bug.cgi?id=168095
3841         <rdar://problem/30297427>
3842
3843         Reviewed by Joseph Pecoraro.
3844
3845         Convert platformGetBase64EncodedPNGData to return a std::optional<String>.
3846         Return nullopt if we can't create a screenshot or convert it to base64.
3847
3848         * UIProcess/Automation/WebAutomationSession.cpp:
3849         (WebKit::WebAutomationSession::didTakeScreenshot):
3850         (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
3851         * UIProcess/Automation/WebAutomationSession.h:
3852         * UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm:
3853         (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
3854
3855 2017-02-09  Carlos Garcia Campos  <cgarcia@igalia.com>
3856
3857         Unreviewed. Fix GTK+ build with threaded compositor disabled.
3858
3859         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
3860         (WebKit::AcceleratedDrawingArea::enterAcceleratedCompositingMode):
3861         (WebKit::AcceleratedDrawingArea::exitAcceleratedCompositingModeNow):
3862
3863 2017-02-09  Alex Christensen  <achristensen@webkit.org>
3864
3865         Unreviewed, rolling out r212040.
3866
3867         Broke build.  I'm not surprised
3868
3869         Reverted changeset:
3870
3871         "[WebRTC][Mac] Activate libwebrtc"
3872         https://bugs.webkit.org/show_bug.cgi?id=167293
3873         http://trac.webkit.org/changeset/212040
3874
3875 2017-02-09  Chris Dumez  <cdumez@apple.com>
3876
3877         [Mac][WK2] Use MIME type to add file extension to downloads' suggested filenames when missing
3878         https://bugs.webkit.org/show_bug.cgi?id=168077
3879         <rdar://problem/30412595>
3880
3881         Reviewed by Alex Christensen.
3882
3883         Use MIME type to add file extension to downloads' suggested filenames when missing:
3884         - https://html.spec.whatwg.org/#as-a-download (step 19)
3885
3886         This new behavior matches Chrome.
3887
3888         * NetworkProcess/Downloads/BlobDownloadClient.cpp:
3889         (WebKit::BlobDownloadClient::didReceiveResponseAsync):
3890         * NetworkProcess/Downloads/Download.cpp:
3891         (WebKit::Download::didReceiveResponse):
3892         (WebKit::Download::decideDestinationWithSuggestedFilename):
3893         * NetworkProcess/Downloads/Download.h:
3894         * NetworkProcess/NetworkProcess.cpp:
3895         (WebKit::NetworkProcess::findPendingDownloadLocation):
3896         * UIProcess/Downloads/DownloadProxy.cpp:
3897         (WebKit::DownloadProxy::didStart):
3898         (WebKit::DownloadProxy::decideDestinationWithSuggestedFilename):
3899         * UIProcess/Downloads/DownloadProxy.h:
3900         * UIProcess/Downloads/DownloadProxy.messages.in:
3901
3902 2017-02-09  Youenn Fablet  <youenn@apple.com>
3903
3904         [WebRTC][Mac] Activate libwebrtc
3905         https://bugs.webkit.org/show_bug.cgi?id=167293
3906
3907         Reviewed by Alex Christensen.
3908
3909         * Shared/WebPreferencesDefinitions.h:
3910
3911 2017-02-09  Alex Christensen  <achristensen@webkit.org>
3912
3913         Fix libwebrtc build on case-sensitive file systems.
3914
3915         * WebProcess/Network/webrtc/WebRTCMonitor.cpp:
3916
3917 2017-02-09  Alex Christensen  <achristensen@webkit.org>
3918
3919         Fix CMake build.
3920
3921         * PlatformMac.cmake:
3922
3923 2017-02-09  Brady Eidson  <beidson@apple.com>
3924
3925         Transition "WebKit Library Version" checks to SDK version checks.
3926         <rdar://problem/30313696> and https://bugs.webkit.org/show_bug.cgi?id=168056
3927
3928         Reviewed by Geoffrey Garen.
3929
3930         When doing linkedOnOrAfter checks, relying solely on the WebKit library version number is error prone,
3931         since apps may not link against WebKit directly and therefore the linked WebKit is unknown.
3932         
3933         We should first prefer a version check on the SDK that the app was built with.
3934         
3935         If that check fails, we can fallback to the linked WebKit library version number if it exists.
3936
3937         * Shared/Cocoa/CompletionHandlerCallChecker.mm:
3938         (WebKit::shouldThrowExceptionForDuplicateCompletionHandlerCall):
3939
3940         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3941         (-[WKWebViewConfiguration init]):
3942
3943         For each "linked-on-or-after" feature, include both the WebKit library version and SDK version:
3944         * UIProcess/Cocoa/VersionChecks.h:
3945         (WebKit::linkedOnOrAfter):
3946         * UIProcess/Cocoa/VersionChecks.mm:
3947         (WebKit::linkedOnOrAfter):
3948         (WebKit::linkTimeVersion): Deleted.
3949
3950         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3951         (WebKit::WebProcessPool::isNetworkCacheEnabled):
3952
3953 2017-02-09  Commit Queue  <commit-queue@webkit.org>
3954
3955         Unreviewed, rolling out r211980 and r211987.
3956         https://bugs.webkit.org/show_bug.cgi?id=168072
3957
3958         Caused API test WebKit2.DuplicateCompletionHandlerCalls to
3959         fail (Requested by ryanhaddad on #webkit).
3960
3961         Reverted changesets:
3962
3963         "Transition "WebKit Library Version" checks to SDK version
3964         checks."
3965         https://bugs.webkit.org/show_bug.cgi?id=168056
3966         http://trac.webkit.org/changeset/211980
3967
3968         "Build fix for APPLE_INTERNAL_SDK builds after r211980."
3969         http://trac.webkit.org/changeset/211987
3970
3971 2017-02-09  Brady Eidson  <beidson@apple.com>
3972
3973         Transition "WebKit Library Version" checks to SDK version checks.
3974         <rdar://problem/30313696> and https://bugs.webkit.org/show_bug.cgi?id=168056
3975
3976         Reviewed by Geoffrey Garen.
3977
3978         Library version linkedOnOrAfter checks are error prone since apps may not link directly to WebKit.
3979         
3980         We always know what version of the SDK an app was built with, so we should use SDK version checks
3981         whenever possible.
3982
3983         * Shared/Cocoa/CompletionHandlerCallChecker.mm:
3984         (WebKit::shouldThrowExceptionForDuplicateCompletionHandlerCall):
3985         
3986         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
3987         (-[WKWebViewConfiguration init]):
3988         
3989         Add SDKVersion form of the linkedOnOrAfter check, and transition over the current Library Version checks:
3990         * UIProcess/Cocoa/VersionChecks.h: 
3991         * UIProcess/Cocoa/VersionChecks.mm:
3992         (WebKit::linkedOnOrAfter):
3993         
3994         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3995         (WebKit::WebProcessPool::isNetworkCacheEnabled):
3996
3997 2017-02-09  Antti Koivisto  <antti@apple.com>
3998
3999         Use all cacheable speculatively loaded responses
4000         https://bugs.webkit.org/show_bug.cgi?id=168052
4001
4002         Reviewed by Andreas Kling.
4003
4004         We currently only allow 200 responses. There is no reason not to use speculative responses
4005         that have other cacheable status codes. This is helpful for 204s and 404s.
4006
4007         * NetworkProcess/cache/NetworkCache.cpp:
4008         (WebKit::NetworkCache::makeStoreDecision):
4009         (WebKit::NetworkCache::isStatusCodeCacheableByDefault): Deleted.
4010         (WebKit::NetworkCache::isStatusCodePotentiallyCacheable): Deleted.
4011
4012             Move to CacheValidation.h/cpp
4013
4014         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
4015         (WebKit::NetworkCache::SpeculativeLoad::didFinishLoading):
4016
4017             Allow all cacheable-by-default responses.
4018
4019 2017-02-09  Tomas Popela  <tpopela@redhat.com>
4020
4021         Unreviewed. Fix gtk-doc warning
4022
4023         html/WebKitSettings.html:4435: warning: no link for: 'api-index-2.3' -> (2.3).
4024
4025         * UIProcess/API/gtk/WebKitSettings.cpp:
4026         (webkit_settings_class_init):
4027
4028 2017-02-09  Antti Koivisto  <antti@apple.com>
4029
4030         Remove most cases of #if ENABLE(CACHE_PARTITIONING)
4031         https://bugs.webkit.org/show_bug.cgi?id=167990
4032
4033         Reviewed by Sam Weinig.
4034
4035         * NetworkProcess/NetworkResourceLoader.cpp:
4036         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
4037         * NetworkProcess/cache/NetworkCache.cpp:
4038         (WebKit::NetworkCache::Cache::makeCacheKey):
4039         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
4040         (WebKit::NetworkCache::constructRevalidationRequest):
4041         * Shared/WebCoreArgumentCoders.cpp:
4042         (IPC::ArgumentCoder<ResourceRequest>::encode):
4043         (IPC::ArgumentCoder<ResourceRequest>::decode):
4044         * Shared/WebProcessCreationParameters.cpp:
4045         (WebKit::WebProcessCreationParameters::encode):
4046         (WebKit::WebProcessCreationParameters::decode):
4047         * Shared/WebProcessCreationParameters.h:
4048         * UIProcess/API/C/WKContext.cpp:
4049         (WKContextRegisterURLSchemeAsCachePartitioned):