Annotate MediaStream and WebRTC idl with EnabledAtRuntime flag
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2016-12-13  Eric Carlson  <eric.carlson@apple.com>
2
3         Annotate MediaStream and WebRTC idl with EnabledAtRuntime flag
4         https://bugs.webkit.org/show_bug.cgi?id=165251
5
6         Reviewed by Youenn Fablet.
7
8         * WebProcess/WebPage/WebPage.cpp:
9         (WebKit::WebPage::updatePreferences): Update the media stream and peer connection runtime
10         feature instead of the setting.
11
12 2016-12-13  Sergio Villar Senin  <svillar@igalia.com>
13
14         Fix GTK build after r209733
15         https://bugs.webkit.org/show_bug.cgi?id=165794
16
17         Document::visibilityState() now returns an IDL string enumeration.
18
19         Reviewed by Žan Doberšek.
20
21         * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
22         (webkit_dom_document_get_visibility_state):
23
24 2016-12-12  Dean Jackson  <dino@apple.com>
25
26         [iOS] MediaDocument "Done" button should navigate the page back
27         https://bugs.webkit.org/show_bug.cgi?id=165779
28
29         Reviewed by Sam Weinig.
30
31         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
32         * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
33         (WebKit::WebVideoFullscreenModelContext::requestFullscreenMode):
34         (WebKit::WebVideoFullscreenManagerProxy::requestFullscreenMode):
35         * WebProcess/cocoa/WebVideoFullscreenManager.h:
36         * WebProcess/cocoa/WebVideoFullscreenManager.messages.in:
37         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
38         (WebKit::WebVideoFullscreenManager::requestFullscreenMode):
39
40 2016-12-12  Tim Horton  <timothy_horton@apple.com>
41
42         Provide SPI to avoid blocking on painting when coming into view
43         https://bugs.webkit.org/show_bug.cgi?id=165780
44         <rdar://problem/29009559>
45
46         Reviewed by Simon Fraser.
47
48         By default, when parenting a WKWebView which was previously in-window,
49         we block on painting to ensure that we don't flash stale content.
50         We added SPI to disable this behavior to WKWebViewConfiguration, but
51         some clients might want the behavior most of the time, but sometimes
52         instead want to not block the UI process main thread, but instead do
53         their own work (e.g. removing a snapshot) when painting eventually occurs.
54
55         * UIProcess/API/Cocoa/WKWebView.mm:
56         (-[WKWebView _doAfterNextPresentationUpdateWithoutWaitingForPainting:]):
57         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
58         Tell WebPageProxy not to block on painting next time we are parented,
59         and use doAfterNextPresentationUpdate to call the block when the painting
60         does eventually happen. This SPI must be called before - but in the same
61         runloop cycle - the WKWebView is brought back in-window to work correctly.
62         
63         * UIProcess/WebPageProxy.cpp:
64         (WebKit::WebPageProxy::dispatchActivityStateChange):
65         * UIProcess/WebPageProxy.h:
66         (WebKit::WebPageProxy::skipWaitingForPaintAfterNextViewDidMoveToWindow):
67         If we would block because we're coming in-window, but the bit to skip
68         blocking the next time we get brought in-window is set, reset the bit, 
69         and avoid blocking.
70
71 2016-12-12  Chris Dumez  <cdumez@apple.com>
72
73         Document.visibilityState should use an IDL string enumeration
74         https://bugs.webkit.org/show_bug.cgi?id=165774
75
76         Reviewed by Daniel Bates.
77
78         * Shared/API/c/WKSharedAPICast.h:
79         (WebKit::toPageVisibilityState):
80
81 2016-12-11  Konstantin Tokarev  <annulen@yandex.ru>
82
83         Unreviewed attempt to fix EFL and Mac/cmake builds after r209665.
84         https://bugs.webkit.org/show_bug.cgi?id=165686
85
86         * PlatformEfl.cmake: WebKit2 should precede other target so that right
87         config.h comes first in include path.
88
89 2016-12-11  Tim Horton  <timothy_horton@apple.com>
90
91         Quarter-second stalls scrolling images that are links because of sync getPositionInformation
92         https://bugs.webkit.org/show_bug.cgi?id=165707
93
94         Reviewed by Simon Fraser.
95
96         * UIProcess/ios/WKContentViewInteraction.mm:
97         (-[WKContentView positionInformationForActionSheetAssistant:]):
98         (-[WKContentView updatePositionInformationForActionSheetAssistant:]):
99         For now, synchronously block when presenting the action sheet if we
100         don't have a snapshot ready.
101
102         * WebProcess/WebPage/ios/WebPageIOS.mm:
103         (WebKit::WebPage::getPositionInformation):
104         Respect includeSnapshot in another place in getPositionInformation,
105         so that many getPositionInformations don't have to do extra snapshotting work.
106
107 2016-12-10  Filip Pizlo  <fpizlo@apple.com>
108
109         The DOM should have an advancing wavefront opaque root barrier
110         https://bugs.webkit.org/show_bug.cgi?id=165712
111
112         Reviewed by Yusuke Suzuki.
113         
114         Propagate the JSDOMWindowBase::commonVM() -> commonVM() change.
115
116         * Shared/linux/WebMemorySamplerLinux.cpp:
117         (WebKit::WebMemorySampler::sampleWebKit):
118         * Shared/mac/WebMemorySampler.mac.mm:
119         (WebKit::WebMemorySampler::sampleWebKit):
120         * WebProcess/InjectedBundle/InjectedBundle.cpp:
121         (WebKit::InjectedBundle::javaScriptObjectsCount):
122         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
123         (WebKit::JSNPObject::callMethod):
124         (WebKit::JSNPObject::callObject):
125         (WebKit::JSNPObject::callConstructor):
126         (WebKit::JSNPObject::put):
127         (WebKit::JSNPObject::deleteProperty):
128         (WebKit::JSNPObject::getOwnPropertyNames):
129         (WebKit::JSNPObject::propertyGetter):
130         * WebProcess/WebPage/WebPage.cpp:
131         (WebKit::WebPage::runJavaScriptInMainFrame):
132         (WebKit::WebPage::getBytecodeProfile):
133         (WebKit::WebPage::getSamplingProfilerOutput):
134         * WebProcess/WebProcess.cpp:
135         (WebKit::WebProcess::getWebCoreStatistics):
136
137 2016-12-11  Konstantin Tokarev  <annulen@yandex.ru>
138
139         Unreviewed build fix for EFL after r209665
140
141         * UIProcess/efl/TextCheckerClientEfl.h:
142
143 2016-12-10  Konstantin Tokarev  <annulen@yandex.ru>
144
145         [cmake] Include WTF, JSC, and WebCore headers automatically to targers using them
146         https://bugs.webkit.org/show_bug.cgi?id=165686
147
148         Reviewed by Michael Catanzaro.
149
150         This change reduces duplication of include path lists between modules,
151         and reduces future need for fixes like r209605 (broken build because of
152         WebCore header suddenly becoming used in WebKit2).
153
154         * CMakeLists.txt:
155         * PlatformEfl.cmake:
156         * PlatformGTK.cmake:
157         * PlatformMac.cmake:
158
159 2016-12-10  Antti Koivisto  <antti@apple.com>
160
161         CrashTracer: com.apple.WebKit.Networking at WTF::ThreadSafeRefCounted<WebKit::NetworkCache::IOChannel>::deref
162         https://bugs.webkit.org/show_bug.cgi?id=165659
163         <rdar://problem/27077977>
164
165         Reviewed by Darin Adler.
166
167         * NetworkProcess/cache/NetworkCacheIOChannel.h:
168         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
169         (WebKit::NetworkCache::IOChannel::~IOChannel):
170
171             Add non-inlined destructor and release assert against double deletion to narrow down this crash.
172
173 2016-12-09  Brent Fulgham  <bfulgham@apple.com>
174
175         WebCore::Timer is not compatible with UIProcess
176         https://bugs.webkit.org/show_bug.cgi?id=165706
177         <rdar://problem/29360564>
178
179         Reviewed by Andy Estes.
180
181         Anders has explained to me (at least twice) that WebCore::Timer must not
182         be used in UIProcess code. A recent bug fix introduced a WebCore::Timer,
183         which led to another crash.
184         
185         This patch switches from WebCore::Timer to WTF::RunLoop::Timer to avoid
186         the problem.
187
188         * UIProcess/Cocoa/NavigationState.h:
189         * UIProcess/Cocoa/NavigationState.mm:
190         (WebKit::NavigationState::NavigationState):
191
192 2016-12-09  Eric Carlson  <eric.carlson@apple.com>
193
194         Annotate MediaStream and WebRTC idl with EnabledAtRuntime flag
195         https://bugs.webkit.org/show_bug.cgi?id=165251
196
197         Reviewed by Dean Jackson.
198
199         Based on a patch by Dr Alex Gouaillard <agouaillard@gmail.com>
200
201         * Shared/WebPreferencesDefinitions.h: Add peerConnectionEnabled.
202
203         * UIProcess/API/C/WKPreferences.cpp:
204         (WKPreferencesSetPeerConnectionEnabled): Added.
205         (WKPreferencesGetPeerConnectionEnabled): Added.
206         * UIProcess/API/C/WKPreferencesRef.h:
207
208         * WebProcess/InjectedBundle/InjectedBundle.cpp:
209         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner): Add WebKitMediaStreamEnabled
210           and WebKitPeerConnectionEnabled.
211
212         * WebProcess/WebPage/WebPage.cpp:
213         (WebKit::WebPage::updatePreferences): Initialize the peerConnection preference.
214
215 2016-12-09  Brady Eidson  <beidson@apple.com>
216
217         Re-landing:
218         Add _WKIconLoadingDelegate SPI.
219         https://bugs.webkit.org/show_bug.cgi?id=164894
220
221         Reviewed by Alex Christensen.
222
223         With this client, WebCore will ask the FrameLoaderClient about each icon found in the <head>.
224
225         WebKit2 will then ask the embedding app - for each icon - if it wants that icon to load.
226
227         For icons the app decides to load, WebKit will pass the data to the app without storing locally.
228
229         * UIProcess/API/APIIconLoadingClient.h: Copied from Source/WebCore/html/LinkIconCollector.h.
230         (API::IconLoadingClient::~IconLoadingClient):
231         (API::IconLoadingClient::getLoadDecisionForIcon):
232
233         * UIProcess/API/Cocoa/WKWebView.mm:
234         (-[WKWebView _initializeWithConfiguration:]):
235         (-[WKWebView _iconLoadingDelegate]):
236         (-[WKWebView _setIconLoadingDelegate:]):
237         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
238
239         * UIProcess/API/Cocoa/_WKIconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.
240
241         * UIProcess/API/Cocoa/_WKLinkIconParameters.h: Copied from Source/WebCore/html/LinkIconCollector.h.
242         * UIProcess/API/Cocoa/_WKLinkIconParameters.mm: Copied from Source/WebCore/html/LinkIconCollector.h.
243         (-[_WKLinkIconParameters _initWithLinkIcon:]):
244         (-[_WKLinkIconParameters url]):
245         (-[_WKLinkIconParameters mimeType]):
246         (-[_WKLinkIconParameters size]):
247         (-[_WKLinkIconParameters iconType]):
248         * UIProcess/API/Cocoa/_WKLinkIconParametersInternal.h: Copied from Source/WebCore/html/LinkIconCollector.h.
249
250         * UIProcess/Cocoa/IconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.
251         * UIProcess/Cocoa/IconLoadingDelegate.mm: Added.
252         (WebKit::IconLoadingDelegate::IconLoadingDelegate):
253         (WebKit::IconLoadingDelegate::~IconLoadingDelegate):
254         (WebKit::IconLoadingDelegate::createIconLoadingClient):
255         (WebKit::IconLoadingDelegate::delegate):
256         (WebKit::IconLoadingDelegate::setDelegate):
257         (WebKit::IconLoadingDelegate::IconLoadingClient::IconLoadingClient):
258         (WebKit::IconLoadingDelegate::IconLoadingClient::~IconLoadingClient):
259         (WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):
260
261         * UIProcess/WebPageProxy.cpp:
262         (WebKit::WebPageProxy::setIconLoadingClient):
263         (WebKit::WebPageProxy::getLoadDecisionForIcon):
264         (WebKit::WebPageProxy::finishedLoadingIcon):
265         * UIProcess/WebPageProxy.h:
266         (WebKit::WebPageProxy::iconLoadingClient):
267         * UIProcess/WebPageProxy.messages.in:
268
269         * WebKit2.xcodeproj/project.pbxproj:
270
271         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
272         (WebKit::WebFrameLoaderClient::useIconLoadingClient):
273         (WebKit::WebFrameLoaderClient::getLoadDecisionForIcon):
274         (WebKit::WebFrameLoaderClient::finishedLoadingIcon):
275         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
276         (WebKit::WebFrameLoaderClient::setUseIconLoadingClient):
277
278         * WebProcess/WebPage/WebPage.cpp:
279         (WebKit::WebPage::didGetLoadDecisionForIcon):
280         (WebKit::WebPage::setUseIconLoadingClient):
281         * WebProcess/WebPage/WebPage.h:
282         * WebProcess/WebPage/WebPage.messages.in:
283
284 2016-12-09  Simon Fraser  <simon.fraser@apple.com>
285
286         Fix initialization of contentUpdateFrequency
287         https://bugs.webkit.org/show_bug.cgi?id=165705
288         rdar://problem/29602039
289
290         Reviewed by Tim Horton.
291
292         The value that controls web content update frequency was not being initialized.
293
294         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
295         (-[WKWebViewConfiguration init]):
296
297 2016-12-09  Anders Carlsson  <andersca@apple.com>
298
299         Once we can send Mach messages again, make sure to send any pending outgoing messages
300         https://bugs.webkit.org/show_bug.cgi?id=165693
301
302         Reviewed by Brady Eidson.
303
304         * Platform/IPC/mac/ConnectionMac.mm:
305         (IPC::Connection::initializeSendSource):
306
307 2016-12-09  Beth Dakin  <bdakin@apple.com>
308
309         Password fields should not show the emoji button in TouchBar
310         https://bugs.webkit.org/show_bug.cgi?id=165673
311         -and corresponding-
312         rdar://problem/29235739
313
314         Reviewed by Wenson Hsieh.
315
316         This patch adds a new member variable for the password touch bar and password 
317         candidateListTouchBarItem. Since this TouchBar will actually have a different set 
318         of identifiers than the plain text TouchBar, it should just have its own variable.
319         * UIProcess/Cocoa/WebViewImpl.h:
320         * UIProcess/Cocoa/WebViewImpl.mm:
321
322         Return m_passwordTextCandidateListTouchBarItem when appropriate.
323         (WebKit::WebViewImpl::candidateListTouchBarItem):
324
325         The candidate list should be the only item for passwords.
326         (WebKit::passwordTextTouchBarDefaultItemIdentifiers):
327
328         Account for m_passwordTextTouchBar.
329         (WebKit::WebViewImpl::updateTouchBarAndRefreshTextBarIdentifiers):
330         (WebKit::WebViewImpl::setUpTextTouchBar):
331         (WebKit::WebViewImpl::textTouchBar):
332
333         The empty candidates array is not needed. We can just set @[ ] as the candidates 
334         for the m_passwordTextCandidateListTouchBarItem. Safe guards already exist in the 
335         other parts of the code to prevent us from requesting or setting other candidates 
336         when in a password field. 
337         (WebKit::WebViewImpl::updateTextTouchBar):
338
339 2016-12-09  Keith Rollin  <krollin@apple.com>
340
341         Fix string specification in print format
342         https://bugs.webkit.org/show_bug.cgi?id=165650
343
344         Reviewed by Alex Christensen.
345
346         Change "%{public}s" string specifier to something that can be changed
347         to "%s" at compile time when the build environment doesn't support the
348         former.
349
350         * NetworkProcess/capture/NetworkCaptureLogging.h:
351         * NetworkProcess/capture/NetworkCaptureManager.cpp:
352         (WebKit::NetworkCapture::Manager::initialize):
353         (WebKit::NetworkCapture::Manager::findMatch):
354         (WebKit::NetworkCapture::Manager::findExactMatch):
355         (WebKit::NetworkCapture::Manager::findBestFuzzyMatch):
356         (WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
357         (WebKit::NetworkCapture::Manager::logPlayedBackResource):
358         (WebKit::NetworkCapture::Manager::openCacheFile):
359         (WebKit::NetworkCapture::Manager::getLine):
360         * NetworkProcess/capture/NetworkCaptureRecorder.cpp:
361         (WebKit::NetworkCapture::Recorder::recordRequestSent):
362         (WebKit::NetworkCapture::Recorder::recordResponseReceived):
363         (WebKit::NetworkCapture::Recorder::recordRedirectReceived):
364         (WebKit::NetworkCapture::Recorder::recordRedirectSent):
365         (WebKit::NetworkCapture::Recorder::writeEvents):
366         * NetworkProcess/capture/NetworkCaptureResource.cpp:
367         (WebKit::NetworkCapture::Resource::url):
368         (WebKit::NetworkCapture::Resource::EventStream::nextEvent):
369         * NetworkProcess/capture/NetworkDataTaskReplay.cpp:
370         (WebKit::NetworkCapture::NetworkDataTaskReplay::NetworkDataTaskReplay):
371         (WebKit::NetworkCapture::NetworkDataTaskReplay::~NetworkDataTaskReplay):
372         (WebKit::NetworkCapture::NetworkDataTaskReplay::resume):
373         (WebKit::NetworkCapture::NetworkDataTaskReplay::suspend):
374         (WebKit::NetworkCapture::NetworkDataTaskReplay::complete):
375         (WebKit::NetworkCapture::NetworkDataTaskReplay::invalidateAndCancel):
376         (WebKit::NetworkCapture::NetworkDataTaskReplay::enqueueEventHandler):
377         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayRequestSent):
378         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayResponseReceived):
379         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayRedirectReceived):
380         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayRedirectSent):
381         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayDataReceived):
382         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayFinished):
383         (WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse):
384
385 2016-12-09  Jeremy Jones  <jeremyj@apple.com>
386
387         WebView doesn't become first responder in element fullscreen.
388         https://bugs.webkit.org/show_bug.cgi?id=165664
389         rdar://problem/28927252
390
391         Reviewed by Tim Horton.
392
393         WebView was being set as the first responder while the contentView was still hidden.
394         A view can not become first responder while it or its ancestor is hidden.
395
396         This change waits until after the contentView is visible to make the web view the first responder.
397
398         * UIProcess/mac/WKFullScreenWindowController.mm:
399         (-[WKFullScreenWindowController enterFullScreen:]):
400         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]):
401
402 2016-12-09  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
403
404         Unreviewed build fix. Thanks to Konstantin Tokarev and Csaba Osztrogonác
405         for pointing out the fix.
406
407         * CMakeLists.txt: add WebCore/html/canvas to include paths.
408
409 2016-12-09  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
410
411         [GTK] Fix build after r209558
412         https://bugs.webkit.org/show_bug.cgi?id=165653
413
414         Unreviewed build fix.
415
416         * UIProcess/API/APIPolicyClient.h: include WebsitePolicies.h.
417         * UIProcess/API/gtk/WebKitPolicyClient.cpp: ditto.
418         * UIProcess/API/gtk/WebKitPolicyDecision.cpp:
419         (webkit_policy_decision_use):  pass empty structure to new required argument.
420
421 2016-12-09  Gavin Barraclough  <barraclough@apple.com>
422
423         Revert - Add _WKIconLoadingDelegate SPI
424         https://bugs.webkit.org/show_bug.cgi?id=164894
425
426         Unreviewed rollout due to performance regression.
427
428         * PlatformMac.cmake:
429         * UIProcess/API/APIIconLoadingClient.h: Removed.
430         * UIProcess/API/Cocoa/WKWebView.mm:
431         (-[WKWebView _initializeWithConfiguration:]):
432         (-[WKWebView _iconLoadingDelegate]): Deleted.
433         (-[WKWebView _setIconLoadingDelegate:]): Deleted.
434         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
435         * UIProcess/API/Cocoa/_WKIconLoadingDelegate.h: Removed.
436         * UIProcess/API/Cocoa/_WKLinkIconParameters.h: Removed.
437         * UIProcess/API/Cocoa/_WKLinkIconParameters.mm: Removed.
438         * UIProcess/API/Cocoa/_WKLinkIconParametersInternal.h: Removed.
439         * UIProcess/Cocoa/IconLoadingDelegate.h: Removed.
440         * UIProcess/Cocoa/IconLoadingDelegate.mm: Removed.
441         * UIProcess/WebPageProxy.cpp:
442         (WebKit::WebPageProxy::setIconLoadingClient): Deleted.
443         (WebKit::WebPageProxy::getLoadDecisionForIcon): Deleted.
444         (WebKit::WebPageProxy::finishedLoadingIcon): Deleted.
445         * UIProcess/WebPageProxy.h:
446         (WebKit::WebPageProxy::iconLoadingClient): Deleted.
447         * UIProcess/WebPageProxy.messages.in:
448         * WebKit2.xcodeproj/project.pbxproj:
449         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
450         (WebKit::WebFrameLoaderClient::useIconLoadingClient): Deleted.
451         (WebKit::WebFrameLoaderClient::getLoadDecisionForIcon): Deleted.
452         (WebKit::WebFrameLoaderClient::finishedLoadingIcon): Deleted.
453         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
454         (WebKit::WebFrameLoaderClient::setUseIconLoadingClient): Deleted.
455         (): Deleted.
456         * WebProcess/WebPage/WebPage.cpp:
457         (WebKit::WebPage::didGetLoadDecisionForIcon): Deleted.
458         (WebKit::WebPage::setUseIconLoadingClient): Deleted.
459         * WebProcess/WebPage/WebPage.h:
460         * WebProcess/WebPage/WebPage.messages.in:
461
462 2016-12-08  Keith Rollin  <krollin@apple.com>
463
464         Move FileHandle to WebCore FileHandle.h
465         https://bugs.webkit.org/show_bug.cgi?id=165562
466
467         Reviewed by Alex Christensen.
468
469         Move FileHandle from NetworkCaptureTypes.h (which can now be deleted)
470         to WebCore. Update client code to use the new version.
471
472         * NetworkProcess/capture/NetworkCaptureEvent.cpp:
473         * NetworkProcess/capture/NetworkCaptureEvent.h:
474         * NetworkProcess/capture/NetworkCaptureManager.cpp:
475         (WebKit::NetworkCapture::Manager::initialize):
476         (WebKit::NetworkCapture::Manager::terminate):
477         (WebKit::NetworkCapture::Manager::logRecordedResource):
478         (WebKit::NetworkCapture::Manager::logLoadedResource):
479         (WebKit::NetworkCapture::Manager::logPlayedBackResource):
480         (WebKit::NetworkCapture::Manager::openCacheFile):
481         (WebKit::NetworkCapture::Manager::ensureFileHandle): Deleted.
482         (WebKit::NetworkCapture::Manager::printToFile): Deleted.
483         * NetworkProcess/capture/NetworkCaptureManager.h:
484         * NetworkProcess/capture/NetworkCaptureRecorder.cpp:
485         (WebKit::NetworkCapture::Recorder::writeEvents):
486         * NetworkProcess/capture/NetworkCaptureTypes.h: Removed.
487         * WebKit2.xcodeproj/project.pbxproj:
488
489 2016-12-08  Anders Carlsson  <andersca@apple.com>
490
491         Attempt to fix the iOS build.
492
493         * Platform/IPC/mac/MachMessage.cpp:
494
495 2016-12-08  Anders Carlsson  <andersca@apple.com>
496
497         Defer sending Mach messages if the queue is full
498         https://bugs.webkit.org/show_bug.cgi?id=165622
499         rdar://problem/29518036
500
501         Reviewed by Brady Eidson.
502
503         * Platform/IPC/Connection.cpp:
504         Include MachMessage.h so the Connection destructor can do its thing.
505
506         * Platform/IPC/Connection.h:
507         Add new members.
508
509         * Platform/IPC/mac/ConnectionMac.mm:
510         (IPC::Connection::platformInvalidate):
511         Null out the pending outgoing mach message.
512
513         (IPC::Connection::sendMessage):
514         New helper that will send a Mach message. If we time out, store the message in m_pendingOutgoingMachMessage.
515         When our send source will be triggered we'll try to send the message again.
516
517         (IPC::Connection::platformCanSendOutgoingMessages):
518         We can only send messages if we don't have a pending outgoing message.
519
520         (IPC::Connection::sendOutgoingMessage):
521         Call the newly added sendMessage function.
522
523         (IPC::Connection::initializeSendSource):
524         Add the DISPATCH_MACH_SEND_POSSIBLE mask (and DISPATCH_MACH_SEND_DEAD which was previously implicit).
525         In our event handler, check for DISPATCH_MACH_SEND_POSSIBLE and try to send the pending outgoing message again.
526
527         * Platform/IPC/mac/MachMessage.cpp:
528         (IPC::MachMessage::create):
529         Rename length to size.
530
531         (IPC::MachMessage::MachMessage):
532         Initialize m_shouldFreeDescriptors.
533
534         (IPC::MachMessage::~MachMessage):
535         Call mach_msg_destroy, which will free the descriptors.
536
537         (IPC::MachMessage::leakDescriptors):
538         Set m_shouldFreeDescriptors to false.
539
540         * Platform/IPC/mac/MachMessage.h:
541         (IPC::MachMessage::size):
542         (IPC::MachMessage::length): Deleted.
543
544 2016-12-08  Chelsea Pugh  <cpugh@apple.com>
545
546         [iOS] WKWebView should not allow app links to be opened on back or forward navigation
547         https://bugs.webkit.org/show_bug.cgi?id=165502
548
549         Reviewed by Dan Bernstein.
550
551         * UIProcess/WebPageProxy.cpp:
552         (WebKit::WebPageProxy::decidePolicyForNavigationAction): Add a condition to shouldOpenAppLinks
553         (which we use when creating a NavigationAction) that the navigationActionData is not a navigation
554         of type BackForward. This way, we don't open app links when a navigation is done via back or
555         forward.
556
557 2016-12-08  Filip Pizlo  <fpizlo@apple.com>
558
559         Enable SharedArrayBuffer, remove the flag
560         https://bugs.webkit.org/show_bug.cgi?id=165614
561
562         Rubber stamped by Geoffrey Garen.
563
564         * UIProcess/API/C/WKPreferencesRefPrivate.h:
565         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
566
567 2016-12-08  Alex Christensen  <achristensen@webkit.org>
568
569         Add SPI for sending WebsiteSettings to WebProcess during navigation
570         https://bugs.webkit.org/show_bug.cgi?id=165517
571         <rdar://29341068>
572
573         We add the ability for the navigation client to send settings to the WebProcess 
574         based on the URL of the document being navigated to. This approach adds no new IPC 
575         messages and allows the application to decide what settings to use during navigation 
576         instead of declaratively before navigation. Right now there is only one setting, 
577         whether to disable content blockers, but this infrastructure can be used for more settings.
578
579         Reviewed by Anders Carlsson.
580
581         * CMakeLists.txt:
582         * PlatformMac.cmake:
583         * Shared/API/APIObject.h:
584         * Shared/API/c/WKBase.h:
585         * Shared/WebsitePolicies.h: Added.
586         (WebKit::WebsitePolicies::encode):
587         (WebKit::WebsitePolicies::decode):
588         * UIProcess/API/APINavigationClient.h:
589         (API::NavigationClient::decidePolicyForNavigationAction):
590         (API::NavigationClient::decidePolicyForNavigationResponse):
591         * UIProcess/API/APIPolicyClient.h:
592         (API::PolicyClient::decidePolicyForNavigationAction):
593         (API::PolicyClient::decidePolicyForNewWindowAction):
594         (API::PolicyClient::decidePolicyForResponse):
595         * UIProcess/API/APIWebsitePolicies.cpp: Added.
596         (API::WebsitePolicies::create):
597         * UIProcess/API/APIWebsitePolicies.h: Added.
598         * UIProcess/API/C/WKAPICast.h:
599         * UIProcess/API/C/WKFramePolicyListener.cpp:
600         (WKFramePolicyListenerUse):
601         (WKFramePolicyListenerUseWithPolicies):
602         * UIProcess/API/C/WKFramePolicyListener.h:
603         * UIProcess/API/C/WKPage.cpp:
604         (WKPageSetPagePolicyClient):
605         * UIProcess/API/C/WKWebsitePolicies.cpp: Added.
606         (WKWebsitePoliciesGetTypeID):
607         (WKWebsitePoliciesCreate):
608         (WKWebsitePoliciesSetContentBlockersEnabled):
609         (WKWebsitePoliciesGetContentBlockersEnabled):
610         * UIProcess/API/C/WKWebsitePolicies.h: Added.
611         * UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
612         * UIProcess/API/Cocoa/_WKWebsitePolicies.h: Added.
613         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm: Added.
614         (-[_WKWebsitePolicies dealloc]):
615         (-[_WKWebsitePolicies init]):
616         (-[_WKWebsitePolicies setContentBlockersEnabled:]):
617         (-[_WKWebsitePolicies contentBlockersEnabled]):
618         (-[_WKWebsitePolicies description]):
619         (-[_WKWebsitePolicies _apiObject]):
620         * UIProcess/API/Cocoa/_WKWebsitePoliciesInternal.h: Added.
621         (WebKit::wrapper):
622         * UIProcess/Automation/WebAutomationSession.cpp:
623         (WebKit::WebAutomationSession::reloadBrowsingContext):
624         * UIProcess/Cocoa/NavigationState.h:
625         * UIProcess/Cocoa/NavigationState.mm:
626         (WebKit::NavigationState::setNavigationDelegate):
627         (WebKit::tryAppLink):
628         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
629         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse):
630         * UIProcess/WebFormSubmissionListenerProxy.cpp:
631         (WebKit::WebFormSubmissionListenerProxy::continueSubmission):
632         * UIProcess/WebFrameListenerProxy.cpp:
633         (WebKit::WebFrameListenerProxy::receivedPolicyDecision):
634         * UIProcess/WebFrameListenerProxy.h:
635         * UIProcess/WebFramePolicyListenerProxy.cpp:
636         (WebKit::WebFramePolicyListenerProxy::use):
637         (WebKit::WebFramePolicyListenerProxy::download):
638         (WebKit::WebFramePolicyListenerProxy::ignore):
639         * UIProcess/WebFramePolicyListenerProxy.h:
640         (WebKit::WebFramePolicyListenerProxy::create):
641         * UIProcess/WebFrameProxy.cpp:
642         (WebKit::WebFrameProxy::receivedPolicyDecision):
643         * UIProcess/WebFrameProxy.h:
644         * UIProcess/WebInspectorProxy.cpp:
645         (WebKit::decidePolicyForNavigationAction):
646         * UIProcess/WebPageProxy.cpp:
647         (WebKit::WebPageProxy::receivedPolicyDecision):
648         (WebKit::WebPageProxy::decidePolicyForNavigationAction):
649         * UIProcess/WebPageProxy.h:
650         * UIProcess/WebPageProxy.messages.in:
651         * WebKit2.xcodeproj/project.pbxproj:
652         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
653         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
654
655 2016-12-08  Antti Koivisto  <antti@apple.com>
656
657         Salt network cache hashes
658         https://bugs.webkit.org/show_bug.cgi?id=164924
659
660         Reviewed by Alex Christensen.
661
662         To enhance privacy make cache content unidentifiable from file names alone.
663         This is done by generating a unique persistent salt for each cache instance.
664         It is used when computing hashes used in file names.
665
666         The patch also replaces plain text partition directory names with salted hashes.
667
668         * NetworkProcess/cache/NetworkCache.cpp:
669         (WebKit::NetworkCache::Cache::makeCacheKey):
670         (WebKit::NetworkCache::makeCacheKey): Deleted.
671         * NetworkProcess/cache/NetworkCache.h:
672
673             Increment cache version.
674
675         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
676         (WebKit::NetworkCache::BlobStorage::BlobStorage):
677         (WebKit::NetworkCache::BlobStorage::add):
678         (WebKit::NetworkCache::BlobStorage::get):
679
680             Use salt for blob content hash.
681
682         * NetworkProcess/cache/NetworkCacheBlobStorage.h:
683         * NetworkProcess/cache/NetworkCacheData.cpp:
684         (WebKit::NetworkCache::computeSHA1):
685
686             For simplicity all SHA1s are now salted.
687
688         (WebKit::NetworkCache::makeSalt):
689         (WebKit::NetworkCache::readOrMakeSalt):
690
691             Read salt if it exists, generate and persist it otherwise.
692
693         * NetworkProcess/cache/NetworkCacheData.h:
694         * NetworkProcess/cache/NetworkCacheKey.cpp:
695         (WebKit::NetworkCache::Key::Key):
696
697             Remove the "No partition" string and just empty.
698             That was only needed to have a directory name of some sort.
699
700         (WebKit::NetworkCache::Key::computeHash):
701
702             Use salt for key hash.
703
704         (WebKit::NetworkCache::Key::computePartitionHash):
705
706             Separate hash for partition.
707
708         * NetworkProcess/cache/NetworkCacheKey.h:
709         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
710         (WebKit::NetworkCache::makeSubresourcesKey):
711         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady):
712         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
713         * NetworkProcess/cache/NetworkCacheStorage.cpp:
714         (WebKit::NetworkCache::makeSaltFilePath):
715         (WebKit::NetworkCache::Storage::open):
716
717             Cache can't be opened if we can't read or persist a salt.
718
719         (WebKit::NetworkCache::traverseRecordsFiles):
720         (WebKit::NetworkCache::Storage::Storage):
721         (WebKit::NetworkCache::Storage::synchronize):
722         (WebKit::NetworkCache::Storage::recordDirectoryPathForKey):
723
724             Use the partition hash in the directory name instead of a plain text name.
725
726         (WebKit::NetworkCache::decodeRecordHeader):
727         (WebKit::NetworkCache::Storage::readRecord):
728         (WebKit::NetworkCache::Storage::encodeRecord):
729         (WebKit::NetworkCache::Storage::traverse):
730         (WebKit::NetworkCache::Storage::clear):
731         * NetworkProcess/cache/NetworkCacheStorage.h:
732         (WebKit::NetworkCache::Storage::salt):
733
734 2016-12-08  Eric Carlson  <eric.carlson@apple.com>
735
736         Fix the EFL build.
737
738         * UIProcess/WebPageProxy.cpp:
739         (WebKit::WebPageProxy::isPlayingMediaDidChange): Add another ENABLE(MEDIA_STREAM) guard.
740
741 2016-12-08  Tomas Popela  <tpopela@redhat.com>
742
743         [GTK] Process accelerated compositing env variables only if they are really enabled
744         https://bugs.webkit.org/show_bug.cgi?id=165300
745
746         Don't process the WEBKIT_FORCE_COMPOSITING_MODE and
747         WEBKIT_DISABLE_COMPOSITING_MODE env variables if they are disabled
748         (eg. WEBKIT_DISABLE_COMPOSITING_MODE=0).
749
750         Reviewed by Michael Catanzaro.
751
752         * UIProcess/gtk/WebPreferencesGtk.cpp:
753         (WebKit::WebPreferences::platformInitializeStore):
754
755 2016-12-08  Alex Christensen  <achristensen@webkit.org>
756
757         Fix CMake build.
758
759         * CMakeLists.txt:
760         Add the new NetworkProcess/capture include directory to find new headers from r209498.
761         * NetworkProcess/capture/NetworkCaptureEvent.cpp:
762         (WebKit::NetworkCapture::Response::Response):
763         (WebKit::NetworkCapture::Error::Error):
764         The String constructor was ambiguous after r209498 because URL has an operator NSString* and String has an NSString constructor.
765         We should get rid of operator NSString* and operator String on URL.
766         * UIProcess/WebPageProxy.cpp:
767         * UIProcess/WebPageProxy.h:
768         Add some ENABLE(MEDIA_STREAM) macros to fix the build without it enabled after r209512.
769
770 2016-12-08  Alex Christensen  <achristensen@webkit.org>
771
772         Fix iOS debug build after r209498
773         https://bugs.webkit.org/show_bug.cgi?id=164527
774
775         * NetworkProcess/capture/NetworkCaptureLogging.h:
776         Logs were causing compile warnings/errors.  Disable logs for now.
777
778 2016-12-07  Dean Jackson  <dino@apple.com>
779
780         Remove runtime toggle for pointer-lock
781         https://bugs.webkit.org/show_bug.cgi?id=165577
782         <rdar://problems/29566996>
783
784         Reviewed by Jon Lee.
785
786         Remove any runtime calls to check if pointer-lock is enabled. It's
787         either compiled in or out.
788
789         * Shared/WebPreferencesDefinitions.h:
790         * UIProcess/API/C/WKPreferences.cpp:
791         (WKPreferencesSetPointerLockEnabled): Deleted.
792         (WKPreferencesGetPointerLockEnabled): Deleted.
793         * UIProcess/API/C/WKPreferencesRefPrivate.h:
794         * WebProcess/WebPage/WebPage.cpp:
795         (WebKit::WebPage::updatePreferences):
796
797 2016-12-07  Eric Carlson  <eric.carlson@apple.com>
798
799         [MediaStream][Mac] Revoke sandbox extensions when capture ends
800         https://bugs.webkit.org/show_bug.cgi?id=165476
801
802         Reviewed by Brady Eidson.
803
804         Track media capture by process so it is possible to revoke the sandbox extensions issued to
805         a web process when capture stops. Allocate WK2 user media permission manager lazily rather
806         than every time a page is created as most pages won't need one.
807
808         * CMakeLists.txt: Add new files.
809
810         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
811         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Register
812           with process manager.
813         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
814         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Move sandbox 
815           extension code to the process manager.
816         (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New.
817         (WebKit::UserMediaPermissionRequestManagerProxy::startedCaptureSession): New, report state
818           change to the process manager.
819         (WebKit::UserMediaPermissionRequestManagerProxy::endedCaptureSession): Ditto.
820         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
821
822         * UIProcess/UserMediaProcessManager.cpp: Added.
823         (WebKit::ProcessState::ProcessState):
824         (WebKit::ProcessState::managers):
825         (WebKit::ProcessState::sandboxExtensionsGranted):
826         (WebKit::ProcessState::setSandboxExtensionsGranted):
827         (WebKit::stateMap):
828         (WebKit::processState):
829         (WebKit::ProcessState::addRequestManager):
830         (WebKit::ProcessState::removeRequestManager):
831         (WebKit::UserMediaProcessManager::singleton):
832         (WebKit::UserMediaProcessManager::addUserMediaPermissionRequestManagerProxy):
833         (WebKit::UserMediaProcessManager::removeUserMediaPermissionRequestManagerProxy):
834         (WebKit::UserMediaProcessManager::willCreateMediaStream):
835         (WebKit::UserMediaProcessManager::startedCaptureSession):
836         (WebKit::UserMediaProcessManager::endedCaptureSession):
837         * UIProcess/UserMediaProcessManager.h: Added.
838
839         * UIProcess/WebPageProxy.cpp:
840         (WebKit::WebPageProxy::WebPageProxy): Don't allocate m_userMediaPermissionRequestManager.
841         (WebKit::WebPageProxy::resetState): Set m_userMediaPermissionRequestManager to null.
842         (WebKit::WebPageProxy::userMediaPermissionRequestManager): Allocate m_userMediaPermissionRequestManager
843           lazily as most pages don't need it.
844         (WebKit::WebPageProxy::requestUserMediaPermissionForFrame): Call userMediaPermissionRequestManager().
845         (WebKit::WebPageProxy::enumerateMediaDevicesForFrame): Ditto.
846         (WebKit::WebPageProxy::clearUserMediaState): Ditto.
847         (WebKit::WebPageProxy::isPlayingMediaDidChange): Report capture state changes to the request
848           manager proxy.
849         * UIProcess/WebPageProxy.h:
850
851         * WebKit2.xcodeproj/project.pbxproj: Add new files.
852
853         * WebProcess/MediaStream/MediaDeviceSandboxExtensions.cpp: Added.
854         (WebKit::MediaDeviceSandboxExtensions::MediaDeviceSandboxExtensions):
855         (WebKit::MediaDeviceSandboxExtensions::encode):
856         (WebKit::MediaDeviceSandboxExtensions::decode):
857         (WebKit::MediaDeviceSandboxExtensions::operator[]):
858         (WebKit::MediaDeviceSandboxExtensions::size):
859         * WebProcess/MediaStream/MediaDeviceSandboxExtensions.h: Added.
860
861         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
862         (WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Sandbox extension
863           is now in a HashMap, not a Vector.
864         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Record
865           IDs with extensions so they can be revoked later.
866         (WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): New.
867         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDevicesSandboxExtension): Deleted.
868         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
869
870         * WebProcess/WebPage/WebPage.cpp:
871         (WebKit::WebPage::grantUserMediaDeviceSandboxExtensions):
872         (WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions):
873         (WebKit::WebPage::grantUserMediaDevicesSandboxExtension): Deleted.
874         * WebProcess/WebPage/WebPage.h:
875         * WebProcess/WebPage/WebPage.messages.in:
876
877 2016-12-07  Jeremy Jones  <jeremyj@apple.com>
878
879         One esc to exit fullscreen and pointer lock
880         https://bugs.webkit.org/show_bug.cgi?id=165416
881         rdar://problem/29430711
882
883         Reviewed by Jer Noble.
884
885         Fix a crash when didLosePointerLock is not specified.
886
887         * UIProcess/API/C/WKPage.cpp:
888         (WKPageSetPageUIClient):
889
890 2016-12-07  Keith Rollin  <krollin@apple.com>
891
892         Network event record/replay
893         https://bugs.webkit.org/show_bug.cgi?id=164527
894         <rdar://problem/29168157>
895
896         Reviewed by Alex Christensen.
897
898         Add WebKit2/NetworkProcess/capture/* for recording the network events
899         that occur when loading a page and for replaying them later. Update
900         NetworkLoad to invoke capture facilities. Add preferences for enabling
901         record or replay.
902
903         * CMakeLists.txt:
904         * NetworkProcess/NetworkLoad.cpp:
905         (WebKit::NetworkLoad::NetworkLoad):
906         (WebKit::NetworkLoad::initializeForRecord):
907         (WebKit::NetworkLoad::initializeForReplay):
908         (WebKit::NetworkLoad::initialize):
909         (WebKit::NetworkLoad::setDefersLoading):
910         (WebKit::NetworkLoad::continueWillSendRequest):
911         (WebKit::NetworkLoad::sharedWillSendRedirectedRequest):
912         (WebKit::NetworkLoad::notifyDidReceiveResponse):
913         (WebKit::NetworkLoad::didReceiveData):
914         (WebKit::NetworkLoad::didCompleteWithError):
915         * NetworkProcess/NetworkLoad.h:
916         * NetworkProcess/NetworkProcess.cpp:
917         (WebKit::NetworkProcess::initializeNetworkProcess):
918         (WebKit::NetworkProcess::terminate):
919         * NetworkProcess/NetworkProcessCreationParameters.cpp:
920         (WebKit::NetworkProcessCreationParameters::encode):
921         (WebKit::NetworkProcessCreationParameters::decode):
922         * NetworkProcess/NetworkProcessCreationParameters.h:
923         * NetworkProcess/capture/NetworkCaptureEvent.cpp: Added.
924         (WebKit::NetworkCapture::copyHeaders):
925         (WebKit::NetworkCapture::KeyValuePair::KeyValuePair):
926         (WebKit::NetworkCapture::ResourceRequest::ResourceRequest):
927         (WebKit::NetworkCapture::ResourceRequest::operator WebCore::ResourceRequest):
928         (WebKit::NetworkCapture::ResourceResponse::ResourceResponse):
929         (WebKit::NetworkCapture::ResourceResponse::operator WebCore::ResourceResponse):
930         (WebKit::NetworkCapture::ResourceError::ResourceError):
931         (WebKit::NetworkCapture::ResourceError::operator WebCore::ResourceError):
932         (WebKit::NetworkCapture::JSONCoder::encode):
933         (WebKit::NetworkCapture::JSONCoder::decode):
934         (WebKit::NetworkCapture::JSONCoder<String>::encode):
935         (WebKit::NetworkCapture::JSONCoder<String>::decode):
936         (WebKit::NetworkCapture::JSONCoder<CaptureTimeType>::encode):
937         (WebKit::NetworkCapture::JSONCoder<CaptureTimeType>::decode):
938         (WebKit::NetworkCapture::JSONCoder<KeyValuePair>::encode):
939         (WebKit::NetworkCapture::JSONCoder<KeyValuePair>::decode):
940         (WebKit::NetworkCapture::JSONCoder<Vector<T>>::encode):
941         (WebKit::NetworkCapture::JSONCoder<Vector<T>>::decode):
942         (WebKit::NetworkCapture::JSONCoder<ResourceRequest>::encode):
943         (WebKit::NetworkCapture::JSONCoder<ResourceRequest>::decode):
944         (WebKit::NetworkCapture::JSONCoder<ResourceResponse>::encode):
945         (WebKit::NetworkCapture::JSONCoder<ResourceResponse>::decode):
946         (WebKit::NetworkCapture::JSONCoder<ResourceError>::encode):
947         (WebKit::NetworkCapture::JSONCoder<ResourceError>::decode):
948         (WebKit::NetworkCapture::JSONCoder<WebCore::SharedBuffer>::encode):
949         (WebKit::NetworkCapture::JSONCoder<WebCore::SharedBuffer>::decode):
950         (WebKit::NetworkCapture::JSONCoder<RequestSentEvent>::encode):
951         (WebKit::NetworkCapture::JSONCoder<RequestSentEvent>::decode):
952         (WebKit::NetworkCapture::JSONCoder<ResponseReceivedEvent>::encode):
953         (WebKit::NetworkCapture::JSONCoder<ResponseReceivedEvent>::decode):
954         (WebKit::NetworkCapture::JSONCoder<RedirectReceivedEvent>::encode):
955         (WebKit::NetworkCapture::JSONCoder<RedirectReceivedEvent>::decode):
956         (WebKit::NetworkCapture::JSONCoder<RedirectSentEvent>::encode):
957         (WebKit::NetworkCapture::JSONCoder<RedirectSentEvent>::decode):
958         (WebKit::NetworkCapture::JSONCoder<DataReceivedEvent>::encode):
959         (WebKit::NetworkCapture::JSONCoder<DataReceivedEvent>::decode):
960         (WebKit::NetworkCapture::JSONCoder<FinishedEvent>::encode):
961         (WebKit::NetworkCapture::JSONCoder<FinishedEvent>::decode):
962         (WebKit::NetworkCapture::eventToString):
963         (WebKit::NetworkCapture::stringToEvent):
964         * NetworkProcess/capture/NetworkCaptureEvent.h: Added.
965         (WebKit::NetworkCapture::TimedEvent::TimedEvent):
966         * NetworkProcess/capture/NetworkCaptureLogging.h: Added.
967         * NetworkProcess/capture/NetworkCaptureManager.cpp: Added.
968         (WebKit::NetworkCapture::Manager::singleton):
969         (WebKit::NetworkCapture::Manager::initialize):
970         (WebKit::NetworkCapture::Manager::terminate):
971         (WebKit::NetworkCapture::Manager::findMatch):
972         (WebKit::NetworkCapture::Manager::findExactMatch):
973         (WebKit::NetworkCapture::Manager::findBestFuzzyMatch):
974         (WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
975         (WebKit::NetworkCapture::Manager::loadResources):
976         (WebKit::NetworkCapture::Manager::reportLoadPath):
977         (WebKit::NetworkCapture::Manager::reportRecordPath):
978         (WebKit::NetworkCapture::Manager::reportReplayPath):
979         (WebKit::NetworkCapture::Manager::requestToPath):
980         (WebKit::NetworkCapture::Manager::stringToHash):
981         (WebKit::NetworkCapture::Manager::hashToPath):
982         (WebKit::NetworkCapture::Manager::logRecordedResource):
983         (WebKit::NetworkCapture::Manager::logLoadedResource):
984         (WebKit::NetworkCapture::Manager::logPlayedBackResource):
985         (WebKit::NetworkCapture::Manager::ensureFileHandle):
986         (WebKit::NetworkCapture::Manager::openCacheFile):
987         (WebKit::NetworkCapture::Manager::readFile):
988         (WebKit::NetworkCapture::Manager::getLine):
989         (WebKit::NetworkCapture::Manager::getWord):
990         (WebKit::NetworkCapture::Manager::printToFile):
991         * NetworkProcess/capture/NetworkCaptureManager.h: Added.
992         (WebKit::NetworkCapture::Manager::isRecording):
993         (WebKit::NetworkCapture::Manager::isReplaying):
994         (WebKit::NetworkCapture::Manager::mode):
995         * NetworkProcess/capture/NetworkCaptureRecorder.cpp: Added.
996         (WebKit::NetworkCapture::Recorder::recordRequestSent):
997         (WebKit::NetworkCapture::Recorder::recordResponseReceived):
998         (WebKit::NetworkCapture::Recorder::recordRedirectReceived):
999         (WebKit::NetworkCapture::Recorder::recordRedirectSent):
1000         (WebKit::NetworkCapture::Recorder::recordDataReceived):
1001         (WebKit::NetworkCapture::Recorder::recordFinish):
1002         (WebKit::NetworkCapture::Recorder::writeEvents):
1003         * NetworkProcess/capture/NetworkCaptureRecorder.h: Added.
1004         (WebKit::NetworkCapture::Recorder::recordEvent):
1005         * NetworkProcess/capture/NetworkCaptureReplayer.cpp: Added.
1006         (WebKit::NetworkCapture::Replayer::replayResource):
1007         * NetworkProcess/capture/NetworkCaptureReplayer.h: Added.
1008         * NetworkProcess/capture/NetworkCaptureResource.cpp: Added.
1009         (WebKit::NetworkCapture::Resource::Resource):
1010         (WebKit::NetworkCapture::Resource::url):
1011         (WebKit::NetworkCapture::Resource::baseURL):
1012         (WebKit::NetworkCapture::Resource::queryParameters):
1013         (WebKit::NetworkCapture::Resource::eventStream):
1014         (WebKit::NetworkCapture::Resource::EventStream::EventStream):
1015         (WebKit::NetworkCapture::Resource::EventStream::nextEvent):
1016         * NetworkProcess/capture/NetworkCaptureResource.h: Added.
1017         * NetworkProcess/capture/NetworkCaptureTypes.h: Added.
1018         (WebKit::NetworkCapture::TypeHolder::forEachTypeImpl):
1019         (WebKit::NetworkCapture::TypeHolder::forEachType):
1020         * NetworkProcess/capture/NetworkDataTaskReplay.cpp: Added.
1021         (WebKit::NetworkCapture::NetworkDataTaskReplay::NetworkDataTaskReplay):
1022         (WebKit::NetworkCapture::NetworkDataTaskReplay::~NetworkDataTaskReplay):
1023         (WebKit::NetworkCapture::NetworkDataTaskReplay::resume):
1024         (WebKit::NetworkCapture::NetworkDataTaskReplay::suspend):
1025         (WebKit::NetworkCapture::NetworkDataTaskReplay::cancel):
1026         (WebKit::NetworkCapture::NetworkDataTaskReplay::complete):
1027         (WebKit::NetworkCapture::NetworkDataTaskReplay::invalidateAndCancel):
1028         (WebKit::NetworkCapture::NetworkDataTaskReplay::enqueueEventHandler):
1029         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayRequestSent):
1030         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayResponseReceived):
1031         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayRedirectReceived):
1032         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayRedirectSent):
1033         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayDataReceived):
1034         (WebKit::NetworkCapture::NetworkDataTaskReplay::replayFinished):
1035         (WebKit::NetworkCapture::NetworkDataTaskReplay::didReceiveResponse):
1036         (WebKit::NetworkCapture::NetworkDataTaskReplay::didFinish):
1037         * NetworkProcess/capture/NetworkDataTaskReplay.h: Added.
1038         (WebKit::NetworkCapture::NetworkDataTaskReplay::create):
1039         * NetworkProcess/capture/json.hpp: Added.
1040         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1041         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1042         * WebKit2.xcodeproj/project.pbxproj:
1043         * config.h:
1044
1045 2016-12-07  Anders Carlsson  <andersca@apple.com>
1046
1047         Fix build.
1048
1049         * Platform/IPC/mac/ConnectionMac.mm:
1050         (IPC::Connection::open):
1051
1052 2016-12-07  Anders Carlsson  <andersca@apple.com>
1053
1054         Rename the connection sources to better indicate what data direction they are used for
1055         https://bugs.webkit.org/show_bug.cgi?id=165548
1056
1057         Reviewed by Tim Horton.
1058
1059         * Platform/IPC/Connection.h:
1060         * Platform/IPC/mac/ConnectionMac.mm:
1061         (IPC::Connection::platformInvalidate):
1062         (IPC::Connection::platformInitialize):
1063         (IPC::createReceiveSource):
1064         (IPC::Connection::initializeSendSource):
1065         (IPC::Connection::receiveSourceEventHandler):
1066         (IPC::createDataAvailableSource): Deleted.
1067         (IPC::Connection::initializeDeadNameSource): Deleted.
1068         Rename m_deadNameSource to m_sendSource, and m_receivePortDataAvailableSource to m_receiveSource.
1069
1070         (IPC::Connection::open):
1071         Initialize the send source before we attempt to send a first message.
1072
1073 2016-12-07  Simon Fraser  <simon.fraser@apple.com>
1074
1075         Fix use of enum in a WK2 C SPI header.
1076         rdar://problem/28725583
1077
1078         Followup to correctly prefix the enum values.
1079
1080         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1081         (WKBundlePageSetEventThrottlingBehaviorOverride):
1082         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
1083
1084 2016-12-07  Simon Fraser  <simon.fraser@apple.com>
1085
1086         Fix use of enum in a WK2 C SPI header.
1087         rdar://problem/28725583
1088
1089         Reviewed by Dan Bernstein.
1090
1091         Use correct enum style for a C SPI header and fix the callers.
1092
1093         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1094         (WKBundlePageSetEventThrottlingBehaviorOverride):
1095         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
1096
1097 2016-12-07  Beth Dakin  <bdakin@apple.com>
1098
1099         Remove iCloud Pages and Keynote site-specific hacks
1100         https://bugs.webkit.org/show_bug.cgi?id=165544
1101         -and corresponding-
1102         rdar://problem/29082536
1103
1104         Reviewed by Wenson Hsieh.
1105
1106         * WebProcess/WebPage/WebPage.cpp:
1107         (WebKit::needsHiddenContentEditableQuirk):
1108         (WebKit::needsPlainTextQuirk):
1109
1110 2016-12-05  Ada Chan  <adachan@apple.com>
1111
1112         Add a getter for serverTrust in _WKObservablePageState
1113         https://bugs.webkit.org/show_bug.cgi?id=165433
1114
1115         Reviewed by Anders Carlsson.
1116
1117         * UIProcess/API/C/mac/WKPagePrivateMac.h:
1118         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
1119         (-[WKObservablePageState serverTrust]):
1120
1121 2016-12-07  Jer Noble  <jer.noble@apple.com>
1122
1123         Exiting Element Fullscreen mode loses focus on WKWebView.
1124         https://bugs.webkit.org/show_bug.cgi?id=165512
1125
1126         Reviewed by Eric Carlson.
1127
1128         Setting 'window.contentView.hidden = YES' will reset the first-responder (whereas
1129         previously setting 'window.contentView.layer.hidden = YES' did not). Grab the first-
1130         responder before doing so, so that it can be reset correctly when moving the WKWebView
1131         back to it's original window.
1132
1133         * UIProcess/mac/WKFullScreenWindowController.mm:
1134         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]):
1135
1136 2016-12-07  Alex Christensen  <achristensen@webkit.org>
1137
1138         Fix CMake build after r209418.
1139         https://bugs.webkit.org/show_bug.cgi?id=165484
1140
1141         * PlatformMac.cmake:
1142
1143 2016-12-07  Philippe Normand  <pnormand@igalia.com>
1144
1145         Unreviewed, GTK build fix after r209407.
1146
1147         * Platform/IPC/unix/ConnectionUnix.cpp:
1148         (IPC::Connection::processMessage):
1149         * UIProcess/LegacySessionStateCodingNone.cpp:
1150         (WebKit::decodeLegacySessionState):
1151
1152 2016-12-06  Ryan Haddad  <ryanhaddad@apple.com>
1153
1154         Unreviewed, rolling out r209422.
1155
1156         This change caused assertion failures during API tests.
1157
1158         Reverted changeset:
1159
1160         "[MediaStream][Mac] Revoke sandbox extensions when capture
1161         ends"
1162         https://bugs.webkit.org/show_bug.cgi?id=165476
1163         http://trac.webkit.org/changeset/209422
1164
1165 2016-12-06  Dean Jackson  <dino@apple.com>
1166
1167         Include default value in Experimental Feature information
1168         https://bugs.webkit.org/show_bug.cgi?id=165509
1169         <rdar://problems/29547177>
1170
1171         Reviewed by Tim Horton.
1172
1173         Add a defaultValue member variable to experimental
1174         features, both the C++ and ObjC interfaces.
1175
1176         * UIProcess/API/APIExperimentalFeature.cpp:
1177         (API::ExperimentalFeature::create):
1178         (API::ExperimentalFeature::ExperimentalFeature):
1179         * UIProcess/API/APIExperimentalFeature.h:
1180         * UIProcess/API/Cocoa/_WKExperimentalFeature.h:
1181         * UIProcess/API/Cocoa/_WKExperimentalFeature.mm:
1182         (-[_WKExperimentalFeature description]):
1183         (-[_WKExperimentalFeature defaultValue]):
1184         * UIProcess/WebPreferences.cpp:
1185         (WebKit::createExperimentalFeaturesVector):
1186
1187 2016-12-06  Commit Queue  <commit-queue@webkit.org>
1188
1189         Unreviewed, rolling out r209391.
1190         https://bugs.webkit.org/show_bug.cgi?id=165501
1191
1192         requires explicit nullptr checks so missing env vars don't
1193         flip AC mode (Requested by mcatanzaro on #webkit).
1194
1195         Reverted changeset:
1196
1197         "[GTK] Process accelerated compositing env variables only if
1198         they are really enabled"
1199         https://bugs.webkit.org/show_bug.cgi?id=165300
1200         http://trac.webkit.org/changeset/209391
1201
1202 2016-12-06  Alexey Proskuryakov  <ap@apple.com>
1203
1204         Correct SDKROOT values in xcconfig files
1205         https://bugs.webkit.org/show_bug.cgi?id=165487
1206         rdar://problem/29539209
1207
1208         Reviewed by Dan Bernstein.
1209
1210         Fix suggested by Dan Bernstein.
1211
1212         * Configurations/DebugRelease.xcconfig:
1213
1214 2016-12-06  Andreas Kling  <akling@apple.com>
1215
1216         [Cocoa] Add some memory usage related information to sysdiagnose state dumps
1217         <https://webkit.org/b/165375>
1218         <rdar://problem/29057243>
1219
1220         Reviewed by Darin Adler.
1221
1222         Follow-up to address two more review comments.
1223
1224         * WebProcess/cocoa/WebProcessCocoa.mm:
1225         (WebKit::WebProcess::registerWithStateDumper): Use adoptNS() instead of autorelease for NSStrings.
1226
1227 2016-12-06  Eric Carlson  <eric.carlson@apple.com>
1228
1229         [MediaStream][Mac] Revoke sandbox extensions when capture ends
1230         https://bugs.webkit.org/show_bug.cgi?id=165476
1231
1232         Reviewed by Brady Eidson.
1233         
1234         Track media capture by process so it is possible to revoke the sandbox extensions issued to
1235         a web process when capture stops.
1236
1237         * CMakeLists.txt: Add new files.
1238
1239         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
1240         (WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Register
1241           with process manager.
1242         (WebKit::UserMediaPermissionRequestManagerProxy::~UserMediaPermissionRequestManagerProxy):
1243         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted): Move sandbox 
1244           extension code to the process manager.
1245         (WebKit::UserMediaPermissionRequestManagerProxy::stopCapture): New.
1246         (WebKit::UserMediaPermissionRequestManagerProxy::startedCaptureSession): New, report state
1247           change to the process manager.
1248         (WebKit::UserMediaPermissionRequestManagerProxy::endedCaptureSession): Ditto.
1249         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
1250
1251         * UIProcess/UserMediaProcessManager.cpp: Added.
1252         (WebKit::ProcessState::ProcessState):
1253         (WebKit::ProcessState::managers):
1254         (WebKit::ProcessState::sandboxExtensionsGranted):
1255         (WebKit::ProcessState::setSandboxExtensionsGranted):
1256         (WebKit::stateMap):
1257         (WebKit::processState):
1258         (WebKit::ProcessState::addRequestManager):
1259         (WebKit::ProcessState::removeRequestManager):
1260         (WebKit::UserMediaProcessManager::singleton):
1261         (WebKit::UserMediaProcessManager::addUserMediaPermissionRequestManagerProxy):
1262         (WebKit::UserMediaProcessManager::removeUserMediaPermissionRequestManagerProxy):
1263         (WebKit::UserMediaProcessManager::willCreateMediaStream):
1264         (WebKit::UserMediaProcessManager::startedCaptureSession):
1265         (WebKit::UserMediaProcessManager::endedCaptureSession):
1266         * UIProcess/UserMediaProcessManager.h: Added.
1267
1268         * UIProcess/WebPageProxy.cpp:
1269         (WebKit::WebPageProxy::isPlayingMediaDidChange): Report capture state changes to the request
1270           manager proxy.
1271         * UIProcess/WebPageProxy.h:
1272
1273         * WebKit2.xcodeproj/project.pbxproj: Add new files.
1274
1275         * WebProcess/MediaStream/MediaDeviceSandboxExtensions.cpp: Added.
1276         (WebKit::MediaDeviceSandboxExtensions::MediaDeviceSandboxExtensions):
1277         (WebKit::MediaDeviceSandboxExtensions::encode):
1278         (WebKit::MediaDeviceSandboxExtensions::decode):
1279         (WebKit::MediaDeviceSandboxExtensions::operator[]):
1280         (WebKit::MediaDeviceSandboxExtensions::size):
1281         * WebProcess/MediaStream/MediaDeviceSandboxExtensions.h: Added.
1282
1283         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
1284         (WebKit::UserMediaPermissionRequestManager::~UserMediaPermissionRequestManager): Sandbox extension
1285           is now in a HashMap, not a Vector.
1286         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Record
1287           IDs with extensions so they can be revoked later.
1288         (WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): New.
1289         (WebKit::UserMediaPermissionRequestManager::grantUserMediaDevicesSandboxExtension): Deleted.
1290         * WebProcess/MediaStream/UserMediaPermissionRequestManager.h:
1291
1292         * WebProcess/WebPage/WebPage.cpp:
1293         (WebKit::WebPage::grantUserMediaDeviceSandboxExtensions):
1294         (WebKit::WebPage::revokeUserMediaDeviceSandboxExtensions):
1295         (WebKit::WebPage::grantUserMediaDevicesSandboxExtension): Deleted.
1296         * WebProcess/WebPage/WebPage.h:
1297         * WebProcess/WebPage/WebPage.messages.in:
1298
1299 2016-12-06  Anders Carlsson  <andersca@apple.com>
1300
1301         Add a new MachMessage class and use it for sending outgoing messages
1302         https://bugs.webkit.org/show_bug.cgi?id=165484
1303
1304         Reviewed by Sam Weinig.
1305
1306         * Platform/IPC/mac/ConnectionMac.mm:
1307         (IPC::Connection::sendOutgoingMessage):
1308         Instead of trying to randomly use memory from the stack as well as using mmap for the message data for out of line messages
1309         (which makes no sense at all, since the body data is already mmapped), just always create a MachMessage object and use it.
1310         
1311         (IPC::machMessageSize): Deleted.
1312         This has been moved to MachMessage::messageSize().
1313         
1314         * Platform/IPC/mac/MachMessage.cpp: Added.
1315         (IPC::MachMessage::create):
1316         Allocate extra memory to store the actual buffer.
1317
1318         (IPC::MachMessage::MachMessage):
1319         Initialize variables. m_size isn't really used right now, but will be in a subsequent patch.
1320
1321         (IPC::MachMessage::header):
1322         Return the header.
1323         
1324         * Platform/IPC/mac/MachMessage.h: Added.
1325         (IPC::MachMessage::length):
1326
1327         * WebKit2.xcodeproj/project.pbxproj:
1328         Add new files.
1329
1330 2016-12-06  Simon Fraser  <simon.fraser@apple.com>
1331
1332         Enable visual viewports by default on Mac, and iOS Wk2
1333         https://bugs.webkit.org/show_bug.cgi?id=165452
1334
1335         Reviewed by Zalan Bujtas.
1336
1337         Turn visual viewports on by default for WK2.
1338
1339         * Shared/WebPreferencesDefinitions.h:
1340
1341 2016-12-06  Daniel Bates  <dabates@apple.com>
1342
1343         WebKitTestRunner: Plugins are disabled in new windows
1344         https://bugs.webkit.org/show_bug.cgi?id=165410
1345
1346         Reviewed by Alex Christensen.
1347
1348         Remove SPI exposed to explicitly toggle plugins from WebKitTestRunner.
1349         Instead we will update WebKitTestRunner to make use of the SPI
1350         WKBundleOverrideBoolPreferenceForTestRunner() to toggle plugins in
1351         all windows.
1352
1353         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
1354         (WKBundleSetPluginsEnabled): Deleted.
1355         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
1356         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1357         (WebKit::InjectedBundle::setPluginsEnabled): Deleted.
1358
1359 2016-12-05  Anders Carlsson  <andersca@apple.com>
1360
1361         Don't memcpy out of line data
1362         https://bugs.webkit.org/show_bug.cgi?id=165434
1363
1364         Reviewed by Sam Weinig.
1365
1366         Change the Decoder constructor to take a buffer deallocator parameter. If the buffer deallocator is null, the
1367         data will be copied as before. Otherwise, the memory will be adopted by the Decoder object, and will be deallocated
1368         by invoking the data deallocator.
1369
1370         * Platform/IPC/Decoder.cpp:
1371         (IPC::copyBuffer):
1372         Add a new helper.
1373
1374         (IPC::Decoder::Decoder):
1375         Copy the buffer if the deallocator is null.
1376
1377         (IPC::Decoder::~Decoder):
1378         Invoke the deallocator or call fastFree if it is null.
1379
1380         (IPC::Decoder::unwrapForTesting):
1381         Update constructor.
1382         
1383         (IPC::roundUpToAlignment):
1384         (IPC::Decoder::alignBufferPosition):
1385         (IPC::Decoder::decodeVariableLengthByteArray):
1386         (IPC::decodeValueFromBuffer):
1387         Change all these to deal with const pointers.
1388
1389         * Platform/IPC/Decoder.h:
1390         Add new members.
1391
1392         * Platform/IPC/mac/ConnectionMac.mm:
1393         (IPC::createMessageDecoder):
1394         When we have out of line data, pass a deallocator that calls vm_deallocate, instead of copying the data
1395         and then immediately throwing the original away.
1396
1397 2016-12-06  Tim Horton  <timothy_horton@apple.com>
1398
1399         Almost half-second stall scrolling apple.com because of synchronous getPositionInformation
1400         https://bugs.webkit.org/show_bug.cgi?id=165403
1401         <rdar://problem/29493285>
1402
1403         Reviewed by Enrica Casucci.
1404
1405         When retrieving interaction information, we don't always need to do
1406         snapshots for 3D Touch or the action sheet, especially if we're
1407         synchronously blocking the UI process main thread waiting for the reply.
1408
1409         Add a new InteractionInformationRequest, which allows callers of
1410         getPositionInformation and requestPositionInformation to specify which
1411         optional pieces of information they would like to compute.
1412
1413         * Shared/AssistedNodeInformation.h:
1414         Fix a incorrect comment.
1415
1416         * Shared/ios/InteractionInformationRequest.cpp: Added.
1417         (WebKit::InteractionInformationRequest::encode):
1418         (WebKit::InteractionInformationRequest::decode):
1419         (WebKit::InteractionInformationRequest::isValidForRequest):
1420         * Shared/ios/InteractionInformationRequest.h: Added.
1421         (WebKit::InteractionInformationRequest::InteractionInformationRequest):
1422         * WebKit2.xcodeproj/project.pbxproj:
1423         Add InteractionInformationRequest, which encapsulates all of the
1424         parameters required to generate an InteractionInformationAtPosition.
1425         Previously, that was just a point, but now we have two new parameters:
1426         whether we should generate a snapshot of the element, and whether
1427         we should generate a TextIndicator if the element is a link.
1428
1429         * Shared/ios/InteractionInformationAtPosition.h:
1430         * Shared/ios/InteractionInformationAtPosition.mm:
1431         (WebKit::InteractionInformationAtPosition::encode):
1432         (WebKit::InteractionInformationAtPosition::decode):
1433         (WebKit::InteractionInformationAtPosition::mergeCompatibleOptionalInformation):
1434         Adopt InteractionInformationRequest.
1435
1436         * UIProcess/WebPageProxy.h:
1437         * UIProcess/ios/WebPageProxyIOS.mm:
1438         (WebKit::WebPageProxy::getPositionInformation):
1439         (WebKit::WebPageProxy::requestPositionInformation):
1440         * UIProcess/ios/WKActionSheetAssistant.mm:
1441         (-[WKActionSheetAssistant initialPresentationRectInHostViewForSheet]):
1442         (-[WKActionSheetAssistant presentationRectInHostViewForSheet]):
1443         (-[WKActionSheetAssistant showImageSheet]):
1444         (-[WKActionSheetAssistant showLinkSheet]):
1445         * UIProcess/ios/WKPDFView.mm:
1446         (-[WKPDFView annotation:isBeingPressedAtPoint:controller:]):
1447         * WebProcess/WebPage/WebPage.h:
1448         * WebProcess/WebPage/WebPage.messages.in:
1449         Adopt InteractionInformationRequest.
1450         
1451         * UIProcess/ios/WKContentViewInteraction.h:
1452         * UIProcess/ios/WKContentViewInteraction.mm:
1453         (-[WKContentView _showAttachmentSheet]):
1454         (-[WKContentView ensurePositionInformationIsUpToDate:]):
1455         If we have a outstanding asynchronous position information request
1456         for the current point, instead of sending a second separate request,
1457         just wait for the async one to come in.
1458
1459         (-[WKContentView requestAsynchronousPositionInformationUpdate:]):
1460         If asked to do an asynchronous request with more optional bits than
1461         the current otherwise-valid response's request, update the position information.
1462
1463         (-[WKContentView gestureRecognizerShouldBegin:]):
1464         The design of this mechanism is that during the highlight long press,
1465         we do an async position information update, and then when we actually
1466         begin a 3D Touch gesture, we hope to already have the requisite snapshots
1467         ready (so that we can avoid synchronously blocking for them, there).
1468         So, in the highlight long-press async request, ask for all the goodies.
1469
1470         (-[WKContentView hasSelectablePositionAtPoint:]):
1471         (-[WKContentView pointIsNearMarkedText:]):
1472         (-[WKContentView pointIsInAssistedNode:]):
1473         (-[WKContentView _didNotHandleTapAsClick:]):
1474         (-[WKContentView _positionInformationDidChange:]):
1475         If we get a position information update for the same point, but with less
1476         goodies attached (the snapshot/link indicator), copy them over from the old
1477         position information, so that we never accidentally "downgrade" our info.
1478
1479         (-[WKContentView updatePositionInformationForActionSheetAssistant:]):
1480         (-[WKContentView actionSheetAssistant:willStartInteractionWithElement:]):
1481         (-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
1482         (-[WKContentView _dataForPreviewItemController:atPosition:type:]):
1483         (-[WKContentView _presentedViewControllerForPreviewItemController:]):        
1484         More adoption.
1485         
1486         * WebProcess/WebPage/ios/WebPageIOS.mm:
1487         (WebKit::WebPage::handleTap):
1488         (WebKit::WebPage::handleTwoFingerTapAtPoint):
1489         (WebKit::WebPage::commitPotentialTap):
1490         Adopt InteractionInformationRequest.
1491
1492         (WebKit::WebPage::getPositionInformation):
1493         (WebKit::WebPage::requestPositionInformation):
1494         Copy the request into the response.
1495         Only snapshot if the request wants a snapshot.
1496         Only make a link indicator if the request wants one.
1497
1498 2016-12-06  Daniel Bates  <dabates@apple.com>
1499
1500         Cleanup: Rename some HTTP 0.9-specific functions to conform to WebKit Code Style Guidelines
1501         https://bugs.webkit.org/show_bug.cgi?id=165451
1502
1503         Reviewed by Alex Christensen.
1504
1505         * NetworkProcess/NetworkDataTask.cpp:
1506         (WebKit::NetworkDataTask::didReceiveResponse):
1507
1508 2016-12-06  Daniel Bates  <dabates@apple.com>
1509
1510         Remove unused InjectedBundle::overrideXSSAuditorEnabledForTestRunner()
1511         https://bugs.webkit.org/show_bug.cgi?id=165408
1512
1513         Reviewed by Alex Christensen.
1514
1515         InjectedBundle::overrideXSSAuditorEnabledForTestRunner() is unused. This function was only
1516         called by WKBundleOverrideXSSAuditorEnabledForTestRunner(), which was removed in r106005.
1517
1518         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1519         (WebKit::InjectedBundle::overrideXSSAuditorEnabledForTestRunner): Deleted.
1520         * WebProcess/InjectedBundle/InjectedBundle.h:
1521
1522 2016-12-04  Darin Adler  <darin@apple.com>
1523
1524         Use ASCIICType more, and improve it a little bit
1525         https://bugs.webkit.org/show_bug.cgi?id=165360
1526
1527         Reviewed by Sam Weinig.
1528
1529         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.cpp:
1530         (WebKit::capitalizeRFC822HeaderFieldName): Removed unneeded checks to simplify code.
1531
1532 2016-12-06  Dave Hyatt  <hyatt@apple.com>
1533
1534         [CSS Parser] Turn on the new CSS parser
1535         https://bugs.webkit.org/show_bug.cgi?id=165213
1536
1537         Reviewed by Zalan Bujtas.
1538
1539         * Shared/WebPreferencesDefinitions.h:
1540
1541 2016-12-06  Tomas Popela  <tpopela@redhat.com>
1542
1543         [GTK] Process accelerated compositing env variables only if they are really enabled
1544         https://bugs.webkit.org/show_bug.cgi?id=165300
1545
1546         Don't process the WEBKIT_FORCE_COMPOSITING_MODE and
1547         WEBKIT_DISABLE_COMPOSITING_MODE env variables if they are disabled
1548         (eg. WEBKIT_DISABLE_COMPOSITING_MODE=0).
1549
1550         Reviewed by Michael Catanzaro.
1551
1552         * UIProcess/gtk/WebPreferencesGtk.cpp:
1553         (WebKit::WebPreferences::platformInitializeStore):
1554
1555 2016-12-06  Sam Weinig  <sam@webkit.org>
1556
1557         [WebIDL] Add support for converting dictionaries to JS
1558         https://bugs.webkit.org/show_bug.cgi?id=165367
1559
1560         Reviewed by Darin Adler and Alex Christensen.
1561
1562         * CMakeLists.txt:
1563         Add missing directories to look in for headers.
1564
1565 2016-12-05  Tim Horton  <timothy_horton@apple.com>
1566
1567         Try to fix the iOS Simulator build.
1568
1569         * UIProcess/mac/RemoteLayerTreeHost.mm:
1570         (WebKit::RemoteLayerTreeHost::mapAllIOSurfaceBackingStore):
1571
1572 2016-12-03  Simon Fraser  <simon.fraser@apple.com>
1573
1574         Minor reformat and renames in -didUpdateVisibleRect:
1575         https://bugs.webkit.org/show_bug.cgi?id=165365
1576
1577         Reviewed by Dave Hyatt.
1578         
1579         didUpdateVisibleRect:... has lots of parameters. Put one on each line.
1580
1581         Rename the rects to make it clear they are "content" rects (i.e. in document coordinates).
1582
1583         * UIProcess/ios/WKContentView.h:
1584         * UIProcess/ios/WKContentView.mm:
1585         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
1586
1587 2016-12-05  Tim Horton  <timothy_horton@apple.com>
1588
1589         Adopt CAMachPort-as-layer-contents
1590         https://bugs.webkit.org/show_bug.cgi?id=141687
1591         <rdar://problem/19393233>
1592
1593         Reviewed by Darin Adler.
1594
1595         * Shared/mac/RemoteLayerBackingStore.h:
1596         * Shared/mac/RemoteLayerBackingStore.mm:
1597         (WebKit::RemoteLayerBackingStore::decode):
1598         On the UI process side, instead of actually looking up the surface,
1599         just keep the MachSendRight around, to later be turned into a CAMachPort.
1600
1601         (WebKit::RemoteLayerBackingStore::applyBackingStoreToLayer):
1602         Make a CAMachPort and leak our send right into it. CAMachPort
1603         will adopt the port and destroy it when needed.
1604
1605         (WebKit::RemoteLayerBackingStore::setBufferVolatility):
1606         Tiny style fix.
1607
1608         * Shared/mac/RemoteLayerTreePropertyApplier.h:
1609         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
1610         (WebKit::applyPropertiesToLayer):
1611         (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
1612         * UIProcess/DrawingAreaProxy.h:
1613         (WebKit::DrawingAreaProxy::prepareForAppSuspension):
1614         * UIProcess/ios/WebPageProxyIOS.mm:
1615         (WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground):
1616         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
1617         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1618         (WebKit::RemoteLayerTreeDrawingAreaProxy::prepareForAppSuspension):
1619         * UIProcess/mac/RemoteLayerTreeHost.h:
1620         * UIProcess/mac/RemoteLayerTreeHost.mm:
1621         (WebKit::RemoteLayerTreeHost::updateLayerTree):
1622         (WebKit::RemoteLayerTreeHost::mapAllIOSurfaceBackingStore):
1623         * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
1624         (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
1625         Two supporting changes in order to fix the two regressions that this
1626         caused when we tried to land it two years ago:
1627
1628         When an app is being suspended, resolve all CAMachPort backing store
1629         into actual IOSurfaces. Otherwise, any live CAMachPorts will keep a
1630         +1 on their respective IOSurface's use count, causing us to fail to
1631         mark them volatile, keeping the app alive for more time (re-trying the
1632         volatility change), and increasing the likelihood of background jetsam.
1633
1634         If the debugging tile map is enabled, do not use CAMachPort, because
1635         we don't have a great way to plumb the same CAMachPort to two layers
1636         (and it doesn't seem to work even if you do). Instead, just map the
1637         IOSurface into the UI process like we used to.
1638
1639 2016-12-05  Dean Jackson  <dino@apple.com>
1640
1641         pointer lock needs to be feature detectable
1642         https://bugs.webkit.org/show_bug.cgi?id=165426
1643         <rdar://problem/29486715>
1644
1645         Reviewed by Antoine Quint.
1646
1647         Set the RuntimeEnabledFeature as preferences
1648         change.
1649
1650         * UIProcess/API/C/WKPreferences.cpp:
1651         (WKPreferencesSetPointerLockEnabled):
1652         (WKPreferencesGetPointerLockEnabled):
1653         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1654         * WebProcess/WebPage/WebPage.cpp:
1655         (WebKit::WebPage::updatePreferences):
1656
1657 2016-12-05  Andreas Kling  <akling@apple.com>
1658
1659         [Cocoa] Add some memory usage related information to sysdiagnose state dumps
1660         <https://webkit.org/b/165375>
1661         <rdar://problem/29057243>
1662
1663         Reviewed by Darin Adler.
1664
1665         Add two new entries to the sysdiagnose state dumps for WebContent processes:
1666         "Memory Usage Stats" and "JavaScript Object Counts".
1667
1668         The first category contains all the interesting stuff from task_info()
1669         along with some WebCore and JavaScriptCore object/memory counters.
1670
1671         The second category contains a list of all the JS object types currently live
1672         on the heap, along with a count.
1673
1674         * WebProcess/cocoa/WebProcessCocoa.mm:
1675         (WebKit::WebProcess::registerWithStateDumper): Add two new entries to the
1676         state dictionary: "Memory Usage Stats" and "JavaScript Object Counts".
1677
1678 2016-12-05  Csaba Osztrogonác  <ossy@webkit.org>
1679
1680         Unreviewed cmake buildfix after r209307.
1681
1682         * PlatformMac.cmake:
1683
1684 2016-12-03  Dan Bernstein  <mitz@apple.com>
1685
1686         [Cocoa] Expose InjectedBundlePageEditorClient via the Objective-C bundle SPI
1687         https://bugs.webkit.org/show_bug.cgi?id=165276
1688         <rdar://problem/29467040>
1689
1690         Reviewed by Darin Adler.
1691
1692         Test: TestWebKitAPI/Tests/WebKit2Cocoa/BundleEditingDelegate.mm
1693
1694         * Shared/Cocoa/APIObject.mm:
1695         (API::Object::newObject): Wrap InjectedBundleRangeHandle in WKWebProcessPlugInRangeHandle.
1696
1697         * WebKit2.xcodeproj/project.pbxproj: Added references to new files, making
1698           WKWebProcessPlugInEditingDelegate.h and WKWebProcessPlugInRangeHandle.h private headers.
1699
1700         * WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h: Added. An base class
1701           based on InjectedBundlePageEditorClient.
1702         (API::InjectedBundle::EditorClient::~EditorClient):
1703         (API::InjectedBundle::EditorClient::shouldBeginEditing):
1704         (API::InjectedBundle::EditorClient::shouldEndEditing):
1705         (API::InjectedBundle::EditorClient::shouldInsertNode):
1706         (API::InjectedBundle::EditorClient::shouldInsertText):
1707         (API::InjectedBundle::EditorClient::shouldDeleteRange):
1708         (API::InjectedBundle::EditorClient::shouldChangeSelectedRange):
1709         (API::InjectedBundle::EditorClient::shouldApplyStyle):
1710         (API::InjectedBundle::EditorClient::didBeginEditing):
1711         (API::InjectedBundle::EditorClient::didEndEditing):
1712         (API::InjectedBundle::EditorClient::didChange):
1713         (API::InjectedBundle::EditorClient::didChangeSelection):
1714         (API::InjectedBundle::EditorClient::willWriteToPasteboard):
1715         (API::InjectedBundle::EditorClient::getPasteboardDataForRange):
1716         (API::InjectedBundle::EditorClient::didWriteToPasteboard):
1717
1718         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h: Added. Declares
1719           the new delegate protocol, currently comprising three methods corresponding to
1720           willWriteToPasteboard, getPasteboardDataForRange, and didWriteToPasteboard.
1721
1722         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.h:
1723         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
1724         (-[WKWebProcessPlugInFrame jsRangeForRangeHandle:inWorld:]): Added. Gets the JS wrapper for
1725           the specified range handle.
1726
1727         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.h: Added.
1728         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandle.mm: Added.
1729         (-[WKWebProcessPlugInRangeHandle dealloc]): Call the InjectedBundleRangeHandle destructor.
1730         (+[WKWebProcessPlugInRangeHandle rangeHandleWithJSValue:inContext:]): Get or create an
1731           InjectedBundleRangeHandle for the specified object.
1732         (-[WKWebProcessPlugInRangeHandle frame]): Return the range’s owner document’s frame.
1733         (-[WKWebProcessPlugInRangeHandle _rangeHandle]): Return the InjectedBundleRangeHandle.
1734         (-[WKWebProcessPlugInRangeHandle _apiObject]): Ditto.
1735
1736         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInRangeHandleInternal.h: Added.
1737         (WebKit::wrapper):
1738
1739         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1740         (WKBundlePageSetEditorClient): Updated for WebPage change.
1741
1742         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
1743         (-[WKWebProcessPlugInBrowserContextController _editingDelegate]): Added. Returns the
1744           delegate.
1745         (-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]): Added. Defines a
1746           Client class, which derives from API::InjectedBundle::EditorClient, and invokes the
1747           delegate methods. Instantiates a Client and sets it on the WebPage.
1748
1749         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextControllerPrivate.h:
1750           Declared new _editingDelegate property.
1751
1752         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
1753         (WebKit::InjectedBundleRangeHandle::document): Added. Returns an InjectedBundleNodeHandle
1754           for the range’s owner document.
1755         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h:
1756
1757         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
1758         (WebKit::InjectedBundlePageEditorClient::InjectedBundlePageEditorClient): Added. Calls
1759           initialize().
1760         (WebKit::InjectedBundlePageEditorClient::shouldBeginEditing): Updated for type change.
1761         (WebKit::InjectedBundlePageEditorClient::shouldEndEditing): Ditto.
1762         (WebKit::InjectedBundlePageEditorClient::shouldInsertNode): Ditto.
1763         (WebKit::InjectedBundlePageEditorClient::shouldInsertText): Ditto.
1764         (WebKit::InjectedBundlePageEditorClient::shouldDeleteRange): Ditto.
1765         (WebKit::InjectedBundlePageEditorClient::shouldChangeSelectedRange): Ditto.
1766         (WebKit::InjectedBundlePageEditorClient::shouldApplyStyle): Ditto.
1767         (WebKit::InjectedBundlePageEditorClient::didBeginEditing): Ditto.
1768         (WebKit::InjectedBundlePageEditorClient::didEndEditing): Ditto.
1769         (WebKit::InjectedBundlePageEditorClient::didChange): Ditto.
1770         (WebKit::InjectedBundlePageEditorClient::didChangeSelection): Ditto.
1771         (WebKit::InjectedBundlePageEditorClient::willWriteToPasteboard): Ditto.
1772         (WebKit::InjectedBundlePageEditorClient::getPasteboardDataForRange): Ditto.
1773         (WebKit::InjectedBundlePageEditorClient::didWriteToPasteboard): Ditto.
1774         * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h: Now derives from
1775           API::InjectedBundle::EditorClient.
1776
1777         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1778         (WebKit::WebEditorClient::shouldDeleteRange): Ditto.
1779         (WebKit::WebEditorClient::shouldBeginEditing): Ditto.
1780         (WebKit::WebEditorClient::shouldEndEditing): Ditto.
1781         (WebKit::WebEditorClient::shouldInsertNode): Ditto.
1782         (WebKit::WebEditorClient::shouldInsertText): Ditto.
1783         (WebKit::WebEditorClient::shouldChangeSelectedRange): Ditto.
1784         (WebKit::WebEditorClient::shouldApplyStyle): Ditto.
1785         (WebKit::WebEditorClient::didBeginEditing): Ditto.
1786         (WebKit::WebEditorClient::respondToChangedContents): Ditto.
1787         (WebKit::WebEditorClient::respondToChangedSelection): Ditto.
1788         (WebKit::WebEditorClient::didEndEditing): Ditto.
1789         (WebKit::WebEditorClient::didWriteSelectionToPasteboard): Ditto.
1790         (WebKit::WebEditorClient::willWriteSelectionToPasteboard): Ditto.
1791         (WebKit::WebEditorClient::getClientPasteboardDataForRange): Ditto.
1792
1793         * WebProcess/WebPage/WebPage.cpp:
1794         (WebKit::WebPage::WebPage): Initialize m_editorClient.
1795         (WebKit::WebPage::setInjectedBundleEditorClient): Replaces
1796           initializeInjectedBundleEditorClient and just sets m_editorClient.
1797         (WebKit::WebPage::close): Resets m_editorClient.
1798
1799         * WebProcess/WebPage/WebPage.h: Changed m_editorClient to a unique_ptr.
1800
1801 2016-12-02  Said Abou-Hallawa  <sabouhallawa@apple.com>
1802
1803         [iOS] Add a WebView private configuration for changing the WebContent update frequency
1804         https://bugs.webkit.org/show_bug.cgi?id=165289
1805         <rdar://problem/29472577>
1806
1807         Reviewed by Tim Horton.
1808         
1809         Expose a preference which allows us to control the fps of web content updates.
1810
1811         * UIProcess/API/APIPageConfiguration.h:
1812         (API::PageConfiguration::contentUpdateFrequency):
1813         (API::PageConfiguration::setContentUpdateFrequency):
1814         * UIProcess/API/Cocoa/WKWebView.mm:
1815         (-[WKWebView _initializeWithConfiguration:]):
1816         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1817         (-[WKWebViewConfiguration copyWithZone:]):
1818         (-[WKWebViewConfiguration _contentUpdateFrequency]):
1819         (-[WKWebViewConfiguration _setContentUpdateFrequency:]):
1820         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1821         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
1822         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1823         (-[WKOneShotDisplayLinkHandler initWithDrawingAreaProxy:]):
1824         (WebKit::RemoteLayerTreeDrawingAreaProxy::contentUpdateFrequency):
1825
1826 2016-12-02  Andy Estes  <aestes@apple.com>
1827
1828         [Cocoa] Adopt the PRODUCT_BUNDLE_IDENTIFIER build setting
1829         https://bugs.webkit.org/show_bug.cgi?id=164492
1830
1831         Reviewed by Dan Bernstein.
1832
1833         * Configurations/DatabaseService.xcconfig: Set PRODUCT_BUNDLE_IDENTIFIER to
1834         $(PRODUCT_NAME).
1835         * Configurations/NetworkService.xcconfig: Ditto.
1836         * Configurations/PluginService.32.xcconfig: Ditto.
1837         * Configurations/PluginService.64.xcconfig: Ditto.
1838         * Configurations/WebContentService.xcconfig: Ditto.
1839         * Configurations/WebKit.xcconfig: Set PRODUCT_BUNDLE_IDENTIFIER to
1840         com.apple.$(PRODUCT_NAME:rfc1034identifier).
1841         * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService/Info.plist: Changed
1842         CFBundleIdentifier's value from ${PRODUCT_NAME} to ${PRODUCT_BUNDLE_IDENTIFIER}.
1843         * Info.plist: Changed CFBundleIdentifier's value from com.apple.${PRODUCT_NAME} to
1844         ${PRODUCT_BUNDLE_IDENTIFIER}.
1845         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX-10.9-10.10.plist: Changed
1846         CFBundleIdentifier's value from ${PRODUCT_NAME} to ${PRODUCT_BUNDLE_IDENTIFIER}.
1847         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist: Ditto.
1848         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-iOS.plist: Ditto.
1849         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64-10.9-10.10.Info.plist: Ditto.
1850         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist: Ditto.
1851         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX-10.9-10.10.plist: Ditto.
1852         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist: Ditto.
1853         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist: Ditto.
1854
1855 2016-12-02  Brent Fulgham  <bfulgham@apple.com>
1856
1857         [Mac] Update sandbox profiles to use modern syntax and avoid duplication
1858         https://bugs.webkit.org/show_bug.cgi?id=165332
1859         <rdar://problem/26898991>
1860
1861         Reviewed by Anders Carlsson.
1862
1863         Update the Mac sandbox profiles to reflect that modern Cocoa applications
1864         communicate with cfprefsd, rather than plists on disk (and have done so
1865         for the past several releases).
1866
1867         Get rid of some duplicated rules, as well as old compatibility rules that
1868         are never triggered under supported operating systems.
1869
1870         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
1871         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
1872         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
1873         * WebProcess/com.apple.WebProcess.sb.in:
1874
1875 2016-12-02  Gustavo Sverzut Barbieri  <barbieri@profusion.mobi>
1876
1877         Fix build break when disabling some features.
1878         https://bugs.webkit.org/show_bug.cgi?id=165254
1879
1880         The EFL port was broken if SPELLCHECK was disabled or
1881         PLUGIN_ARCHITECTURE is not x11.
1882
1883         Reviewed by Michael Catanzaro.
1884
1885         * UIProcess/efl/TextCheckerEfl.cpp:
1886         (WebKit::TextChecker::checkTextOfParagraph):
1887         (WebKit::TextChecker::checkSpellingOfString):
1888         Fix UNUSED_PARAM() usage if SPELLCHECK is disabled.
1889         * UIProcess/efl/WebPageProxyEfl.cpp:
1890         Isolate methods within #if PLUGIN_ARCHITECTURE(X11).
1891
1892 2016-12-01  Jiewen Tan  <jiewen_tan@apple.com>
1893
1894         Add a runtime flag for SubtleCrypto
1895         https://bugs.webkit.org/show_bug.cgi?id=164982
1896
1897         Reviewed by Brent Fulgham.
1898
1899         * Shared/WebPreferencesDefinitions.h:
1900         * UIProcess/API/C/WKPreferences.cpp:
1901         (WKPreferencesSetSubtleCryptoEnabled):
1902         (WKPreferencesGetSubtleCryptoEnabled):
1903         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1904         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1905         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1906         * WebProcess/WebPage/WebPage.cpp:
1907         (WebKit::WebPage::updatePreferences):
1908
1909 2016-12-01  Saam Barati  <sbarati@apple.com>
1910
1911         Rename CallFrame::callee() to CallFrame::jsCallee()
1912         https://bugs.webkit.org/show_bug.cgi?id=165293
1913
1914         Reviewed by Keith Miller.
1915
1916         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
1917         (WebKit::callMethod):
1918         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
1919         (WebKit::callNPJSObject):
1920         (WebKit::constructWithConstructor):
1921
1922 2016-12-01  Chris Dumez  <cdumez@apple.com>
1923
1924         [iOS][WK2] Tapping an element generates a 'click' event that has 0 as timeStamp
1925         https://bugs.webkit.org/show_bug.cgi?id=165270
1926         <rdar://problem/29224355>
1927
1928         Reviewed by Simon Fraser.
1929
1930         Tapping an element generates a 'click' event that has 0 as timeStamp
1931         instead of having a proper timeStamp value. This is breaking some
1932         sites.
1933
1934         * WebProcess/WebPage/ios/WebPageIOS.mm:
1935         (WebKit::WebPage::handleSyntheticClick):
1936         (WebKit::WebPage::completeSyntheticClick):
1937
1938 2016-12-01  Tim Horton  <timothy_horton@apple.com>
1939
1940         Try to fix the EFL/Gtk build
1941
1942         * UIProcess/efl/WebProcessPoolEfl.cpp:
1943         (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
1944         * UIProcess/gtk/WebProcessPoolGtk.cpp:
1945         (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
1946
1947 2016-12-01  Tim Horton  <timothy_horton@apple.com>
1948
1949         Every WKWebView initialization spends a few milliseconds hitting the disk
1950         https://bugs.webkit.org/show_bug.cgi?id=165268
1951         <rdar://problem/29010113>
1952
1953         Reviewed by Brady Eidson.
1954
1955         Every WKWebView init currently involves doing directory creation and
1956         symlink resolution for a number of paths (to create sandbox extensions
1957         for all of our storage directories), which means touching the disk a
1958         lot during init. All of these paths are immutable per-WebProcessPool,
1959         so, instead, cache them on WebProcessPool and create sandbox extensions
1960         from the already-resolved paths. This is a sizable (~4x) speedup when
1961         initializing subsequent web views.
1962
1963         * Shared/SandboxExtension.h:
1964         (WebKit::SandboxExtension::createHandleWithoutResolvingPath):
1965         Add createHandleWithoutResolvingPath, which makes a sandbox extension
1966         handle without doing symlink resolution.
1967
1968         (WebKit::resolvePathForSandboxExtension):
1969         (WebKit::resolveAndCreateReadWriteDirectoryForSandboxExtension):
1970         Add two functions that do the same resolution that SandboxExtension::createHandle
1971         and ::createHandleForReadWriteDirectory do, but just return the paths,
1972         for later use with createHandleWithoutResolvingPath.
1973
1974         * Shared/mac/SandboxExtensionMac.mm:
1975         (WebKit::resolveAndCreateReadWriteDirectoryForSandboxExtension):
1976         (WebKit::resolvePathForSandboxExtension):
1977         (WebKit::SandboxExtension::createHandleWithoutResolvingPath):
1978         (WebKit::SandboxExtension::createHandle):
1979         (WebKit::SandboxExtension::createHandleForReadWriteDirectory):
1980         Implement the aforementioned functions, and reimplement the existing
1981         createHandle{ForReadWriteDirectory} functions in terms of them.
1982
1983         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1984         (WebKit::WebProcessPool::platformDefaultIconDatabasePath):
1985         Stop wasting time generating and resolving a platform default icon
1986         database path, since we don't actually use it for anything anymore except
1987         to determine whether the icon database is enabled, and we only want to
1988         enable it if the client has provided a path.
1989
1990         (WebKit::WebProcessPool::platformResolvePathsForSandboxExtensions):
1991         (WebKit::WebProcessPool::platformInitializeWebProcess):
1992         * UIProcess/WebProcessPool.cpp:
1993         (WebKit::m_hiddenPageThrottlingTimer):
1994         (WebKit::WebProcessPool::resolvePathsForSandboxExtensions):
1995         (WebKit::WebProcessPool::createNewWebProcess):
1996         * UIProcess/WebProcessPool.h:
1997         Resolve paths in resolvePathsForSandboxExtensions, and use the resolved
1998         paths along with createHandleWithoutResolvingPath in order to effectively
1999         cache the resolution operation.
2000
2001 2016-12-01  Antti Koivisto  <antti@apple.com>
2002
2003         Revert r208931
2004         https://bugs.webkit.org/show_bug.cgi?id=164924
2005
2006         PLT regression.
2007
2008         * NetworkProcess/cache/NetworkCache.cpp:
2009         (WebKit::NetworkCache::makeCacheKey):
2010         (WebKit::NetworkCache::Cache::makeCacheKey): Deleted.
2011         * NetworkProcess/cache/NetworkCache.h:
2012         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
2013         (WebKit::NetworkCache::BlobStorage::BlobStorage):
2014         (WebKit::NetworkCache::BlobStorage::add):
2015         (WebKit::NetworkCache::BlobStorage::get):
2016         * NetworkProcess/cache/NetworkCacheBlobStorage.h:
2017         * NetworkProcess/cache/NetworkCacheData.cpp:
2018         (WebKit::NetworkCache::computeSHA1):
2019         (WebKit::NetworkCache::makeSalt): Deleted.
2020         (WebKit::NetworkCache::readOrMakeSalt): Deleted.
2021         * NetworkProcess/cache/NetworkCacheData.h:
2022         * NetworkProcess/cache/NetworkCacheKey.cpp:
2023         (WebKit::NetworkCache::noPartitionString):
2024         (WebKit::NetworkCache::Key::Key):
2025         (WebKit::NetworkCache::Key::hasPartition):
2026         (WebKit::NetworkCache::Key::computeHash):
2027         (WebKit::NetworkCache::Key::hashAsString):
2028         (WebKit::NetworkCache::Key::computePartitionHash): Deleted.
2029         * NetworkProcess/cache/NetworkCacheKey.h:
2030         (WebKit::NetworkCache::Key::hash):
2031         (WebKit::NetworkCache::Key::partitionHash): Deleted.
2032         (WebKit::NetworkCache::Key::hashAsString): Deleted.
2033         (WebKit::NetworkCache::Key::partitionHashAsString): Deleted.
2034         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2035         (WebKit::NetworkCache::makeSubresourcesKey):
2036         (WebKit::NetworkCache::constructRevalidationRequest):
2037         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady):
2038         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
2039         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2040         (WebKit::NetworkCache::Storage::open):
2041         (WebKit::NetworkCache::traverseRecordsFiles):
2042         (WebKit::NetworkCache::Storage::Storage):
2043         (WebKit::NetworkCache::Storage::recordDirectoryPathForKey):
2044         (WebKit::NetworkCache::decodeRecordHeader):
2045         (WebKit::NetworkCache::Storage::readRecord):
2046         (WebKit::NetworkCache::Storage::encodeRecord):
2047         (WebKit::NetworkCache::Storage::traverse):
2048         (WebKit::NetworkCache::makeSaltFilePath): Deleted.
2049         * NetworkProcess/cache/NetworkCacheStorage.h:
2050         (WebKit::NetworkCache::Storage::salt): Deleted.
2051
2052 2016-11-30  Sam Weinig  <sam@webkit.org>
2053
2054         [WebIDL] Remove custom bindings for File and Blob constructors
2055         https://bugs.webkit.org/show_bug.cgi?id=165218
2056
2057         Reviewed by Darin Adler.
2058
2059         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
2060         (WebKit::NetworkBlobRegistry::registerBlobURL):
2061         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
2062         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2063         (WebKit::NetworkConnectionToWebProcess::registerBlobURL):
2064         * NetworkProcess/NetworkConnectionToWebProcess.h:
2065         * WebProcess/FileAPI/BlobRegistryProxy.cpp:
2066         (WebKit::BlobRegistryProxy::registerBlobURL):
2067         * WebProcess/FileAPI/BlobRegistryProxy.h:
2068         Avoid copies of the BlobPart Vector.
2069
2070 2016-11-30  Carlos Garcia Campos  <cgarcia@igalia.com>
2071
2072         [GTK] UI process crash in WebKit::WaylandCompositor::Surface::prepareTextureForPainting
2073         https://bugs.webkit.org/show_bug.cgi?id=164911
2074
2075         Reviewed by Michael Catanzaro.
2076
2077         The problem is that m_buffer is nullptr in Surface::prepareTextureForPainting() even though we have already an
2078         image. We only use the buffer to get the image size, so we could save the image size when the image is created,
2079         and then we don't need to care about the buffer anymore.
2080
2081         * UIProcess/gtk/WaylandCompositor.cpp:
2082         (WebKit::WaylandCompositor::Surface::prepareTextureForPainting):
2083         (WebKit::WaylandCompositor::Surface::commit):
2084         * UIProcess/gtk/WaylandCompositor.h:
2085
2086 2016-11-30  Antoine Quint  <graouts@apple.com>
2087
2088         [Modern Media Controls] Add an HTML comment flag to turn the feature on
2089         https://bugs.webkit.org/show_bug.cgi?id=165226
2090
2091         Reviewed by Dean Jackson.
2092
2093         Add new methods to set the Modern Media Controls preference.
2094
2095         * UIProcess/API/C/WKPreferences.cpp:
2096         (WKPreferencesSetModernMediaControlsEnabled):
2097         (WKPreferencesGetModernMediaControlsEnabled):
2098         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2099
2100 2016-11-30  Said Abou-Hallawa  <sabouhallawa@apple.com>
2101
2102         Add separate settings and preferences to enable/disable async decoding for large images and animated images
2103         https://bugs.webkit.org/show_bug.cgi?id=165177
2104
2105         Reviewed by Simon Fraser.
2106         
2107         Hook up the async image decoding settings for WebKit2.
2108
2109         * Shared/WebPreferencesDefinitions.h:
2110         * UIProcess/API/Cocoa/WKPreferences.mm:
2111         (-[WKPreferences _largeImageAsyncDecodingEnabled]):
2112         (-[WKPreferences _setLargeImageAsyncDecodingEnabled:]):
2113         (-[WKPreferences _animatedImageAsyncDecodingEnabled]):
2114         (-[WKPreferences _setAnimatedImageAsyncDecodingEnabled:]):
2115         (-[WKPreferences _asyncImageDecodingEnabled]): Deleted.
2116         (-[WKPreferences _setAsyncImageDecodingEnabled:]): Deleted.
2117         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2118         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2119         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2120         * WebProcess/WebPage/WebPage.cpp:
2121         (WebKit::WebPage::updatePreferences):
2122
2123 2016-11-30  Chris Dumez  <cdumez@apple.com>
2124
2125         [iOS][WK2] Turn on HTML interactive form validation feature
2126         https://bugs.webkit.org/show_bug.cgi?id=165212
2127         <rdar://problem/29444356>
2128
2129         Reviewed by Simon Fraser.
2130
2131         Turn on HTML interactive form validation feature on iOS WK2
2132         now that we have a native UI.
2133
2134         * Shared/WebPreferencesDefinitions.h:
2135
2136 2016-11-30  Brent Fulgham  <bfulgham@apple.com>
2137
2138         Correct plugin sandbox after r208611
2139         https://bugs.webkit.org/show_bug.cgi?id=165187
2140         <rdar://problem/29431165>
2141
2142         Reviewed by Alex Christensen.
2143
2144         In r208611 I removed the 'else' clause of a Scheme conditional
2145         that was needed to properly run plugins (such as Flash Player).
2146
2147         This change retains the relevant current sandbox content, while
2148         still stripping out the old code that is no longer needed.
2149
2150         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
2151
2152 2016-11-29  Carlos Garcia Campos  <cgarcia@igalia.com>
2153
2154         [GTK] Database process should not initialize gtk
2155         https://bugs.webkit.org/show_bug.cgi?id=165138
2156
2157         Reviewed by Sergio Villar Senin.
2158
2159         It doesn't use GTK+ at all.
2160
2161         * DatabaseProcess/gtk/DatabaseProcessMainGtk.cpp:
2162         (WebKit::DatabaseProcessMainUnix):
2163         (): Deleted.
2164
2165 2016-11-29  Gavin Barraclough  <barraclough@apple.com>
2166
2167         Remove WebPage::SetPageSuppressed
2168         https://bugs.webkit.org/show_bug.cgi?id=165158
2169
2170         Unreviewed revert accidental change.
2171
2172         * WebProcess/WebPage/WebPage.cpp:
2173         (WebKit::WebPage::setActivityState):
2174
2175 2016-11-29  Gavin Barraclough  <barraclough@apple.com>
2176
2177         Remove WebPage::SetPageSuppressed
2178         https://bugs.webkit.org/show_bug.cgi?id=165158
2179
2180         Reviewed by Tim Horton.
2181
2182         This was scaffolding. We've now refactored to the point that the information driving throttling originates
2183         from the UI process (so UI and web processes can have a consistent view of what should throttle), but we
2184         don't need a separate message to handle this - necessary state to determine is provided in ActivityState.
2185
2186         * UIProcess/WebPageProxy.cpp:
2187         (WebKit::WebPageProxy::updateThrottleState):
2188             - used to send SetPageSuppressed; no longer does.
2189         * UIProcess/WebPageProxy.h:
2190             - removed m_pageSuppressed (was used to avoid duplicated messages).
2191         * WebProcess/WebPage/WebPage.cpp:
2192         (WebKit::WebPage::updateThrottleState):
2193             - compute throttle state based on m_activityState.
2194         (WebKit::WebPage::setActivityState):
2195             - update throttle state whenever activity state changes.
2196         (WebKit::WebPage::updatePreferences):
2197             - update throttle state whenever preferences change (throttling can be disabled via preference).
2198         (WebKit::WebPage::setPageSuppressed): Deleted.
2199             - Removed WebPage::SetPageSuppressed.
2200         * WebProcess/WebPage/WebPage.h:
2201             - Removed WebPage::SetPageSuppressed.
2202             - Added m_processSuppressionEnabled, to cache preference state.
2203         * WebProcess/WebPage/WebPage.messages.in:
2204             - Removed WebPage::SetPageSuppressed.
2205
2206 2016-11-29  Andy Estes  <aestes@apple.com>
2207
2208         [Cocoa] Enable two clang warnings recommended by Xcode
2209         https://bugs.webkit.org/show_bug.cgi?id=164498
2210
2211         Reviewed by Mark Lam.
2212
2213         * Configurations/Base.xcconfig: Enabled CLANG_WARN_INFINITE_RECURSION and CLANG_WARN_SUSPICIOUS_MOVE.
2214
2215 2016-11-29  Eric Carlson  <eric.carlson@apple.com>
2216
2217         [MediaStream] Don't request user permission for a device if it has already been granted in the current browsing context
2218         https://bugs.webkit.org/show_bug.cgi?id=164760
2219         <rdar://problem/29261266>
2220
2221         Reviewed by Youenn Fablet.
2222
2223         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2224         (WebKit::FrameAuthorizationState::FrameAuthorizationState):
2225         (WebKit::FrameAuthorizationState::hasPermissionToUseCaptureDevice):
2226         (WebKit::FrameAuthorizationState::setHasPermissionToUseCaptureDevice):
2227         (WebKit::FrameAuthorizationState::reset):
2228         (WebKit::FrameAuthorizationState::securityOriginsAreEqual):
2229         (WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest):
2230         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests):
2231         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest):
2232         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
2233         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
2234         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
2235         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2236         (WebKit::FrameAuthorizationState::~FrameAuthorizationState):
2237         (WebKit::FrameAuthorizationState::frameID):
2238         * UIProcess/UserMediaPermissionRequestProxy.cpp:
2239         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
2240         * UIProcess/UserMediaPermissionRequestProxy.h:
2241         (WebKit::UserMediaPermissionRequestProxy::create):
2242         (WebKit::UserMediaPermissionRequestProxy::frameID):
2243         (WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin):
2244         (WebKit::UserMediaPermissionRequestProxy::topLevelDocumentSecurityOrigin):
2245         * UIProcess/WebPageProxy.cpp:
2246         (WebKit::WebPageProxy::didCommitLoadForFrame):
2247         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2248         (WebKit::UserMediaPermissionRequestManager::removeMediaRequestFromMaps):
2249
2250 2016-11-29  Wenson Hsieh  <wenson_hsieh@apple.com>
2251
2252         Scroll snapping on Mac should use AppKit animations
2253         https://bugs.webkit.org/show_bug.cgi?id=147261
2254         <rdar://problem/29395293>
2255
2256         Reviewed by Brent Fulgham.
2257
2258         Add some logic to plumb filtered wheel velocity over to WebCore in the case of mainframe scrolling. See
2259         WebCore/ChangeLog for more details.
2260
2261         * WebProcess/WebPage/EventDispatcher.cpp:
2262         (WebKit::EventDispatcher::wheelEvent):
2263
2264 2016-11-21  Brian Burg  <bburg@apple.com>
2265
2266         Web Automation: add ObjC SPI to set whether a page is controlled by automation
2267         https://bugs.webkit.org/show_bug.cgi?id=165001
2268         <rdar://problem/29350432>
2269
2270         Reviewed by Dan Bernstein.
2271
2272         Add SPI property to WKWebViewConfiguration and plumb it through to
2273         initialize WebPageProxy::m_controlledByAutomation. This is propagated
2274         to the WebProcess on creation via WebPageCreationParameters.
2275
2276         * UIProcess/API/APIPageConfiguration.cpp:
2277         (API::PageConfiguration::copy):
2278         * UIProcess/API/APIPageConfiguration.h:
2279         (API::PageConfiguration::isControlledByAutomation):
2280         (API::PageConfiguration::setControlledByAutomation):
2281         * UIProcess/API/Cocoa/WKWebView.mm:
2282         (-[WKWebView _initializeWithConfiguration:]):
2283         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2284         (-[WKWebViewConfiguration init]):
2285         (-[WKWebViewConfiguration copyWithZone:]):
2286         (-[WKWebViewConfiguration _isControlledByAutomation]):
2287         (-[WKWebViewConfiguration _setControlledByAutomation:]):
2288         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
2289         * UIProcess/WebPageProxy.cpp:
2290         (WebKit::WebPageProxy::WebPageProxy):
2291
2292 2016-11-28  Carlos Garcia Campos  <cgarcia@igalia.com>
2293
2294         [GTK] BadDamage X Window System error in WebKit::AcceleratedBackingStoreX11::update when called from WebPageProxy::exitAcceleratedCompositingMode
2295         https://bugs.webkit.org/show_bug.cgi?id=164303
2296
2297         Reviewed by Michael Catanzaro.
2298
2299         Trap also BadDrawable and BadDamage X errors when creating the surface and damage.
2300
2301         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
2302         (WebKit::AcceleratedBackingStoreX11::update):
2303
2304 2016-11-28  Chris Dumez  <cdumez@apple.com>
2305
2306         [Mac][WK2] Enable HTML interactive form validation
2307         https://bugs.webkit.org/show_bug.cgi?id=165123
2308         <rdar://problem/28944652>
2309
2310         Reviewed by Simon Fraser.
2311
2312         Enable HTML interactive form validation now that we have a native UI
2313         for it.
2314
2315         * Shared/WebPreferencesDefinitions.h:
2316
2317 2016-11-28  Brent Fulgham  <bfulgham@apple.com>
2318
2319         Generated sandbox profile is not being put in the correct Resources directory
2320         https://bugs.webkit.org/show_bug.cgi?id=165126
2321
2322         Reviewed by Tim Horton.
2323
2324         * WebKit2.xcodeproj/project.pbxproj: Copy the generated file to the 'PlugInSandboxProfiles'
2325         sub-directory.
2326
2327 2016-11-28  Ryan Haddad  <ryanhaddad@apple.com>
2328
2329         Unreviewed, rolling out r209008.
2330
2331         This change appears to have caused two fast/mediastrem
2332         LayoutTests to fail.
2333
2334         Reverted changeset:
2335
2336         "[MediaStream] Don't request user permission for a device if
2337         it has already been granted in the current browsing context"
2338         https://bugs.webkit.org/show_bug.cgi?id=164760
2339         http://trac.webkit.org/changeset/209008
2340
2341 2016-11-28  Andrew Gold  <agold@apple.com>
2342
2343         Support for HTML Media Capture API
2344         https://bugs.webkit.org/show_bug.cgi?id=43239
2345
2346         Reviewed by Tim Horton.
2347
2348         In order to enable media capture on iOS, we must first use the AVFoundation API to 
2349         check/request capture permission from the user for Safari. Then, Safari must request
2350         permission on behalf of the webpage to use the capture devices. Additionally, Safari
2351         must present UI when the capture is taking place, so WebKit needs to notify the client
2352         of a capture session beginning and ending. To do this, we added four methods to 
2353         WKUIDelegatePrivate to request permission from the user, check for permissions, notify
2354         that a capture session has begun, and notify that a capture session has ended. Additionally,
2355         we added a private method to WKWebView that allows the client to stop a capture session.
2356
2357         * UIProcess/API/APIUIClient.h:
2358         (API::UIClient::didBeginCaptureSession): Notifies the client of a capture session beginning.
2359         (API::UIClient::didEndCaptureSession): Notifies the client of a capture session ending.
2360
2361         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h: Added new delegate methods to request permission,
2362         check for permission, notify of a capture session beginning, and notify of a capture session
2363         ending.
2364
2365         * UIProcess/API/Cocoa/WKWebView.mm:
2366         (-[WKWebView _stopMediaCapture]): Cancels a media capture session.
2367         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2368
2369         * UIProcess/Cocoa/UIDelegate.h:
2370         * UIProcess/Cocoa/UIDelegate.mm:
2371         (WebKit::UIDelegate::setDelegate): Added the new delegate methods.
2372         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest):
2373         First checks if the user has authorized the client application access capture devices,
2374         then uses the WKUIDelegate to request permission for a site from the user.
2375         (WebKit::UIDelegate::UIClient::checkUserMediaPermissionForOrigin): Checks the client
2376         for permission to access capture devices.
2377         (WebKit::UIDelegate::UIClient::didBeginCaptureSession): Notifies the client of a capture
2378         session beginning.
2379         (WebKit::UIDelegate::UIClient::didEndCaptureSession): Notifies the client of a capture
2380         session ending.
2381
2382         * UIProcess/WebPageProxy.cpp:
2383         (WebKit::WebPageProxy::isPlayingMediaDidChange): Calls UIDelegate method to notify the
2384         client of a capture session beginning/ending.
2385
2386 2016-11-28  Eric Carlson  <eric.carlson@apple.com>
2387
2388         [MediaStream] Don't request user permission for a device if it has already been granted in the current browsing context
2389         https://bugs.webkit.org/show_bug.cgi?id=164760
2390         <rdar://problem/29261266>
2391
2392         Reviewed by Youenn Fablet.
2393
2394         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2395         (WebKit::FrameAuthorizationState::FrameAuthorizationState):
2396         (WebKit::FrameAuthorizationState::hasPermissionToUseCaptureDevice):
2397         (WebKit::FrameAuthorizationState::setHasPermissionToUseCaptureDevice):
2398         (WebKit::FrameAuthorizationState::reset):
2399         (WebKit::FrameAuthorizationState::securityOriginsAreEqual):
2400         (WebKit::UserMediaPermissionRequestManagerProxy::stateForRequest):
2401         (WebKit::UserMediaPermissionRequestManagerProxy::invalidateRequests):
2402         (WebKit::UserMediaPermissionRequestManagerProxy::createRequest):
2403         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied):
2404         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasGranted):
2405         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
2406         * UIProcess/UserMediaPermissionRequestManagerProxy.h:
2407         (WebKit::FrameAuthorizationState::~FrameAuthorizationState):
2408         (WebKit::FrameAuthorizationState::frameID):
2409         * UIProcess/UserMediaPermissionRequestProxy.cpp:
2410         (WebKit::UserMediaPermissionRequestProxy::UserMediaPermissionRequestProxy):
2411         * UIProcess/UserMediaPermissionRequestProxy.h:
2412         (WebKit::UserMediaPermissionRequestProxy::create):
2413         (WebKit::UserMediaPermissionRequestProxy::frameID):
2414         (WebKit::UserMediaPermissionRequestProxy::userMediaDocumentSecurityOrigin):
2415         (WebKit::UserMediaPermissionRequestProxy::topLevelDocumentSecurityOrigin):
2416         * UIProcess/WebPageProxy.cpp:
2417         (WebKit::WebPageProxy::didCommitLoadForFrame):
2418         * WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
2419         (WebKit::UserMediaPermissionRequestManager::removeMediaRequestFromMaps):
2420
2421 2016-11-27  Dean Jackson  <dino@apple.com>
2422
2423         Removed a WTFLogAlways I left in with a recent commit.
2424
2425         * UIProcess/Cocoa/WebViewImpl.mm:
2426         (-[WKAccessibilitySettingsObserver _settingsDidChange:]):
2427
2428 2016-11-27  Csaba Osztrogonác  <ossy@webkit.org>
2429
2430         Fix unused-private-field build warning in WebKit2/Platform/SharedMemory.h
2431         https://bugs.webkit.org/show_bug.cgi?id=165069
2432
2433         Reviewed by Darin Adler.
2434
2435         * Platform/SharedMemory.h:
2436
2437 2016-11-26  Simon Fraser  <simon.fraser@apple.com>
2438
2439         Fix the iOS build.
2440
2441         * WebProcess/WebPage/ios/WebPageIOS.mm:
2442         (WebKit::WebPage::eventThrottlingDelay):
2443
2444 2016-11-26  Yusuke Suzuki  <utatane.tea@gmail.com>
2445
2446         [WTF] Import std::optional reference implementation as WTF::Optional
2447         https://bugs.webkit.org/show_bug.cgi?id=164199
2448
2449         Reviewed by Saam Barati and Sam Weinig.
2450
2451         * NetworkProcess/NetworkDataTask.cpp:
2452         (WebKit::NetworkDataTask::didReceiveResponse):
2453         * NetworkProcess/NetworkLoad.h:
2454         * NetworkProcess/cache/NetworkCache.cpp:
2455         (WebKit::NetworkCache::responseHasExpired):
2456         * NetworkProcess/cache/NetworkCacheCoders.h:
2457         (WebKit::NetworkCache::Coder<std::optional<T>>::encode):
2458         (WebKit::NetworkCache::Coder<std::optional<T>>::decode):
2459         (WebKit::NetworkCache::Coder<Optional<T>>::encode): Deleted.
2460         (WebKit::NetworkCache::Coder<Optional<T>>::decode): Deleted.
2461         * NetworkProcess/cache/NetworkCacheData.cpp:
2462         (WebKit::NetworkCache::readOrMakeSalt):
2463         * NetworkProcess/cache/NetworkCacheData.h:
2464         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2465         (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::PreloadedEntry):
2466         (WebKit::NetworkCache::SpeculativeLoadManager::PreloadedEntry::revalidationRequest):
2467         (WebKit::NetworkCache::SpeculativeLoadManager::addPreloadedEntry):
2468         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
2469         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
2470         (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
2471         (WebKit::NetworkCache::Statistics::recordRetrievalFailure):
2472         (WebKit::NetworkCache::Statistics::queryWasEverRequested):
2473         * NetworkProcess/cache/NetworkCacheStatistics.h:
2474         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2475         (WebKit::NetworkCache::Storage::storeBodyAsBlob):
2476         (WebKit::NetworkCache::Storage::encodeRecord):
2477         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
2478         * NetworkProcess/cache/NetworkCacheStorage.h:
2479         * Platform/IPC/ArgumentCoders.h:
2480         (IPC::ArgumentCoder<std::optional<T>>::encode):
2481         (IPC::ArgumentCoder<std::optional<T>>::decode):
2482         (IPC::ArgumentCoder<WTF::Optional<T>>::encode): Deleted.
2483         (IPC::ArgumentCoder<WTF::Optional<T>>::decode): Deleted.
2484         * Platform/IPC/Connection.h:
2485         (IPC::Connection::sendWithReply):
2486         * Platform/SharedMemory.h:
2487         * Platform/unix/SharedMemoryUnix.cpp:
2488         (WebKit::SharedMemory::map):
2489         * Scripts/webkit/messages.py:
2490         (class_template_headers):
2491         * Shared/API/APISecurityOrigin.h:
2492         (API::SecurityOrigin::create):
2493         * Shared/API/Cocoa/_WKRemoteObjectInterface.mm:
2494         * Shared/API/c/WKSecurityOriginRef.cpp:
2495         (WKSecurityOriginGetPort):
2496         * Shared/SessionState.h:
2497         * Shared/WebPageCreationParameters.h:
2498         * Shared/mac/ObjCObjectGraph.mm:
2499         (WebKit::typeFromObject):
2500         * Shared/mac/SecItemShim.cpp:
2501         (WebKit::sendSecItemRequest):
2502         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
2503         (WKKeyValueStorageManagerGetStorageDetailsByOrigin):
2504         * UIProcess/API/Cocoa/WKSecurityOrigin.mm:
2505         (-[WKSecurityOrigin port]):
2506         * UIProcess/API/Cocoa/WKWebView.mm:
2507         (-[WKWebView _didCommitLayerTree:]):
2508         (-[WKWebView _navigationGestureDidEnd]):
2509         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
2510         (WebKit::toWebsiteDataType):
2511         * UIProcess/API/efl/EwkView.cpp:
2512         (EwkView::setCursor):
2513         * UIProcess/API/mac/WKView.mm:
2514         (toCoreScrollbarStyle):
2515         (toAPIScrollbarStyle):
2516         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
2517         (WebKit::WebPaymentCoordinatorProxy::completeShippingMethodSelection):
2518         (WebKit::WebPaymentCoordinatorProxy::completeShippingContactSelection):
2519         (WebKit::WebPaymentCoordinatorProxy::completePaymentMethodSelection):
2520         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
2521         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
2522         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2523         (WebKit::toPKPaymentSummaryItem):
2524         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingMethodSelection):
2525         (WebKit::WebPaymentCoordinatorProxy::platformCompleteShippingContactSelection):
2526         (WebKit::WebPaymentCoordinatorProxy::platformCompletePaymentMethodSelection):
2527         * UIProcess/Automation/WebAutomationSession.cpp:
2528         (WebKit::WebAutomationSession::webFrameIDForHandle):
2529         (WebKit::WebAutomationSession::switchToBrowsingContext):
2530         (WebKit::WebAutomationSession::evaluateJavaScriptFunction):
2531         (WebKit::WebAutomationSession::resolveChildFrameHandle):
2532         (WebKit::WebAutomationSession::resolveParentFrameHandle):
2533         (WebKit::WebAutomationSession::computeElementLayout):
2534         * UIProcess/Automation/WebAutomationSession.h:
2535         * UIProcess/Cocoa/WebViewImpl.h:
2536         * UIProcess/Cocoa/WebViewImpl.mm:
2537         (WebKit::WebViewImpl::updateViewExposedRect):
2538         (WebKit::WebViewImpl::setOverlayScrollbarStyle):
2539         (WebKit::WebViewImpl::overlayScrollbarStyle):
2540         * UIProcess/DrawingAreaProxy.cpp:
2541         (WebKit::DrawingAreaProxy::setViewExposedRect):
2542         * UIProcess/DrawingAreaProxy.h:
2543         (WebKit::DrawingAreaProxy::viewExposedRect):
2544         * UIProcess/InspectorServer/WebSocketServerConnection.cpp:
2545         (WebKit::WebSocketServerConnection::didReceiveSocketStreamData):
2546         * UIProcess/InspectorServer/WebSocketServerConnection.h:
2547         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
2548         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
2549         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
2550         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
2551         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
2552         * UIProcess/Scrolling/RemoteScrollingTree.h:
2553         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
2554         (WebKit::fileCreationTime):
2555         (WebKit::fileModificationTime):
2556         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
2557         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2558         (WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame):
2559         * UIProcess/WebBackForwardList.cpp:
2560         (WebKit::WebBackForwardList::backForwardListState):
2561         (WebKit::WebBackForwardList::restoreFromState):
2562         * UIProcess/WebPageProxy.cpp:
2563         (WebKit::WebPageProxy::didCommitLoadForFrame):
2564         (WebKit::WebPageProxy::creationParameters):
2565         (WebKit::WebPageProxy::setOverlayScrollbarStyle):
2566         * UIProcess/WebPageProxy.h:
2567         (WebKit::WebPageProxy::overlayScrollbarStyle):
2568         * UIProcess/WebPageProxy.messages.in:
2569         * UIProcess/WebsiteData/WebsiteDataRecord.h:
2570         * UIProcess/efl/WebView.cpp:
2571         (WebKit::WebView::transformFromScene):
2572         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
2573         * UIProcess/gtk/WebPreferencesGtk.cpp:
2574         (WebKit::WebPreferences::platformInitializeStore):
2575         * UIProcess/ios/WKContentViewInteraction.mm:
2576         (-[WKContentView _scrollOffsetForEvent:]):
2577         (-[WKContentView _interpretKeyEvent:isCharEvent:]):
2578         * UIProcess/mac/LegacySessionStateCoding.cpp:
2579         (WebKit::encodeFormDataElement):
2580         (WebKit::decodeFormDataElement):
2581         (WebKit::decodeV1SessionHistory):
2582         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
2583         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
2584         (WebKit::RemoteLayerTreeDrawingAreaProxy::setViewExposedRect):
2585         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
2586         (WebKit::WebPaymentCoordinator::completeShippingMethodSelection):
2587         (WebKit::WebPaymentCoordinator::completeShippingContactSelection):
2588         (WebKit::WebPaymentCoordinator::completePaymentMethodSelection):
2589         * WebProcess/ApplePay/WebPaymentCoordinator.h:
2590         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2591         (WKBundlePageSetEventThrottlingBehaviorOverride):
2592         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
2593         (WebKit::PDFPlugin::convertFromPDFViewToRootView):
2594         (WebKit::PDFPlugin::convertFromPDFViewToScreen):
2595         (WebKit::PDFPlugin::boundsOnScreen):
2596         (WebKit::PDFPlugin::geometryDidChange):
2597         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2598         (WebKit::PDFPlugin::geometryDidChange):
2599         * WebProcess/Plugins/PluginView.cpp:
2600         (WebKit::PluginView::performFrameLoadURLRequest):
2601         (WebKit::PluginView::evaluate):
2602         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
2603         (WebKit::WebPluginInfoProvider::pluginLoadClientPolicyForHost):
2604         * WebProcess/Plugins/WebPluginInfoProvider.h:
2605         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
2606         (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
2607         * WebProcess/WebCoreSupport/SessionStateConversion.cpp:
2608         (WebKit::toFormData):
2609         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2610         (WebKit::WebChromeClient::preferredScrollbarOverlayStyle):
2611         * WebProcess/WebCoreSupport/WebChromeClient.h:
2612         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2613         (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad):
2614         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2615         * WebProcess/WebPage/DrawingArea.h:
2616         * WebProcess/WebPage/DrawingArea.messages.in:
2617         * WebProcess/WebPage/WebFrame.cpp:
2618         (WebKit::WebFrame::certificateInfo):
2619         * WebProcess/WebPage/WebPage.cpp:
2620         (WebKit::m_userInterfaceLayoutDirection):
2621         (WebKit::WebPage::setScrollbarOverlayStyle):
2622         * WebProcess/WebPage/WebPage.h:
2623         (WebKit::WebPage::scrollbarOverlayStyle):
2624         * WebProcess/WebPage/WebPage.messages.in:
2625         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2626         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2627         (WebKit::RemoteLayerTreeDrawingArea::setViewExposedRect):
2628         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
2629         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2630         (WebKit::TiledCoreAnimationDrawingArea::setViewExposedRect):
2631
2632 2016-11-26  Sam Weinig  <sam@webkit.org>
2633
2634         Convert IntersectionObserver over to using RuntimeEnabledFeatures so it can be properly excluded from script
2635         https://bugs.webkit.org/show_bug.cgi?id=164965
2636
2637         Reviewed by Simon Fraser.
2638
2639         * Shared/WebPreferencesDefinitions.h:
2640         * UIProcess/API/C/WKPreferences.cpp:
2641         (WKPreferencesSetIntersectionObserverEnabled):
2642         (WKPreferencesGetIntersectionObserverEnabled):
2643         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2644         * WebProcess/WebPage/WebPage.cpp:
2645         (WebKit::WebPage::updatePreferences):
2646         Add a preference, defaulting to off, for enabling IntersectionObserver.
2647
2648 2016-11-26  Simon Fraser  <simon.fraser@apple.com>
2649
2650         Migrate some layout timer-related code from std::chrono to Seconds and MonotonicTime
2651         https://bugs.webkit.org/show_bug.cgi?id=164992
2652
2653         Reviewed by Darin Adler.
2654         
2655         No more ugly conversion from seconds to milliseconds.
2656
2657         * WebProcess/WebPage/WebPage.cpp:
2658         (WebKit::WebPage::updatePreferences):
2659         * WebProcess/WebPage/ios/WebPageIOS.mm:
2660         (WebKit::WebPage::eventThrottlingDelay):
2661
2662 2016-11-25  Michael Catanzaro  <mcatanzaro@igalia.com>
2663
2664         [GTK] Follow-up fixes to r208974
2665         https://bugs.webkit.org/show_bug.cgi?id=164771
2666
2667         Unreviewed, implement Carlos's review feedback.
2668
2669         * UIProcess/API/gtk/WebKitNotification.cpp:
2670         (webkit_notification_get_tag):
2671         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
2672         (WebKitNotificationProvider::withdrawAnyPreviousNotificationMatchingTag):
2673         (WebKitNotificationProvider::show):
2674         * UIProcess/API/gtk/WebKitNotificationProvider.h:
2675
2676 2016-11-24  Michael Catanzaro  <mcatanzaro@igalia.com>
2677
2678         [GTK] Notifications API does not expose or respect the "tag" attribute
2679         https://bugs.webkit.org/show_bug.cgi?id=164771
2680
2681         Reviewed by Gustavo Noronha Silva.
2682
2683         Expose a tag property on WebKitNotification. Ensure that any previous notification with the
2684         same tag is closed when showing a new notification with that tag.
2685
2686         * UIProcess/API/gtk/WebKitNotification.cpp:
2687         (webkit_notification_class_init):
2688         (webkitNotificationCreate):
2689         (webkit_notification_get_tag):
2690         * UIProcess/API/gtk/WebKitNotification.h:
2691         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
2692         (WebKitNotificationProvider::withdrawAnyPreviousNotificationMatchingTag):
2693         (WebKitNotificationProvider::show):
2694         * UIProcess/API/gtk/WebKitNotificationProvider.h:
2695         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2696
2697 2016-11-22  Sergio Villar Senin  <svillar@igalia.com>
2698
2699         [GTK] Fix introspection warning
2700         https://bugs.webkit.org/show_bug.cgi?id=165026
2701
2702         Reviewed by Michael Catanzaro.
2703
2704         This fixes an introspection annotation for a new API added in r208532.
2705
2706         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.cpp:
2707         (webkit_web_page_class_init):
2708
2709 2016-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2710
2711         [SOUP] Simplify custom protocols handler implementation
2712         https://bugs.webkit.org/show_bug.cgi?id=164922
2713
2714         Reviewed by Michael Catanzaro.
2715
2716         We are using too many classes for this and also the C API that is not needed, because both GTK+ and EFL have
2717         their own APIs and this is not used by WTR at all.
2718
2719         * PlatformEfl.cmake: Remove files from compilation.
2720         * PlatformGTK.cmake: Ditto.
2721         * Shared/API/c/WKBase.h:
2722         * Shared/API/c/soup/WKBaseSoup.h: Removed.
2723         * UIProcess/API/APICustomProtocolManagerClient.h: Added.
2724         (API::CustomProtocolManagerClient::~CustomProtocolManagerClient):
2725         (API::CustomProtocolManagerClient::startLoading):
2726         (API::CustomProtocolManagerClient::stopLoading):
2727         (API::CustomProtocolManagerClient::invalidate):
2728         * UIProcess/API/C/WKAPICast.h:
2729         * UIProcess/API/C/soup/WKAPICastSoup.h: Removed.
2730         * UIProcess/API/C/soup/WKContextSoup.h: Removed.
2731         * UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.cpp: Removed.
2732         * UIProcess/API/C/soup/WKSoupCustomProtocolRequestManager.h: Removed.
2733         * UIProcess/API/C/soup/WKSoupRequestManager.h: Removed.
2734         * UIProcess/API/efl/ewk_context.cpp: Remove unneeded include.
2735         * UIProcess/API/efl/ewk_url_scheme_request.cpp: Use CustomProtocolManagerProxy instead of WKSoupCustomProtocolRequestManagerRef.
2736         (EwkUrlSchemeRequest::EwkUrlSchemeRequest):
2737         (EwkUrlSchemeRequest::finish):
2738         (EwkUrlSchemeRequest::invalidate):
2739         * UIProcess/API/efl/ewk_url_scheme_request_private.h:
2740         (EwkUrlSchemeRequest::create):
2741         (EwkUrlSchemeRequest::manager):
2742         * UIProcess/API/gtk/WebKitCustomProtocolManagerClient.cpp: Added.
2743         (attachCustomProtocolManagerClientToContext):
2744         * UIProcess/API/gtk/WebKitCustomProtocolManagerClient.h: Renamed from Source/WebKit2/UIProcess/API/gtk/WebKitRequestManagerClient.h.
2745         * UIProcess/API/gtk/WebKitPrivate.h:
2746         * UIProcess/API/gtk/WebKitRequestManagerClient.cpp: Removed.
2747         * UIProcess/API/gtk/WebKitRequestManagerClient.h: Removed.
2748         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp: Use CustomProtocolManagerProxy instead of WebSoupCustomProtocolRequestManager.
2749         (webkitURISchemeRequestCreate):
2750         (webkitURISchemeRequestCancel):
2751         (webkitURISchemeRequestGetManager):
2752         (webkitURISchemeRequestInvalidate):
2753         (webkitURISchemeRequestReadCallback):
2754         (webkit_uri_scheme_request_finish_error):
2755         * UIProcess/API/gtk/WebKitURISchemeRequestPrivate.h:
2756         * UIProcess/API/gtk/WebKitWebContext.cpp:
2757         (webkitWebContextConstructed):
2758         (webkitWebContextDispose):
2759         (webkit_web_context_register_uri_scheme):
2760         (webkitWebContextStartLoadingCustomProtocol):
2761         (webkitWebContextInvalidateCustomProtocolRequests):
2762         * UIProcess/API/gtk/WebKitWebContextPrivate.h:
2763         * UIProcess/Network/CustomProtocols/CustomProtocolManagerProxy.h:
2764         * UIProcess/Network/CustomProtocols/mac/CustomProtocolManagerProxyMac.mm:
2765         (WebKit::CustomProtocolManagerProxy::processDidClose):
2766         * UIProcess/Network/CustomProtocols/soup/CustomProtocolManagerProxySoup.cpp:
2767         (WebKit::CustomProtocolManagerProxy::processDidClose): Invalidate the client.
2768         (WebKit::CustomProtocolManagerProxy::startLoading): Notify the client.
2769         (WebKit::CustomProtocolManagerProxy::stopLoading): Ditto.
2770         (WebKit::CustomProtocolManagerProxy::didReceiveResponse): Notify the network process.
2771         (WebKit::CustomProtocolManagerProxy::didLoadData): Ditto.
2772         (WebKit::CustomProtocolManagerProxy::didFailWithError): Ditto.
2773         (WebKit::CustomProtocolManagerProxy::didFinishLoading): Ditto.
2774         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.cpp: Removed.
2775         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManager.h: Removed.
2776         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.cpp: Removed.
2777         * UIProcess/Network/CustomProtocols/soup/WebSoupCustomProtocolRequestManagerClient.h: Removed.
2778         * UIProcess/Network/NetworkProcessProxy.cpp:
2779         (WebKit::NetworkProcessProxy::didClose): Notify the CustomProtocolManagerProxy.
2780         * UIProcess/WebProcessPool.cpp:
2781         (WebKit::WebProcessPool::WebProcessPool): Initialize the CustomProtocolManagerClient and remove the all supplement.
2782         (WebKit::WebProcessPool::setCustomProtocolManagerClient):
2783         (WebKit::WebProcessPool::registerSchemeForCustomProtocol): In case of soup cache the given protocol.
2784         (WebKit::WebProcessPool::unregisterSchemeForCustomProtocol): In case of soup delete the given protocol from the cache.
2785         * UIProcess/WebProcessPool.h:
2786         * UIProcess/efl/RequestManagerClientEfl.cpp: Do not use the C API, but API::CustomProtocolManagerClient.
2787         (WebKit::RequestManagerClientEfl::RequestManagerClientEfl):
2788         (WebKit::RequestManagerClientEfl::registerURLSchemeHandler):
2789         * UIProcess/efl/RequestManagerClientEfl.h:
2790         * UIProcess/efl/WebProcessPoolEfl.cpp:
2791         * UIProcess/gtk/WebProcessPoolGtk.cpp:
2792         * UIProcess/soup/WebProcessPoolSoup.cpp:
2793         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Use m_urlSchemesRegisteredForCustomProtocols to
2794         build the list of custom protocols to send to the network process.
2795
2796 2016-11-21  Alex Christensen  <achristensen@webkit.org>
2797
2798         Fix Sierra CMake build after r208452
2799         https://bugs.webkit.org/show_bug.cgi?id=164437
2800
2801         * UIProcess/Cocoa/WebViewImpl.mm:
2802         (WebKit::WebViewImpl::updateMediaTouchBar):
2803         I haven't enabled VIDEO_PRESENTATION_MODE in the CMake build yet.
2804         It's needed for WebPlaybackSessionInterfaceMac to exist.
2805
2806 2016-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2807
2808         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.15.2 release.
2809
2810         * gtk/NEWS: Add release notes for 2.15.2.
2811
2812 2016-11-21  Carlos Garcia Campos  <cgarcia@igalia.com>
2813
2814         Remove m_customProtocolManagerProxy from WebProcessProxy
2815         https://bugs.webkit.org/show_bug.cgi?id=164908
2816
2817         Reviewed by Andreas Kling.
2818
2819         Since the network process is mandatory, the custom protocol manager proxy of WebProcessProxy is unused and can
2820         be removed.
2821
2822         * UIProcess/WebProcessProxy.cpp:
2823         (WebKit::WebProcessProxy::WebProcessProxy):
2824         * UIProcess/WebProcessProxy.h:
2825
2826 2016-11-20  Zan Dobersek  <zdobersek@igalia.com>
2827
2828         [EncryptedMedia] Make EME API runtime-enabled
2829         https://bugs.webkit.org/show_bug.cgi?id=164927
2830
2831         Reviewed by Jer Noble.
2832
2833         Add the new EncryptedMediaAPI preference. Set the same feature
2834         flag on the shared RuntimeEnabledFeatures object to the
2835         corresponding value that's stored in the WebPreferencesStore.
2836
2837         InjectedBundle::overrideBoolPreferenceForTestRunner() does the
2838         same when the 'WebKitEncryptedMediaAPIEnabled' preference is
2839         overridden in WKTR for testing purposes.
2840
2841         * Shared/WebPreferencesDefinitions.h:
2842         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2843         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
2844         * WebProcess/WebPage/WebPage.cpp:
2845         (WebKit::WebPage::updatePreferences):
2846
2847 2016-11-19  Antti Koivisto  <antti@apple.com>
2848
2849         Salt network cache hashes
2850         https://bugs.webkit.org/show_bug.cgi?id=164924
2851
2852         Reviewed by Alex Christensen.
2853
2854         To enhance privacy make cache content unidentifiable from file names alone.
2855         This is done by generating a unique persistent salt for each cache instance.
2856         It is used when computing hashes used in file names.
2857
2858         The patch also replaces plain text partition directory names with salted hashes.
2859
2860         * NetworkProcess/cache/NetworkCache.cpp:
2861         (WebKit::NetworkCache::Cache::makeCacheKey):
2862         (WebKit::NetworkCache::makeCacheKey): Deleted.
2863         * NetworkProcess/cache/NetworkCache.h:
2864
2865             Increment cache version.
2866
2867         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
2868         (WebKit::NetworkCache::BlobStorage::BlobStorage):
2869         (WebKit::NetworkCache::BlobStorage::add):
2870         (WebKit::NetworkCache::BlobStorage::get):
2871
2872             Use salt for blob content hash.
2873
2874         * NetworkProcess/cache/NetworkCacheBlobStorage.h:
2875         * NetworkProcess/cache/NetworkCacheData.cpp:
2876         (WebKit::NetworkCache::computeSHA1):
2877
2878             For simplicity all SHA1s are now salted.
2879
2880         (WebKit::NetworkCache::makeSalt):
2881         (WebKit::NetworkCache::readOrMakeSalt):
2882
2883             Read salt if it exists, generate and persist it otherwise.
2884
2885         * NetworkProcess/cache/NetworkCacheData.h:
2886         * NetworkProcess/cache/NetworkCacheKey.cpp:
2887         (WebKit::NetworkCache::Key::Key):
2888
2889             Remove the "No partition" string and just empty.
2890             That was only needed to have a directory name of some sort.
2891
2892         (WebKit::NetworkCache::Key::computeHash):
2893
2894             Use salt for key hash.
2895
2896         (WebKit::NetworkCache::Key::computePartitionHash):
2897
2898             Separate hash for partition.
2899
2900         * NetworkProcess/cache/NetworkCacheKey.h:
2901         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2902         (WebKit::NetworkCache::makeSubresourcesKey):
2903         (WebKit::NetworkCache::SpeculativeLoadManager::PendingFrameLoad::saveToDiskIfReady):
2904         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveSubresourcesEntry):
2905         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2906         (WebKit::NetworkCache::makeSaltFilePath):
2907         (WebKit::NetworkCache::Storage::open):
2908
2909             Cache can't be opened if we can't read or persist a salt.
2910
2911         (WebKit::NetworkCache::traverseRecordsFiles):
2912         (WebKit::NetworkCache::Storage::Storage):
2913         (WebKit::NetworkCache::Storage::synchronize):
2914         (WebKit::NetworkCache::Storage::recordDirectoryPathForKey):
2915
2916             Use the partition hash in the directory name instead of a plain text name.
2917
2918         (WebKit::NetworkCache::decodeRecordHeader):
2919         (WebKit::NetworkCache::Storage::readRecord):
2920         (WebKit::NetworkCache::Storage::encodeRecord):
2921         (WebKit::NetworkCache::Storage::traverse):
2922         (WebKit::NetworkCache::Storage::clear):
2923         * NetworkProcess/cache/NetworkCacheStorage.h:
2924         (WebKit::NetworkCache::Storage::salt):
2925
2926 2016-11-19  Simon Fraser  <simon.fraser@apple.com>
2927
2928         [iOS WK2] When zoomed in and panning on pages with fixed bars, parts of the bars are sometimes missing
2929         https://bugs.webkit.org/show_bug.cgi?id=164855
2930
2931         Reviewed by Sam Weinig.
2932
2933         During UI-process panning and zooming, we send visible rect updates to the web process
2934         with inStableState=false, and don't update GraphicsLayers until we get into a stable state.
2935
2936         This causes a problem where the web process has a stale notion of where the GraphicsLayers
2937         for position:fixed elements are, but is then told to update tiling coverage with an up-to-date
2938         visible rect. The existing "sync layer positions" path isn't useful to fix this, because it
2939         breaks the relationship between the GraphicsLayer positions and their FixedPositionViewportConstraints
2940         in the scrolling tree.
2941
2942         To address this, add the notion of an Optional<> approximatePosition on GraphicsLayers. This is used
2943         only by the coverageRect computation code path, and is cleared by a setPosition(). ApproximatePositions
2944         are pushed onto GraphicsLayers via the syncViewportConstrainedLayerPositions() code path (renamed to
2945         reconcileViewportConstrainedLayerPositions).
2946
2947         Tested by scrollingcoordinator/ios/non-stable-viewport-scroll.html
2948
2949         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
2950         (WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeNodeDidScroll):
2951         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
2952         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
2953         (WebKit::RemoteScrollingTree::scrollingTreeNodeDidScroll):
2954         * UIProcess/Scrolling/RemoteScrollingTree.h:
2955         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
2956         (WebKit::RemoteScrollingCoordinator::scrollPositionChangedForNode):
2957         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2958         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
2959         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2960         (WebKit::CoordinatedLayerTreeHost::didFlushRootLayer):
2961         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
2962         (WebKit::LayerTreeHostGtk::flushPendingLayerChanges):
2963         * WebProcess/WebPage/ios/WebPageIOS.mm:
2964         (WebKit::WebPage::updateVisibleContentRects): Always push the custom fixed position rect down, but send
2965         ScrollingLayerPositionAction::SetApproximate if the state is not stable.
2966         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2967         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
2968         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2969         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
2970
2971 2016-11-18  Simon Fraser  <simon.fraser@apple.com>
2972
2973         Make it possible to test non-stable-state scrolling on iOS
2974         https://bugs.webkit.org/show_bug.cgi?id=164905
2975
2976         Reviewed by Dan Bernstein.
2977
2978         Make it possible for an iOS layout test to force every visible rect update
2979         from the UI process to the web process to be in a non-stable state. This emulates
2980         what happens during panning and zooming interactions, and allows us to test the
2981         scrolling and layer trees in these transient states.
2982
2983         This is done by adding a testing property on WKWebView, _stableStateOverride, whose
2984         getters and setters are overridden in TestRunnerWKWebView. When non-nil, we _updateVisibleContentRectAfterScrollInView
2985         consults the NSNumber's boolValue and uses it to override the stable state.
2986
2987         To facilitate this kind of testing, also add immediateScrollToOffset() and
2988         immediateZoomToScale() to UIScriptController. Finally, add doAfterPresentationUpdate()
2989         which provides a callback that fires after one trip to the web process and back.
2990
2991         * UIProcess/API/Cocoa/WKWebView.mm:
2992         (-[WKWebView _updateVisibleContentRectAfterScrollInView:]):
2993         (-[WKWebView _stableStateOverride]):
2994         (-[WKWebView _setStableStateOverride:]):
2995         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2996
2997 2016-11-18  Simon Fraser  <simon.fraser@apple.com>
2998
2999         [iOS WK2] Eliminate a source of flakiness in layout tests by forcing WebPage into "responsive" mode for all tests, with an internals override
3000         https://bugs.webkit.org/show_bug.cgi?id=164980
3001
3002         Reviewed by Chris Dumez.
3003
3004         WebPage::eventThrottlingDelay() uses a latency estimate based on the round-trip time from the UI process
3005         to affect behavior, including whether scroll events are fired. This also affects the FrameView "scrolledByUser"
3006         flag that impacts tile coverage.
3007
3008         During testing, latency falling above or below the 16ms threshold could affect behavior. Fix by forcing
3009         WebPage into "responsive" mode while running tests, via InjectedBundlePage::prepare().
3010
3011         Add a nullable internals property so that a test can specify responsive, unresponsive or default behavior.
3012
3013         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
3014         (WKBundlePageSetEventThrottlingBehaviorOverride):
3015         * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
3016         * WebProcess/WebPage/ios/WebPageIOS.mm:
3017         (WebKit::WebPage::eventThrottlingDelay):
3018
3019 2016-11-18  Simon Fraser  <simon.fraser@apple.com>
3020
3021         Remove use of std::chrono in WebPage and entrained code
3022         https://bugs.webkit.org/show_bug.cgi?id=164967
3023
3024         Reviewed by Tim Horton.
3025
3026         Replace std::chrono with Seconds and Monotonic Time.
3027
3028         Use more C++11 initialization for WebPage data members.
3029
3030         * Shared/VisibleContentRectUpdateInfo.cpp:
3031         (WebKit::operator<<):
3032         * Shared/VisibleContentRectUpdateInfo.h:
3033         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
3034         (WebKit::VisibleContentRectUpdateInfo::timestamp):
3035         * Shared/WebCoreArgumentCoders.cpp:
3036         (IPC::ArgumentCoder<MonotonicTime>::encode):
3037         (IPC::ArgumentCoder<MonotonicTime>::decode):
3038         (IPC::ArgumentCoder<Seconds>::encode):
3039         (IPC::ArgumentCoder<Seconds>::decode):
3040         * Shared/WebCoreArgumentCoders.h:
3041         * UIProcess/ios/WKContentView.mm:
3042         (WebKit::HistoricalVelocityData::HistoricalVelocityData):
3043         (WebKit::HistoricalVelocityData::velocityForNewData):
3044         (WebKit::HistoricalVelocityData::append):
3045         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
3046         * WebProcess/WebCoreSupport/WebChromeClient.h:
3047         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
3048         (WebKit::WebChromeClient::eventThrottlingDelay):
3049         * WebProcess/WebPage/ViewUpdateDispatcher.h:
3050         * WebProcess/WebPage/WebPage.cpp:
3051         (WebKit::WebPage::WebPage):
3052         (WebKit::m_userActivityHysteresis):
3053         (WebKit::WebPage::didFlushLayerTreeAtTime):
3054         (WebKit::WebPage::didCommitLoad):
3055         * WebProcess/WebPage/WebPage.h:
3056         * WebProcess/WebPage/ios/WebPageIOS.mm:
3057         (WebKit::WebPage::eventThrottlingDelay):
3058         (WebKit::WebPage::updateVisibleContentRects):
3059         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
3060         (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
3061
3062 2016-11-18  Dean Jackson  <dino@apple.com>
3063
3064         AX: "(inverted-colors)" media query only matches on page reload; should match on change
3065         https://bugs.webkit.org/show_bug.cgi?id=163564
3066         <rdar://problem/28807350>
3067
3068         Reviewed by Simon Fraser.
3069
3070         Listen for the appropriate notifications that accessibility settings
3071         have changed. This is a single notification on macOS, which uses WebViewImpl,
3072         and more fine-grained notifications on iOS, using WKWebView.
3073
3074         When we see the notification, send a message to the WebProcess which will
3075         then tell the WebCore::Page.
3076
3077         * UIProcess/API/Cocoa/WKWebView.mm:
3078         (-[WKWebView _initializeWithConfiguration:]):
3079         (-[WKWebView _accessibilitySettingsDidChange:]):
3080         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3081         * UIProcess/Cocoa/WebViewImpl.h:
3082         * UIProcess/Cocoa/WebViewImpl.mm:
3083         (-[WKAccessibilitySettingsObserver initWithImpl:]):
3084         (-[WKAccessibilitySettingsObserver dealloc]):
3085         (-[WKAccessibilitySettingsObserver _settingsDidChange:]):
3086         (WebKit::WebViewImpl::WebViewImpl):
3087         (WebKit::WebViewImpl::accessibilitySettingsDidChange):
3088         * UIProcess/WebPageProxy.cpp:
3089         (WebKit::WebPageProxy::accessibilitySettingsDidChange):
3090         * UIProcess/WebPageProxy.h:
3091         * WebProcess/WebPage/WebPage.cpp:
3092         (WebKit::WebPage::accessibilitySettingsDidChange):
3093         * WebProcess/WebPage/WebPage.h:
3094         * WebProcess/WebPage/WebPage.messages.in:
3095
3096 2016-11-18  Jeremy Jones  <jeremyj@apple.com>
3097
3098         USE WK_MAC_TBA for version number in _webViewRequestPointerLock:(WKWebView *)webView WK_API_AVAILABLE(macosx(10.12))
3099         https://bugs.webkit.org/show_bug.cgi?id=164962
3100
3101         Reviewed by Dean Jackson.
3102
3103         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3104
3105 2016-11-18  Enrica Casucci  <enrica@apple.com>
3106
3107         Refactor drag and drop for WebKit2 to encode DragData message exchange.
3108         https://bugs.webkit.org/show_bug.cgi?id=164945
3109
3110         Reviewed by Tim Horton.
3111
3112         * Shared/WebCoreArgumentCoders.cpp:
3113         (IPC::ArgumentCoder<DragData>::encode):
3114         (IPC::ArgumentCoder<DragData>::decode):
3115         * Shared/WebCoreArgumentCoders.h:
3116         * UIProcess/WebPageProxy.cpp:
3117         (WebKit::WebPageProxy::performDragControllerAction):
3118         * WebProcess/WebCoreSupport/WebDragClient.cpp:
3119         (WebKit::WebDragClient::willPerformDragDestinationAction):
3120         (WebKit::WebDragClient::actionMaskForDrag):
3121         * WebProcess/WebCoreSupport/WebDragClient.h:
3122         * WebProcess/WebPage/WebPage.cpp:
3123         (WebKit::WebPage::performDragControllerAction):
3124         * WebProcess/WebPage/WebPage.h:
3125         * WebProcess/WebPage/WebPage.messages.in:
3126
3127 2016-11-18  Jeremy Jones  <jeremyj@apple.com>
3128
3129         Add runtime flag to enable pointer lock. Enable pointer lock feature for mac.
3130         https://bugs.webkit.org/show_bug.cgi?id=163801
3131
3132         Reviewed by Simon Fraser.
3133
3134         Add SPI to notify client of pointer lock and for client to allow or deny.
3135         Unlock pointer when view is not longer active.
3136
3137         * Configurations/FeatureDefines.xcconfig:
3138         * Shared/WebPreferencesDefinitions.h:
3139         * UIProcess/API/APIUIClient.h:
3140         (API::UIClient::requestPointerLock):
3141         (API::UIClient::didLosePointerLock):
3142         * UIProcess/API/C/WKPage.cpp:
3143         (WKPageSetPageUIClient):
3144         (WKPageDidAllowPointerLock):
3145         (WKPageDidDenyPointerLock):
3146         * UIProcess/API/C/WKPagePrivate.h:
3147         * UIProcess/API/C/WKPageUIClient.h:
3148         * UIProcess/API/C/WKPreferences.cpp:
3149         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
3150         * UIProcess/Cocoa/UIDelegate.h:
3151         * UIProcess/Cocoa/UIDelegate.mm:
3152         (WebKit::UIDelegate::setDelegate):
3153         (WebKit::UIDelegate::UIClient::requestPointerLock):
3154         (WebKit::UIDelegate::UIClient::didLosePointerLock):
3155         * UIProcess/WebPageProxy.cpp:
3156         (WebKit::WebPageProxy::dispatchActivityStateChange):
3157         (WebKit::WebPageProxy::resetStateAfterProcessExited):
3158         (WebKit::WebPageProxy::requestPointerLock):
3159         (WebKit::WebPageProxy::didAllowPointerLock):
3160         (WebKit::WebPageProxy::didDenyPointerLock):
3161         (WebKit::WebPageProxy::requestPointerUnlock):
3162         * UIProcess/WebPageProxy.h:
3163         * WebProcess/WebPage/WebPage.cpp:
3164         (WebKit::WebPage::updatePreferences):
3165
3166 2016-11-17  Carlos Garcia Campos  <cgarcia@igalia.com>
3167
3168         Downloads started by context menu actions should also have a web view associated
3169         https://bugs.webkit.org/show_bug.cgi?id=164364
3170
3171         Reviewed by Michael Catanzaro.
3172
3173         When a request is converted to a download WebPageProxy calls handleDownloadRequest() and clients handle that to
3174         associate the web view to the download. When a download is started by a context menu action, WebPageProxy calls
3175         WebProcessPool::download() with this as initiatingPage parameter, but clients are not notified in this case.
3176
3177         * UIProcess/API/gtk/WebKitDownload.cpp:
3178         (webkitDownloadCreateForRequest): Deleted.
3179         * UIProcess/API/gtk/WebKitDownloadPrivate.h:
3180         * UIProcess/API/gtk/WebKitWebContext.cpp:
3181         (webkitWebContextStartDownload): Use webkitWebContextGetOrCreateDownload() after WebProcessPool::download()
3182         because the WebKitDownload could have already been created by the web view download handler at this point.
3183         * UIProcess/API/gtk/WebKitWebView.cpp:
3184         (webkit_web_view_download_uri): We no longer need to associate the web view to the download here.
3185         * UIProcess/WebProcessPool.cpp:
3186         (WebKit::WebProcessPool::download): If an initiatingPage has been passed, call handleDownloadRequest() to notify
3187         the page client.
3188
3189 2016-11-17  Alex Christensen  <achristensen@webkit.org>
3190
3191         REGRESSION: API test _WKDownload.ConvertResponseToDownload is a flaky timeout
3192         https://bugs.webkit.org/show_bug.cgi?id=164631
3193
3194         Reviewed by Carlos Garcia Campos.
3195
3196         * NetworkProcess/NetworkResourceLoader.cpp:
3197         (WebKit::NetworkResourceLoader::convertToDownload):
3198         I could reproduce the flaky failure 100% of the time when not using NETWORK_SESSION
3199         by adding a usleep(1000000) in NetworkResourceLoader::convertToDownload.  m_networkLoad
3200         was not being set to nullptr before it was being checked in NetworkResourceLoader::abort
3201
3202 2016-11-17  Alex Christensen  <achristensen@webkit.org>
3203
3204         Fix CMake build after r208865
3205         https://bugs.webkit.org/show_bug.cgi?id=164894
3206
3207         * PlatformMac.cmake:
3208         Add new files.
3209
3210 2016-11-17  Ryosuke Niwa  <rniwa@webkit.org>
3211
3212         WKBundleNodeHandleSetHTMLInputElementSpellcheckEnabled should keep text replacement enabled
3213         https://bugs.webkit.org/show_bug.cgi?id=164857
3214         <rdar://problem/27721742>
3215
3216         Reviewed by Wenson Hsieh.
3217
3218         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
3219         (WebKit::InjectedBundleNodeHandle::setHTMLInputElementSpellcheckEnabled):
3220
3221 2016-11-17  John Wilander  <wilander@apple.com>
3222
3223         Resource load statistics: Cover further data records, count removed data records, and only fire handler when needed
3224         https://bugs.webkit.org/show_bug.cgi?id=164659
3225
3226         Reviewed by Andy Estes.
3227
3228         * UIProcess/WebResourceLoadStatisticsStore.cpp:
3229         (WebKit::WebResourceLoadStatisticsStore::removeDataRecords):
3230             Consistent naming with 'remove' rather than 'delete'.
3231             Now removes localStorage, IndexDB, disk cache, and memory cache too.
3232             Updates statistics with number of times it has removed data records.
3233         (WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
3234             No longer checks whether it has enough data since the classification rules
3235             are absolute, not relative.
3236         (WebKit::WebResourceLoadStatisticsStore::clearDataRecords): Deleted.
3237         * UIProcess/WebResourceLoadStatisticsStore.h:
3238             Consistent naming with 'remove' rather than 'delete'.
3239
3240 2016-11-17  Brady Eidson  <beidson@apple.com>
3241
3242         Add _WKIconLoadingDelegate SPI.
3243         https://bugs.webkit.org/show_bug.cgi?id=164894
3244
3245         Reviewed by Alex Christensen.
3246
3247         With this client, WebCore will ask the FrameLoaderClient about each icon found in the <head>.
3248
3249         WebKit2 will then ask the embedding app - for each icon - if it wants that icon to load.
3250
3251         For icons the app decides to load, WebKit will pass the data to the app without storing locally.
3252
3253         * UIProcess/API/APIIconLoadingClient.h: Copied from Source/WebCore/html/LinkIconCollector.h.
3254         (API::IconLoadingClient::~IconLoadingClient):
3255         (API::IconLoadingClient::getLoadDecisionForIcon):
3256
3257         * UIProcess/API/Cocoa/WKWebView.mm:
3258         (-[WKWebView _initializeWithConfiguration:]):
3259         (-[WKWebView _iconLoadingDelegate]):
3260         (-[WKWebView _setIconLoadingDelegate:]):
3261         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
3262
3263         * UIProcess/API/Cocoa/_WKIconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.
3264
3265         * UIProcess/API/Cocoa/_WKLinkIconParameters.h: Copied from Source/WebCore/html/LinkIconCollector.h.
3266         * UIProcess/API/Cocoa/_WKLinkIconParameters.mm: Copied from Source/WebCore/html/LinkIconCollector.h.
3267         (-[_WKLinkIconParameters _initWithLinkIcon:]):
3268         (-[_WKLinkIconParameters url]):
3269         (-[_WKLinkIconParameters mimeType]):
3270         (-[_WKLinkIconParameters size]):
3271         (-[_WKLinkIconParameters iconType]):
3272         * UIProcess/API/Cocoa/_WKLinkIconParametersInternal.h: Copied from Source/WebCore/html/LinkIconCollector.h.
3273
3274         * UIProcess/Cocoa/IconLoadingDelegate.h: Copied from Source/WebCore/html/LinkIconCollector.h.
3275         * UIProcess/Cocoa/IconLoadingDelegate.mm: Added.
3276         (WebKit::IconLoadingDelegate::IconLoadingDelegate):
3277         (WebKit::IconLoadingDelegate::~IconLoadingDelegate):
3278         (WebKit::IconLoadingDelegate::createIconLoadingClient):
3279         (WebKit::IconLoadingDelegate::delegate):
3280         (WebKit::IconLoadingDelegate::setDelegate):
3281         (WebKit::IconLoadingDelegate::IconLoadingClient::IconLoadingClient):
3282         (WebKit::IconLoadingDelegate::IconLoadingClient::~IconLoadingClient):
3283         (WebKit::IconLoadingDelegate::IconLoadingClient::getLoadDecisionForIcon):
3284
3285         * UIProcess/WebPageProxy.cpp:
3286         (WebKit::WebPageProxy::setIconLoadingClient):
3287         (WebKit::WebPageProxy::getLoadDecisionForIcon):
3288         (WebKit::WebPageProxy::finishedLoadingIcon):
3289         * UIProcess/WebPageProxy.h:
3290         (WebKit::WebPageProxy::iconLoadingClient):
3291         * UIProcess/WebPageProxy.messages.in:
3292
3293         * WebKit2.xcodeproj/project.pbxproj:
3294
3295         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3296         (WebKit::WebFrameLoaderClient::useIconLoadingClient):
3297         (WebKit::WebFrameLoaderClient::getLoadDecisionForIcon):
3298         (WebKit::WebFrameLoaderClient::finishedLoadingIcon):
3299         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
3300         (WebKit::WebFrameLoaderClient::setUseIconLoadingClient):
3301
3302         * WebProcess/WebPage/WebPage.cpp:
3303         (WebKit::WebPage::didGetLoadDecisionForIcon):
3304         (WebKit::WebPage::setUseIconLoadingClient):
3305         * WebProcess/WebPage/WebPage.h:
3306         * WebProcess/WebPage/WebPage.messages.in:
3307
3308 2016-11-17  Saam Barati  <sbarati@apple.com>
3309
3310         Remove async/await compile time flag and enable tests
3311         https://bugs.webkit.org/show_bug.cgi?id=164828
3312         <rdar://problem/28639334>
3313
3314         Reviewed by Yusuke Suzuki.
3315
3316         * Configurations/FeatureDefines.xcconfig:
3317
3318 2016-11-17  Yusuke Suzuki  <utatane.tea@gmail.com>
3319
3320         [JSC] WTF::TemporaryChange with WTF::SetForScope
3321         https://bugs.webkit.org/show_bug.cgi?id=164761
3322
3323         Reviewed by Saam Barati.
3324
3325         * PluginProcess/PluginControllerProxy.cpp:
3326         (WebKit::PluginControllerProxy::initialize):
3327         * PluginProcess/WebProcessConnection.cpp:
3328         (WebKit::WebProcessConnection::didReceiveMessage):
3329         (WebKit::WebProcessConnection::didReceiveSyncMessage):
3330         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
3331         (createEncodedObject):
3332         (decodeObject):
3333         * UIProcess/API/Cocoa/WKWebView.mm:
3334         (-[WKWebView _keyboardChangedWithInfo:adjustScrollView:]):
3335         * UIProcess/Cocoa/WebViewImpl.mm:
3336         (WebKit::WebViewImpl::updateTextTouchBar):
3337         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
3338         (WebKit::ScrollingTreeOverflowScrollingNodeIOS::commitStateAfterChildren):
3339         * UIProcess/gtk/WebPasteboardProxyGtk.cpp:
3340         (WebKit::WebPasteboardProxy::writeToClipboard):
3341         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
3342         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
3343         (WebKit::CompositingCoordinator::purgeBackingStores):
3344         * WebProcess/WebPage/WebPage.cpp:
3345         (WebKit::WebPage::mouseEvent):
3346         (WebKit::WebPage::keyEvent):
3347         (WebKit::WebPage::dispatchTouchEvent):
3348         (WebKit::WebPage::setInitialFocus):
3349         (WebKit::WebPage::insertTextAsync):
3350         * WebProcess/WebPage/ios/WebPageIOS.mm:
3351         (WebKit::WebPage::dynamicViewportSizeUpdate):
3352         * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
3353         * WebProcess/WebPage/mac/WebPageMac.mm:
3354
3355 2016-11-16  Brent Fulgham  <bfulgham@apple.com>
3356
3357         Unreviewed build fix after r208589
3358
3359         The generated com.apple.WebKit.plugin-common.sb file was not getting copied into
3360         the Resources folder, so was not deployed with WebKit. We need to treat it like
3361         com.apple.WebProcess.sb and the other generated files.
3362
3363         * WebKit2.xcodeproj/project.pbxproj: Tell Xcode to include the generated file in
3364         the framework Resources.
3365
3366 2016-11-16  Yusuke Suzuki  <utatane.tea@gmail.com>
3367
3368         [ES6][WebCore] Change ES6_MODULES compile time flag to runtime flag
3369         https://bugs.webkit.org/show_bug.cgi?id=164827
3370
3371         Reviewed by Ryosuke Niwa.
3372
3373         * Configurations/FeatureDefines.xcconfig:
3374         * Shared/WebPreferencesDefinitions.h:
3375         Annotated ES6 Modules option with DEFAULT_EXPERIMENTAL_FEATURES_ENABLED.
3376         * UIProcess/API/C/WKPreferences.cpp:
3377         (WKPreferencesSetES6ModulesEnabled):
3378         (WKPreferencesGetES6ModulesEnabled):
3379         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3380         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3381         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
3382         * WebProcess/WebPage/WebPage.cpp:
3383         (WebKit::WebPage::updatePreferences):
3384
3385 2016-11-16  Simon Fraser  <simon.fraser@apple.com>
3386
3387         Add logging support to VisibleContentRectUpdateInfo
3388         https://bugs.webkit.org/show_bug.cgi?id=164825
3389
3390         Reviewed by Zalan Bujtas.
3391
3392         Add TextStream output to VisibleContentRectUpdateInfo. Just piping it into a logging
3393         stream does single-line output, so also make a convenience dump() function that will
3394         product multiline output. Result look like:
3395
3396             (VisibleContentRectUpdateInfo
3397               (lastLayerTreeTransactionID 54)
3398               (exposedContentRect (523.44,1258.63) width=676.20 height=901.60)
3399               (unobscuredContentRect (523.44,1293.41) width=676.20 height=866.82)
3400               (unobscuredRectInScrollViewCoordinates (0,39.50) width=768 height=984.50)
3401               (customFixedPositionRect (219.64,935) width=980 height=1225)
3402               (obscuredInset width=0 height=39.50)
3403               (scale 1.14)
3404               (inStableState 0)
3405               (timestamp 736446.61)
3406               (verticalVelocity -11.36))
3407
3408         * Shared/VisibleContentRectUpdateInfo.cpp:
3409         (WebKit::VisibleContentRectUpdateInfo::dump):
3410         (WebKit::operator<<):
3411         * Shared/VisibleContentRectUpdateInfo.h:
3412         * UIProcess/ios/WKContentView.mm:
3413         (-[WKContentView didUpdateVisibleRect:unobscuredRect:unobscuredRectInScrollViewCoordinates:obscuredInset:scale:minimumScale:inStableState:isChangingObscuredInsetsInteractively:enclosedInScrollableAncestorView:]):
3414
3415 2016-11-15  Simon Fraser  <simon.fraser@apple.com>
3416
3417         [iOS WK2] Scroll view scrolling and zooming animations can keep running across page loads
3418         https://bugs.webkit.org/show_bug.cgi?id=164810
3419
3420         Reviewed by Tim Horton.
3421         
3422         Scrolling and zooming animations can leak across page loads, which makes tests flakey,
3423         and is unexpected by users.
3424
3425         Tested by scrollingcoordinator/ios/sync-layer-positions-after-scroll.html followed by
3426         scrollingcoordinator/ios/ui-scrolling-tree.html
3427
3428         * UIProcess/API/Cocoa/WKWebView.mm:
3429         (-[WKWebView _didCommitLoadForMainFrame]):
3430
3431 2016-11-15  Jon Lee  <jonlee@apple.com>
3432
3433         Report active video and audio capture devices separately
3434         https://bugs.webkit.org/show_bug.cgi?id=164769
3435
3436         Reviewed by Eric Carlson.
3437
3438         Replace kWKMediaHasActiveCaptureDevice with kWKMediaHasActiveAudioCaptureDevice and
3439         kWKMediaHasActiveVideoCaptureDevice
3440
3441         * UIProcess/API/C/WKPage.cpp:
3442         (WKPageGetMediaState):
3443         * UIProcess/API/C/WKPagePrivate.h:
3444         * UIProcess/WebPageProxy.cpp:
3445         (WebKit::WebPageProxy::isPlayingMediaDidChange): Update the mask to include the two
3446         bits.
3447
3448 2016-11-14  Simon Fraser  <simon.fraser@apple.com>
3449
3450         [iOS WK2] Implement support for visual viewports
3451         https://bugs.webkit.org/show_bug.cgi?id=164765