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