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