Fix remaining bad uses of logDiagnosticMessageWithValue()
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2017-01-27  Chris Dumez  <cdumez@apple.com>
2
3         Fix remaining bad uses of logDiagnosticMessageWithValue()
4         https://bugs.webkit.org/show_bug.cgi?id=167526
5
6         Reviewed by Alex Christensen.
7
8         Fix remaining bad uses of logDiagnosticMessageWithValue(). It can only
9         be called with numeric values.
10
11         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
12         (WebKit::NetworkCache::Statistics::recordNotUsingCacheForRequest):
13         (WebKit::NetworkCache::Statistics::recordRetrievalFailure):
14         (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
15         * UIProcess/WebBackForwardList.cpp:
16         (WebKit::WebBackForwardList::goToItem):
17         * WebProcess/WebPage/ios/WebPageIOS.mm:
18         (WebKit::WebPage::willStartUserTriggeredZooming):
19
20 2017-01-27  Chris Dumez  <cdumez@apple.com>
21
22         Round CPU Usage diagnostic logging to 2 significant digits
23         https://bugs.webkit.org/show_bug.cgi?id=167515
24         <rdar://problem/30236297>
25
26         Reviewed by Antti Koivisto.
27
28         Round CPU Usage diagnostic logging to 2 significant digits
29         as requested by diagnostic logging team.
30
31         * UIProcess/PerActivityStateCPUUsageSampler.cpp:
32         (WebKit::toStringRoundingSignificantFigures):
33         (WebKit::PerActivityStateCPUUsageSampler::loggingTimerFired):
34
35 2017-01-27  Carlos Garcia Campos  <cgarcia@igalia.com>
36
37         [Threaded Compositor] Stop creating the GLContext on demand the first time makeContextCurrent is called
38         https://bugs.webkit.org/show_bug.cgi?id=167496
39
40         Reviewed by Žan Doberšek.
41
42         This is causing problems with animations when entering AC mode on demand. What happens is that the threaded
43         compositor is created, then the animation is scheduled and during the first animation iteration the GLContext is
44         created, making the first frame of the animation quite slow. In my computer creating the GLContext takes 0.8
45         seconds. If the animation duration is less than the time it takes to create the GLContext, the animation ends
46         without iterating. This causing timeouts in the bots in tests like
47         animations/animation-iteration-event-destroy-renderer.html that expect webkitAnimationIteration events that
48         never fire.
49
50         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
51         (WebKit::ThreadedCompositor::ThreadedCompositor): Create the GLContext right after the compositing thread is
52         created if we already have a native surface handle.
53         (WebKit::ThreadedCompositor::createGLContext): Helper to create the GLContext.
54         (WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): Create the GLContext when a native surface
55         handle is given.
56         (WebKit::ThreadedCompositor::makeContextCurrent): Deleted.
57         (WebKit::ThreadedCompositor::renderLayerTree): Make the context cunrrent directly here.
58         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
59
60 2017-01-27  Carlos Garcia Campos  <cgarcia@igalia.com>
61
62         [GTK] Stop forcing accelerated compositing by default
63         https://bugs.webkit.org/show_bug.cgi?id=167492
64
65         Reviewed by Žan Doberšek.
66
67         We are now ready to bring back the on demand accelerated compositing mode with the threaded
68         compositor. Unfortunately, having AC always enabled brought a lot of issues for many people. Not only it
69         requires a lot more memory but also caused rendering issues (or even nothing rendered at all) with some graphics
70         drivers. People started to use WEBKIT_DISABLE_COMPOSITING_MODE as a workaround, but that was not expected to be
71         used by users. So, entering/leaving AC when required by web contents is not actually the solution but a huge
72         improvement for many people. If we are eventually ready to force AC mode again, we'll change this again. Note
73         that we still have WEBKIT_DISABLE_COMPOSITING_MODE, but now also WEBKIT_FORCE_COMPOSITING_MODE for testing and debugging.
74
75         * UIProcess/gtk/WebPreferencesGtk.cpp:
76         (WebKit::WebPreferences::platformInitializeStore):
77
78 2017-01-26  Chris Dumez  <cdumez@apple.com>
79
80         Crash when navigating back to a page in PacheCache when one of its frames has been removed
81         https://bugs.webkit.org/show_bug.cgi?id=167421
82         <rdar://problem/30188490>
83
84         Reviewed by Darin Adler.
85
86         Add a new setting allowing layout tests to enable PageCache in a window
87         that has an opener, for convenience.
88
89         * Shared/WebPreferencesDefinitions.h:
90         * UIProcess/API/C/WKPreferences.cpp:
91         (WKPreferencesSetAllowsPageCacheWithWindowOpener):
92         (WKPreferencesGetAllowsPageCacheWithWindowOpener):
93         * UIProcess/API/C/WKPreferencesRefPrivate.h:
94         * WebProcess/InjectedBundle/InjectedBundle.cpp:
95         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
96         * WebProcess/WebPage/WebPage.cpp:
97         (WebKit::WebPage::updatePreferences):
98
99 2017-01-26  Keith Miller  <keith_miller@apple.com>
100
101         classInfo should take a VM so it is not materialized from the object on each call
102         https://bugs.webkit.org/show_bug.cgi?id=167424
103
104         Rubber Stamped by Michael Saboff.
105
106         Previously, classInfo() would get the VM from the target's
107         MarkedBlock.  Most callers already have a VM on hand, so it is
108         wasteful to compute the VM from the marked block every time. This
109         patch refactors some of the most common callers of classInfo(),
110         jsDynamicCast and inherits to take a VM as well.
111
112         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
113         (WebKit::WebAutomationSessionProxy::elementForNodeHandle):
114         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
115         (WebKit::InjectedBundleNodeHandle::getOrCreate):
116         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
117         (WebKit::InjectedBundleRangeHandle::getOrCreate):
118         * WebProcess/InjectedBundle/InjectedBundle.cpp:
119         (WebKit::InjectedBundle::reportException):
120         (WebKit::InjectedBundle::webNotificationID):
121         (WebKit::InjectedBundle::createWebDataFromUint8Array):
122         * WebProcess/Plugins/Netscape/JSNPMethod.cpp:
123         (WebKit::JSNPMethod::finishCreation):
124         (WebKit::callMethod):
125         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
126         (WebKit::JSNPObject::finishCreation):
127         (WebKit::callNPJSObject):
128         (WebKit::constructWithConstructor):
129         * WebProcess/Plugins/Netscape/NPJSObject.cpp:
130         (WebKit::NPJSObject::create):
131         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
132         (WebKit::NPRuntimeObjectMap::getOrCreateNPObject):
133         * WebProcess/WebPage/WebFrame.cpp:
134         (WebKit::WebFrame::frameForContext):
135         (WebKit::WebFrame::counterValue):
136
137 2017-01-26  Chris Dumez  <cdumez@apple.com>
138
139         Fix CPU usage diagnostic logging in PerActivityStateCPUUsageSampler
140         https://bugs.webkit.org/show_bug.cgi?id=167471
141         <rdar://problem/30221723>
142
143         Reviewed by Alex Christensen.
144
145         Fix CPU usage diagnostic logging in PerActivityStateCPUUsageSampler
146         to use numeric values for logDiagnosticMessageWithValue().
147
148         * UIProcess/PerActivityStateCPUUsageSampler.cpp:
149         (WebKit::PerActivityStateCPUUsageSampler::loggingTimerFired):
150         (WebKit::loggingKeyForCPUUsage): Deleted.
151
152 2017-01-26  Jeremy Jones  <jeremyj@apple.com>
153
154         Request pointer unlock on navigation and re-enable pointer-lock tests for WK2.
155         https://bugs.webkit.org/show_bug.cgi?id=166765
156
157         Reviewed by Tim Horton.
158
159         When the main frame is load is committed, pointer lock should end.
160         This resets pointer lock state between tests and allows tests to succeed.
161
162         * UIProcess/WebPageProxy.cpp:
163         (WebKit::WebPageProxy::didCommitLoadForFrame):
164
165 2017-01-26  Chris Dumez  <cdumez@apple.com>
166
167         Fix WebGL diagnostic logging
168         https://bugs.webkit.org/show_bug.cgi?id=167463
169         <rdar://problem/30216981>
170
171         Reviewed by Alex Christensen.
172
173         Fix WebGL diagnostic logging so that it no longer uses logDiagnosticMessageWithValue().
174         This is because the value apparently needs to be numeric on Mac.
175
176         * UIProcess/HighPerformanceGraphicsUsageSampler.cpp:
177         (WebKit::HighPerformanceGraphicsUsageSampler::timerFired):
178
179 2017-01-26  Wenson Hsieh  <wenson_hsieh@apple.com>
180
181         Add support for recognizing data interaction gestures in WebKit2
182         https://bugs.webkit.org/show_bug.cgi?id=167444
183
184         Reviewed by Beth Dakin.
185
186         Adds a new data interaction gesture recognizer, responsible for determining when to begin data interaction. This
187         is a new long press gesture recognizer that fires simultaneously with the existing long press gesture
188         recognizers (for performing long-press actions, and for showing the tap highlight).
189
190         Also tweaks logic for determining whether selection gesture recognizers should fire to account for data
191         interaction -- in particular, we don't want selection gesture recognizers to cause the current selection to
192         change while data interaction is possible. See -hasSelectablePositionAtPoint and -pointIsInAssistedNode for
193         more details.
194
195         * UIProcess/ios/PageClientImplIOS.mm:
196         (WebKit::PageClientImpl::didPerformDataInteractionControllerOperation):
197         (WebKit::PageClientImpl::startDataInteractionWithImage):
198         * UIProcess/ios/WKContentViewInteraction.h:
199         * UIProcess/ios/WKContentViewInteraction.mm:
200         (-[WKContentView _createAndConfigureLongPressGestureRecognizer]):
201         (-[WKContentView setupInteraction]):
202         (-[WKContentView cleanupInteraction]):
203         (-[WKContentView _removeDefaultGestureRecognizers]):
204         (-[WKContentView _addDefaultGestureRecognizers]):
205         (-[WKContentView resignFirstResponder]):
206         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
207         (-[WKContentView gestureRecognizerShouldBegin:]):
208         (-[WKContentView hasSelectablePositionAtPoint:]):
209         (-[WKContentView pointIsInDataInteractionContent:]):
210         (-[WKContentView pointIsInAssistedNode:]):
211
212 2017-01-26  Matt Rajca  <mrajca@apple.com>
213
214         Notify clients when the user plays media otherwise prevented from autoplaying
215         https://bugs.webkit.org/show_bug.cgi?id=167390
216
217         Reviewed by Alex Christensen.
218
219         * UIProcess/API/APIUIClient.h:
220         (API::UIClient::didPlayMediaPreventedFromPlayingWithoutUserGesture):
221         * UIProcess/API/C/WKPage.cpp:
222         (WKPageSetPageUIClient):
223         * UIProcess/API/C/WKPageUIClient.h:
224         * UIProcess/WebPageProxy.cpp:
225         (WebKit::WebPageProxy::didPlayMediaPreventedFromPlayingWithoutUserGesture):
226         * UIProcess/WebPageProxy.h:
227         * UIProcess/WebPageProxy.messages.in:
228         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
229         (WebKit::WebChromeClient::didPlayMediaPreventedFromPlayingWithoutUserGesture):
230         * WebProcess/WebCoreSupport/WebChromeClient.h:
231
232 2017-01-26  Anders Carlsson  <andersca@apple.com>
233
234         Don't use _CFBundleCreateUnique on Yosemite, it's not available there
235         https://bugs.webkit.org/show_bug.cgi?id=167459
236         rdar://problem/30181179
237
238         Reviewed by Beth Dakin.
239
240         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
241         (WebKit::NetscapePluginModule::getPluginInfo):
242
243 2017-01-26  Alex Christensen  <achristensen@webkit.org>
244
245         Add SPI for updating WebsitePolicies
246         https://bugs.webkit.org/show_bug.cgi?id=167040
247
248         Reviewed by Brady Eidson.
249         
250         In r209558 we added a way to send a WebsitePolicies structure to the WebProcess during navigation.
251         If the UIProcess wants to update these policies on a WKWebView while a page is open, we will
252         need to have SPI for doing so. This adds such SPI, but it's not hooked up to change functionality yet.
253
254         * UIProcess/API/C/WKPage.cpp:
255         (WKPageUpdateWebsitePolicies):
256         * UIProcess/API/C/WKPage.h:
257         * UIProcess/API/Cocoa/WKWebView.mm:
258         (-[WKWebView _updateWebsitePolicies:]):
259         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
260         * UIProcess/WebPageProxy.cpp:
261         (WebKit::WebPageProxy::updateWebsitePolicies):
262         * UIProcess/WebPageProxy.h:
263         * WebProcess/WebPage/WebPage.cpp:
264         (WebKit::WebPage::updateWebsitePolicies):
265         * WebProcess/WebPage/WebPage.h:
266         * WebProcess/WebPage/WebPage.messages.in:
267
268 2017-01-26  Carlos Garcia Campos  <cgarcia@igalia.com>
269
270         [Threaded Compositor] Update also the contents size when creating the threaded compositor
271         https://bugs.webkit.org/show_bug.cgi?id=167452
272
273         Reviewed by Žan Doberšek.
274
275         In r210954 we ensured that the threaded compositor and the viewport controller were created with the initial web
276         page size. If we don't update the contents size, the visible rectangle will be empty and tiles won't be created
277         until contentsSizeDidChange is called. It's even possible, when entering AC mode on demand, that we create the
278         layer tree host after the contents size changed, in which case nothing is rendered unless we resize the window.
279
280         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
281         (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost):
282
283 2017-01-26  Csaba Osztrogonác  <ossy@webkit.org>
284
285         [Mac][cmake] Fix the build after r211160
286         https://bugs.webkit.org/show_bug.cgi?id=167451
287
288         Unreviewed buildfix.
289
290         * UIProcess/API/Cocoa/WKWebView.mm:
291
292 2017-01-25  Ryan Haddad  <ryanhaddad@apple.com>
293
294         Unreviewed, rolling out r211193.
295
296         This change broke internal builds.
297
298         Reverted changeset:
299
300         "Notify clients when the user plays media otherwise prevented
301         from autoplaying"
302         https://bugs.webkit.org/show_bug.cgi?id=167390
303         http://trac.webkit.org/changeset/211193
304
305 2017-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
306
307         Add infrastructure to support data interaction in WebKit2
308         https://bugs.webkit.org/show_bug.cgi?id=167443
309
310         Reviewed by Simon Fraser.
311
312         Adds plumbing for two new XPC messages: WebPageProxy::DidPerformDataInteractionControllerOperation and
313         WebPage::RequestStartDataInteraction. Additionally, adds a new field to InteractionInformationAtPosition that
314         indicates whether or not there is data to interact with at a given location.
315
316         This patch only adds infrastructure, and does not change any behavior.
317
318         * Shared/ios/InteractionInformationAtPosition.h:
319         * Shared/ios/InteractionInformationAtPosition.mm:
320         (WebKit::InteractionInformationAtPosition::encode):
321         (WebKit::InteractionInformationAtPosition::decode):
322         * UIProcess/PageClient.h:
323         * UIProcess/WebPageProxy.h:
324         * UIProcess/WebPageProxy.messages.in:
325         * UIProcess/ios/PageClientImplIOS.h:
326         * UIProcess/ios/PageClientImplIOS.mm:
327         (WebKit::PageClientImpl::didPerformDataInteractionControllerOperation):
328         (WebKit::PageClientImpl::startDataInteractionWithImage):
329         * UIProcess/ios/WebPageProxyIOS.mm:
330         (WebKit::WebPageProxy::didPerformDataInteractionControllerOperation):
331         (WebKit::requestStartDataInteraction):
332         * UIProcess/mac/PageClientImpl.h:
333         * UIProcess/mac/PageClientImpl.mm:
334         (WebKit::PageClientImpl::didPerformDataInteractionControllerOperation):
335         (WebKit::PageClientImpl::startDataInteractionWithImage):
336         * WebProcess/WebPage/WebPage.cpp:
337         * WebProcess/WebPage/WebPage.h:
338         * WebProcess/WebPage/WebPage.messages.in:
339         * WebProcess/WebPage/ios/WebPageIOS.mm:
340         (WebKit::WebPage::requestStartDataInteraction):
341         (WebKit::WebPage::getPositionInformation):
342
343 2017-01-25  Tim Horton  <timothy_horton@apple.com>
344
345         Stop inheriting from UIWebScrollView, just use UIScrollView
346         https://bugs.webkit.org/show_bug.cgi?id=167440
347         <rdar://problem/7729691>
348
349         Reviewed by Simon Fraser.
350
351         * UIProcess/API/Cocoa/WKWebView.mm:
352         (-[WKWebView scrollViewWillBeginDragging:]):
353         * UIProcess/ios/WKScrollView.h:
354         * UIProcess/ios/WKScrollView.mm:
355         (-[WKScrollView initWithFrame:]): Deleted.
356         (-[WKScrollView setDecelerationRate:]): Deleted.
357         Inherit directly from UIScrollView, no need for UIWebScrollView.
358         Set the few settings we care about directly.
359         This has the side effect of reducing the default rate of scroll deceleration.
360
361 2017-01-25  Matt Rajca  <mrajca@apple.com>
362
363         Notify clients when the user plays media otherwise prevented from autoplaying
364         https://bugs.webkit.org/show_bug.cgi?id=167390
365
366         Reviewed by Alex Christensen.
367
368         * UIProcess/API/APIUIClient.h:
369         (API::UIClient::didPlayMediaPreventedFromPlayingWithoutUserGesture):
370         * UIProcess/API/C/WKPage.cpp:
371         (WKPageSetPageUIClient):
372         * UIProcess/API/C/WKPageUIClient.h:
373         * UIProcess/WebPageProxy.cpp:
374         (WebKit::WebPageProxy::didPlayMediaPreventedFromPlayingWithoutUserGesture):
375         * UIProcess/WebPageProxy.h:
376         * UIProcess/WebPageProxy.messages.in:
377         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
378         (WebKit::WebChromeClient::didPlayMediaPreventedFromPlayingWithoutUserGesture):
379         * WebProcess/WebCoreSupport/WebChromeClient.h:
380
381 2017-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
382
383         Refactor drag and drop implementation on Mac
384         https://bugs.webkit.org/show_bug.cgi?id=167427
385
386         Reviewed by Enrica Casucci.
387
388         See WebCore ChangeLog for more details.
389
390         * Shared/WebCoreArgumentCoders.cpp:
391         (IPC::ArgumentCoder<DragData>::encode):
392         (IPC::ArgumentCoder<DragData>::decode):
393         * UIProcess/Cocoa/WebPageProxyCocoa.mm:
394         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
395
396 2017-01-25  Andy Estes  <aestes@apple.com>
397
398         Use #pragma once in a few places
399         https://bugs.webkit.org/show_bug.cgi?id=167435
400
401         Reviewed by Alex Christensen.
402
403         * UIProcess/PageClient.h:
404         * UIProcess/ios/PageClientImplIOS.h:
405         * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h:
406
407 2017-01-25  Andy Estes  <aestes@apple.com>
408
409         [QuickLook] Display a WKPasswordView when a document is password-protected
410         https://bugs.webkit.org/show_bug.cgi?id=167407
411         <rdar://problem/28544527>
412
413         Reviewed by Alex Christensen.
414
415         * UIProcess/API/Cocoa/WKWebView.mm:
416         (-[WKWebView _hidePasswordView]): Added an early return if there is no _passwordView.
417         * UIProcess/PageClient.h: Declared requestPasswordForQuickLookDocument().
418         (WebKit::PageClient::didStartProvisionalLoadForMainFrame): Added an no-op base class
419         implementation.
420         (WebKit::PageClient::didFailProvisionalLoadForMainFrame): Ditto.
421         * UIProcess/WebPageProxy.cpp:
422         (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): Called
423         PageClient::didStartProvisionalLoadForMainFrame() if frame is the main frame.
424         (WebKit::WebPageProxy::didFailProvisionalLoadForFrame): Ditto for
425         PageClient::didFailProvisionalLoadForMainFrame().
426         * UIProcess/WebPageProxy.h: Declared didRequestPasswordForQuickLookDocumentInMainFrame().
427         * UIProcess/WebPageProxy.messages.in: Added message
428         DidRequestPasswordForQuickLookDocumentInMainFrame.
429         * UIProcess/ios/PageClientImplIOS.h: Overrode requestPasswordForQuickLookDocument(),
430         didStartProvisionalLoadForMainFrame(), and didFailProvisionalLoadForMainFrame().
431         * UIProcess/ios/PageClientImplIOS.mm:
432         (WebKit::PageClientImpl::didStartProvisionalLoadForMainFrame): Called
433         -[WKWebView _hidePasswordView].
434         (WebKit::PageClientImpl::didFailProvisionalLoadForMainFrame): Ditto.
435         (WebKit::PageClientImpl::didCommitLoadForMainFrame): Ditto.
436         (WebKit::PageClientImpl::requestPasswordForQuickLookDocument): If there is already a
437         password view, assert that it is for the same fileName. Call
438         -[WKPasswordView showPasswordFailureAlert] and update the userDidEnterPassword block.
439         Otherwise, call -[WKWebView _showPasswordViewWithDocumentName:passwordHandler:].
440         * UIProcess/ios/WebPageProxyIOS.mm:
441         (WebKit::WebPageProxy::didRequestPasswordForQuickLookDocumentInMainFrame): Called
442         PageClient::requestPasswordForQuickLookDocument() with a completion handler that send
443         message WebPage::DidReceivePasswordForQuickLookDocument.
444         * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.cpp:
445         (WebKit::passwordCallbacks): Stores a map of page IDs to completion handler functions.
446         (WebKit::WebQuickLookHandleClient::~WebQuickLookHandleClient): Removes the current page ID
447         from passwordCallbacks().
448         (WebKit::WebQuickLookHandleClient::didRequestPassword): Asserts there is no current function
449         for this page ID in passwordCallbacks(), adds completionHandler to passwordCallbacks(), and
450         sends message WebPageProxy::DidRequestPasswordForQuickLookDocumentInMainFrame.
451         (WebKit::WebQuickLookHandleClient::didReceivePassword): Asserts there is a function for this
452         page ID in passwordCallbacks(), takes the completionHandler from passwordCallbacks(), and
453         calls it with the received password.
454         * WebProcess/WebCoreSupport/ios/WebQuickLookHandleClient.h: Declared didReceivePassword()
455         and overrode supportsPasswordEntry() and didRequestPassword().
456         * WebProcess/WebPage/WebPage.h: Declared didReceivePasswordForQuickLookDocument().
457         * WebProcess/WebPage/WebPage.messages.in: Added message
458         DidReceivePasswordForQuickLookDocument.
459         * WebProcess/WebPage/ios/WebPageIOS.mm:
460         (WebKit::WebPage::didReceivePasswordForQuickLookDocument): Called
461         WebQuickLookHandleClient::didReceivePassword() with the received password and current page ID.
462
463 2017-01-25  Youenn Fablet  <youennf@gmail.com>
464
465         [WebRTC] Introduce libwebrtc abstraction for WK1/WK2 implementations
466         https://bugs.webkit.org/show_bug.cgi?id=167294
467
468         Reviewed by Alex Christensen.
469
470         * WebProcess/WebPage/WebPage.cpp:
471         (WebKit::m_userInterfaceLayoutDirection):
472
473 2017-01-25  Andy Estes  <aestes@apple.com>
474
475         [iOS] Move WKPDFView's password view to WKWebView
476         https://bugs.webkit.org/show_bug.cgi?id=167401
477
478         Reviewed by Tim Horton.
479
480         r210943 moved the PDF password view into the new class WKPasswordView but left it as a
481         subview of the WKPDFView. To show the password view for Web content, my original plan was to
482         teach WKContentView to host its own password view, but this turned out not to work. Since
483         QuickLook needs to unlock a document before determining its preview's MIME type, we have to
484         ask for a password during provisional navigation, but if the still-committed document is a
485         PDF then the WKContentView will not be in the view hierarchy.
486
487         To ensure password view visibility, this patch moves the ownership of WKPasswordView to
488         WKWebView and creates an internal API for showing and hiding it. When
489         -_showPasswordViewWithDocumentName:passwordHandler: is called, WKWebView inserts a new
490         WKPasswordView as a subview of the scroll view and hides the current content view. The
491         password view is removed and the current content view is unhidden by -_hidePasswordView.
492
493         This also fixes a bug in WKPDFView where a PDF document is laid out incorrectly if the view
494         size changes while the password view is displayed.
495
496         * UIProcess/API/Cocoa/WKWebView.mm: Declared _passwordView.
497         (-[WKWebView _processDidExit]): Hid the password view.
498         (-[WKWebView _didCommitLayerTree:]): Ignored if not showing the standard content view.
499         (-[WKWebView _restorePageScrollPosition:scrollOrigin:previousObscuredInset:scale:]): Ditto.
500         (-[WKWebView _restorePageStateToUnobscuredCenter:scale:]): Ditto.
501         (-[WKWebView usesStandardContentView]): Changed to return false if _passwordView is non-nil.
502         (-[WKWebView _updateContentRectsWithState:]): Updated _passwordView's frame with the current
503         bounds size.
504         (-[WKWebView _showPasswordViewWithDocumentName:passwordHandler:]): Created a WKPasswordView,
505         called -showInScrollView:, and hid _currentContentView.
506         (-[WKWebView _hidePasswordView]): Removed _passwordView from its superview, set
507         _passwordView to nil, and unhid _currentContentView.
508         (-[WKWebView _passwordView]): Returned _passwordView.
509         (-[WKWebView _beginAnimatedResizeWithUpdates:]): Called -usesStandardContentView instead of
510         checking for a non-nil _customContentView when deciding whether to do a non-animated resize.
511         * UIProcess/API/Cocoa/WKWebViewInternal.h:
512         * UIProcess/ios/WKPDFView.mm: Removed _passwordView.
513         (-[WKPDFView web_setMinimumSize:]): Set m_minimumSize and updated the frame size even when a
514         password view is displayed.
515         (-[WKPDFView _computePageAndDocumentFrames]): Removed password view code.
516         (-[WKPDFView _showPasswordEntryField]): Ditto.
517         (-[WKPDFView _passwordViewFrame]): Deleted.
518         * UIProcess/ios/WKPasswordView.h:
519         * UIProcess/ios/WKPasswordView.mm:
520         (-[WKPasswordView initWithFrame:documentName:]): Stored a copy of documentName in
521         _documentName.
522         (-[WKPasswordView documentName]): Added. Returns _documentName.
523         (-[WKPasswordView showInScrollView:]): Renamed from displayInContentView:. Started saving
524         zoomScale and contentSize.
525         (-[WKPasswordView hide]): Started restoring zoomeScale and contentSize.
526         (-[WKPasswordView showPasswordFailureAlert]): Renamed from -displayPasswordFailureAlert.
527         (-[WKPasswordView displayInContentView:]): Renamed to -showInScrollView:
528         (-[WKPasswordView displayPasswordFailureAlert]): Renamed to -showPasswordFailureAlert.
529
530 2017-01-25  Wenson Hsieh  <wenson_hsieh@apple.com>
531
532         Add support for named pasteboards, pasteboard strategies and platform pasteboards
533         https://bugs.webkit.org/show_bug.cgi?id=167404
534
535         Reviewed by Enrica Casucci.
536
537         Adds support for delivering the pasteboard name to the UI process when writing to or reading from the pasteboard.
538
539         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
540         (WebKit::WebPasteboardProxy::writeWebContentToPasteboard):
541         (WebKit::WebPasteboardProxy::writeImageToPasteboard):
542         (WebKit::WebPasteboardProxy::writeStringToPasteboard):
543         (WebKit::WebPasteboardProxy::readStringFromPasteboard):
544         (WebKit::WebPasteboardProxy::readURLFromPasteboard):
545         (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
546         (WebKit::WebPasteboardProxy::getPasteboardItemsCount):
547         * UIProcess/WebPasteboardProxy.h:
548         * UIProcess/WebPasteboardProxy.messages.in:
549         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
550         (WebKit::WebPlatformStrategies::writeToPasteboard):
551         (WebKit::WebPlatformStrategies::getPasteboardItemsCount):
552         (WebKit::WebPlatformStrategies::readBufferFromPasteboard):
553         (WebKit::WebPlatformStrategies::readURLFromPasteboard):
554         (WebKit::WebPlatformStrategies::readStringFromPasteboard):
555         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
556
557 2017-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
558
559         [GTK] Icon Database should be in private browsing mode for ephemeral web views
560         https://bugs.webkit.org/show_bug.cgi?id=167414
561
562         Reviewed by Michael Catanzaro.
563
564         This is already done by WebProcessPool for the legacy private session setting, but only checking the setting and not
565         whether there are ephemeral web pages or not.
566
567         * UIProcess/API/gtk/WebKitWebContext.cpp:
568         (webkitWebContextEnableIconDatabasePrivateBrowsingIfNeeded): Enable icon database private browsing if there's
569         any ephemeral web view.
570         (webkitWebContextDisableIconDatabasePrivateBrowsingIfNeeded): Disable icon database private browsing if there
571         aren't ephemeral web views anymore.
572         (webkit_web_context_set_favicon_database_directory): Enable icon database private browsing if the web context is ephemeral.
573         (webkitWebContextCreatePageForWebView): Call webkitWebContextEnableIconDatabasePrivateBrowsingIfNeeded().
574         (webkitWebContextWebViewDestroyed): Call webkitWebContextDisableIconDatabasePrivateBrowsingIfNeeded().
575         * UIProcess/API/gtk/WebKitWebView.cpp:
576         (webkitWebViewDispose): Ensure webkitWebContextWebViewDestroyed is called only once.
577
578 2017-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
579
580         [GTK] UIProcess from WebKitGtk+ 2.15.x SIGSEGVs because of X Error BadDamage in WebKit::AcceleratedBackingStoreX11::update(WebKit::LayerTreeContext const&) () at Source/WebKit2/UIProcess/gtk/AcceleratedBackingStoreX11.cpp:145
581         https://bugs.webkit.org/show_bug.cgi?id=165656
582
583         Reviewed by Michael Catanzaro.
584
585         We are incorrectly handling BadDamage errors because the BadDamage value we pass to the XErrorTrapper is not
586         the actual error code used by X11. Since XDamage is an extension, it has its own errors and a base error
587         code. We need to use the base error code we get when calling XDamageQueryExtension to pass the right error code
588         to the XErrorTrapper.
589
590         * UIProcess/gtk/AcceleratedBackingStoreX11.cpp:
591         (WebKit::AcceleratedBackingStoreX11::create): Get also the damage base error.
592         (WebKit::xDamageErrorCode): Helper to get the actual error code.
593         (WebKit::AcceleratedBackingStoreX11::~AcceleratedBackingStoreX11): Use xDamageErrorCode().
594         (WebKit::AcceleratedBackingStoreX11::update): Ditto.
595
596 2017-01-25  Miguel Gomez  <magomez@igalia.com>
597
598         [GTK] The inspector is broken when AC support is disabled
599         https://bugs.webkit.org/show_bug.cgi?id=165237
600
601         Reviewed by Carlos Garcia Campos.
602
603         WebInspector must not use PageOverlays or GraphicsLayers when AC is not avaialable.
604
605         No new tests added.
606
607         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
608         (WebKit::WebInspectorClient::highlight):
609         (WebKit::WebInspectorClient::showPaintRect):
610
611 2017-01-25  Carlos Garcia Campos  <cgarcia@igalia.com>
612
613         [SOUP] Custom protocols don't work in private browsing mode
614         https://bugs.webkit.org/show_bug.cgi?id=167236
615
616         Reviewed by Sergio Villar Senin.
617
618         We only register them in the default session, they should be registered in all existing sessions, and also on
619         newly created ones.
620
621         * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
622         (WebKit::CustomProtocolManager::registerProtocolClass): Set the WEBKIT_TYPE_SOUP_REQUEST_GENERIC as type for
623         custom protocols.
624         (WebKit::CustomProtocolManager::registerScheme): Use g_type_class_peek instead of g_type_class_ref since we know
625         the class was already created in registerProtocolClass(). Setup custom protocols in all existing sessions.
626
627 2017-01-24  Carlos Garcia Campos  <cgarcia@igalia.com>
628
629         [GTK] Add API to create ephemeral web views and deprecate the private browsing setting
630         https://bugs.webkit.org/show_bug.cgi?id=167370
631
632         Reviewed by Michael Catanzaro.
633
634         Add API to create ephemeral WebKitWebView, WebKitWebsiteDataManager and WebKitWebContext.
635
636         * UIProcess/API/gtk/WebKitSettings.cpp:
637         (webKitSettingsSetProperty): Ignore deprecation warnings.
638         (webKitSettingsGetProperty): Ditto.
639         (webkit_settings_class_init): Mark WebKitSettings:enable-private-browsing as deprecated.
640         * UIProcess/API/gtk/WebKitSettings.h:
641         * UIProcess/API/gtk/WebKitWebContext.cpp:
642         (webkit_web_context_new_ephemeral): Create an ephemeral WebKitWebContext. This is just a convenient method to
643         create a WebKitWebContext with an ephemeral WebKitWebsiteDataManager without having to deal with the manager.
644         (webkit_web_context_is_ephemeral): Return whether the context is ephemeral.
645         (webkitWebContextCreatePageForWebView): Configure page with the web view WebKitWebsiteDataManager if it has one.
646         * UIProcess/API/gtk/WebKitWebContext.h:
647         * UIProcess/API/gtk/WebKitWebView.cpp:
648         (webkitWebViewConstructed): Check if the WebView is or should be ephemeral and create a non persistent website
649         data manager if it's an ephemeral web view in a non ephemeral web context.
650         (webkitWebViewSetProperty): Add setter for is-ephemeral property.
651         (webkitWebViewGetProperty): Add getter for is-ephemeral property.
652         (webkit_web_view_class_init): Add is-ephemeral property.
653         (webkitWebViewHandleAuthenticationChallenge): Check also whether web view is ephemeral.
654         (webkitWebViewGetWebsiteDataManager): Helper private to return the web view data manager.
655         (webkit_web_view_new_with_context): Also set is-ephemeral property depending on the context.
656         (webkit_web_view_is_ephemeral): Return whether the view is ephemeral.
657         * UIProcess/API/gtk/WebKitWebView.h:
658         * UIProcess/API/gtk/WebKitWebViewPrivate.h:
659         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
660         (webkitWebsiteDataManagerGetProperty): Add setter for is-ephemeral property.
661         (webkitWebsiteDataManagerSetProperty): Add getter for is-ephemeral property.
662         (webkit_website_data_manager_class_init): Add is-ephemeral property.
663         (webkit_website_data_manager_new_ephemeral): Create a new ephemeral WebKitWebsiteDataManager.
664         (webkit_website_data_manager_is_ephemeral): Return whether the website data manager is ephemeral.
665         (webkit_website_data_manager_get_base_data_directory): Return nullptr if manager is ephemeral.
666         (webkit_website_data_manager_get_base_cache_directory): Ditto.
667         (webkit_website_data_manager_get_local_storage_directory): Ditto.
668         (webkit_website_data_manager_get_disk_cache_directory): Ditto.
669         (webkit_website_data_manager_get_offline_application_cache_directory): Ditto.
670         (webkit_website_data_manager_get_indexeddb_directory): Ditto.
671         (webkit_website_data_manager_get_websql_directory): Ditto.
672         * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
673         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
674
675 2017-01-24  Zalan Bujtas  <zalan@apple.com>
676
677         Add simple line layout toggle to MiniBrowser
678         https://bugs.webkit.org/show_bug.cgi?id=167405
679
680         Reviewed by Andreas Kling.
681
682         * UIProcess/API/Cocoa/WKPreferences.mm:
683         (-[WKPreferences _simpleLineLayoutEnabled]):
684         (-[WKPreferences _setSimpleLineLayoutEnabled:]):
685         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
686
687 2017-01-24  Joseph Pecoraro  <pecoraro@apple.com>
688
689         Fold USER_TIMING into WEB_TIMING and make it a RuntimeEnabledFeature
690         https://bugs.webkit.org/show_bug.cgi?id=167394
691
692         Reviewed by Ryosuke Niwa.
693
694         * Configurations/FeatureDefines.xcconfig:
695
696 2017-01-24  Simon Fraser  <simon.fraser@apple.com>
697
698         [iOS WK2] Avoid IOSurface readback for snapshot creation
699         https://bugs.webkit.org/show_bug.cgi?id=167397
700         rdar://problem/30174873
701
702         Reviewed by Tim Horton.
703
704         Use IOSurface::sinkIntoImage() for snapshots, to avoid GPU readback.
705
706         * UIProcess/API/Cocoa/WKWebView.mm:
707         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
708
709 2017-01-24  Tim Horton  <timothy_horton@apple.com>
710
711         Script gets touch events even after navigation swipe begins
712         https://bugs.webkit.org/show_bug.cgi?id=167383
713         <rdar://problem/22938927>
714
715         Reviewed by Simon Fraser.
716
717         * Platform/spi/ios/UIKitSPI.h:
718         * UIProcess/API/Cocoa/WKWebView.mm:
719         (-[WKWebView _isNavigationSwipeGestureRecognizer:]):
720         * UIProcess/API/Cocoa/WKWebViewInternal.h:
721         * UIProcess/Cocoa/ViewGestureController.h:
722         * UIProcess/ios/ViewGestureControllerIOS.mm:
723         (-[WKSwipeTransitionController isNavigationSwipeGestureRecognizer:]):
724         (WebKit::ViewGestureController::isNavigationSwipeGestureRecognizer):
725         * UIProcess/ios/WKContentViewInteraction.mm:
726         (-[WKContentView gestureRecognizer:shouldRequireFailureOfGestureRecognizer:]):
727         Require the navigation swipe gesture recognizer to fail before the
728         UIWebTouchEventsGestureRecognizer can recognize. This way, the page
729         doesn't get touch events during the swipe, which previously led to
730         e.g. carousels scrolling while swiping.
731
732 2017-01-24  Matt Rajca  <mrajca@apple.com>
733
734         Pass down website autoplay policies to media elements
735         https://bugs.webkit.org/show_bug.cgi?id=167355
736
737         Reviewed by Alex Christensen.
738
739         Autoplay policies can be specified at the global web view preferences level or on a per-page
740         basis during navigation. This patch ensures that policies specified on a per-page basis hold
741         precedence over global policies. If no policies are specified during navigation, global
742         policies are used. A WebsiteAutoplayPolicy::Default option has been added to let clients
743         explicitly specify web view defaults should be used.
744
745         * Shared/WebsitePolicies.h:
746         * UIProcess/API/C/WKWebsitePolicies.cpp:
747         (WKWebsitePoliciesGetAutoplayPolicy):
748         (WKWebsitePoliciesSetAutoplayPolicy):
749         * UIProcess/API/C/WKWebsitePolicies.h:
750         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
751         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
752         (-[_WKWebsitePolicies setAutoplayPolicy:]):
753         (-[_WKWebsitePolicies autoplayPolicy]):
754         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
755         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
756
757 2017-01-24  Nan Wang  <n_wang@apple.com>
758
759         AX: Speak Selection does not work in an iframe
760         https://bugs.webkit.org/show_bug.cgi?id=166794
761         <rdar://problem/29913013>
762
763         Reviewed by Chris Fleizach.
764
765         Making sure WebPage::getSelectionOrContentsAsString() is getting the
766         selection content in the right frame. 
767
768         * UIProcess/API/Cocoa/WKWebView.mm:
769         (-[WKWebView _accessibilityRetrieveSpeakSelectionContent]):
770         (-[WKWebView _accessibilityDidGetSpeakSelectionContent:]):
771         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
772         * UIProcess/ios/WKContentViewInteraction.h:
773         * UIProcess/ios/WKContentViewInteraction.mm:
774         (-[WKContentView accessibilityRetrieveSpeakSelectionContent]):
775         * WebProcess/WebPage/WebPage.cpp:
776         (WebKit::WebPage::getSelectionOrContentsAsString):
777
778 2017-01-24  Jer Noble  <jer.noble@apple.com>
779
780         Make _WKFullscreenDelegate available to users of the WebKit2 C-API.
781         https://bugs.webkit.org/show_bug.cgi?id=165255
782
783         Reviewed by Anders Carlsson.
784
785         Add a getter and setter to WKPagePrivate allowing clients to set/get the
786         _WKFullscreenDelegate associated with the page.
787
788         * UIProcess/API/C/mac/WKPagePrivateMac.h:
789         * UIProcess/API/C/mac/WKPagePrivateMac.mm:
790         (WKPageSetFullscreenDelegate):
791         (WKPageGetFullscreenDelegate):
792
793 2017-01-23  Anders Carlsson  <andersca@apple.com>
794
795         The Score Esports crashes on launch
796         https://bugs.webkit.org/show_bug.cgi?id=167338
797         rdar://problem/29948645
798
799         Reviewed by Dan Bernstein.
800
801         * Shared/Cocoa/WKObject.mm:
802         (+[WKObject conformsToProtocol:]):
803         Add a class method implementation in case an app ends up calling +[WKObject conformsToProtocol:] for some reason.
804
805 2017-01-24  Miguel Gomez  <magomez@igalia.com>
806
807         [Coordinated Graphics] Ensure that we're in AC mode before trying to create GraphicsLayers
808         https://bugs.webkit.org/show_bug.cgi?id=167365
809
810         Reviewed by Carlos Garcia Campos.
811
812         When entering AC on demand, the RenderLayerCompositor wants to create the root GraphicsLayer before the
813         AcceleratedDrawingArea is in AC mode. This means there's no LayerTreeHost to request the GraphicsLayerFactory,
814         so no layers are created. Ensure that we are in AC mode before requesting the GraphicsLayerFactory.
815
816         No behaviour change, no new tests.
817
818         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
819         (WebKit::AcceleratedDrawingArea::graphicsLayerFactory):
820
821 2017-01-23  Carlos Garcia Campos  <cgarcia@igalia.com>
822
823         [GTK] Add API to WebKitWebsiteDataManager to handle website data
824         https://bugs.webkit.org/show_bug.cgi?id=146589
825
826         Reviewed by Michael Catanzaro.
827
828         Add WebKitWebsiteData boxed type to wrap a WebsiteDataRecord and new methods to WebKitWebsiteDataManager to
829         fetch, remove and clear website data.
830
831         * PlatformGTK.cmake: Add new files to compilation.
832         * UIProcess/API/gtk/WebKitWebsiteData.cpp: Added.
833         (_WebKitWebsiteData::_WebKitWebsiteData):
834         (recordContainsSupportedDataTypes): Helper function to check if the WebsiteDataRecord contains any type exposed
835         by our API.
836         (toWebKitWebsiteDataTypes): Convert from WebKit::WebsiteDataType to the GTK+ public API types.
837         (webkitWebsiteDataCreate): Create a new WebKitWebsiteData for the given WebsiteDataRecord if it contains any
838         supported type.
839         (webkitWebsiteDataGetRecord): Returns the wrapped WebsiteDataRecord.
840         (webkit_website_data_ref):
841         (webkit_website_data_unref):
842         (webkit_website_data_get_name): Return the display name.
843         (webkit_website_data_get_types): Returns the mask of types.
844         (webkit_website_data_get_size): Returns the size for the given types.
845         * UIProcess/API/gtk/WebKitWebsiteData.h: Added.
846         * UIProcess/API/gtk/WebKitWebsiteDataManager.cpp:
847         (toWebsiteDataTypes): Convert from GTK+ public API types to WebKit::WebsiteDataType.
848         (webkit_website_data_manager_fetch): Fetch website data of the given types.
849         (webkit_website_data_manager_fetch_finish):
850         (webkit_website_data_manager_remove): Remove the website data of the given types for the given WebKitWebsiteData list.
851         (webkit_website_data_manager_remove_finish):
852         (webkit_website_data_manager_clear): Clear all website data of the given types modified since the given time span.
853         (webkit_website_data_manager_clear_finish):
854         * UIProcess/API/gtk/WebKitWebsiteDataManager.h:
855         * UIProcess/API/gtk/WebKitWebsiteDataPrivate.h: Added.
856         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols.
857         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section.
858         * UIProcess/API/gtk/webkit2.h: Inlcude WebKitWebsiteData.h
859
860 2017-01-23  Antti Koivisto  <antti@apple.com>
861
862         Maintain ordering when doing speculative loads
863         https://bugs.webkit.org/show_bug.cgi?id=167324
864
865         Forgot to implement a review comment.
866
867         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
868         (WebKit::NetworkCache::makeSubresourceInfoVector):
869
870         Allocated initial capacity and use uncheckedAppend.
871
872 2017-01-23  Commit Queue  <commit-queue@webkit.org>
873
874         Unreviewed, rolling out r211062.
875         https://bugs.webkit.org/show_bug.cgi?id=167354
876
877         broke API tests (Requested by alexchristensen on #webkit).
878
879         Reverted changeset:
880
881         "Pass down website autoplay policies to media elements"
882         https://bugs.webkit.org/show_bug.cgi?id=167132
883         http://trac.webkit.org/changeset/211062
884
885 2017-01-23  Antti Koivisto  <antti@apple.com>
886
887         Maintain ordering when doing speculative loads
888         https://bugs.webkit.org/show_bug.cgi?id=167324
889
890         Reviewed by Chris Dumez.
891
892         We currently randomize the ordering of speculative loads because they are serialized as a hash map.
893         It would be better to load in the same order as the requests were originally issued as that is
894         likely to match the order the document needs them.
895
896         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
897         (WebKit::NetworkCache::SpeculativeLoadManager::startSpeculativeRevalidation):
898         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
899         (WebKit::NetworkCache::SubresourceInfo::encode):
900         (WebKit::NetworkCache::SubresourceInfo::decode):
901
902             Include key into SubresourceInfo.
903
904         (WebKit::NetworkCache::makeSubresourcesVector):
905
906             Deduplicate the entries.
907
908         (WebKit::NetworkCache::SubresourcesEntry::SubresourcesEntry):
909         (WebKit::NetworkCache::SubresourcesEntry::updateSubresourceLoads):
910         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
911         (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
912         (WebKit::NetworkCache::SubresourceInfo::key):
913         (WebKit::NetworkCache::SubresourceInfo::setTransient):
914         (WebKit::NetworkCache::SubresourcesEntry::subresources):
915
916             Keep the resources in a Vector instead of a HashMap to maintain order.
917
918 2017-01-23  Matt Rajca  <mrajca@apple.com>
919
920         Pass down website autoplay policies to media elements
921         https://bugs.webkit.org/show_bug.cgi?id=167132
922
923         Reviewed by Alex Christensen.
924
925         The playbackRequiresUserGesture APIs are already covered by tests. This patch adds API tests
926         for autoplay website policies.
927
928         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
929         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
930
931 2017-01-23  Joseph Pecoraro  <pecoraro@apple.com>
932
933         Web Inspector: Asserts seen opening and closing Remote Web Inspector windows
934         https://bugs.webkit.org/show_bug.cgi?id=167316
935         <rdar://problem/28891161>
936
937         Reviewed by Alexey Proskuryakov.
938
939         * UIProcess/RemoteWebInspectorProxy.cpp:
940         (WebKit::RemoteWebInspectorProxy::createFrontendPageAndWindow):
941         Assume read access, like the local web inspector, to Web Inspector resources.
942
943         * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
944         (WebKit::RemoteWebInspectorUI::closeWindow):
945         Clear ourselves as the inspector frontend client when closing.
946
947 2017-01-20  Anders Carlsson  <andersca@apple.com>
948
949         When Safari reloads pages with Flash objects after Flash is installed, placeholders don't paint (but do work!)
950         https://bugs.webkit.org/show_bug.cgi?id=167268
951         rdar://problem/29857388
952
953         Reviewed by Sam Weinig.
954
955         * WebProcess/Plugins/WebPluginInfoProvider.h:
956         Make refreshPlugins() private.
957
958         * WebProcess/WebProcess.cpp:
959         (WebKit::WebProcess::refreshPlugins):
960         Call the newly added PluginInfoProvider::refresh().
961
962 2017-01-23  Antti Koivisto  <antti@apple.com>
963
964         Use priorities in speculative revalidation
965         https://bugs.webkit.org/show_bug.cgi?id=167314
966
967         Reviewed by Chris Dumez.
968
969         We currently do all speculative cache operations with 'Medium' priority
970         and network operations with 'Low'. We should use the actual request priorities instead.
971
972         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
973         (WebKit::NetworkCache::constructRevalidationRequest):
974
975             Use priority when constructing validation request.
976
977         (WebKit::NetworkCache::SpeculativeLoadManager::retrieveEntryFromStorage):
978
979             Use priority when retrieving from cache.
980
981         (WebKit::NetworkCache::SpeculativeLoadManager::preloadEntry):
982         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
983         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
984         (WebKit::NetworkCache::SubresourceInfo::encode):
985         (WebKit::NetworkCache::SubresourceInfo::decode):
986
987             Save and restore the priority.
988
989         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
990         (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
991         (WebKit::NetworkCache::SubresourceInfo::priority):
992
993 2017-01-23  Jer Noble  <jer.noble@apple.com>
994
995         Video details does not apear and missing scrubber in Control Center
996         https://bugs.webkit.org/show_bug.cgi?id=167233
997
998         Reviewed by Alex Christensen.
999
1000         Make requestActiveNowPlayingSessionInfo() and handleActiveNowPlayingSessionInfoResponse()
1001         work in PLATFORM(IOS).
1002
1003         * UIProcess/API/Cocoa/WKWebView.mm:
1004         (-[WKWebView _requestActiveNowPlayingSessionInfo]):
1005         (-[WKWebView _handleActiveNowPlayingSessionInfoResponse:title:duration:elapsedTime:]):
1006         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1007         * UIProcess/PageClient.h:
1008         * UIProcess/WebPageProxy.cpp:
1009         (WebKit::WebPageProxy::requestActiveNowPlayingSessionInfo):
1010         (WebKit::WebPageProxy::handleActiveNowPlayingSessionInfoResponse):
1011         * UIProcess/WebPageProxy.h:
1012         * UIProcess/WebPageProxy.messages.in:
1013         * UIProcess/ios/PageClientImplIOS.h:
1014         * UIProcess/ios/PageClientImplIOS.mm:
1015         (WebKit::PageClientImpl::handleActiveNowPlayingSessionInfoResponse):
1016         * WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
1017         (WebKit::WebPage::requestActiveNowPlayingSessionInfo):
1018         * WebProcess/WebPage/WebPage.h:
1019         * WebProcess/WebPage/WebPage.messages.in:
1020         * WebProcess/WebPage/mac/WebPageMac.mm:
1021         (WebKit::WebPage::requestActiveNowPlayingSessionInfo): Deleted.
1022
1023 2017-01-23  Chris Dumez  <cdumez@apple.com>
1024
1025         REGRESSION (r211033): ASSERTION FAILED: m_ptr in com.apple.WebCore: WTF::RefPtr<WebCore::Element>::operator* const + 70
1026         https://bugs.webkit.org/show_bug.cgi?id=167308
1027         <rdar://problem/30144964>
1028
1029         Unreviewed, do a partial revert of r211033 to fix assertion.
1030
1031         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1032         (WebKit::WebChromeClient::exitFullScreenForElement):
1033         * WebProcess/WebCoreSupport/WebChromeClient.h:
1034
1035 2017-01-20  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
1036
1037         urlParserEnabled parameter is only encoded for COCOA ports
1038         https://bugs.webkit.org/show_bug.cgi?id=167238
1039
1040         Reviewed by Alex Christensen.
1041
1042         This leads to URLParser being enabled on the UI process, since it is
1043         the default, but disabled on the WebProcess, which is the default for
1044         WebProcessCreationParameters, casuing asserts like on tests such as these
1045         due to differences in parsing:
1046
1047         - fast/loader/redirect-to-invalid-url-using-javascript-calls-policy-delegate.html
1048         - fast/loader/window-open-to-invalid-url-calls-policy-delegate.html
1049         - http/tests/inspector/network/copy-as-curl.html
1050
1051         * Shared/WebProcessCreationParameters.cpp:
1052         (WebKit::WebProcessCreationParameters::encode): encode urlParserEnabled
1053         (WebKit::WebProcessCreationParameters::decode): decode urlParserEnabled
1054
1055 2017-01-20  Darin Adler  <darin@apple.com>
1056
1057         Remove PassRefPtr from "page" directory of WebCore, also deploy references
1058         https://bugs.webkit.org/show_bug.cgi?id=167224
1059
1060         Reviewed by Chris Dumez.
1061
1062         * UIProcess/Scrolling/RemoteScrollingTree.cpp:
1063         (WebKit::RemoteScrollingTree::createScrollingTreeNode): Return a Ref
1064         instead of PassRefPtr.
1065         * UIProcess/Scrolling/RemoteScrollingTree.h: Updated for the above.
1066
1067         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
1068         (WKBundlePageInstallPageOverlay): Pass a reference.
1069         (WKBundlePageUninstallPageOverlay): Ditto.
1070         (WKBundlePageInstallPageOverlayWithAnimation): Ditto.
1071         (WKBundlePageUninstallPageOverlayWithAnimation): Ditto.
1072         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
1073         (WebKit::PDFPlugin::jsPDFDocPrint): Ditto.
1074         * WebProcess/Plugins/PluginView.cpp:
1075         (WebKit::PluginView::focusPluginElement): Ditto.
1076         (WebKit::PluginView::setStatusbarText): Ditto.
1077
1078         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1079         (WebKit::WebChromeClient::elementDidFocus): Updated for changes to ChromeClient.
1080         (WebKit::WebChromeClient::elementDidBlur): Ditto.
1081         (WebKit::WebChromeClient::makeFirstResponder): Ditto.
1082         (WebKit::WebChromeClient::createWindow): Ditto.
1083         (WebKit::WebChromeClient::runBeforeUnloadConfirmPanel): Ditto.
1084         (WebKit::WebChromeClient::runJavaScriptAlert): Ditto.
1085         (WebKit::WebChromeClient::runJavaScriptConfirm): Ditto.
1086         (WebKit::WebChromeClient::runJavaScriptPrompt): Ditto.
1087         (WebKit::WebChromeClient::contentsSizeChanged): Ditto.
1088         (WebKit::WebChromeClient::unavailablePluginButtonClicked): Ditto.
1089         (WebKit::WebChromeClient::print): Ditto.
1090         (WebKit::WebChromeClient::exceededDatabaseQuota): Ditto.
1091         (WebKit::WebChromeClient::reachedApplicationCacheOriginQuota): Ditto.
1092         (WebKit::WebChromeClient::createColorChooser): Ditto.
1093         (WebKit::WebChromeClient::createPopupMenu): Ditto.
1094         (WebKit::WebChromeClient::createSearchPopupMenu): Ditto.
1095         (WebKit::WebChromeClient::attachRootGraphicsLayer): Ditto.
1096         (WebKit::WebChromeClient::attachViewOverlayGraphicsLayer): Ditto.
1097         (WebKit::WebChromeClient::createScrollingCoordinator): Ditto.
1098         (WebKit::WebChromeClient::supportsFullScreenForElement): Ditto.
1099         (WebKit::WebChromeClient::enterFullScreenForElement): Ditto.
1100         (WebKit::WebChromeClient::exitFullScreenForElement): Ditto.
1101         (WebKit::WebChromeClient::didAddHeaderLayer): Ditto.
1102         (WebKit::WebChromeClient::didAddFooterLayer): Ditto.
1103         (WebKit::WebChromeClient::shouldUseTiledBackingForFrameView): Ditto.
1104         * WebProcess/WebCoreSupport/WebChromeClient.h: Ditto.
1105         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
1106         (WebKit::WebChromeClient::elementDidRefocus): Ditto.
1107         (WebKit::WebChromeClient::didReceiveMobileDocType): Ditto.
1108         (WebKit::WebChromeClient::observedContentChange): Ditto.
1109         (WebKit::WebChromeClient::clearContentChangeObservers): Ditto.
1110         (WebKit::WebChromeClient::notifyRevealedSelectionByScrollingFrame): Ditto.
1111
1112         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1113         (WebKit::WebFrameLoaderClient::dispatchCreatePage): Pass reference.
1114         * WebProcess/WebCoreSupport/WebInspectorClient.cpp:
1115         (WebKit::WebInspectorClient::~WebInspectorClient): Ditto.
1116         (WebKit::WebInspectorClient::hideHighlight): Ditto.
1117         (WebKit::WebInspectorClient::showPaintRect): Ditto.
1118         * WebProcess/WebPage/FindController.cpp:
1119         (WebKit::FindController::updateFindUIAfterPageScroll): Ditto.
1120         (WebKit::FindController::hideFindUI): Ditto.
1121
1122         * WebProcess/WebPage/WebFrame.cpp:
1123         (WebKit::WebFrame::createWithCoreMainFrame): Return Ref instead of
1124         PassRefPtr.
1125         (WebKit::WebFrame::createSubframe): Ditto.
1126         (WebKit::WebFrame::create): Ditto.
1127         * WebProcess/WebPage/WebFrame.h: Updated for the above.
1128
1129         * WebProcess/WebPage/WebInspector.cpp:
1130         (WebKit::WebInspector::openInNewTab): Pass reference.
1131
1132         * WebProcess/WebPage/ios/FindControllerIOS.mm:
1133         (WebKit::FindController::updateFindIndicator): Use reference.
1134         (WebKit::FindController::hideFindIndicator): Ditto.
1135
1136 2017-01-21  Carlos Garcia Campos  <cgarcia@igalia.com>
1137
1138         Unreviewed, rolling out r211012.
1139
1140         It caused a lot of crashes in the network process
1141
1142         Reverted changeset:
1143
1144         "[SOUP] Custom protocols don't work in private browsing mode"
1145         https://bugs.webkit.org/show_bug.cgi?id=167236
1146         http://trac.webkit.org/changeset/211012
1147
1148 2017-01-20  Joseph Pecoraro  <pecoraro@apple.com>
1149
1150         Remove never changing IndexedDB RuntimeEnabledFeature
1151         https://bugs.webkit.org/show_bug.cgi?id=167278
1152
1153         Reviewed by Darin Adler.
1154
1155         * WebProcess/WebProcess.cpp:
1156         (WebKit::m_resourceLoadStatisticsStorage):
1157
1158 2017-01-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1159
1160         [SOUP] Custom protocols don't work in private browsing mode
1161         https://bugs.webkit.org/show_bug.cgi?id=167236
1162
1163         Reviewed by Sergio Villar Senin.
1164
1165         We only register them in the default session.
1166
1167         * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
1168         (WebKit::CustomProtocolManager::registerProtocolClass): Set the WEBKIT_TYPE_SOUP_REQUEST_GENERIC as type for
1169         custom protocols, and setup custom protocols in all existing sessions.
1170         (WebKit::CustomProtocolManager::registerScheme): Use g_type_class_peek instead of g_type_class_ref since we know
1171         the class was already created in registerProtocolClass().
1172
1173 2017-01-20  Brady Eidson  <beidson@apple.com>
1174
1175         Require a button press on a gamepad for them to be exposed to the DOM.
1176         <rdar://problem/28620919> and https://bugs.webkit.org/show_bug.cgi?id=167272
1177
1178         Reviewed by Alex Christensen.
1179
1180         * UIProcess/Gamepad/UIGamepadProvider.cpp:
1181         (WebKit::UIGamepadProvider::gamepadSyncTimerFired):
1182         (WebKit::UIGamepadProvider::platformGamepadInputActivity):
1183         * UIProcess/Gamepad/UIGamepadProvider.h:
1184
1185         * UIProcess/WebPageProxy.cpp:
1186         (WebKit::WebPageProxy::gamepadActivity):
1187         * UIProcess/WebPageProxy.h:
1188
1189         * WebProcess/Gamepad/WebGamepadProvider.cpp:
1190         (WebKit::WebGamepadProvider::gamepadActivity):
1191         * WebProcess/Gamepad/WebGamepadProvider.h:
1192
1193         * WebProcess/WebPage/WebPage.cpp:
1194         (WebKit::WebPage::gamepadActivity):
1195         * WebProcess/WebPage/WebPage.h:
1196         * WebProcess/WebPage/WebPage.messages.in:
1197
1198 2017-01-20  Joseph Pecoraro  <pecoraro@apple.com>
1199
1200         Cleanup RuntimeEnabledFeatures
1201         https://bugs.webkit.org/show_bug.cgi?id=167228
1202
1203         Reviewed by Simon Fraser.
1204
1205         * WebProcess/WebProcess.cpp:
1206         (WebKit::m_resourceLoadStatisticsStorage):
1207
1208 2017-01-20  Joseph Pecoraro  <pecoraro@apple.com>
1209
1210         Remove outdated ENABLE(CSP_NEXT) build flag
1211         https://bugs.webkit.org/show_bug.cgi?id=167252
1212
1213         Reviewed by Brent Fulgham.
1214
1215         * Configurations/FeatureDefines.xcconfig:
1216
1217 2017-01-20  Alex Christensen  <achristensen@webkit.org>
1218
1219         Fix Mac CMake build.
1220
1221         * CMakeLists.txt:
1222         * PlatformMac.cmake:
1223
1224 2017-01-20  Antoine Quint  <graouts@apple.com>
1225
1226         Web Animations should be off by default and enabled as an experimental feature
1227         https://bugs.webkit.org/show_bug.cgi?id=167115
1228         <rdar://problem/30048963>
1229
1230         Reviewed by Joseph Pecoraro.
1231
1232         Promote, or relegate depending on how you see things, the Web Animations preference
1233         to an experimental feature.
1234
1235         * Shared/WebPreferencesDefinitions.h:
1236
1237 2017-01-20  Antoine Quint  <graouts@apple.com>
1238
1239         [Modern Media Controls] Turn modern media controls on by default
1240         https://bugs.webkit.org/show_bug.cgi?id=165668
1241
1242         Reviewed by Dean Jackson.
1243
1244         Use DEFAULT_EXPERIMENTAL_FEATURES_ENABLED as the default value for modern media controls, which is true.
1245
1246         * Shared/WebPreferencesDefinitions.h:
1247
1248 2017-01-20  Carlos Garcia Campos  <cgarcia@igalia.com>
1249
1250         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.15.3 release.
1251
1252         * gtk/NEWS: Add release notes for 2.15.3.
1253
1254 2017-01-19  Carlos Garcia Campos  <cgarcia@igalia.com>
1255
1256         [Threaded Compositor] Initialize the threaded compositor with the current size
1257         https://bugs.webkit.org/show_bug.cgi?id=167196
1258
1259         Reviewed by Žan Doberšek.
1260
1261         We are always creating the threaded compositor with an empty size and then a sizeDidChange always happen when
1262         the backing store state changes. This is always happening because the threaded compositor is created before the
1263         first backing store state, but if we wanted to create it later, for example to enter/leave AC mode on demand,
1264         the threaded compositor will not have the viewport size unless the window is resized, or sizeDidChange is called
1265         manually when entering AC mode. Creating the threaded compositor is sync and changing the size too, so it's
1266         better to do both things at the same time using the same sync operation.
1267
1268         * Shared/CoordinatedGraphics/SimpleViewportController.cpp:
1269         (WebKit::SimpleViewportController::SimpleViewportController): Pass an initial size to the constructor.
1270         * Shared/CoordinatedGraphics/SimpleViewportController.h:
1271         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1272         (WebKit::ThreadedCompositor::create): Add viewportSize and scaleFactor construction parameters,
1273         (WebKit::ThreadedCompositor::ThreadedCompositor): Ditto. Also mark as needs resize if the given size is not empty.
1274         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1275         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
1276         (WebKit::ThreadedCoordinatedLayerTreeHost::ThreadedCoordinatedLayerTreeHost): Initialize the threaded compositor
1277         with an initial viewport size and scale factor.
1278
1279 2017-01-19  Chris Dumez  <cdumez@apple.com>
1280
1281         iterable<> should be enabled on WK1
1282         https://bugs.webkit.org/show_bug.cgi?id=167221
1283         <rdar://problem/30108531>
1284
1285         Reviewed by Youenn Fablet.
1286
1287         * Shared/WebPreferencesDefinitions.h:
1288         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1289         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
1290         * WebProcess/WebPage/WebPage.cpp:
1291         (WebKit::WebPage::updatePreferences):
1292
1293 2017-01-19  Alex Christensen  <achristensen@webkit.org>
1294
1295         Construct URLSearchParams from array or object
1296         https://bugs.webkit.org/show_bug.cgi?id=166973
1297
1298         Reviewed by Sam Weinig.
1299
1300         * NetworkProcess/capture/NetworkCaptureManager.cpp:
1301         (WebKit::NetworkCapture::Manager::fuzzyMatchURLs):
1302         Change std::pair's first/second to WTF::KeyValuePair's key/value.
1303
1304 2017-01-19  Andy Estes  <aestes@apple.com>
1305
1306         [iOS] Move the PDF password view into its own class for possible reuse
1307         https://bugs.webkit.org/show_bug.cgi?id=167192
1308
1309         Reviewed by Tim Horton.
1310
1311         * UIProcess/ios/WKPDFView.h: Stopped conforming to UIDocumentPasswordViewDelegate.
1312         * UIProcess/ios/WKPDFView.mm: Changed _passwordView to a WKPasswordView.
1313         (-[WKPDFView _passwordViewFrame]): Returns the frame to set on _passwordView.
1314         (-[WKPDFView _updatePasswordEntryField]): Removed.
1315         (-[WKPDFView _showPasswordEntryField]): Created a WKPasswordView, set a lambda on its
1316         userDidEnterPassword property to do the work previously done in -_tryToUnlockWithPassword:,
1317         and showed the password view.
1318         (-[WKPDFView _keyboardDidShow:]): Moved to WKPasswordView.
1319         (-[WKPDFView _hidePasswordEntryField]): Deleted. The userDidEnterPassword lambda now calls
1320         -[WKPasswordView hide] when the document is unlocked.
1321         (-[WKPDFView userDidEnterPassword:forPasswordView:]): Moved to WKPasswordView.
1322         (-[WKPDFView didBeginEditingPassword:inView:]): Ditto.
1323         (-[WKPDFView didEndEditingPassword:inView:]): Ditto.
1324         (-[WKPDFView _didFailToUnlock]): Ditto.
1325         (-[WKPDFView _tryToUnlockWithPassword:]): Moved into _passwordView's userDidEnterPassword lambda.
1326         * UIProcess/ios/WKPasswordView.h: Added.
1327         * UIProcess/ios/WKPasswordView.mm: Added.
1328         (-[WKPasswordView initWithFrame:documentName:]): Created a UIDocumentPasswordView with
1329         documentName, set self as its passwordDelegate, and added it as a subview.
1330         (-[WKPasswordView layoutSubviews]): Updated _scrollView's contentSize if we are displaying
1331         the view.
1332         (-[WKPasswordView displayInContentView:]): Saved the scroll view's previous minimum/maximum
1333         zoom scale and color, set new values for minimum/maximum zoom scale and color, and added
1334         self as a subview of contentView.
1335         (-[WKPasswordView hide]): Restored the saved minimum/maximum zoom scale and color on the
1336         scroll view and removed self from its superview.
1337         (-[WKPasswordView displayPasswordFailureAlert]): Displayed the alert previously shown by
1338         -[WKPDFView _didFailToUnlock].
1339         (-[WKPasswordView _keyboardDidShow:]): Moved from WKPDFView.
1340         (-[WKPasswordView userDidEnterPassword:forPasswordView:]): Retained self and called the
1341         _userDidEnterPassword block with the password.
1342         (-[WKPasswordView didBeginEditingPassword:inView:]): Moved from WKPDFView.
1343         (-[WKPasswordView didEndEditingPassword:inView:]): Ditto.
1344         * WebKit2.xcodeproj/project.pbxproj:
1345
1346 2017-01-19  Chris Dumez  <cdumez@apple.com>
1347
1348         Make sure HTML validation bubble gets dismissed when its associated element's frame gets detached
1349         https://bugs.webkit.org/show_bug.cgi?id=167215
1350         <rdar://problem/29885052>
1351
1352         Reviewed by Andreas Kling.
1353
1354         Make sure HTML validation bubble gets dismissed when its associated
1355         element's frame gets detached and that we do not crash.
1356
1357         * WebProcess/WebCoreSupport/WebValidationMessageClient.cpp:
1358         (WebKit::WebValidationMessageClient::documentDetached):
1359         * WebProcess/WebCoreSupport/WebValidationMessageClient.h:
1360
1361 2017-01-19  Chris Dumez  <cdumez@apple.com>
1362
1363         Implement per activity state CPU usage reporting using diagnostic logging
1364         https://bugs.webkit.org/show_bug.cgi?id=167163
1365         <rdar://problem/30058349>
1366
1367         Reviewed by Andreas Kling.
1368
1369         Implement per activity state CPU usage reporting using diagnostic logging.
1370
1371         * Platform/Logging.h:
1372         * UIProcess/PerActivityStateCPUUsageSampler.cpp: Added.
1373         (WebKit::PerActivityStateCPUUsageSampler::PerActivityStateCPUUsageSampler):
1374         (WebKit::PerActivityStateCPUUsageSampler::~PerActivityStateCPUUsageSampler):
1375         (WebKit::PerActivityStateCPUUsageSampler::reportWebContentCPUTime):
1376         (WebKit::loggingKeyForActivityState):
1377         (WebKit::loggingKeyForCPUUsage):
1378         (WebKit::PerActivityStateCPUUsageSampler::loggingTimerFired):
1379         (WebKit::PerActivityStateCPUUsageSampler::pageForLogging):
1380         * UIProcess/PerActivityStateCPUUsageSampler.h: Copied from Source/WebCore/page/ActivityState.h.
1381         * UIProcess/WebProcessPool.cpp:
1382         (WebKit::WebProcessPool::WebProcessPool):
1383         (WebKit::WebProcessPool::reportWebContentCPUTime):
1384         * UIProcess/WebProcessPool.h:
1385         * UIProcess/WebProcessPool.messages.in:
1386         * WebKit2.xcodeproj/project.pbxproj:
1387         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1388         (WebKit::WebChromeClient::reportProcessCPUTime):
1389         * WebProcess/WebCoreSupport/WebChromeClient.h:
1390
1391 2017-01-19  Dan Bernstein  <mitz@apple.com>
1392
1393         Build fix.
1394
1395         Rubber-stamped by Anders Carlsson.
1396
1397         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1398         (WebKit::toPKPaymentAuthorizationStatus): Suppressed deprecation warnings.
1399
1400 2017-01-19  Myles C. Maxfield  <mmaxfield@apple.com>
1401
1402         [Cocoa] Variation fonts are erroneously disabled on iOS
1403         https://bugs.webkit.org/show_bug.cgi?id=167172
1404
1405         Reviewed by Simon Fraser.
1406
1407         OpenSource builders don't seem to understand sdk=embedded*.
1408
1409         * Configurations/FeatureDefines.xcconfig:
1410
1411 2017-01-18  Anders Carlsson  <andersca@apple.com>
1412
1413         Install WebKit.apinotes with the public headers of WebKit framework
1414         https://bugs.webkit.org/show_bug.cgi?id=167182
1415         rdar://problem/29008989
1416
1417         Reviewed by Sam Weinig.
1418
1419         * Shared/API/Cocoa/WebKit.apinotes: Added.
1420         * WebKit2.xcodeproj/project.pbxproj:
1421
1422 2017-01-19  Brian Burg  <bburg@apple.com>
1423
1424         Web Inspector: move Mac-specific automation commands to a separate implementation file
1425         https://bugs.webkit.org/show_bug.cgi?id=163297
1426         <rdar://problem/28718990>
1427
1428         Reviewed by Timothy Hatcher.
1429
1430         Not all Automation commands are available on all platforms. Start splitting out
1431         command declarations and implementations based on the target platform.
1432
1433         * DerivedSources.make:
1434         Set an appropriate --platform so the correct backend interface is generated.
1435
1436         * UIProcess/Automation/Automation.json:
1437         Guard commands that should not be available on iOS:
1438             - resizeWindowOfBrowsingContext
1439             - moveWindowOfBrowsingContext
1440             - inspectBrowsingContext
1441
1442         * UIProcess/Automation/WebAutomationSession.cpp:
1443         (WebKit::WebAutomationSession::platformSimulateKeySequence): Deleted.
1444         - Move shared convenience macros to header file.
1445         - Move out Cocoa-only or Mac-only command implementations.
1446
1447         * UIProcess/Automation/WebAutomationSession.h:
1448         Rearrange some declarations and switch from USE(APPKIT) to PLATFORM(MAC).
1449
1450         * UIProcess/Automation/WebAutomationSessionMacros.h: Added.
1451
1452         * UIProcess/Automation/cocoa/WebAutomationSessionCocoa.mm: Added.
1453         (WebKit::WebAutomationSession::platformGetBase64EncodedPNGData):
1454         Moved from WebAutomationSessionCocoa.mm. Add iOS-specific header includes.
1455
1456         * UIProcess/Automation/mac/WebAutomationSessionMac.mm: Renamed from Source/WebKit2/UIProcess/Cocoa/WebAutomationSessionCocoa.mm.
1457         (WebKit::WebAutomationSession::resizeWindowOfBrowsingContext):
1458         (WebKit::WebAutomationSession::moveWindowOfBrowsingContext):
1459         (WebKit::WebAutomationSession::inspectBrowsingContext):
1460         Move macOS platform command implementations to here. If other desktop ports want
1461         to use these commands, we can move them somewhere else later.
1462
1463         (WebKit::WebAutomationSession::sendSynthesizedEventsToPage):
1464         (WebKit::WebAutomationSession::markEventAsSynthesizedForAutomation):
1465         (WebKit::WebAutomationSession::wasEventSynthesizedForAutomation):
1466         Move out AppKit-specific event simulation code to here.
1467
1468         (WebKit::WebAutomationSession::platformSimulateMouseInteraction):
1469         (WebKit::WebAutomationSession::platformSimulateKeyStroke):
1470         (WebKit::WebAutomationSession::platformSimulateKeySequence):
1471         Move out Mac platformFoo implementations to here.
1472
1473         * WebKit2.xcodeproj/project.pbxproj:
1474         - Added UIProcess/Automation/{mac,cocoa} groups.
1475         - Add new platform-specific implementation files.
1476
1477 2017-01-19  Carlos Garcia Campos  <cgarcia@igalia.com>
1478
1479         [GTK] Provide API to set proxy settings
1480         https://bugs.webkit.org/show_bug.cgi?id=128674
1481
1482         Reviewed by Michael Catanzaro.
1483
1484         Add new method webkit_web_context_set_network_proxy_settings() that allows to set proxy settings in a
1485         WebKitWebContext. It receives an enum WebKitNetworkProxyMode with modes Default, NoProxy and Custom, and an
1486         optional WebKitNetworkProxySettings that is used when mode is Custom. WebKitNetworkProxySettings is a simple
1487         boxed type that user can create to set proxy settins with a similar API to GSimpleProxyResolver.
1488
1489         * NetworkProcess/NetworkProcess.h:
1490         * NetworkProcess/NetworkProcess.messages.in: Add SetNetworkProxySettings message.
1491         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1492         (WebKit::NetworkProcessCreationParameters::encode): Encode proxy settings.
1493         (WebKit::NetworkProcessCreationParameters::decode): Decode proxy settings.
1494         * NetworkProcess/NetworkProcessCreationParameters.h:
1495         * NetworkProcess/efl/NetworkProcessMainEfl.cpp: Use SoupNetworkSession::setProxySettingsFromEnvironment().
1496         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1497         (WebKit::NetworkProcess::platformInitializeNetworkProcess): Set proxy settings if provided by the user.
1498         (WebKit::NetworkProcess::setNetworkProxySettings): Set global proxy settings and setup the proxy for all
1499         existing contexts.
1500         * PlatformGTK.cmake: Add new files to compilation.
1501         * Shared/WebCoreArgumentCoders.h:
1502         * Shared/WebProcessCreationParameters.cpp:
1503         (WebKit::WebProcessCreationParameters::encode): Encode proxy settings.
1504         (WebKit::WebProcessCreationParameters::decode): Decode proxy settings.
1505         * Shared/WebProcessCreationParameters.h:
1506         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
1507         (IPC::ArgumentCoder<SoupNetworkProxySettings>::encode): Add encoder implementation for SoupNetworkProxySettings.
1508         (IPC::ArgumentCoder<SoupNetworkProxySettings>::decode): add decoder implementation for SoupNetworkProxySettings.
1509         * UIProcess/API/gtk/WebKitNetworkProxySettings.cpp: Added.
1510         (_WebKitNetworkProxySettings::_WebKitNetworkProxySettings):
1511         (webkitNetworkProxySettingsGetNetworkProxySettings):
1512         (webkit_network_proxy_settings_new): Create a new WebKitNetworkProxySettings with optional default proxy uri and
1513         ignore hosts list.
1514         (webkit_network_proxy_settings_copy):
1515         (webkit_network_proxy_settings_free):
1516         (webkit_network_proxy_settings_add_proxy): Add a proxy uri for a given uri scheme.
1517         * UIProcess/API/gtk/WebKitNetworkProxySettings.h: Added.
1518         * UIProcess/API/gtk/WebKitNetworkProxySettingsPrivate.h: Added.
1519         * UIProcess/API/gtk/WebKitWebContext.cpp:
1520         (webkit_web_context_set_network_proxy_settings): Set proxy settings.
1521         * UIProcess/API/gtk/WebKitWebContext.h:
1522         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt: Add new symbols to the documentation.
1523         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section for WebKitNetworkProxySettings.
1524         * UIProcess/API/gtk/webkit2.h: Include WebKitNetworkProxySettings.h.
1525         * UIProcess/WebProcessPool.h: Add m_networkProxySettings and a setter for soup.
1526         * UIProcess/efl/WebProcessPoolEfl.cpp:
1527         (WebKit::WebProcessPool::platformInitializeWebProcess): Set m_networkProxySettings to parameters.
1528         * UIProcess/gtk/WebProcessPoolGtk.cpp:
1529         (WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
1530         * UIProcess/soup/WebProcessPoolSoup.cpp:
1531         (WebKit::WebProcessPool::platformInitializeNetworkProcess): Ditto.
1532         (WebKit::WebProcessPool::setNetworkProxySettings): Update m_networkProxySettings and notify all processes.
1533         * WebProcess/WebProcess.h:
1534         * WebProcess/WebProcess.messages.in: Add SetNetworkProxySettings message.
1535         * WebProcess/efl/WebProcessMainEfl.cpp: Use SoupNetworkSession::setProxySettingsFromEnvironment().
1536         * WebProcess/soup/WebProcessSoup.cpp:
1537         (WebKit::WebProcess::platformSetCacheModel): Remove comment that is no longer true.
1538         (WebKit::WebProcess::platformInitializeWebProcess): Set proxy settings if provided by the user.
1539         (WebKit::WebProcess::setNetworkProxySettings): Set global proxy settings and setup the proxy for all
1540         existing contexts.
1541
1542 2017-01-19  Carlos Garcia Campos  <cgarcia@igalia.com>
1543
1544         [GTK] Do not update the backing store state unnecessarily when page visibility changes
1545         https://bugs.webkit.org/show_bug.cgi?id=167195
1546
1547         Reviewed by Sergio Villar Senin.
1548
1549         I've noticed that we are receiving UpdateBackingStoreState messages in the web process even when size and scale
1550         factor didn't change. That's quite unfortunate because we do a lot of work unnecessarily and we tell the
1551         threaded compositor that the size changed. This is not only a problem because it's not true, but also because
1552         changing the size is a sync operation in the threaded compositor, so we block the compositing thread for
1553         nothing. This is happening because the WebPageProxy notifies the drawing area that the backing store is
1554         discardable when the page is not visible, and that always produces a new backing store state. In accelerating
1555         compositing mode we don't even have a backing store to discard, so we should check we have something to discard
1556         and also make sure we only generate a new backing store state if we really discarded the backing store.
1557
1558         * UIProcess/DrawingAreaProxyImpl.cpp:
1559         (WebKit::DrawingAreaProxyImpl::discardBackingStoreSoon):
1560         (WebKit::DrawingAreaProxyImpl::discardBackingStore):
1561
1562 2017-01-18  Said Abou-Hallawa  <sabouhallawa@apple.com>
1563
1564         [iOS][WK2] Remove the WebView private configuration contentUpdateFrequency
1565         https://bugs.webkit.org/show_bug.cgi?id=167188
1566
1567         Reviewed by Simon Fraser.
1568
1569         This patch reverts r209294. This configuration is not needed anymore.
1570         The CADisplayLink::preferredFramesPerSecond for WK2 will be set to the
1571         default value always.
1572
1573         * UIProcess/API/APIPageConfiguration.h:
1574         (API::PageConfiguration::setAlwaysRunsAtForegroundPriority):
1575         (API::PageConfiguration::contentUpdateFrequency): Deleted.
1576         (API::PageConfiguration::setContentUpdateFrequency): Deleted.
1577         (): Deleted.
1578         * UIProcess/API/Cocoa/WKWebView.mm:
1579         (-[WKWebView _initializeWithConfiguration:]):
1580         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1581         (-[WKWebViewConfiguration init]):
1582         (-[WKWebViewConfiguration copyWithZone:]):
1583         (-[WKWebViewConfiguration _setAllowsInlineMediaPlaybackAfterFullscreen:]):
1584         (-[WKWebViewConfiguration _contentUpdateFrequency]): Deleted.
1585         (-[WKWebViewConfiguration _setContentUpdateFrequency:]): Deleted.
1586         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
1587         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
1588         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
1589         (-[WKOneShotDisplayLinkHandler initWithDrawingAreaProxy:]):
1590         (WebKit::RemoteLayerTreeDrawingAreaProxy::contentUpdateFrequency): Deleted.
1591
1592 2017-01-18  Ryan Haddad  <ryanhaddad@apple.com>
1593
1594         Unreviewed, rolling out r210848.
1595
1596         This change introduced media-related LayoutTest failures and
1597         crashes on macOS.
1598
1599         Reverted changeset:
1600
1601         "[Modern Media Controls] Turn modern media controls on by
1602         default"
1603         https://bugs.webkit.org/show_bug.cgi?id=165668
1604         http://trac.webkit.org/changeset/210848
1605
1606 2017-01-18  Anders Carlsson  <andersca@apple.com>
1607
1608         Add instrumentation for when we fail to receive a message
1609         https://bugs.webkit.org/show_bug.cgi?id=167179
1610
1611         Reviewed by Alexey Proskuryakov.
1612
1613         This will help us diagnose what the error from mach_msg is.
1614
1615         * Platform/IPC/mac/ConnectionMac.mm:
1616         (IPC::readFromMachPort):
1617
1618 2017-01-18  Alex Christensen  <achristensen@webkit.org>
1619
1620         Fix CFURLConnection build on Mac
1621         https://bugs.webkit.org/show_bug.cgi?id=167168
1622
1623         Reviewed by Andy Estes.
1624
1625         * NetworkProcess/Downloads/mac/DownloadMac.mm:
1626         (WebKit::Download::resume):
1627         (WebKit::Download::platformDidFinish):
1628         (WebKit::Download::platformCancelNetworkLoad):
1629         (WebKit::Download::startNetworkLoadWithHandle):
1630         (WebKit::Download::startNetworkLoad):
1631         (WebKit::Download::platformInvalidate):
1632         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
1633         (WebKit::NetworkDataTaskCocoa::allowsSpecificHTTPSCertificateForHost):
1634         (WebKit::serverTrustCredential):
1635         * Shared/Authentication/mac/AuthenticationManager.mac.mm:
1636         (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge):
1637         * config.h:
1638
1639 2017-01-18  Alex Christensen  <achristensen@webkit.org>
1640
1641         Modernize DelayedReply IPC code
1642         https://bugs.webkit.org/show_bug.cgi?id=167176
1643
1644         Reviewed by Brady Eidson.
1645
1646         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1647         (WebKit::NetworkConnectionToWebProcess::performSynchronousLoad):
1648         * NetworkProcess/NetworkConnectionToWebProcess.h:
1649         * Platform/IPC/HandleMessage.h:
1650         (IPC::callMemberFunctionImpl):
1651         (IPC::callMemberFunction):
1652         (IPC::handleMessageDelayed):
1653         * Scripts/webkit/messages.py:
1654         (message_to_struct_declaration):
1655         (generate_message_handler):
1656         * UIProcess/Databases/DatabaseProcessProxy.cpp:
1657         (WebKit::DatabaseProcessProxy::getDatabaseProcessConnection):
1658         * UIProcess/Databases/DatabaseProcessProxy.h:
1659         * UIProcess/Network/NetworkProcessProxy.cpp:
1660         (WebKit::NetworkProcessProxy::getNetworkProcessConnection):
1661         (WebKit::NetworkProcessProxy::networkProcessCrashedOrFailedToLaunch):
1662         * UIProcess/Network/NetworkProcessProxy.h:
1663         * UIProcess/Plugins/PluginProcessManager.cpp:
1664         (WebKit::PluginProcessManager::getPluginProcessConnection):
1665         * UIProcess/Plugins/PluginProcessManager.h:
1666         * UIProcess/Plugins/PluginProcessProxy.cpp:
1667         (WebKit::PluginProcessProxy::getPluginProcessConnection):
1668         * UIProcess/Plugins/PluginProcessProxy.h:
1669         * UIProcess/WebPageProxy.cpp:
1670         (WebKit::WebPageProxy::runJavaScriptAlert):
1671         (WebKit::WebPageProxy::runJavaScriptConfirm):
1672         * UIProcess/WebPageProxy.h:
1673         * UIProcess/WebProcessPool.cpp:
1674         (WebKit::WebProcessPool::getNetworkProcessConnection):
1675         (WebKit::WebProcessPool::getDatabaseProcessConnection):
1676         * UIProcess/WebProcessPool.h:
1677         * UIProcess/WebProcessProxy.cpp:
1678         (WebKit::WebProcessProxy::getPluginProcessConnection):
1679         (WebKit::WebProcessProxy::getNetworkProcessConnection):
1680         (WebKit::WebProcessProxy::getDatabaseProcessConnection):
1681         * UIProcess/WebProcessProxy.h:
1682
1683 2017-01-18  Alex Christensen  <achristensen@webkit.org>
1684
1685         Fix CMake build.
1686
1687         * PlatformMac.cmake:
1688
1689 2017-01-18  Megan Gardner  <megan_gardner@apple.com>
1690
1691         Ignore Connection Assertion if we are not using connection to send messages
1692         https://bugs.webkit.org/show_bug.cgi?id=167022
1693
1694         Reviewed by Darin Adler.
1695
1696         Ask the process about a particular connection rather that getting it and making the     
1697         comparison ourselves. 
1698
1699         * UIProcess/ChildProcessProxy.h:
1700         (WebKit::ChildProcessProxy::hasConnection):
1701         Check to see the the ProcessProxy has this particular connection. This get around the assert
1702         that we would run into when just requesting the connection directly.
1703         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
1704         (WebKit::WebPasteboardProxy::setPasteboardPathnamesForType):
1705         Use the new check instead of getting the raw connection.
1706
1707 2017-01-18  Andreas Kling  <akling@apple.com>
1708
1709         Document::securityOrigin() should return a reference.
1710         <https://webkit.org/b/167124>
1711
1712         Reviewed by Sam Weinig.
1713
1714         * UIProcess/Storage/StorageManager.cpp:
1715         (WebKit::StorageManager::createTransientLocalStorageMap):
1716         * WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp:
1717         (WebKit::GeolocationPermissionRequestManager::startRequestForGeolocation):
1718         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
1719         (WKBundleFrameCopySecurityOrigin):
1720         * WebProcess/Plugins/PluginView.cpp:
1721         (WebKit::PluginView::storageBlockingStateChanged):
1722         (WebKit::PluginView::performFrameLoadURLRequest):
1723         (WebKit::PluginView::isPrivateBrowsingEnabled):
1724         * WebProcess/Plugins/WebPluginInfoProvider.cpp:
1725         (WebKit::WebPluginInfoProvider::getWebVisiblePluginInfo):
1726         * WebProcess/Storage/StorageAreaMap.cpp:
1727         (WebKit::StorageAreaMap::dispatchSessionStorageEvent):
1728         (WebKit::StorageAreaMap::dispatchLocalStorageEvent):
1729         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1730         (WebKit::WebChromeClient::exceededDatabaseQuota):
1731         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1732         (WebKit::WebFrameLoaderClient::didRunInsecureContent):
1733         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1734         * WebProcess/WebPage/WebFrame.cpp:
1735         (WebKit::WebFrame::allowsFollowingLink):
1736
1737 2017-01-18  Antoine Quint  <graouts@apple.com>
1738
1739         [Modern Media Controls] Turn modern media controls on by default
1740         https://bugs.webkit.org/show_bug.cgi?id=165668
1741
1742         Reviewed by Dean Jackson.
1743
1744         Use DEFAULT_EXPERIMENTAL_FEATURES_ENABLED as the default value for modern media controls, which is true.
1745
1746         * Shared/WebPreferencesDefinitions.h:
1747
1748 2017-01-15  Darin Adler  <darin@apple.com>
1749
1750         Remove PassRefPtr from "loader" directory of WebCore
1751         https://bugs.webkit.org/show_bug.cgi?id=167055
1752
1753         Reviewed by Alex Christensen.
1754
1755         * Shared/APIWebArchive.h: Use RefPtr&& instead of PassRefPtr.
1756         * Shared/APIWebArchive.mm:
1757         (API::WebArchive::create): Ditto.
1758         (API::WebArchive::WebArchive): Ditto.
1759         (API::WebArchive::subresources): Ditto.
1760         (API::WebArchive::subframeArchives): Ditto.
1761
1762         * Shared/TextCheckerState.h: Initialize data members so classes
1763         using this won't have to explicitly initalize them.
1764
1765         * UIProcess/WebIconDatabase.cpp:
1766         (WebKit::WebIconDatabase::setIconDataForIconURL): Pass a raw
1767         pointer to WebCore.
1768
1769         * UIProcess/WebPageProxy.h: Removed forward declaration of
1770         StringPairVector, not needed here.
1771
1772         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
1773         (WebKit::WebIconDatabaseProxy::WebIconDatabaseProxy): Take a reference.
1774         (WebKit::WebIconDatabaseProxy::retainIconForPageURL): Updated for reference.
1775         (WebKit::WebIconDatabaseProxy::releaseIconForPageURL): Ditto.
1776         (WebKit::WebIconDatabaseProxy::synchronousIconForPageURL): Ditto.
1777         (WebKit::WebIconDatabaseProxy::loadDecisionForIconURL): Ditto.
1778         (WebKit::WebIconDatabaseProxy::receivedIconLoadDecision): Ditto.
1779         (WebKit::WebIconDatabaseProxy::iconDataForIconURL): Ditto.
1780         (WebKit::WebIconDatabaseProxy::setIconURLForPageURL): Ditto.
1781         (WebKit::WebIconDatabaseProxy::setIconDataForIconURL): Ditto.
1782         * WebProcess/IconDatabase/WebIconDatabaseProxy.h: Updated for the above.
1783         Marked the class final, made most functions private and final.
1784
1785         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
1786         (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
1787         Removed assertion that a pointer is non-null since that pointer is now a
1788         reference. Left use of PassRefPtr here for now.z
1789
1790         * WebProcess/Network/WebLoaderStrategy.cpp:
1791         (WebKit::WebLoaderStrategy::scheduleLoad): Updated since application cache
1792         host is now a reference rather thna a pointer.
1793         * WebProcess/Network/WebResourceLoader.cpp:
1794         (WebKit::WebResourceLoader::willSendRequest): Ditto.
1795         (WebKit::WebResourceLoader::didReceiveResponse): Ditto.
1796         (WebKit::WebResourceLoader::didFailResourceLoad): Ditto.
1797
1798         * WebProcess/Plugins/PluginView.cpp:
1799         (WebKit::buildHTTPHeaders): Got rid of unneeded use of String::format.
1800         (WebKit::PluginView::create): Take a reference instead of PassRefPtr.
1801         (WebKit::PluginView::PluginView): Ditto. Also moved much of the data
1802         member initialization to the class definition.
1803         (WebKit::PluginView::recreateAndInitialize): Take Ref&& instead of PassRefPtr.
1804         (WebKit::PluginView::manualLoadDidReceiveResponse): Updated for change to
1805         ManualStreamState enumeration.
1806         (WebKit::PluginView::manualLoadDidReceiveData): Ditto.
1807         (WebKit::PluginView::manualLoadDidFinishLoading Ditto.):
1808         (WebKit::PluginView::manualLoadDidFail): Ditto.
1809         (WebKit::PluginView::liveResourceData): Return RefPtr insead of PassRefPtr.
1810         (WebKit::PluginView::redeliverManualStream): Updated for ManualStreamState.
1811         * WebProcess/Plugins/PluginView.h: Updated for the above. Also changed
1812         ManualStreamState into an enum class.
1813
1814         * WebProcess/WebCoreSupport/WebChromeClient.cpp: Changed m_page to a reference.
1815         (WebKit::WebChromeClient::runOpenPanel): Take both arguments as references.
1816         * WebProcess/WebCoreSupport/WebChromeClient.h: Updated for the above.
1817
1818         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
1819         (WebKit::WebEditorClient::registerUndoStep): Take reference instead of PassRefPtr.
1820         (WebKit::WebEditorClient::registerRedoStep): Ditto.
1821         * WebProcess/WebCoreSupport/WebEditorClient.h: Updated for the above
1822
1823         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1824         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
1825         Updated for change to FrameLoaderClient.
1826         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Ditto.
1827         (WebKit::WebFrameLoaderClient::dispatchWillSendSubmitEvent): Ditto.
1828         (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm): Ditto.
1829         (WebKit::WebFrameLoaderClient::createFrame): Ditto.
1830         (WebKit::WebFrameLoaderClient::createPlugin): Ditto.
1831         (WebKit::WebFrameLoaderClient::recreatePlugin): Ditto.
1832         (WebKit::WebFrameLoaderClient::createJavaAppletWidget): Ditto.
1833         (WebKit::WebFrameLoaderClient::createNetworkingContext): Ditto.
1834         (WebKit::WebFrameLoaderClient::didRequestAutocomplete): Ditto.
1835         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: Updated for the above.
1836
1837         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
1838         (WebKit::WebChromeClient::didReceiveMobileDocType): Updated since m_page is a
1839         reference now.
1840         (WebKit::WebChromeClient::observedContentChange): Ditto.
1841         (WebKit::WebChromeClient::notifyRevealedSelectionByScrollingFrame): Ditto.
1842         (WebKit::WebChromeClient::didLayout): Ditto.
1843         (WebKit::WebChromeClient::didStartOverflowScroll): Ditto.
1844         (WebKit::WebChromeClient::didEndOverflowScroll): Ditto.
1845         (WebKit::WebChromeClient::hasStablePageScaleFactor): Ditto.
1846         (WebKit::WebChromeClient::showPlaybackTargetPicker): Ditto.
1847         (WebKit::WebChromeClient::eventThrottlingDelay): Ditto.
1848         (WebKit::WebChromeClient::deviceOrientation): Ditto.
1849
1850         * WebProcess/WebPage/WebPage.cpp:
1851         (WebKit::WebPage::WebPage): Pass reference.
1852         (WebKit::WebPage::createPlugin): Return RefPtr instead of PassRefPtr.
1853         (WebKit::WebPage::fromCorePage): Updated for change to WebChromeClient.
1854         (WebKit::WebPage::setHeaderPageBanner): Take pointer instead of PassRefPtr.
1855         (WebKit::WebPage::setFooterPageBanner): Ditto.
1856         (WebKit::WebPage::setActiveOpenPanelResultListener): Take Ref&& instead of
1857         PassRefPtr.
1858         (WebKit::WebPage::currentSelectionAsRange): Return RefPtr instead of PassRefPtr.
1859         (WebKit::WebPage::rangeFromEditingRange): Ditto.
1860         * WebProcess/WebPage/WebPage.h: Updated for the above.
1861
1862         * WebProcess/WebPage/efl/WebPageEfl.cpp:
1863         (WebKit::WebPage::cachedResponseDataForURL): Return RefPtr instead of PassRefPtr.
1864         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
1865         (WebKit::WebPage::cachedResponseDataForURL): Ditto.
1866         * WebProcess/WebPage/ios/WebPageIOS.mm:
1867         (WebKit::WebPage::cachedResponseDataForURL): Ditto.
1868         * WebProcess/WebPage/mac/WebPageMac.mm:
1869         (WebKit::WebPage::cachedResponseDataForURL): Ditto.
1870         (WebKit::WebPage::setTopOverhangImage): Take raw pointer instead of PassRefPtr.
1871         (WebKit::WebPage::setBottomOverhangImage): Ditto.
1872
1873         * WebProcess/WebProcess.cpp:
1874         (WebKit::WebProcess::WebProcess): Pass a reference. Move most initialization to
1875         the class definition.
1876         * WebProcess/WebProcess.h: Updaed for the above.
1877
1878 2017-01-17  Michael Catanzaro  <mcatanzaro@igalia.com>
1879
1880         Unreviewed, rolling out r210834
1881         https://bugs.webkit.org/show_bug.cgi?id=165668
1882
1883         It introduced dozens of test timeouts.
1884
1885         Reverted changeset:
1886         "[Modern Media Controls] Turn modern media controls on by default"
1887         https://bugs.webkit.org/show_bug.cgi?id=165668
1888         http://trac.webkit.org/changeset/210834
1889
1890 2017-01-17  Antti Koivisto  <antti@apple.com>
1891
1892         Persist derived data
1893         https://bugs.webkit.org/show_bug.cgi?id=167136
1894
1895         Reviewed by Andreas Kling.
1896
1897         Add a mechanism for storing arbitrary data into disk cache.
1898
1899         From WebCore level data can be stored using
1900
1901             loaderStrategy()->storeDerivedDataToCache(key, partition, type, data);
1902
1903         The data is keyed with the body hash of a network resource. It can be retrieved along
1904         with the resource by specifying the type in ResourceLoaderOptions. If a related data
1905         blob is found it will be deliver via CachedResource::didRetrieveDerivedDataFromCache()
1906         callback.
1907
1908         This patch adds the mechanism but doesn't yet use it for anything.
1909
1910         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1911         (WebKit::NetworkConnectionToWebProcess::storeDerivedDataToCache):
1912         * NetworkProcess/NetworkConnectionToWebProcess.h:
1913         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1914         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1915         (WebKit::NetworkResourceLoadParameters::encode):
1916         (WebKit::NetworkResourceLoadParameters::decode):
1917         * NetworkProcess/NetworkResourceLoadParameters.h:
1918         * NetworkProcess/NetworkResourceLoader.cpp:
1919         (WebKit::NetworkResourceLoader::didRetrieveCacheEntry):
1920
1921             Look for related resources to return if needed.
1922
1923         (WebKit::NetworkResourceLoader::sendResultForCacheEntry):
1924         * NetworkProcess/NetworkResourceLoader.h:
1925         * NetworkProcess/cache/NetworkCache.cpp:
1926         (WebKit::NetworkCache::resourceType):
1927          (WebKit::NetworkCache::Cache::retrieveData):
1928         (WebKit::NetworkCache::Cache::storeData):
1929         (WebKit::NetworkCache::Cache::makeCacheKey): Deleted.
1930         * NetworkProcess/cache/NetworkCache.h:
1931         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1932         (WebKit::NetworkCache::Entry::encodeAsStorageRecord):
1933         (WebKit::NetworkCache::Entry::decodeStorageRecord):
1934         * NetworkProcess/cache/NetworkCacheKey.cpp:
1935         (WebKit::NetworkCache::Key::Key):
1936         * NetworkProcess/cache/NetworkCacheKey.h:
1937         (WebKit::NetworkCache::DataKey::encode):
1938         (WebKit::NetworkCache::DataKey::decode):
1939         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1940         (WebKit::NetworkCache::Storage::readRecord):
1941         (WebKit::NetworkCache::Storage::traverse):
1942         * NetworkProcess/cache/NetworkCacheStorage.h:
1943
1944             Return body hash with the Record.
1945
1946         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
1947         (WebKit::NetworkCache::SubresourcesEntry::encodeAsStorageRecord):
1948         * Platform/IPC/ArgumentCoders.cpp:
1949         (IPC::ArgumentCoder<SHA1::Digest>::encode):
1950         (IPC::ArgumentCoder<SHA1::Digest>::decode):
1951         * Platform/IPC/ArgumentCoders.h:
1952         * WebProcess/Network/WebLoaderStrategy.cpp:
1953         (WebKit::WebLoaderStrategy::scheduleLoad):
1954         (WebKit::WebLoaderStrategy::storeDerivedDataToCache):
1955         * WebProcess/Network/WebLoaderStrategy.h:
1956         * WebProcess/Network/WebResourceLoader.cpp:
1957         (WebKit::WebResourceLoader::didRetrieveDerivedData):
1958         * WebProcess/Network/WebResourceLoader.h:
1959         * WebProcess/Network/WebResourceLoader.messages.in:
1960
1961 2017-01-17  Antoine Quint  <graouts@apple.com>
1962
1963         [Modern Media Controls] Turn modern media controls on by default
1964         https://bugs.webkit.org/show_bug.cgi?id=165668
1965
1966         Reviewed by Dean Jackson.
1967
1968         Use DEFAULT_EXPERIMENTAL_FEATURES_ENABLED as the default value for modern media controls, which is true.
1969
1970         * Shared/WebPreferencesDefinitions.h:
1971
1972 2017-01-17  Joseph Pecoraro  <pecoraro@apple.com>
1973
1974         ENABLE(USER_TIMING) Not Defined for Apple Windows or OS X Ports
1975         https://bugs.webkit.org/show_bug.cgi?id=116551
1976         <rdar://problem/13949830>
1977
1978         Reviewed by Alex Christensen.
1979
1980         * Configurations/FeatureDefines.xcconfig:
1981
1982 2017-01-17  Filip Pizlo  <fpizlo@apple.com>
1983
1984         JSCell::classInfo() shouldn't have a bunch of mitigations for being called during destruction
1985         https://bugs.webkit.org/show_bug.cgi?id=167066
1986
1987         Reviewed by Keith Miller and Michael Saboff.
1988         
1989         Just remove now-erroneous use of jsCast<>.
1990
1991         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
1992         (WebKit::NPRuntimeObjectMap::finalize):
1993
1994 2017-01-17  Joseph Pecoraro  <pecoraro@apple.com>
1995
1996         Remove unnecessary includes
1997         https://bugs.webkit.org/show_bug.cgi?id=167114
1998
1999         Reviewed by Alex Christensen.
2000
2001         * WebProcess/WebPage/ios/WebPageIOS.mm:
2002
2003 2017-01-17  Brady Eidson  <beidson@apple.com>
2004
2005         An update to one gamepad's values should only change that gamepad's modified timestamp.
2006         <rdar://problem/28620865> and https://bugs.webkit.org/show_bug.cgi?id=167139
2007
2008         Reviewed by Andy Estes.
2009
2010         Track the lastModifiedTime for a gamepad in the UI process, and pass it along to web processes.
2011
2012         * Shared/Gamepad/GamepadData.cpp:
2013         (WebKit::GamepadData::GamepadData):
2014         (WebKit::GamepadData::encode):
2015         (WebKit::GamepadData::decode):
2016         * Shared/Gamepad/GamepadData.h:
2017         (WebKit::GamepadData::lastUpdateTime):
2018
2019         * UIProcess/Gamepad/UIGamepad.cpp:
2020         (WebKit::UIGamepad::UIGamepad):
2021         (WebKit::UIGamepad::updateFromPlatformGamepad):
2022         (WebKit::UIGamepad::condensedGamepadData):
2023         (WebKit::UIGamepad::fullGamepadData):
2024         * UIProcess/Gamepad/UIGamepad.h:
2025
2026         * WebProcess/Gamepad/WebGamepad.cpp:
2027         (WebKit::WebGamepad::updateValues):
2028
2029 2017-01-17  Anders Carlsson  <andersca@apple.com>
2030
2031         It's not possible to perform a POST request with HTTPBody content in a WKWebView
2032         https://bugs.webkit.org/show_bug.cgi?id=167131
2033         rdar://problem/20464240
2034
2035         Reviewed by Beth Dakin.
2036
2037         Encode/decode the form data if necessary.
2038
2039         * Shared/LoadParameters.cpp:
2040         (WebKit::LoadParameters::encode):
2041         (WebKit::LoadParameters::decode):
2042
2043 2017-01-17  Joseph Pecoraro  <pecoraro@apple.com>
2044
2045         Crash when closing tab with debugger paused
2046         https://bugs.webkit.org/show_bug.cgi?id=161746
2047         <rdar://problem/15607819>
2048
2049         Reviewed by Brian Burg and Brent Fulgham.
2050
2051         * WebProcess/WebPage/WebPage.cpp:
2052         (WebKit::DeferredPageDestructor::createDeferredPageDestructor):
2053         (WebKit::DeferredPageDestructor::DeferredPageDestructor):
2054         (WebKit::DeferredPageDestructor::tryDestruction):
2055         (WebKit::WebPage::close):
2056         Defer destruction of the Page and WebPage if we are in a nested runloop.
2057         Also, proactively close all inspector frontends, including remote frontends.
2058
2059         * WebProcess/WebPage/ios/WebPageIOS.mm:
2060         (WebKit::WebPage::handleSyntheticClick):
2061         (WebKit::WebPage::completeSyntheticClick):
2062         Return early in some cases where a nested run loop may have closed
2063         the WebPage on us while handling JavaScript events.
2064
2065 2017-01-16  Joseph Pecoraro  <pecoraro@apple.com>
2066
2067         Remove the REQUEST_ANIMATION_FRAME flag
2068         https://bugs.webkit.org/show_bug.cgi?id=156980
2069         <rdar://problem/25906849>
2070
2071         Reviewed by Simon Fraser.
2072
2073         * Configurations/FeatureDefines.xcconfig:
2074         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2075         * WebProcess/WebCoreSupport/WebChromeClient.h:
2076         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
2077         (WebKit::CompositingCoordinator::syncDisplayState):
2078         (WebKit::CompositingCoordinator::nextAnimationServiceTime):
2079         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
2080         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2081         (WebKit::CoordinatedLayerTreeHost::scheduleAnimation):
2082         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
2083         * WebProcess/WebPage/LayerTreeHost.h:
2084
2085 2017-01-16  Carlos Garcia Campos  <cgarcia@igalia.com>
2086
2087         [SOUP] Accept-language could be set twice in a row for the default context
2088         https://bugs.webkit.org/show_bug.cgi?id=167089
2089
2090         Reviewed by Žan Doberšek.
2091
2092         * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
2093         (WebKit::CustomProtocolManager::registerScheme): Use NetworkStorageSession::getOrCreateSoupNetworkSession().
2094         * NetworkProcess/efl/NetworkProcessMainEfl.cpp:
2095         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2096         (WebKit::NetworkProcess::userPreferredLanguagesChanged): Only set the languages if NetworkStorageSession has a
2097         SoupNetworkSession.
2098         * NetworkProcess/soup/NetworkSessionSoup.cpp:
2099         (WebKit::NetworkSessionSoup::soupSession): Use NetworkStorageSession::getOrCreateSoupNetworkSession().
2100         * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
2101         (WebKit::WebCookieManager::setCookiePersistentStorage): Ditto.
2102         * WebProcess/efl/WebProcessMainEfl.cpp:
2103
2104 2017-01-16  Carlos Garcia Campos  <cgarcia@igalia.com>
2105
2106         [SOUP] Fix handling of accept language property
2107         https://bugs.webkit.org/show_bug.cgi?id=166969
2108
2109         Reviewed by Michael Catanzaro.
2110
2111         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2112         (WebKit::buildAcceptLanguages): Moved from WebCore.
2113         (WebKit::NetworkProcess::userPreferredLanguagesChanged): Build the accept language string from the vector and
2114         pass set it to SoupNetworkSession to be used for new sessions, and also to all other existing sessions.
2115
2116 2017-01-14  Tim Horton  <timothy_horton@apple.com>
2117
2118         Remove unused WKView initializer parameter
2119         https://bugs.webkit.org/show_bug.cgi?id=167046
2120
2121         Reviewed by Dan Bernstein.
2122
2123         * UIProcess/API/mac/WKView.mm:
2124         (-[WKView initWithFrame:processPool:configuration:]):
2125         (-[WKView initWithFrame:contextRef:pageGroupRef:relatedToPage:]):
2126         (-[WKView initWithFrame:configurationRef:]):
2127         (-[WKView initWithFrame:processPool:configuration:webView:]): Deleted.
2128         * UIProcess/API/mac/WKViewInternal.h:
2129         Ever since WKWebView stopped having WKView inside it, this parameter
2130         has never been used. Now, it only leads to confusion.
2131
2132 2017-01-13  Joseph Pecoraro  <pecoraro@apple.com>
2133
2134         Remove ENABLE(DETAILS_ELEMENT) guards
2135         https://bugs.webkit.org/show_bug.cgi?id=167042
2136
2137         Reviewed by Alex Christensen.
2138
2139         * Configurations/FeatureDefines.xcconfig:
2140
2141 2017-01-13  Brady Eidson  <beidson@apple.com>
2142
2143         Crash when visiting a webpage that uses Gamepads in a new WebProcess after a previous page has used gamepads..
2144         https://bugs.webkit.org/show_bug.cgi?id=167033
2145
2146         Reviewed by Alex Christensen.
2147
2148         * UIProcess/Gamepad/UIGamepadProvider.cpp:
2149         (WebKit::UIGamepadProvider::processPoolStartedUsingGamepads): Don't schedule a state update here.
2150         (WebKit::UIGamepadProvider::processPoolStoppedUsingGamepads): Ditto.
2151         * UIProcess/Gamepad/UIGamepadProvider.h:
2152         
2153         * UIProcess/WebProcessPool.cpp:
2154         (WebKit::WebProcessPool::startedUsingGamepads): Populate the WebProcess with initial gamepads.
2155
2156 2017-01-11  Darin Adler  <darin@apple.com>
2157
2158         Remove PassRefPtr from more of "platform"
2159         https://bugs.webkit.org/show_bug.cgi?id=166809
2160
2161         Reviewed by Sam Weinig.
2162
2163         * Shared/CoordinatedGraphics/CoordinatedGraphicsArgumentCoders.cpp:
2164         (IPC::ArgumentCoder<TextureMapperAnimation>::encode): Updated since timing function
2165         returns a raw pointer.
2166         (IPC::ArgumentCoder<TextureMapperAnimation>::decode): Updated since timing function
2167         setters now takes an rvalue reference.
2168
2169         * WebProcess/Plugins/PDF/DeprecatedPDFPlugin.mm:
2170         (WebKit::PDFPlugin::createScrollbar): Updated since addChild now takes a reference.
2171
2172 2017-01-13  Chris Dumez  <cdumez@apple.com>
2173
2174         [WK2] Add diagnostic logging to measure WebGL usage
2175         https://bugs.webkit.org/show_bug.cgi?id=166730
2176         <rdar://problem/29883469>
2177
2178         Reviewed by Alex Christensen.
2179
2180         Add diagnostic logging to measure high performance WebGL usage. We report
2181         at regular intervals in which WebGL state Safari is:
2182         - Inactive
2183         - ActiveInForegroundTab
2184         - ActiveInBackgroundTabOnly
2185
2186         This should give us an estimate of:
2187         - What % of the time is Safari using high performance graphics
2188         - What % of this time is only due to background tabs
2189
2190         * UIProcess/HighPerformanceGraphicsUsageSampler.cpp: Added.
2191         (WebKit::HighPerformanceGraphicsUsageSampler::HighPerformanceGraphicsUsageSampler):
2192         (WebKit::HighPerformanceGraphicsUsageSampler::timerFired):
2193         * UIProcess/HighPerformanceGraphicsUsageSampler.h: Copied from Source/WebCore/platform/graphics/GraphicsContext3DAttributes.h.
2194         * UIProcess/WebPageProxy.h:
2195         (WebKit::WebPageProxy::setIsUsingHighPerformanceWebGL):
2196         (WebKit::WebPageProxy::isUsingHighPerformanceWebGL):
2197         * UIProcess/WebPageProxy.messages.in:
2198         * UIProcess/WebProcessPool.cpp:
2199         (WebKit::m_highPerformanceGraphicsUsageSampler):
2200         * UIProcess/WebProcessPool.h:
2201         * WebKit2.xcodeproj/project.pbxproj:
2202         * WebProcess/WebPage/WebPage.cpp:
2203         (WebKit::m_userInterfaceLayoutDirection):
2204
2205 2017-01-13  Matt Rajca  <mrajca@apple.com>
2206
2207         Defer use of autoplay heuristics to clients
2208         https://bugs.webkit.org/show_bug.cgi?id=167010
2209
2210         Reviewed by Alex Christensen.
2211
2212         Switch the autoplay policy tristate to an on/off option since clients should run any
2213         heuristics and simply send their final decision to WebKit.
2214
2215         * Shared/WebsitePolicies.h:
2216         (WebKit::WebsitePolicies::encode):
2217         (WebKit::WebsitePolicies::decode):
2218         * UIProcess/API/APIWebsitePolicies.h:
2219         * UIProcess/API/C/WKWebsitePolicies.cpp:
2220         (WKWebsitePoliciesGetAutoplayEnabled):
2221         (WKWebsitePoliciesSetAutoplayEnabled):
2222         (WKWebsitePoliciesGetAutoplayPolicy): Replaced.
2223         (WKWebsitePoliciesSetAutoplayPolicy): Replaced.
2224         * UIProcess/API/C/WKWebsitePolicies.h:
2225         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
2226         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
2227         (-[_WKWebsitePolicies setAutoplayEnabled:]):
2228         (-[_WKWebsitePolicies autoplayEnabled]):
2229         (-[_WKWebsitePolicies setAutoplayPolicy:]): Replaced.
2230         (-[_WKWebsitePolicies autoplayPolicy]): Replaced.
2231
2232 2017-01-13  Carlos Garcia Campos  <cgarcia@igalia.com>
2233
2234         [SOUP] Simplify cookie storage handling
2235         https://bugs.webkit.org/show_bug.cgi?id=166967
2236
2237         Reviewed by Sergio Villar Senin.
2238
2239         Get the SoupSession from NetworkStorageSession::defaultStorageSession().
2240
2241         * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp:
2242         (WebKit::CustomProtocolManager::registerScheme): Get the SoupSession from NetworkStorageSession::defaultStorageSession().
2243         * NetworkProcess/efl/NetworkProcessMainEfl.cpp: Ditto.
2244         * NetworkProcess/soup/NetworkProcessSoup.cpp:
2245         (WebKit::NetworkProcess::userPreferredLanguagesChanged): Ditto.
2246         (WebKit::NetworkProcess::platformInitializeNetworkProcess): SoupNetworkSession::clearOldSoupCache is static.
2247         * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
2248         (WebKit::WebCookieManager::platformGetHTTPCookieAcceptPolicy): Use the cookie storage from NetworkStorageSession::defaultStorageSession().
2249         (WebKit::WebCookieManager::setCookiePersistentStorage): Ditto.
2250         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
2251         (WebKit::WebFrameNetworkingContext::setCookieAcceptPolicyForAllContexts): Ditto.
2252         * WebProcess/efl/WebProcessMainEfl.cpp:
2253
2254 2017-01-12  Carlos Garcia Campos  <cgarcia@igalia.com>
2255
2256         [SOUP] Do not use the legacy session ID in WebFrameNetworkingContext::storageSession()
2257         https://bugs.webkit.org/show_bug.cgi?id=166970
2258
2259         Reviewed by Sergio Villar Senin.
2260
2261         Get the session for the current page instead.
2262
2263         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
2264         (WebKit::WebFrameNetworkingContext::storageSession):
2265
2266 2017-01-12  Joseph Pecoraro  <pecoraro@apple.com>
2267
2268         Remove unnecessary includes of Page.h
2269         https://bugs.webkit.org/show_bug.cgi?id=166996
2270
2271         Reviewed by Yusuke Suzuki.
2272
2273         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
2274
2275 2017-01-12  Chris Dumez  <cdumez@apple.com>
2276
2277         Add KEYBOARD_KEY_ATTRIBUTE / KEYBOARD_CODE_ATTRIBUTE to FeatureDefines.xcconfig
2278         https://bugs.webkit.org/show_bug.cgi?id=166995
2279
2280         Reviewed by Jer Noble.
2281
2282         Add KEYBOARD_KEY_ATTRIBUTE / KEYBOARD_CODE_ATTRIBUTE to FeatureDefines.xcconfig
2283         as some people are having trouble building without it.
2284
2285         * Configurations/FeatureDefines.xcconfig:
2286         * Shared/WebKeyboardEvent.cpp:
2287         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
2288
2289 2017-01-12  Chris Dumez  <cdumez@apple.com>
2290
2291         [iOS] HTML form validation popover sometimes does not go away
2292         https://bugs.webkit.org/show_bug.cgi?id=166990
2293         <rdar://problem/29985957>
2294
2295         Reviewed by Tim Horton.
2296
2297         Update code using ValidationBubble now that it is RefCounted.
2298
2299         * UIProcess/PageClient.h:
2300         * UIProcess/WebPageProxy.h:
2301         * UIProcess/ios/PageClientImplIOS.h:
2302         * UIProcess/ios/PageClientImplIOS.mm:
2303         (WebKit::PageClientImpl::createValidationBubble):
2304         * UIProcess/mac/PageClientImpl.h:
2305         * UIProcess/mac/PageClientImpl.mm:
2306         (WebKit::PageClientImpl::createValidationBubble):
2307
2308 2017-01-12  Enrica Casucci  <enrica@apple.com>
2309
2310         Do not allow selection of editable content when not editing.
2311         https://bugs.webkit.org/show_bug.cgi?id=166897
2312         <rdar://problem/29388806>
2313
2314         Reviewed by Tim Horton.
2315
2316         Test: fast/events/touch/ios/long-press-on-editable.html
2317
2318         When retrieving the position information, we should not consider
2319         as candidates for selection editable elements, since this is only
2320         used for non editable selections.
2321
2322         * WebProcess/WebPage/ios/WebPageIOS.mm:
2323         (WebKit::isAssistableElement): Moved within the file.
2324         (WebKit::WebPage::getPositionInformation):
2325
2326 2017-01-12  Megan Gardner  <megan_gardner@apple.com>
2327
2328         Double Check URLs on UI side before putting in pasteboard
2329         https://bugs.webkit.org/show_bug.cgi?id=166945
2330         <rdar://problem/11187315>
2331
2332         Reviewed by Tim Horton.
2333
2334         Check URLs sent from the web process before putting the on pasteboard.
2335
2336         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2337         (WebKit::WebPasteboardProxy::setPasteboardPathnamesForType):
2338         Add a check to make sure the URLs we've received are valid and not compromising to the user's system.
2339
2340         * UIProcess/WebPasteboardProxy.cpp:
2341         (WebKit::WebPasteboardProxy::addWebProcessProxy):
2342         Keep track of the webProcesses associated with the pasteboard proxies specifically, so that we can
2343         use it to check the URLs before putting them on pasteboard.
2344         (WebKit::WebPasteboardProxy::removeWebProcessProxy):
2345         Remove dead webProcesses.
2346
2347         * UIProcess/WebPasteboardProxy.h:
2348         * UIProcess/WebPasteboardProxy.messages.in:
2349         Allow for the connection to be passed in, so that we can determine which webProcess we need to
2350         check the URLs of.
2351
2352         * UIProcess/WebProcessProxy.cpp:
2353         (WebKit::WebProcessProxy::~WebProcessProxy):
2354         Make sure to remove WebProcessProxys from the list stored in WebPasteboardProxy
2355
2356 2017-01-12  Chris Dumez  <cdumez@apple.com>
2357
2358         [iOS] Implement support for KeyboardEvent.code
2359         https://bugs.webkit.org/show_bug.cgi?id=166932
2360         <rdar://problem/29972518>
2361
2362         Reviewed by Darin Adler.
2363
2364         Make sure KeyboardEvent.code is properly initialized on
2365         iOS WK2.
2366
2367         * Shared/WebEvent.h:
2368         * Shared/WebKeyboardEvent.cpp:
2369         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
2370         * Shared/ios/WebIOSEventFactory.mm:
2371         (WebIOSEventFactory::createWebKeyboardEvent):
2372
2373 2017-01-12  Andreas Kling  <akling@apple.com>
2374
2375         WebBackForwardListProxy should remove restored session history items from PageCache on close.
2376         <https://webkit.org/b/166972>
2377         <rdar://problem/28904157>
2378
2379         Reviewed by Brady Eidson.
2380
2381         Register history item ID's from the UIProcess with the associated-items map
2382         so that we can remove any PageCache entries associated with them immediately
2383         when closing a WebPage.
2384
2385         Otherwise they might not get removed until the next PageCache pruning happens.
2386         This patch is a speculative fix for what looks like it might be weirdness
2387         related to a PageCache entry outliving its originating Page.
2388
2389         * WebProcess/WebPage/WebBackForwardListProxy.cpp:
2390         (WebKit::WebBackForwardListProxy::addItemFromUIProcess):
2391         * WebProcess/WebPage/WebBackForwardListProxy.h:
2392         * WebProcess/WebPage/WebPage.cpp:
2393         (WebKit::WebPage::restoreSessionInternal):
2394
2395 2017-01-12  Michael Catanzaro  <mcatanzaro@igalia.com>
2396
2397         [GTK] Correct license on WebKitSecurityOrigin headers
2398
2399         These ought to be LGPLv2+, because the rest of the GTK+ API is LPGLv2+.
2400
2401         * UIProcess/API/gtk/WebKitSecurityOrigin.cpp:
2402         * UIProcess/API/gtk/WebKitSecurityOrigin.h:
2403         * UIProcess/API/gtk/WebKitSecurityOriginPrivate.h:
2404
2405 2017-01-12  Eric Carlson  <eric.carlson@apple.com>
2406
2407         [MediaStream, Mac] Render media stream audio buffers
2408         https://bugs.webkit.org/show_bug.cgi?id=159836
2409         <rdar://problem/27380390>
2410
2411         Unreviewed, revert accidental change.
2412
2413         * WebProcess/com.apple.WebProcess.sb.in:
2414
2415 2017-01-11  Brady Eidson  <beidson@apple.com>
2416
2417         Add IconLoadingDelegate functionality to WKView.
2418         https://bugs.webkit.org/show_bug.cgi?id=166951
2419
2420         Reviewed by Tim Horton.
2421         
2422         * UIProcess/API/mac/WKView.mm:
2423         (-[WKView dealloc]):
2424         (-[WKView maybeInstallIconLoadingClient]): If the subclass implements the delegate method, install the
2425           icon loading client. Otherwise, maintain the normal IconDatabase loading behavior.
2426         (-[WKView initWithFrame:processPool:configuration:webView:]):
2427
2428 2017-01-11  Brent Fulgham  <bfulgham@apple.com>
2429
2430         [WK2][Cocoa] Avoid null dereference in FullScreen code.
2431         https://bugs.webkit.org/show_bug.cgi?id=166957
2432         <rdar://problem/27745004>
2433
2434         Reviewed by Eric Carlson.
2435
2436         * WebProcess/cocoa/WebVideoFullscreenManager.mm:
2437         (WebKit::WebVideoFullscreenManager::didSetupFullscreen): Use protected reference to 'this', and check for valid
2438         page before attempting to use it.
2439
2440 2017-01-11  Anders Carlsson  <andersca@apple.com>
2441
2442         navigator.plugins.refresh and WKContextRefreshPlugIns doesn't pick up changes to already-present plug-ins
2443         https://bugs.webkit.org/show_bug.cgi?id=166942
2444         rdar://problem/29839194
2445
2446         Reviewed by Sam Weinig.
2447
2448         Use _CFBundleCreateUnique so the resulting bundle won't be cached.
2449
2450         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
2451         (WebKit::NetscapePluginModule::getPluginInfo):
2452
2453 2017-01-11  Anders Carlsson  <andersca@apple.com>
2454
2455         REGRESSION: Crash in com.apple.WebKit: IPC::Connection::sendMessage(std::__1::unique_ptr<IPC::MachMessage, std::__1::default_delete<IPC::MachMessage> >) + 27
2456         https://bugs.webkit.org/show_bug.cgi?id=165854
2457         rdar://problem/29757269
2458
2459         Reviewed by Tim Horton.
2460
2461         * Platform/IPC/mac/ConnectionMac.mm:
2462         (IPC::Connection::sendMessage):
2463         Add assertion.
2464
2465         (IPC::Connection::initializeSendSource):
2466         Turns out the event handler can be called spuriously, so guard against that.
2467
2468 2017-01-11  Chris Dumez  <cdumez@apple.com>
2469
2470         [iOS][WK2] KeyboardEvent.key always returns an empty string
2471         https://bugs.webkit.org/show_bug.cgi?id=166918
2472         <rdar://problem/29861147>
2473
2474         Reviewed by Wenson Hsieh.
2475
2476         Make sure that KeyboardEvent.key gets properly initialized on iOS / WK2.
2477
2478         * Shared/WebEvent.h:
2479         * Shared/WebKeyboardEvent.cpp:
2480         (WebKit::WebKeyboardEvent::WebKeyboardEvent):
2481         * Shared/ios/WebIOSEventFactory.mm:
2482         (WebIOSEventFactory::createWebKeyboardEvent):
2483
2484 2017-01-10  Michael Catanzaro  <mcatanzaro@igalia.com>
2485
2486         [GTK] No way for applications to set notification permissions without waiting for permission request
2487         https://bugs.webkit.org/show_bug.cgi?id=163366
2488
2489         Reviewed by Carlos Garcia Campos.
2490
2491         Websites can check the Notification.permission DOM property to check if they have permission
2492         to show notifications *without triggering a permission request*. But the WebKitGTK+ API has
2493         no way to affirmatively indicate notifications are allowed without a permission request. The
2494         only way is via the permission request API, which is too late. It's a problem for Epiphany.
2495         For example, open the Riot Matrix client in a web app; you will immediately see an info bar
2496         informing the user that Riot does not have permission to send desktop notifications, even
2497         though Epiphany automatically grants notification permission in web app mode when requested.
2498         This problem is not exclusive to web apps; there is simply no way for notification
2499         permission to be set correctly prior to a permission request for it. Fix this by introducing
2500         a webkit_web_context_initialize_notification_permissions() API, and add a signal
2501         WebKitWebContext::initialize-notification-permissions to indicate when it should be called.
2502
2503         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
2504         (notificationPermissionsCallback):
2505         (WebKitNotificationProvider::create):
2506         (WebKitNotificationProvider::WebKitNotificationProvider):
2507         (WebKitNotificationProvider::notificationPermissions):
2508         (WebKitNotificationProvider::setNotificationPermissions):
2509         * UIProcess/API/gtk/WebKitNotificationProvider.h:
2510         * UIProcess/API/gtk/WebKitSecurityOrigin.cpp:
2511         (webkitSecurityOriginGetSecurityOrigin):
2512         * UIProcess/API/gtk/WebKitSecurityOriginPrivate.h:
2513         * UIProcess/API/gtk/WebKitWebContext.cpp:
2514         (webkitWebContextConstructed):
2515         (webkit_web_context_class_init):
2516         (addOriginToMap):
2517         (webkit_web_context_initialize_notification_permissions):
2518         (webkitWebContextInitializeNotificationPermissions):
2519         * UIProcess/API/gtk/WebKitWebContext.h:
2520         * UIProcess/API/gtk/WebKitWebContextPrivate.h:
2521         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
2522
2523 2017-01-10  Keith Rollin  <krollin@apple.com>
2524
2525         Record/replay: fix range used for fuzzy matching
2526         https://bugs.webkit.org/show_bug.cgi?id=166041
2527
2528         Reviewed by Darin Adler and Alex Christensen.
2529
2530         Because of two bugs, the attempt to determine the range of URLs to
2531         check as part of the process of fuzzy matching was failing. The intent
2532         was to find the range of URLs that started with the same
2533         <scheme://host:port> as a given URL. However, because of a reversed
2534         test, the upper end of the range ended up being the "end()" iterator
2535         of the entire collection of URLs. With that fixed, there was another
2536         bug due to one URL being given as <scheme://host:port> and the other
2537         given as <scheme://host:port/> (note the trailing slash). Both of
2538         these issues are now fixed.
2539
2540         * NetworkProcess/capture/NetworkCaptureManager.cpp:
2541         (WebKit::NetworkCapture::Manager::initialize):
2542         (WebKit::NetworkCapture::Manager::findBestFuzzyMatch):
2543         (WebKit::NetworkCapture::Manager::urlIdentifyingCommonDomain):
2544         * NetworkProcess/capture/NetworkCaptureManager.h:
2545         * NetworkProcess/capture/NetworkCaptureResource.cpp:
2546         (WebKit::NetworkCapture::Resource::url):
2547         (WebKit::NetworkCapture::Resource::urlIdentifyingCommonDomain):
2548         (WebKit::NetworkCapture::Resource::baseURL): Deleted.
2549         * NetworkProcess/capture/NetworkCaptureResource.h:
2550
2551 2017-01-10  Wenson Hsieh  <wenson_hsieh@apple.com>
2552
2553         Implement "proximity" scroll snapping
2554         https://bugs.webkit.org/show_bug.cgi?id=135994
2555         <rdar://problem/18162418>
2556
2557         Reviewed by Dean Jackson.
2558
2559         Adds boilerplate support for plumbing lists of snap offset ranges from the web process to the UI process
2560         alongside the list of snap offsets.
2561
2562         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
2563         (ArgumentCoder<ScrollingStateScrollingNode>::encode):
2564         (ArgumentCoder<ScrollingStateScrollingNode>::decode):
2565         * Shared/WebCoreArgumentCoders.cpp:
2566         (IPC::ArgumentCoder<ScrollOffsetRange<float>>::encode):
2567         (IPC::ArgumentCoder<ScrollOffsetRange<float>>::decode):
2568         * Shared/WebCoreArgumentCoders.h:
2569         * UIProcess/Scrolling/ios/ScrollingTreeOverflowScrollingNodeIOS.mm:
2570         (-[WKOverflowScrollViewDelegate scrollViewWillEndDragging:withVelocity:targetContentOffset:]):
2571         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
2572
2573         Adjust mainframe proximity scroll snapping logic to not subtract out the top content inset when there is no
2574         active snap offset (i.e. when snapping rests in a snap offset range). Attempting to subtract out the top inset
2575         in this case caused the scroll offset to jump after ending a drag with no momentum in a snap offset range.
2576
2577         (WebKit::RemoteScrollingCoordinatorProxy::adjustTargetContentOffsetForSnapping):
2578         (WebKit::RemoteScrollingCoordinatorProxy::shouldSnapForMainFrameScrolling):
2579         (WebKit::RemoteScrollingCoordinatorProxy::closestSnapOffsetForMainFrameScrolling):
2580
2581 2017-01-10  Zan Dobersek  <zdobersek@igalia.com>
2582
2583         ThreadedCoordinatedLayerTreeHost::renderNextFrame() should short-cut to layer flushing
2584         https://bugs.webkit.org/show_bug.cgi?id=157614
2585
2586         Reviewed by Carlos Garcia Campos.
2587
2588         CoordinatedLayerTreeHost prevents any layer flushes while a previously-commited scene
2589         state is still being rendered on the composition thread. renderNextFrame() is called
2590         once that is complete, and a new layer flush is scheduled.
2591
2592         This change improves the whole ordeal by immediately performing the layer flush only if
2593         it was requested during the time we were waiting on the renderer (i.e. when the latest
2594         scene state was being composited), instead of scheduling it unconditionally.
2595         m_scheduledWhileWaitingForRenderer member variable is added to track that occurrence.
2596
2597         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
2598         (WebKit::CoordinatedLayerTreeHost::scheduleLayerFlush):
2599         (WebKit::CoordinatedLayerTreeHost::renderNextFrame):
2600         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
2601
2602 2017-01-09  Chris Dumez  <cdumez@apple.com>
2603
2604         [iOS] Drop VNodeTracker
2605         https://bugs.webkit.org/show_bug.cgi?id=166868
2606         <rdar://problem/29937587>
2607
2608         Reviewed by Andreas Kling.
2609
2610         * WebProcess/cocoa/WebProcessCocoa.mm:
2611         (WebKit::WebProcess::platformInitializeWebProcess):
2612
2613 2017-01-09  Enrica Casucci  <enrica@apple.com>
2614
2615         Selection animation flashing on editable content when zooming.
2616         https://bugs.webkit.org/show_bug.cgi?id=166863
2617         rdar://problem/29931470
2618
2619         Reviewed by Tim Horton.
2620
2621         Implementing _allowAnimatedUpdateSelectionRectView and returning NO,
2622         prevents the selection animation in UIKit.
2623
2624         * UIProcess/ios/WKContentViewInteraction.mm:
2625         (-[WKContentView _allowAnimatedUpdateSelectionRectViews]):
2626
2627 2017-01-06  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
2628
2629         [GTK] Should support key and code properties on keyboard events
2630         https://bugs.webkit.org/show_bug.cgi?id=166759
2631
2632         Reviewed by Carlos Garcia Campos.
2633
2634         * Shared/WebEvent.h:
2635         * Shared/WebKeyboardEvent.cpp:
2636         (WebKit::WebKeyboardEvent::WebKeyboardEvent): accept web key value and code on construction.
2637         * Shared/gtk/WebEventFactory.cpp:
2638         (WebKit::WebEventFactory::createWebKeyboardEvent): pass web key value and code on construction.
2639
2640 2017-01-08  Antti Koivisto  <antti@apple.com>
2641
2642         Move cache coders to WTF
2643         https://bugs.webkit.org/show_bug.cgi?id=166825
2644
2645         Rubber-stamped by Sam Weinig.
2646
2647         * NetworkProcess/cache/NetworkCache.h:
2648         * NetworkProcess/cache/NetworkCacheCoder.h: Removed.
2649         * NetworkProcess/cache/NetworkCacheCoders.cpp:
2650         (WebKit::NetworkCache::Coder<AtomicString>::encode): Deleted.
2651         (WebKit::NetworkCache::Coder<AtomicString>::decode): Deleted.
2652         (WebKit::NetworkCache::Coder<CString>::encode): Deleted.
2653         (WebKit::NetworkCache::Coder<CString>::decode): Deleted.
2654         (WebKit::NetworkCache::Coder<String>::encode): Deleted.
2655         (WebKit::NetworkCache::decodeStringText): Deleted.
2656         (WebKit::NetworkCache::Coder<String>::decode): Deleted.
2657         (WebKit::NetworkCache::Coder<SHA1::Digest>::encode): Deleted.
2658         (WebKit::NetworkCache::Coder<SHA1::Digest>::decode): Deleted.
2659         (WebKit::NetworkCache::Coder<WebCore::HTTPHeaderMap>::encode): Deleted.
2660         (WebKit::NetworkCache::Coder<WebCore::HTTPHeaderMap>::decode): Deleted.
2661         * NetworkProcess/cache/NetworkCacheCoders.h:
2662         (): Deleted.
2663         (WebKit::NetworkCache::Coder<std::optional<T>>::encode): Deleted.
2664         (WebKit::NetworkCache::Coder<std::optional<T>>::decode): Deleted.
2665         * NetworkProcess/cache/NetworkCacheCodersCocoa.cpp:
2666         (WebKit::NetworkCache::encodeCFData): Deleted.
2667         (WebKit::NetworkCache::decodeCFData): Deleted.
2668         (WebKit::NetworkCache::encodeSecTrustRef): Deleted.
2669         (WebKit::NetworkCache::decodeSecTrustRef): Deleted.
2670         (WebKit::NetworkCache::encodeCertificateChain): Deleted.
2671         (WebKit::NetworkCache::decodeCertificateChain): Deleted.
2672         (WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::encode): Deleted.
2673         (WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::decode): Deleted.
2674         * NetworkProcess/cache/NetworkCacheDecoder.cpp: Removed.
2675         * NetworkProcess/cache/NetworkCacheDecoder.h: Removed.
2676         * NetworkProcess/cache/NetworkCacheEncoder.cpp: Removed.
2677         * NetworkProcess/cache/NetworkCacheEncoder.h: Removed.
2678         * NetworkProcess/cache/NetworkCacheEntry.cpp:
2679         (WebKit::NetworkCache::Entry::encodeAsStorageRecord):
2680         (WebKit::NetworkCache::Entry::decodeStorageRecord):
2681         * NetworkProcess/cache/NetworkCacheKey.cpp:
2682         (WebKit::NetworkCache::Key::encode):
2683         (WebKit::NetworkCache::Key::decode):
2684         * NetworkProcess/cache/NetworkCacheKey.h:
2685         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2686         (WebKit::NetworkCache::decodeRecordMetaData):
2687         (WebKit::NetworkCache::encodeRecordMetaData):
2688         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
2689         (WebKit::NetworkCache::SubresourceInfo::encode):
2690         (WebKit::NetworkCache::SubresourceInfo::decode):
2691         (WebKit::NetworkCache::SubresourcesEntry::encodeAsStorageRecord):
2692         (WebKit::NetworkCache::SubresourcesEntry::decodeStorageRecord):
2693         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
2694         * UIProcess/API/APIUserContentExtensionStore.cpp:
2695         (API::encodeContentExtensionMetaData):
2696         (API::decodeContentExtensionMetaData):
2697         * WebKit2.xcodeproj/project.pbxproj:
2698
2699 2017-01-09  Tomas Popela  <tpopela@redhat.com>
2700
2701         [GTK] Replace WebKitWebSettings with WebKitSettings in documentation
2702         https://bugs.webkit.org/show_bug.cgi?id=166836
2703
2704         Reviewed by Carlos Garcia Campos.
2705
2706         Don't use WebKitWebSettings (it was a WebKit1 thing) in documentation,
2707         but replace it with WebKitSettings.
2708
2709         * UIProcess/API/gtk/WebKitSettings.cpp:
2710         (webkit_settings_class_init):
2711         * UIProcess/API/gtk/WebKitWebView.cpp:
2712
2713 2017-01-06  Darin Adler  <darin@apple.com>
2714
2715         Remove PassRefPtr use from "inspector", "platform/sql", and "platform/text"
2716         https://bugs.webkit.org/show_bug.cgi?id=166797
2717
2718         Reviewed by Alex Christensen.
2719
2720         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2721         (WebKit::WebEditorClient::requestCheckingOfString): Take a reference
2722         instead of a PassRefPtr.
2723         * WebProcess/WebCoreSupport/WebEditorClient.h: Updated for above change.
2724
2725 2017-01-07  Andy Estes  <aestes@apple.com>
2726
2727         [QuickLook] Consolidate usage of QuickLookHandle into SubresourceLoader
2728         https://bugs.webkit.org/show_bug.cgi?id=166713
2729
2730         Reviewed by Alex Christensen.
2731
2732         * WebProcess/Network/WebResourceLoader.cpp:
2733         (WebKit::WebResourceLoader::didReceiveResponse): Removed QuickLook code.
2734         (WebKit::WebResourceLoader::didReceiveData): Ditto.
2735         (WebKit::WebResourceLoader::didFinishResourceLoad): Ditto.
2736         (WebKit::WebResourceLoader::didFailResourceLoad): Ditto.
2737         (WebKit::WebResourceLoader::didReceiveResource): Ditto.
2738
2739 2017-01-06  Daniel Bates  <dabates@apple.com>
2740
2741         Attempt to fix the EFL build following <http://trac.webkit.org/changeset/210461>
2742         (https://bugs.webkit.org/show_bug.cgi?id=166781)
2743
2744         * UIProcess/API/C/WKWebsitePolicies.cpp:
2745         (WKWebsitePoliciesGetAutoplayPolicy): Invoke ASSERT_NOT_REACHED() and return kWKWebsiteAutoplayPolicyUseHeuristics
2746         if the specified policy is not covered by a switch case.
2747         (WKWebsitePoliciesSetAutoplayPolicy): Substituted "return" for "break" in each switch case and
2748         invoke ASSERT_NOT_REACHED() if the specified policy is not covered by a switch case.
2749
2750 2017-01-06  Matt Rajca  <mrajca@apple.com>
2751
2752         Add infrastructure for sending autoplay website policies to WebKit
2753         https://bugs.webkit.org/show_bug.cgi?id=166781
2754
2755         Reviewed by Alex Christensen.
2756
2757         * Shared/WebsitePolicies.h:
2758         (WebKit::WebsitePolicies::encode):
2759         (WebKit::WebsitePolicies::decode):
2760         * UIProcess/API/APIWebsitePolicies.h:
2761         * UIProcess/API/C/WKWebsitePolicies.cpp:
2762         (WKWebsitePoliciesGetAutoplayPolicy):
2763         (WKWebsitePoliciesSetAutoplayPolicy):
2764         * UIProcess/API/C/WKWebsitePolicies.h:
2765         * UIProcess/API/Cocoa/_WKWebsitePolicies.h:
2766         * UIProcess/API/Cocoa/_WKWebsitePolicies.mm:
2767         (-[_WKWebsitePolicies setAutoplayPolicy:]):
2768         (-[_WKWebsitePolicies autoplayPolicy]):
2769
2770 2017-01-05  Carlos Garcia Campos  <cgarcia@igalia.com>
2771
2772         [SOUP] Network process crash in WebKit::CustomProtocolManagerImpl::didFailWithError
2773         https://bugs.webkit.org/show_bug.cgi?id=165082
2774
2775         Reviewed by Alex Christensen.
2776
2777         CustomProtocolManager uses a Workqueue to receive the IPC messages since r149194. Then we added the Soup
2778         implementation adopting that approach, but without making our implementation thread safe. The crash happens
2779         because the CustomProtocolManager implementation is used by two threads at the same time, the main thread
2780         because of a ping load (probably caused by an image load in the unload handler, I haven't been able to
2781         reproduce the crash) and the work queue thread. The reasons to make CustomProtocolManager use a WorkQueue
2782         are no longer valid because CustomProtocolManager is now only used in the network process and sync loads don't
2783         use any nested run loop, they are just an IPC sync message. So this patch makes CustomProtocolManager a normal
2784         message receiver again to ensure messages are handled in the main thread. It also adds the common implementation
2785         to a new CustomProtocolManager.cpp file shared by Cocoa and Soup based ports.
2786
2787         * CMakeLists.txt: Add CustomProtocolManager.cpp.
2788         * NetworkProcess/CustomProtocols/Cocoa/CustomProtocolManagerCocoa.mm:
2789         (-[WKCustomProtocol initWithRequest:cachedResponse:client:]): Use new CustomProtocolManager API.
2790         (-[WKCustomProtocol startLoading]): Ditto.
2791         (-[WKCustomProtocol stopLoading]): Ditto.
2792         (WebKit::CustomProtocolManager::registerProtocolClass): Register the NSURLProtocol class when not using the
2793         network session.
2794         (WebKit::CustomProtocolManager::didFailWithError): removeCustomProtocol now receives an ID.
2795         (WebKit::CustomProtocolManager::didFinishLoading): Ditto.
2796         * NetworkProcess/CustomProtocols/CustomProtocolManager.cpp: Added.
2797         (WebKit::generateCustomProtocolID): Moved from CustomProtocolManagerCocoa.mm and CustomProtocolManagerSoup.cpp.
2798         (WebKit::CustomProtocolManager::supplementName): Ditto.
2799         (WebKit::CustomProtocolManager::CustomProtocolManager): Also removes the work queue initialization.
2800         (WebKit::CustomProtocolManager::initialize): Copied and modernized the loop.
2801         (WebKit::CustomProtocolManager::addCustomProtocol): Copied from CustomProtocolManagerCocoa.mm.
2802         (WebKit::CustomProtocolManager::removeCustomProtocol): Ditto.
2803         (WebKit::CustomProtocolManager::startLoading): Send the StartLoading message to the proxy.
2804         (WebKit::CustomProtocolManager::stopLoading): Send the StopLoading message to the proxy.
2805         * NetworkProcess/CustomProtocols/CustomProtocolManager.h:
2806         * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerImpl.cpp: Removed.
2807         * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerImpl.h: Removed.
2808         * NetworkProcess/CustomProtocols/soup/CustomProtocolManagerSoup.cpp: Moved the implementation from
2809         CustomProtocolManagerImpl and updated to the new CustomProtocolManager API.
2810         (WebKit::CustomProtocolManager::WebSoupRequestAsyncData::WebSoupRequestAsyncData):
2811         (WebKit::CustomProtocolManager::WebSoupRequestAsyncData::~WebSoupRequestAsyncData):
2812         (WebKit::CustomProtocolManager::registerProtocolClass):
2813         (WebKit::CustomProtocolManager::registerScheme):
2814         (WebKit::CustomProtocolManager::supportsScheme):
2815         (WebKit::CustomProtocolManager::didFailWithError):
2816         (WebKit::CustomProtocolManager::didLoadData):
2817         (WebKit::CustomProtocolManager::didReceiveResponse):
2818         (WebKit::CustomProtocolManager::didFinishLoading):
2819         (WebKit::CustomProtocolManager::wasRedirectedToRequest):
2820         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
2821         (WebKit::globalCustomProtocolManager):
2822         (WebKit::NetworkSessionCocoa::defaultSession):
2823         CustomProtocolManager is no longer refcounted, so just pass a pointer.
2824         A static pointer has the same lifetime as the NetworkProcess object in the NetworkProcess,
2825         and in the WebProcess it will remain nullptr, just like it used to.
2826         * PlatformEfl.cmake:
2827         * PlatformGTK.cmake:
2828         * WebKit2.xcodeproj/project.pbxproj:
2829
2830 2017-01-05  Antti Koivisto  <antti@apple.com>
2831
2832         Use WTF::Function instead of std::function in network cache code
2833         https://bugs.webkit.org/show_bug.cgi?id=166721
2834
2835         Reviewed by Andreas Kling.
2836
2837         Use better move-only type. Fix some unnecessary function copies.
2838
2839         * NetworkProcess/cache/NetworkCache.cpp:
2840         (WebKit::NetworkCache::Cache::retrieve):
2841         (WebKit::NetworkCache::Cache::clear):
2842         * NetworkProcess/cache/NetworkCache.h:
2843         * NetworkProcess/cache/NetworkCacheData.h:
2844         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
2845         (WebKit::NetworkCache::Data::apply):
2846         * NetworkProcess/cache/NetworkCacheDataSoup.cpp:
2847         (WebKit::NetworkCache::Data::apply):
2848         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
2849         (WebKit::NetworkCache::traverseDirectory):
2850         * NetworkProcess/cache/NetworkCacheFileSystem.h:
2851         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
2852         (WebKit::NetworkCache::SpeculativeLoadManager::canRetrieve):
2853         (WebKit::NetworkCache::SpeculativeLoadManager::retrieve):
2854
2855             Split retrieve() to canRetrieve() and retrieve() functions.
2856             This avoids the need to copy the completion handler in the caller.
2857
2858         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.h:
2859         * NetworkProcess/cache/NetworkCacheStorage.cpp:
2860         (WebKit::NetworkCache::Storage::ReadOperation::ReadOperation):
2861         (WebKit::NetworkCache::Storage::traverse):
2862         (WebKit::NetworkCache::Storage::clear):
2863         * NetworkProcess/cache/NetworkCacheStorage.h:
2864
2865 2017-01-05  Enrica Casucci  <enrica@apple.com>
2866
2867         Unreviewed build fix after https://trac.webkit.org/changeset/210360
2868
2869         * UIProcess/Cocoa/WebViewImpl.mm:
2870         (WebKit::WebViewImpl::performDragOperation):
2871
2872 2017-01-05  Enrica Casucci  <enrica@apple.com>
2873
2874         Support File Promise during drag for macOS.
2875         https://bugs.webkit.org/show_bug.cgi?id=165204
2876         rdar://problem/19595567
2877
2878         Reviewed by Tim Horton.
2879
2880         Adds support for dropping a File Promise in a WKWebView.
2881         The implementation uses new File Promise API available in Sierra.
2882
2883         * Shared/WebCoreArgumentCoders.cpp:
2884         (IPC::ArgumentCoder<DragData>::encode):
2885         (IPC::ArgumentCoder<DragData>::decode):
2886         * Shared/mac/PasteboardTypes.mm:
2887         (WebKit::PasteboardTypes::forURL):
2888         * UIProcess/Cocoa/WebViewImpl.h:
2889         * UIProcess/Cocoa/WebViewImpl.mm:
2890         (WebKit::WebViewImpl::createSandboxExtensionsIfNeeded):
2891         (WebKit::WebViewImpl::performDragOperation):
2892         (WebKit::maybeCreateSandboxExtensionFromPasteboard): Deleted.
2893         (WebKit::createSandboxExtensionsForFileUpload): Deleted.
2894
2895 2017-01-05  Andreas Kling  <akling@apple.com>
2896
2897         Remove ChromeClient::needTouchEvents().
2898         <https://webkit.org/b/166723>
2899
2900         Rubber-stamped by Antti Koivisto.
2901
2902         * WebProcess/WebCoreSupport/WebChromeClient.h:
2903
2904 2017-01-04  Darin Adler  <darin@apple.com>
2905
2906         Remove PassRefPtr use from the "html" directory, other improvements
2907         https://bugs.webkit.org/show_bug.cgi?id=166635
2908
2909         Reviewed by Alex Christensen.
2910
2911         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
2912         (WebKit::WebChromeClient::loadIconForFiles): Take a reference instead of a pointer.
2913         * WebProcess/WebCoreSupport/WebChromeClient.h: Ditto.
2914
2915 2017-01-04  Myles C. Maxfield  <mmaxfield@apple.com>
2916
2917         Remove runtime flag for variation fonts
2918         https://bugs.webkit.org/show_bug.cgi?id=164251
2919
2920         Reviewed by Dean Jackson.
2921
2922         * Shared/WebPreferencesDefinitions.h:
2923         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2924         (WebKit::registerUserDefaultsIfNeeded):
2925         * WebProcess/WebPage/WebPage.cpp:
2926         (WebKit::WebPage::updatePreferences):
2927
2928 2017-01-04  Ryan Haddad  <ryanhaddad@apple.com>
2929
2930         Unreviewed, rolling out r210287.
2931
2932         This change caused editing test failures on macOS.
2933
2934         Reverted changeset:
2935
2936         "Support File Promise during drag for macOS."
2937         https://bugs.webkit.org/show_bug.cgi?id=165204
2938         http://trac.webkit.org/changeset/210287
2939
2940 2017-01-04  Enrica Casucci  <enrica@apple.com>
2941
2942         Support File Promise during drag for macOS.
2943         https://bugs.webkit.org/show_bug.cgi?id=165204
2944         rdar://problem/19595567
2945
2946         Reviewed by Tim Horton.
2947
2948         Adds support for dropping a File Promise in a WKWebView.
2949         The implementation uses new File Promise API available in Sierra.
2950
2951         * Shared/WebCoreArgumentCoders.cpp:
2952         (IPC::ArgumentCoder<DragData>::encode):
2953         (IPC::ArgumentCoder<DragData>::decode):
2954         * Shared/mac/PasteboardTypes.mm:
2955         (WebKit::PasteboardTypes::forURL):
2956         * UIProcess/Cocoa/WebViewImpl.h:
2957         * UIProcess/Cocoa/WebViewImpl.mm:
2958         (WebKit::WebViewImpl::createSandboxExtensionsIfNeeded):
2959         (WebKit::WebViewImpl::performDragOperation):
2960         (WebKit::maybeCreateSandboxExtensionFromPasteboard): Deleted.
2961         (WebKit::createSandboxExtensionsForFileUpload): Deleted.
2962
2963 2017-01-04  Jeremy Jones  <jeremyj@apple.com>
2964
2965         Release pointer lock when page state is reset for any reason, not just for process exited.
2966         https://bugs.webkit.org/show_bug.cgi?id=166654
2967         <rdar://problem/29849769>
2968
2969         Reviewed by Tim Horton.
2970
2971         Pointer lock was not being released when the window is closed.
2972         Move the pointer lock to resetState() so it happens whenever the page is
2973         reset, not just when it is reset after process exit.
2974
2975         * UIProcess/WebPageProxy.cpp:
2976         (WebKit::WebPageProxy::resetState): Release here.
2977         (WebKit::WebPageProxy::resetStateAfterProcessExited): Don't release here.
2978
2979 2017-01-03  Tim Horton  <timothy_horton@apple.com>
2980
2981         NSSpellChecker's recordResponse isn't called for unseen automatic corrections
2982         https://bugs.webkit.org/show_bug.cgi?id=166450
2983         <rdar://problem/29447824>
2984
2985         Reviewed by Darin Adler.
2986
2987         * UIProcess/mac/CorrectionPanel.h:
2988         * UIProcess/mac/CorrectionPanel.mm:
2989         (WebKit::CorrectionPanel::recordAutocorrectionResponse):
2990         (WebKit::CorrectionPanel::handleAcceptedReplacement):
2991         Funnel all calls to recordResponse:toCorrection:forWord:language:inSpellDocumentWithTag:
2992         through recordAutocorrectionResponse, for debugging's sake.
2993         Drop the NSView parameter because we don't need it, just the tag.
2994
2995         * UIProcess/mac/PageClientImpl.mm:
2996         (WebKit::toCorrectionResponse):
2997         (WebKit::PageClientImpl::recordAutocorrectionResponse):
2998         Convert the new AutocorrectionResponseType value to its corresponding
2999         NSCorrectionResponse value.
3000
3001 2017-01-03  Daniel Bates  <dabates@apple.com>
3002
3003         Another attempt to fix the Apple Sierra Release 32-bit Build following <https://trac.webkit.org/changeset/210075>
3004         (https://bugs.webkit.org/show_bug.cgi?id=166367)
3005
3006         Guard more code in WebViewImpl::handleRequestedCandidates() inside HAVE(TOUCH_BAR).
3007         Remove unused local variable weakThis.
3008
3009         * UIProcess/Cocoa/WebViewImpl.mm:
3010         (WebKit::WebViewImpl::handleRequestedCandidates):
3011
3012 2017-01-03  Daniel Bates  <dabates@apple.com>
3013
3014         Attempt to fix the Apple Sierra Release 32-bit Build following <https://trac.webkit.org/changeset/210075>
3015         (https://bugs.webkit.org/show_bug.cgi?id=166367)
3016
3017         Add HAVE(TOUCH_BAR)-guard around code that messages candidateListTouchBarItem() as
3018         candidateListTouchBarItem() is only defined when building with Touch Bar support.
3019
3020         Also added an inline comment to help demarcate the code when building without Touch Bar
3021         support. We should look to clean up WebViewImpl.mm including extracting out the Touch
3022         Bar code to another file or better demarcating it so as to improve the hackability of
3023         this code and prevent breaking the build when building without Touch Bar support.
3024
3025         * UIProcess/Cocoa/WebViewImpl.mm:
3026         (WebKit::WebViewImpl::handleRequestedCandidates):
3027
3028 2017-01-03  Michael Catanzaro  <mcatanzaro@igalia.com> and Carlos Garcia Campos  <cgarcia@igalia.com>
3029
3030         [GTK] Expose WebKitSecurityOrigin API
3031         https://bugs.webkit.org/show_bug.cgi?id=166632
3032
3033         Reviewed by Carlos Garcia Campos.
3034
3035         This API will be useful to have for various purposes, such as setting initial notification
3036         permissions.
3037
3038         * PlatformGTK.cmake:
3039         * UIProcess/API/gtk/WebKitAutocleanups.h:
3040         * UIProcess/API/gtk/WebKitSecurityOrigin.cpp: Added.
3041         (_WebKitSecurityOrigin::_WebKitSecurityOrigin):
3042         (webkitSecurityOriginCreate):
3043         (webkit_security_origin_new):
3044         (webkit_security_origin_new_for_uri):
3045         (webkit_security_origin_ref):
3046         (webkit_security_origin_unref):
3047         (webkit_security_origin_get_protocol):
3048         (webkit_security_origin_get_host):
3049         (webkit_security_origin_get_port):
3050         (webkit_security_origin_is_opaque):
3051         (webkit_security_origin_to_string):
3052         * UIProcess/API/gtk/WebKitSecurityOrigin.h: Added.
3053         * UIProcess/API/gtk/WebKitSecurityOriginPrivate.h: Added.
3054         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
3055         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
3056         * UIProcess/API/gtk/webkit2.h:
3057
3058 2017-01-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3059
3060         [SOUP] Load options allowStoredCredentials = DoNotAllowStoredCredentials with clientCredentialPolicy = MayAskClientForCredentials doesn't work
3061         https://bugs.webkit.org/show_bug.cgi?id=164471
3062
3063         Reviewed by Michael Catanzaro.
3064
3065         When DoNotAllowStoredCredentials is used we disable the SoupAuthManager feature for the message, but that
3066         disables all HTTP authentication, causing the load to always fail with Authorization required even when
3067         clientCredentialPolicy allows to ask the user for credentials. The problem is that even if we don't use the
3068         WebCore credentials for that request, libsoup will always use its internal cache of SoupAuth if we enable the
3069         SoupAuthManager feature. Libsoup 2.57.1 has new API to disable the use of cached credentials for a particular
3070         message, adding the new message flag SOUP_MESSAGE_DO_NOT_USE_AUTH_CACHE.
3071
3072         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
3073         (WebKit::NetworkDataTaskSoup::createRequest): Set SOUP_MESSAGE_DO_NOT_USE_AUTH_CACHE flag to disable cached
3074         credentials for the message if libsoup >= 2.57.1 is used.
3075
3076 2017-01-03  Carlos Garcia Campos  <cgarcia@igalia.com>
3077
3078         [GTK] HTTP auth layout tests are flaky
3079         https://bugs.webkit.org/show_bug.cgi?id=158919
3080
3081         Reviewed by Michael Catanzaro.
3082
3083         Implement NetworkSession::clearCredentials() for soup using the new libsoup API when available.
3084
3085         * NetworkProcess/soup/NetworkSessionSoup.cpp:
3086         (WebKit::NetworkSessionSoup::clearCredentials):
3087         * NetworkProcess/soup/NetworkSessionSoup.h:
3088
3089 2017-01-01  Jeff Miller  <jeffm@apple.com>
3090
3091         Update user-visible copyright strings to include 2017
3092         https://bugs.webkit.org/show_bug.cgi?id=166278
3093
3094         Reviewed by Dan Bernstein.
3095
3096         * DatabaseProcess/EntryPoint/mac/XPCService/DatabaseService/Info.plist:
3097         * Info.plist:
3098         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX-10.9-10.10.plist:
3099         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-OSX.plist:
3100         * NetworkProcess/EntryPoint/mac/XPCService/NetworkService/Info-iOS.plist:
3101         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64-10.9-10.10.Info.plist:
3102         * PluginProcess/EntryPoint/mac/XPCService/PluginService.32-64.Info.plist:
3103         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX-10.9-10.10.plist:
3104         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-OSX.plist:
3105         * WebProcess/EntryPoint/mac/XPCService/WebContentService/Info-iOS.plist:
3106
3107 2016-12-30  Darin Adler  <darin@apple.com>
3108
3109         Remove PassRefPtr use from the "dom" directory, related cleanup
3110         https://bugs.webkit.org/show_bug.cgi?id=166569
3111
3112         Reviewed by Alex Christensen.
3113
3114         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
3115         (WebKit::WebFrameLoaderClient::dispatchDidReceiveTitle): Updated to use struct.
3116         (WebKit::WebFrameLoaderClient::updateGlobalHistory): Ditto.
3117         (WebKit::WebFrameLoaderClient::setTitle): Ditto.
3118
3119 2016-12-27  Alex Christensen  <achristensen@webkit.org>
3120
3121         reduce PassRefPtr use in WebKit2
3122         https://bugs.webkit.org/show_bug.cgi?id=166452
3123
3124         Reviewed by Yusuke Suzuki.
3125
3126         * Shared/API/c/cg/WKImageCG.cpp:
3127         (WKImageCreateCGImage):
3128         (WKImageCreateFromCGImage):
3129         * Shared/ShareableBitmap.cpp:
3130         (WebKit::ShareableBitmap::createHandle):
3131         * Shared/ShareableBitmap.h:
3132         * Shared/UserData.cpp:
3133         (WebKit::UserData::encode):
3134         (WebKit::UserData::decode):
3135         * Shared/WebImage.cpp:
3136         (WebKit::WebImage::create):
3137         (WebKit::WebImage::WebImage):
3138         * Shared/WebImage.h:
3139         (WebKit::WebImage::bitmap):
3140         * UIProcess/WebPageProxy.cpp:
3141         (WebKit::WebPageProxy::didGetImageForFindMatch):
3142         * UIProcess/mac/WKTextFinderClient.mm:
3143         (-[WKTextFinderClient didGetImageForMatchResult:]):
3144         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
3145         (WebKit::WebAutomationSessionProxy::takeScreenshot):
3146         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
3147         (-[WKWebProcessPlugInNodeHandle renderedImageWithOptions:]):
3148         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp:
3149         (WebKit::imageForRect):
3150         (WebKit::InjectedBundleNodeHandle::renderedImage):
3151         (WebKit::InjectedBundleNodeHandle::visibleRange):
3152         (WebKit::InjectedBundleNodeHandle::htmlTableCellElementCellAbove):
3153         (WebKit::InjectedBundleNodeHandle::documentFrame):
3154         (WebKit::InjectedBundleNodeHandle::htmlFrameElementContentFrame):
3155         (WebKit::InjectedBundleNodeHandle::htmlIFrameElementContentFrame):
3156         * WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h:
3157         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
3158         (WebKit::InjectedBundleRangeHandle::renderedImage):
3159         * WebProcess/WebPage/WebPage.cpp:
3160         (WebKit::WebPage::takeSnapshot):
3161         (WebKit::WebPage::snapshotAtSize):
3162         (WebKit::WebPage::snapshotNode):
3163         (WebKit::WebPage::drawRectToImage):
3164         * WebProcess/WebPage/ios/WebPageIOS.mm:
3165         (WebKit::WebPage::getPositionInformation):
3166         * WebProcess/WebPage/mac/WebPageMac.mm:
3167         (WebKit::WebPage::setTopOverhangImage):
3168         (WebKit::WebPage::setBottomOverhangImage):
3169
3170 2016-12-27  Emanuele Aina  <emanuele.aina@collabora.com>
3171
3172         Ensure NetworkProcess is ready before whitelisting TLS certificates
3173         https://bugs.webkit.org/show_bug.cgi?id=162962
3174
3175         Reviewed by Alex Christensen.
3176
3177         If the API user tries to whitelist TLS certificates before any web
3178         view has been created, the action will be ignored because the
3179         NetworkProcess hasn't been fired up yet.
3180
3181         For example, the snippet below using the GTK+ API does not work,
3182         unless the whitelisting is moved after the web view creation:
3183
3184           webkit_web_context_allow_tls_certificate_for_host(webkit_web_context_get_default(), crt, host);
3185           webView = webkit_web_view_new();
3186
3187         * UIProcess/WebProcessPool.cpp:
3188         (WebKit::WebProcessPool::allowSpecificHTTPSCertificateForHost): Ensure
3189         that the NetworkProcess has been already fired up when adding
3190         certificates, so they can be whitelisted before the first web view is
3191         instantiated.
3192
3193 2016-12-25  Yusuke Suzuki  <utatane.tea@gmail.com>
3194
3195         Propagate the source origin as much as possible
3196         https://bugs.webkit.org/show_bug.cgi?id=166348
3197
3198         Reviewed by Darin Adler.
3199
3200         * WebProcess/Plugins/Netscape/NPRuntimeObjectMap.cpp:
3201         (WebKit::NPRuntimeObjectMap::evaluate):
3202
3203 2016-12-22  Andy Estes  <aestes@apple.com>
3204
3205         Reduce QuickLook.h include overhead
3206         https://bugs.webkit.org/show_bug.cgi?id=166454
3207
3208         Reviewed by Andreas Kling.
3209
3210         * WebProcess/Network/WebLoaderStrategy.cpp: Included QuickLook.h for QLPreviewProtocol().
3211         * WebProcess/Network/WebResourceLoader.cpp: Included QuickLook.h for QuickLookHandle.
3212         * WebProcess/Network/WebResourceLoader.h: Stopped including QuickLook.h.
3213
3214 2016-12-22  Tim Horton  <timothy_horton@apple.com>
3215
3216         Null deref under WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground
3217         https://bugs.webkit.org/show_bug.cgi?id=166433
3218         <rdar://problem/29732407>
3219
3220         Reviewed by Daniel Bates.
3221
3222         * UIProcess/ios/WebPageProxyIOS.mm:
3223         (WebKit::WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground):
3224         m_drawingArea can be null if the process is not valid.
3225
3226 2016-12-22  Andy Estes  <aestes@apple.com>
3227
3228         Make WebCore::EditorInsertAction an enum class
3229         https://bugs.webkit.org/show_bug.cgi?id=166424
3230
3231         Reviewed by Brent Fulgham.
3232
3233         * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
3234         (WebKit::toAPI):
3235         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
3236         (toWK):
3237
3238 2016-12-22  Zhuo Li  <zachli@apple.com>
3239
3240         [Cocoa] SPI for setloadsImagesAutomatically
3241         https://bugs.webkit.org/show_bug.cgi?id=166401
3242
3243         Reviewed by Darin Adler.
3244
3245         * UIProcess/API/Cocoa/WKPreferences.mm: Call the C API under the hood.
3246         (-[WKPreferences _loadsImagesAutomatically]):
3247         (-[WKPreferences _setLoadsImagesAutomatically:]):
3248
3249         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3250         Add `_loadsImagesAutomatically` property.
3251
3252 2016-12-22  Eric Carlson  <eric.carlson@apple.com>
3253
3254         AVPlayerLayer isn't available on every system
3255         https://bugs.webkit.org/show_bug.cgi?id=166399
3256
3257         Reviewed by Jer Noble.
3258
3259         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm: Use SOFT_LINK_CLASS_OPTIONAL.
3260
3261 2016-12-22  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
3262
3263         MediaStream: ASSERTION FAILED: m_ids.size() == m_handles.size() in MediaDeviceSandboxExtensions
3264         https://bugs.webkit.org/show_bug.cgi?id=166328
3265
3266         Reviewed by Eric Carlson.
3267
3268         This assertion failure happens for ports with sandbox extensions disabled. SandboxExtension is empty and
3269         HandleArray:size() always returns 0. Disable creation of MediaDevicesSandboxExtension in UserMediaProcessManager
3270         when building without support of sandbox extension. Disable also WebPage::grantUserMediaDeviceSandboxExtensions
3271         and WebPage::revokeUserMediaDeviceSandboxExtensions which can be avoided when sandbox extension is empty.
3272
3273         * UIProcess/UserMediaProcessManager.cpp:
3274         (WebKit::UserMediaProcessManager::willCreateMediaStream):
3275         (WebKit::UserMediaProcessManager::endedCaptureSession):
3276         * WebProcess/WebPage/WebPage.cpp:
3277         * WebProcess/WebPage/WebPage.h:
3278         * WebProcess/WebPage/WebPage.messages.in:
3279
3280 2016-12-22  Alejandro G. Castro  <alex@igalia.com>
3281
3282         [WebRTC] Add support for runtime PeeConnection setting, required after r209757
3283         https://bugs.webkit.org/show_bug.cgi?id=166346
3284
3285         Reviewed by Carlos Garcia Campos.
3286
3287         After that commit we have to enable the peerConnection runtime
3288         flag if we want webrtc to work. We are not adding a new API for
3289         the moment to control the peerConnection feature.
3290
3291         * UIProcess/API/gtk/WebKitSettings.cpp:
3292         (webkit_settings_set_enable_media_stream): Use the mediaStream
3293         setting to control the peerConnection
3294
3295 2016-12-21  Brent Fulgham  <bfulgham@apple.com>
3296
3297         [Mac][WK2] Stop using file* rules in WebProcess sandbox profiles
3298         https://bugs.webkit.org/show_bug.cgi?id=165824
3299         <rdar://problem/14024823>
3300
3301         Reviewed by Alexey Proskuryakov
3302
3303         Switch from blanket 'file*' sandbox rules, to the specific 'file-read*' and 'file-write*' rules
3304         we actually need.
3305
3306         * DatabaseProcess/mac/com.apple.WebKit.Databases.sb.in:
3307         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
3308         * WebProcess/com.apple.WebProcess.sb.in:
3309
3310 2016-12-21  Beth Dakin  <bdakin@apple.com>
3311
3312         Holding down on candidates in the TouchBar should show panel on screen
3313         https://bugs.webkit.org/show_bug.cgi?id=166367
3314         -and corresponding-
3315         <rdar://problem/28479236>
3316
3317         Reviewed by Tim Horton.
3318
3319         The showCandidates() helper function is not needed. We can call the AppKit method 
3320         directly at the one call site.
3321         * UIProcess/Cocoa/WebViewImpl.h:
3322         * UIProcess/Cocoa/WebViewImpl.mm:
3323
3324         The panel should appear under the selection, so offset the selection rect.
3325         (WebKit::WebViewImpl::handleRequestedCandidates):
3326
3327         No more showCandidates() since we can call it directly. 
3328         (WebKit::WebViewImpl::showCandidates): Deleted.
3329
3330 2016-12-20  Taras Tsugrii  <ttsugrii@fb.com>
3331
3332         Fix undefined behavior caused by macro expansion producing 'defined'
3333         https://bugs.webkit.org/show_bug.cgi?id=166047
3334
3335         Reviewed by Darin Adler.
3336
3337         * Shared/API/Cocoa/WKFoundation.h:
3338
3339 2016-12-20  Brent Fulgham  <bfulgham@apple.com>
3340
3341         Address some style problems found by static analysis
3342         https://bugs.webkit.org/show_bug.cgi?id=165975
3343
3344         Reviewed by Alex Christensen.
3345
3346         Avoid passing large ANGLE data structures through the ANGLEWebKitBridge methods.
3347
3348         * Shared/WebBackForwardListItem.cpp:
3349         (WebKit::WebBackForwardListItem::create):
3350         (WebKit::WebBackForwardListItem::WebBackForwardListItem):
3351         * Shared/WebBackForwardListItem.h:
3352
3353 2016-12-20  Simon Fraser  <simon.fraser@apple.com>
3354
3355         [iOS WK2] Switching or closing a tab leads to all-white tab content if the status bar is double height
3356         https://bugs.webkit.org/show_bug.cgi?id=166286
3357         rdar://problem/29593525
3358
3359         Reviewed by Tim Horton.
3360
3361         A double-height status bar triggers view resize while snapshotting in the background,
3362         which also triggers calls to _endAnimatedResize on tab resume. However, it was possible
3363         for _endAnimatedResize to re-enter via synchronizeDynamicViewportUpdate()/didCommitLayerTree(),
3364         causing us to use a nil _resizeAnimationView for scale computations, thus setting a zero
3365         scale on the WKContentView.
3366
3367         Fix by checking _dynamicViewportUpdateMode again after the call to synchronizeDynamicViewportUpdate(),
3368         and do a belt-and-braces check for a nil _resizeAnimationView.
3369
3370         * UIProcess/API/Cocoa/WKWebView.mm:
3371         (-[WKWebView _endAnimatedResize]):
3372
3373 2016-12-20  Andy Estes  <aestes@apple.com>
3374
3375         [Cocoa] REGRESSION (r209558): Calling decisionHandler multiple times in webView:decidePolicyForNavigationAction:decisionHandler: leads to a crash
3376         https://bugs.webkit.org/show_bug.cgi?id=165992
3377         <rdar://problem/29693817>
3378
3379         Reviewed by Brady Eidson.
3380
3381         r209558 added additional move semantics to the decisionHandler block passed to
3382         -webView:decidePolicyForNavigationAction:decisionHandler:, resulting in a null pointer
3383         dereference in clients that call the decisionHandler block more than once.
3384
3385         None of the completion handlers we expose in the WebKit API are intended to be called more
3386         than once, and we ASSERT in CompletionHandlerCallChecker::didCallCompletionHandler() that
3387         this doesn't happen.
3388
3389         This change strenghtens that protection by returning immediately in completion handlers
3390         called more than once. And in programs linked on or after WebKit 603.1.17, an NSException is
3391         thrown if a completion handler is called a second time, like we do for completion handlers
3392         that are never called.
3393
3394         New API test: WebKit2.DuplicateCompletionHandlerCalls
3395
3396         * Shared/Cocoa/CompletionHandlerCallChecker.h: Declared completionHandlerHasBeenCalled().
3397         * Shared/Cocoa/CompletionHandlerCallChecker.mm:
3398         (WebKit::shouldThrowExceptionForDuplicateCompletionHandlerCall): Added. Returns true if the
3399         program is linked on or after
3400         LibraryVersion::FirstWithExceptionsForDuplicateCompletionHandlerCalls.
3401         (WebKit::CompletionHandlerCallChecker::completionHandlerHasBeenCalled): Added. Returns
3402         whether or not the completion handler has been called. If it has, and
3403         shouldThrowExceptionForDuplicateCompletionHandlerCall() returns true, throws an
3404         NSInternalInconsistencyException.
3405         * UIProcess/API/Cocoa/WKWebView.mm:
3406         (-[WKWebView _setInputDelegate:]): Added an early return if the completion handler has
3407         already been called.
3408         * UIProcess/Cocoa/NavigationState.mm:
3409         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction): Ditto.
3410         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationResponse): Ditto.
3411         (WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge): Ditto.
3412         * UIProcess/Cocoa/UIDelegate.mm:
3413         (WebKit::UIDelegate::UIClient::runJavaScriptAlert): Ditto.
3414         (WebKit::UIDelegate::UIClient::runJavaScriptConfirm): Ditto.
3415         (WebKit::UIDelegate::UIClient::runJavaScriptPrompt): Ditto.
3416         (WebKit::UIDelegate::UIClient::exceededDatabaseQuota): Ditto.
3417         (WebKit::UIDelegate::UIClient::runOpenPanel): Ditto.
3418         (WebKit::UIDelegate::UIClient::reachedApplicationCacheOriginQuota): Ditto.
3419         * UIProcess/Cocoa/VersionChecks.h: Added
3420         FirstWithExceptionsForDuplicateCompletionHandlerCalls with the version number for 603.1.17.
3421
3422 2016-12-20  Dean Jackson  <dino@apple.com>
3423
3424         Remove INDIE_UI
3425         https://bugs.webkit.org/show_bug.cgi?id=165881
3426         <rdar://problem/29672532>
3427
3428         Reviewed by Simon Fraser.
3429
3430         The Indie UI work has been discontinued.
3431
3432         * Configurations/FeatureDefines.xcconfig:
3433
3434 2016-12-20  Wenson Hs