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