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