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