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