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