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