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