[CacheAPI] Introduce a WebKit::CacheStorage namespace
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2017-08-23  Youenn Fablet  <youenn@apple.com>
2
3         [CacheAPI] Introduce a WebKit::CacheStorage namespace
4         https://bugs.webkit.org/show_bug.cgi?id=175885
5
6         Reviewed by Alex Christensen.
7
8         Introducing WebKit::CacheStorage namespace.
9         Splitting CacheStorageEngine.h in three files.
10         Updating client code accordingly.
11
12         * NetworkProcess/cache/CacheStorage.h: Added.
13         * NetworkProcess/cache/CacheStorageEngine.cpp:
14         (WebKit::CacheStorage::globalEngineMap):
15         (WebKit::CacheStorage::Engine::from):
16         (WebKit::CacheStorage::Engine::destroyEngine):
17         (WebKit::CacheStorage::Engine::defaultEngine):
18         (WebKit::CacheStorage::Engine::open):
19         (WebKit::CacheStorage::Engine::remove):
20         (WebKit::CacheStorage::Engine::retrieveCaches):
21         (WebKit::CacheStorage::Engine::retrieveRecords):
22         (WebKit::CacheStorage::Engine::putRecords):
23         (WebKit::CacheStorage::Engine::deleteMatchingRecords):
24         (WebKit::CacheStorage::Engine::writeCachesToDisk):
25         (WebKit::CacheStorage::Engine::readCachesFromDisk):
26         (WebKit::CacheStorage::Engine::readCache):
27         (WebKit::CacheStorage::Engine::writeCacheRecords):
28         (WebKit::CacheStorage::Engine::removeCacheRecords):
29         (WebKit::CacheStorage::Engine::cache):
30         (WebKit::CacheStorage::Engine::caches const):
31         (WebKit::CacheStorage::Engine::queryCache):
32         * NetworkProcess/cache/CacheStorageEngineCache.h: Added.
33         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
34         (WebKit::CacheStorageEngineConnection::open):
35         (WebKit::CacheStorageEngineConnection::remove):
36         (WebKit::CacheStorageEngineConnection::caches):
37         (WebKit::CacheStorageEngineConnection::records):
38         (WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
39         (WebKit::CacheStorageEngineConnection::putRecords):
40         * WebKit.xcodeproj/project.pbxproj:
41         * WebProcess/Cache/WebCacheStorageConnection.cpp:
42         (WebKit::WebCacheStorageConnection::openCompleted):
43         (WebKit::WebCacheStorageConnection::removeCompleted):
44         (WebKit::WebCacheStorageConnection::updateCaches):
45         (WebKit::WebCacheStorageConnection::updateRecords):
46         (WebKit::WebCacheStorageConnection::deleteRecordsCompleted):
47         (WebKit::WebCacheStorageConnection::putRecordsCompleted):
48         * WebProcess/Cache/WebCacheStorageConnection.h:
49
50 2017-08-23  Youenn Fablet  <youenn@apple.com>
51
52         [Cache API] Enable persistent coder to encode FetchOptions
53         https://bugs.webkit.org/show_bug.cgi?id=175883
54
55         Reviewed by Alex Christensen.
56
57         Removing FetchOptions related ArgumentCoders specific code.
58
59         * Shared/WebCoreArgumentCoders.cpp:
60         * Shared/WebCoreArgumentCoders.h:
61
62 2017-08-23  Youenn Fablet  <youenn@apple.com>
63
64         CacheStorageEngine readCachesFromDisk callback should return the read Caches
65         https://bugs.webkit.org/show_bug.cgi?id=175882
66
67         Reviewed by Alex Christensen.
68
69         Callback of readCachesFromDisk takes now a Caches or error parameter.
70
71         * NetworkProcess/cache/CacheStorageEngine.cpp:
72         (WebKit::CacheStorageEngine::open):
73         (WebKit::CacheStorageEngine::retrieveCaches):
74         (WebKit::CacheStorageEngine::readCachesFromDisk):
75         * NetworkProcess/cache/CacheStorageEngine.h:
76
77 2017-08-23  Chris Dumez  <cdumez@apple.com>
78
79         Regression(r221059): NetworkDataTask::didReceiveResponse() should not use PolicyUse for HTTP/0.9
80         https://bugs.webkit.org/show_bug.cgi?id=175872
81
82         Reviewed by Daniel Bates.
83
84         r221059 was calling the ResponseCompletionHandler with {} which ended up being
85         PolicyUse. Since this is an error case and do not want to receive the data, it
86         makes more sense to use PolicyIgnore instead. There should not be a behavior
87         change on WebKit side though since we are cancelling the load right after
88         calling the completion handler anyway.
89
90         Tests under http/tests/security/http-0.9/ are still passing.
91
92         * NetworkProcess/NetworkDataTask.cpp:
93         (WebKit::NetworkDataTask::didReceiveResponse):
94
95 2017-08-22  Tim Horton  <timothy_horton@apple.com>
96
97         _WKThumbnailView should use the screen color space instead of sRGB
98         https://bugs.webkit.org/show_bug.cgi?id=175858
99         <rdar://problem/33925559>
100
101         Reviewed by Dean Jackson.
102
103         Currently, _WKThumbnailView uses software snapshotting via
104         WebPage's takeSnapshot and friends, which always use sRGB.
105         However, it is immediately presented in display space, which
106         causes an expensive color conversion, which could have been avoided
107         if the snapshot was instead originally taken in display space.
108
109         To solve this, add:
110
111         - a mechanism allowing ShareableBitmap to be constructed with a
112           configuration, which can include a color space as well as the
113           existing flags (flipping SupportsAlpha to be IsOpaque instead
114           because most callers want alpha)
115
116         - a WebImage constructor allowing callers to pass a ShareableBitmap
117           configuration through
118
119         - a bit in SnapshotOptions for callers to indicate that they
120           want to snapshot in the display's color space (repurposed
121           from the ExtendedColor bit)
122
123         And then make use of that bit in _WKThumbnailView.
124
125         * Shared/API/c/WKSharedAPICast.h:
126         (WebKit::snapshotOptionsFromImageOptions):
127         Remove this incorrect conversion (WKImageOptions doesn't include
128         kWKSnapshotOptionsExtendedColor).
129
130         (WebKit::toSnapshotOptions):
131         Plumb kWKSnapshotOptionsExtendedColor to WebKit::SnapshotOptions
132         as the "UseScreenColorSpace". Leave the SPI name intact because
133         it has clients, but the difference isn't so huge that it will be
134         a problem.
135
136         * Shared/ImageOptions.h:
137         (WebKit::snapshotOptionsToImageOptions):
138         Remove ImageOptionsExtendedColor, and rename
139         SnapshotOptionsExtendedColor to SnapshotOptionsUseScreenColorSpace.
140
141         * Shared/ShareableBitmap.cpp:
142         (WebKit::ShareableBitmap::Handle::Handle):
143         (WebKit::ShareableBitmap::Handle::encode const):
144         (WebKit::ShareableBitmap::Handle::decode):
145         (WebKit::ShareableBitmap::Handle::clear):
146         (WebKit::ShareableBitmap::Configuration::encode const):
147         (WebKit::ShareableBitmap::Configuration::decode):
148         (WebKit::ShareableBitmap::create):
149         (WebKit::ShareableBitmap::createShareable):
150         (WebKit::ShareableBitmap::createHandle const):
151         (WebKit::ShareableBitmap::ShareableBitmap):
152         (WebKit::ShareableBitmap::calculateBytesPerPixel):
153         (WebKit::calculateBytesPerPixel): Deleted.
154         * Shared/ShareableBitmap.h:
155         (WebKit::ShareableBitmap::numBytesForSize):
156         (WebKit::ShareableBitmap::sizeInBytes const):
157         * Shared/cg/ShareableBitmapCG.cpp:
158         (WebKit::colorSpace):
159         (WebKit::bitmapInfo):
160         (WebKit::ShareableBitmap::calculateBytesPerPixel):
161         (WebKit::ShareableBitmap::createGraphicsContext):
162         (WebKit::ShareableBitmap::createCGImage const):
163         Remove ShareableBitmap's flags parameter, and replace it with
164         a configuration parameter. Configuration is a struct that currently
165         encompasses the newly-flipped IsOpaque bit and (on Cocoa platforms)
166         a platform colorspace object. Compute bytesPerPixel dynamically
167         based on the colorspace and whether it uses extended colors or not.
168
169         * Shared/WebImage.cpp:
170         (WebKit::WebImage::create):
171         * Shared/WebImage.h:
172         Pass ShareableBitmap::Configuration through to the ShareableBitmap
173         constructor, if provided.
174
175         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
176         (-[_WKThumbnailView requestSnapshot]):
177         Make use of the new bit, and use the screen's color space.
178
179         * WebProcess/WebPage/WebPage.cpp:
180         (WebKit::snapshotOptionsToBitmapConfiguration):
181         (WebKit::WebPage::snapshotAtSize):
182         (WebKit::WebPage::snapshotNode):
183         If the snapshot option to use the display color space is set,
184         fill in the colorSpace field in the ShareableBitmap::Configuration
185         with the screen's color space.
186
187         (WebKit::WebPage::drawRectToImage):
188         * Shared/WebCoreArgumentCoders.cpp:
189         (IPC::encodeImage):
190         * Shared/ContextMenuContextData.cpp:
191         (WebKit::ContextMenuContextData::ContextMenuContextData):
192         * Shared/mac/RemoteLayerBackingStore.mm:
193         (WebKit::RemoteLayerBackingStore::swapToValidFrontBuffer):
194         * WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp:
195         (WebKit::InjectedBundleRangeHandle::renderedImage):
196         * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
197         (WebKit::NetscapePlugin::snapshot):
198         * WebProcess/Plugins/PDF/PDFPlugin.mm:
199         (WebKit::PDFPlugin::snapshot):
200         * WebProcess/Plugins/PluginProxy.cpp:
201         (WebKit::PluginProxy::geometryDidChange):
202         (WebKit::PluginProxy::updateBackingStore):
203         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
204         (WebKit::convertImageToBitmap):
205         (WebKit::convertCGImageToBitmap):
206         * WebProcess/WebPage/WebFrame.cpp:
207         (WebKit::WebFrame::createSelectionSnapshot const):
208         * WebProcess/WebPage/ios/WebPageIOS.mm:
209         (WebKit::WebPage::getPositionInformation):
210         Adopt ShareableBitmap::Configuration. Since IsOpaque
211         defaults to false, all callers who previously constructed
212         ShareableBitmap with SupportsAlpha now don't have to do anything.
213
214 2017-08-20  Wenson Hsieh  <wenson_hsieh@apple.com>
215
216         [iOS WK2] WKWebView schedules nonstop layout after pressing cmb+b,i,u inside a contenteditable div
217         https://bugs.webkit.org/show_bug.cgi?id=175116
218         <rdar://problem/28279301>
219
220         Reviewed by Darin Adler and Ryosuke Niwa.
221
222         Refactors WebPage::editorState to only use the StyleProperties derived from EditingStyle, instead of inserting
223         and removing a temporary node to figure out the style. Also adds hooks to notify the UI delegate of EditorState
224         changes.
225
226         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
227         * UIProcess/API/Cocoa/WKWebView.mm:
228         (nsTextAlignment):
229         (dictionaryRepresentationForEditorState):
230         (-[WKWebView _didChangeEditorState]):
231
232         Alerts the private UI delegate of UI-side EditorState updates.
233
234         (-[WKWebView _web_editorStateDidChange]):
235         (-[WKWebView _executeEditCommand:argument:completion:]):
236         * UIProcess/API/Cocoa/WKWebViewInternal.h:
237         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
238         * UIProcess/API/mac/WKView.mm:
239         (-[WKView _web_editorStateDidChange]):
240         * UIProcess/Cocoa/WebViewImpl.h:
241         * UIProcess/Cocoa/WebViewImpl.mm:
242         (WebKit::WebViewImpl::selectionDidChange):
243         * UIProcess/WebPageProxy.cpp:
244         (WebKit::WebPageProxy::executeEditCommand):
245
246         Change executeEditCommand(name, callback) to executeEditCommand(name, argument, callback) and lift out of iOS
247         platform code and into WebPage.cpp.
248
249         * UIProcess/WebPageProxy.h:
250         * UIProcess/ios/WKContentViewInteraction.mm:
251         (-[WKContentView executeEditCommandWithCallback:]):
252         (-[WKContentView _selectionChanged]):
253         * UIProcess/ios/WebPageProxyIOS.mm:
254         (WebKit::WebPageProxy::executeEditCommand): Deleted.
255
256         Move the iOS-specific implementation of executeEditCommand that invokes a callback when the web process responds
257         out of WebPageProxyIOS, and into cross-platform WebPageProxy code. Additionally, add a parameter for the edit
258         command's argument.
259
260         * WebProcess/WebPage/WebPage.cpp:
261         (WebKit::WebPage::editorState const):
262
263         Use EditingStyle::styleAtSelectionStart instead of Editor::styleForSelectionStart when computing an EditorState.
264         Tweak bold, italic and underline to use EditingStyle TriStates.
265
266         (WebKit::WebPage::executeEditCommandWithCallback):
267         * WebProcess/WebPage/WebPage.h:
268         * WebProcess/WebPage/WebPage.messages.in:
269         * WebProcess/WebPage/ios/WebPageIOS.mm:
270         (WebKit::WebPage::executeEditCommandWithCallback): Deleted.
271
272 2017-08-22  Wenson Hsieh  <wenson_hsieh@apple.com>
273
274         [WK2] EditorState updates should be rolled into the layer update lifecycle when possible
275         https://bugs.webkit.org/show_bug.cgi?id=175370
276         <rdar://problem/33799806>
277
278         Reviewed by Ryosuke Niwa.
279
280         See per-method comments for more detail. WebPage::didChangeSelection now schedules EditorState updates to be sent
281         during the next layer tree transaction rather than sending them synchronously. To ensure that iOS and Mac continue
282         to behave correctly w.r.t. EditorState updates, we immediately dispatch EditorStates in the following cases:
283         - After the composition changes, is confirmed, or is canceled.
284         - After an edit command is executed.
285         - After ending user-triggered selection changes.
286
287         * Shared/mac/RemoteLayerTreeTransaction.h:
288         (WebKit::RemoteLayerTreeTransaction::hasEditorState const):
289         (WebKit::RemoteLayerTreeTransaction::editorState const):
290         (WebKit::RemoteLayerTreeTransaction::setEditorState):
291
292         Attaches an optional EditorState to the RemoteLayerTreeTransaction. This EditorState is computed and sent over
293         when setting up the transaction in WebPage, if something previously scheduled an EditorState update.
294
295         * Shared/mac/RemoteLayerTreeTransaction.mm:
296         (WebKit::RemoteLayerTreeTransaction::encode const):
297         (WebKit::RemoteLayerTreeTransaction::decode):
298
299         Add coder support for sending over a layer tree transaction's EditorState.
300
301         * UIProcess/API/Cocoa/WKViewPrivate.h:
302         * UIProcess/API/mac/WKView.mm:
303         (-[WKView _doAfterNextPresentationUpdate:]):
304
305         Add _doAfterNextPresentationUpdate to WKView (used in TestWebKitAPI -- refer to
306         WebKitAgnosticTest::waitForNextPresentationUpdate).
307
308         * UIProcess/DrawingAreaProxy.h:
309         (WebKit::DrawingAreaProxy::dispatchPresentationCallbacksAfterFlushingLayers):
310         * UIProcess/DrawingAreaProxy.messages.in:
311
312         Add a new IPC messages, DispatchPresentationCallbacksAfterFlushingLayers, to invoke in-flight presentation
313         callbacks in the UI process following a layer flush in the web process.
314
315         * UIProcess/WebPageProxy.h:
316         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
317         (WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
318         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
319         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
320         (WebKit::TiledCoreAnimationDrawingAreaProxy::~TiledCoreAnimationDrawingAreaProxy):
321         (WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchAfterEnsuringDrawing):
322         (WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchPresentationCallbacksAfterFlushingLayers):
323
324         Run all pending _doAfterNextPresentationUpdate callbacks.
325
326         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
327         (WebKit::WebEditorClient::didApplyStyle):
328         (WebKit::WebEditorClient::respondToChangedContents):
329         (WebKit::WebEditorClient::didEndUserTriggeredSelectionChanges):
330         (WebKit::WebEditorClient::didUpdateComposition):
331
332         Forward editor client calls to the WebPage.
333
334         (WebKit::WebEditorClient::didChangeSelectionAndUpdateLayout): Deleted.
335         * WebProcess/WebCoreSupport/WebEditorClient.h:
336         * WebProcess/WebPage/WebPage.cpp:
337         (WebKit::WebPage::editorState const):
338         (WebKit::WebPage::updateEditorStateAfterLayoutIfEditabilityChanged):
339         (WebKit::WebPage::willCommitLayerTree):
340         (WebKit::WebPage::didApplyStyle):
341
342         Allow style application to immediately trigger EditorState updates, if we're not currently ignoring selection
343         changes in the Editor.
344
345         (WebKit::WebPage::didChangeContents):
346
347         Allow applying top-level edit commands to immediately trigger EditorState updates, if we're not currently
348         ignoring selection changes in the Editor.
349
350         (WebKit::WebPage::didChangeSelection):
351         (WebKit::WebPage::didUpdateComposition):
352         (WebKit::WebPage::didEndUserTriggeredSelectionChanges):
353         (WebKit::WebPage::discardedComposition):
354         (WebKit::WebPage::canceledComposition):
355
356         When handling composition updates, always send an EditorState to the UI process. Unlike other cases, IME
357         requires immediate EditorState data, so we need to be explicit here in sending updates right away.
358
359         (WebKit::WebPage::sendEditorStateUpdate):
360         (WebKit::WebPage::sendPartialEditorStateAndSchedulePostLayoutUpdate):
361         (WebKit::WebPage::flushPendingEditorStateUpdate):
362
363         Helper methods to schedule an EditorState update to be sent upon the next layer tree update, or flush any
364         pending EditorState update that has been scheduled. The private, more aggressive variant of this is
365         sendEditorStateUpdate, which ignores whether or not there was already an EditorState update scheduled, and sends
366         one anyways (this still fulfills any EditorState update that was previously scheduled).
367
368         These helper methods are treated as no-ops when invoked while ignoring selection changes. This is to prevent
369         temporary selection state and editor commands during operations such as text indicator snapshotting from pushing
370         bogus information about transient editor states to the UI process.
371
372         (WebKit::WebPage::sendPostLayoutEditorStateIfNeeded): Deleted.
373         * WebProcess/WebPage/WebPage.h:
374         * WebProcess/WebPage/ios/WebPageIOS.mm:
375         (WebKit::WebPage::platformEditorState const):
376         (WebKit::WebPage::executeEditCommandWithCallback):
377         (WebKit::selectionIsInsideFixedPositionContainer):
378         (WebKit::WebPage::updateVisibleContentRects):
379
380         Fix a hack that was computing an EditorState to figure out whether the current selection starts or ends in a
381         fixed position container. Factors out relevant logic into a separate helper, and also schedules an EditorState
382         update instead of immediately computing it.
383
384         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
385         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
386         (WebKit::TiledCoreAnimationDrawingArea::addTransactionCallbackID):
387
388         Add support for registering and dispatching presentation callbacks that hook into the layer flush lifecycle,
389         using the tiled CA drawing area. These are used by Mac LayoutTests and API tests that need to wait until the
390         next flush before checking for state that depends on EditorState updates in the UI process.
391
392         (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
393
394         Tell the WebPage to flush any pending EditorState updates.
395
396         * WebProcess/WebPage/mac/WebPageMac.mm:
397         (WebKit::WebPage::platformEditorState const):
398
399 2017-08-22  Brent Fulgham  <bfulgham@apple.com>
400
401         Relax keychain access to permit users to permanently allow client certificates
402         https://bugs.webkit.org/show_bug.cgi?id=175857
403         <rdar://problem/32293867>
404
405         Reviewed by Alex Christensen.
406
407         * NetworkProcess/mac/com.apple.WebKit.NetworkProcess.sb.in:
408         * WebProcess/com.apple.WebProcess.sb.in:
409
410 2017-08-22  Chris Dumez  <cdumez@apple.com>
411
412         Introduce a new CompletionHandler type and use it for NetworkDataTaskClient's completion handlers to help catch bugs
413         https://bugs.webkit.org/show_bug.cgi?id=175832
414
415         Reviewed by Alex Christensen.
416
417         Use new CompletionHandler type for NetworkDataTaskClient's completion handlers to help catch bugs.
418         It actually already found a bug in our HTTP 0.9 error handling which is fixed in this patch
419         as well.
420
421         * NetworkProcess/NetworkDataTask.cpp:
422         (WebKit::NetworkDataTask::didReceiveResponse):
423         * NetworkProcess/NetworkDataTask.h:
424         * NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
425         * NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
426         (WebKit::NetworkDataTaskCocoa::tryPasswordBasedAuthentication):
427         * Shared/Authentication/AuthenticationManager.cpp:
428         (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge):
429         * Shared/Authentication/AuthenticationManager.h:
430         * Shared/Authentication/mac/AuthenticationManager.mac.mm:
431         (WebKit::AuthenticationManager::tryUseCertificateInfoForChallenge):
432
433 2017-08-22  Alex Christensen  <achristensen@webkit.org>
434
435         Add UIDelegatePrivate SPI corresponding to WKPageUIClient.showPage
436         https://bugs.webkit.org/show_bug.cgi?id=175797
437         <rdar://problem/29270035>
438
439         Reviewed by Geoffrey Garen.
440
441         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
442         * UIProcess/Cocoa/UIDelegate.h:
443         * UIProcess/Cocoa/UIDelegate.mm:
444         (WebKit::UIDelegate::setDelegate):
445         (WebKit::UIDelegate::UIClient::showPage):
446         * WebProcess/WebPage/WebPage.cpp:
447         (WebKit::WebPage::registerURLSchemeHandler):
448         window.open, createWebViewWithConfiguration, and WKURLSchemeHandlers all used together
449         make it so that URLSchemeHandlers are added to WebPages that already have them.  The
450         assertions are no longer valid.
451
452 2017-08-22  Matt Lewis  <jlewis3@apple.com>
453
454         Unreviewed, rolling out r221026.
455
456         This caused a consistent API failure on iOS Simulator.
457
458         Reverted changeset:
459
460         "Add UIDelegatePrivate SPI corresponding to
461         WKPageUIClient.showPage"
462         https://bugs.webkit.org/show_bug.cgi?id=175797
463         http://trac.webkit.org/changeset/221026
464
465 2017-08-22  Ryan Haddad  <ryanhaddad@apple.com>
466
467         Unreviewed, rolling out r221027.
468
469         This change caused LayoutTests to exit early with assertion
470         failures.
471
472         Reverted changeset:
473
474         "Add sanity check for source origin in
475         WebLoaderStrategy::startPingLoad()"
476         https://bugs.webkit.org/show_bug.cgi?id=175827
477         http://trac.webkit.org/changeset/221027
478
479 2017-08-22  Chris Dumez  <cdumez@apple.com>
480
481         [WK2] Enable Beacon API by default
482         https://bugs.webkit.org/show_bug.cgi?id=175839
483
484         Reviewed by Youenn Fablet.
485
486         * Shared/WebPreferencesDefinitions.h:
487
488 2017-08-22  Tim Horton  <timothy_horton@apple.com>
489
490         REGRESSION (High Sierra): PDFPlugin won't render PostScript Files
491         https://bugs.webkit.org/show_bug.cgi?id=175840
492         <rdar://problem/33877923>
493
494         Reviewed by Brent Fulgham.
495
496         * WebProcess/com.apple.WebProcess.sb.in:
497         Add a sandbox exception for the PostScript conversion process.
498
499 2017-08-22  Chris Dumez  <cdumez@apple.com>
500
501         Clean up PingLoad::processContentExtensionRulesForLoad()
502         https://bugs.webkit.org/show_bug.cgi?id=175834
503
504         Reviewed by Alex Christensen.
505
506         * NetworkProcess/PingLoad.cpp:
507         (WebKit::PingLoad::willPerformHTTPRedirection):
508         (WebKit::PingLoad::processContentExtensionRulesForLoad):
509         * NetworkProcess/PingLoad.h:
510
511 2017-08-22  Alex Christensen  <achristensen@webkit.org>
512
513         Remove ChromeClient::scrollbarsModeDidChange
514         https://bugs.webkit.org/show_bug.cgi?id=175805
515
516         Reviewed by Daniel Bates.
517
518         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
519         (WebKit::WebChromeClient::scrollbarsModeDidChange const): Deleted.
520         * WebProcess/WebCoreSupport/WebChromeClient.h:
521
522 2017-08-22  Chris Dumez  <cdumez@apple.com>
523
524         Add sanity check for source origin in WebLoaderStrategy::startPingLoad()
525         https://bugs.webkit.org/show_bug.cgi?id=175827
526
527         Reviewed by Geoffrey Garen.
528
529         * WebProcess/Network/WebLoaderStrategy.cpp:
530         (WebKit::WebLoaderStrategy::startPingLoad):
531
532 2017-08-22  Alex Christensen  <achristensen@webkit.org>
533
534         Add UIDelegatePrivate SPI corresponding to WKPageUIClient.showPage
535         https://bugs.webkit.org/show_bug.cgi?id=175797
536         <rdar://problem/29270035>
537
538         Reviewed by Geoffrey Garen.
539
540         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
541         * UIProcess/Cocoa/UIDelegate.h:
542         * UIProcess/Cocoa/UIDelegate.mm:
543         (WebKit::UIDelegate::setDelegate):
544         (WebKit::UIDelegate::UIClient::showPage):
545         * WebProcess/WebPage/WebPage.cpp:
546         (WebKit::WebPage::registerURLSchemeHandler):
547         window.open, createWebViewWithConfiguration, and WKURLSchemeHandlers all used together
548         make it so that URLSchemeHandlers are added to WebPages that already have them.  The
549         assertions are no longer valid.
550
551 2017-08-22  Youenn Fablet  <youenn@apple.com>
552
553         [Cache API] Add support for overwriting responses with put on an existing record
554         https://bugs.webkit.org/show_bug.cgi?id=175825
555
556         Reviewed by Geoffrey Garen.
557
558         Add support for encoding/decoding the update counter.
559         Incrementing it when overwriting an existing response.
560         Storing the new body in addition to the new response.
561
562         * NetworkProcess/cache/CacheStorageEngine.cpp:
563         (WebKit::CacheStorageEngine::putRecords):
564         * Shared/WebCoreArgumentCoders.cpp:
565         (IPC::ArgumentCoder<CacheStorageConnection::Record>::encode):
566         (IPC::ArgumentCoder<CacheStorageConnection::Record>::decode):
567
568 2017-08-22  Alex Christensen  <achristensen@webkit.org>
569
570         Remove ChromeClient::hasOpenedPopup
571         https://bugs.webkit.org/show_bug.cgi?id=175804
572
573         Reviewed by Sam Weinig.
574
575         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
576         (WebKit::WebChromeClient::hasOpenedPopup const): Deleted.
577         * WebProcess/WebCoreSupport/WebChromeClient.h:
578
579 2017-08-22  Brent Fulgham  <bfulgham@apple.com> and Pranjal Jumde  <pjumde@apple.com>
580
581         Disable access to secure cookies if an HTTPS site loads mixed content
582         https://bugs.webkit.org/show_bug.cgi?id=157053
583         <rdar://problem/11290808>
584
585         Reviewed by Dan Bates.
586
587         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
588         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM): Pass new arguments needed by WebCore.
589         * NetworkProcess/NetworkConnectionToWebProcess.h:
590         * NetworkProcess/NetworkConnectionToWebProcess.messages.in: Updated the CookiesForDOM message with the new foundMixedContent
591         argument and the new didAccessSecureCookies reply.
592         * Shared/mac/CookieStorageShim.mm:
593         (WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL): Drive-by fix to use the right message.
594         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
595         (WebKit::WebPlatformStrategies::cookiesForDOM): Check and return whether secure cookies were accessed. Accept a new argument
596         indicating whether secure cookies should be included in the response.
597         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
598
599 2017-08-22  Zan Dobersek  <zdobersek@igalia.com>
600
601         [GTK][WPE] Rename StorageProcessMainGtk.cpp to StorageProcessMainGLib.cpp
602         https://bugs.webkit.org/show_bug.cgi?id=175814
603
604         Reviewed by Gyuyoung Kim.
605
606         Both GTK+ and WPE ports already compile the StorageProcessMainGtk.cpp
607         file, but it should be renamed to StorageProcessMainGLib and moved into
608         the StorageProcess/glib/ directory.
609
610         * PlatformGTK.cmake:
611         * PlatformWPE.cmake:
612         * StorageProcess/glib/StorageProcessMainGLib.cpp: Renamed from Source/WebKit/StorageProcess/gtk/StorageProcessMainGtk.cpp.
613
614 2017-08-21  Zan Dobersek  <zdobersek@igalia.com>
615
616         [WK] Add missing ENABLE(NETWORK_CACHE) build guards
617         https://bugs.webkit.org/show_bug.cgi?id=175769
618
619         Reviewed by Carlos Alberto Lopez Perez.
620
621         Given that the build guard exists, it should be possible to
622         compile the WebKit layer with the feature disabled. Missing
623         guards are added in order to achieve that.
624
625         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
626         * NetworkProcess/NetworkConnectionToWebProcess.h:
627         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
628         * NetworkProcess/NetworkProcess.h:
629         * NetworkProcess/NetworkResourceLoader.cpp:
630         (WebKit::NetworkResourceLoader::NetworkResourceLoader):
631         * NetworkProcess/soup/NetworkProcessSoup.cpp:
632         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
633         (WebKit::NetworkProcess::clearDiskCache):
634         * UIProcess/soup/WebProcessPoolSoup.cpp:
635         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
636         * WebProcess/Network/WebLoaderStrategy.cpp:
637         (WebKit::WebLoaderStrategy::storeDerivedDataToCache):
638
639 2017-08-21  Chris Dumez  <cdumez@apple.com>
640
641         [Beacon] Content extensions should be able to intercept Beacon / Ping redirects
642         https://bugs.webkit.org/show_bug.cgi?id=175746
643         <rdar://problem/33946050>
644
645         Reviewed by Alex Christensen.
646
647         Update PingLoad to process content extension rules upon redirect. This allows content
648         extensions to block and upgrade to HTTPS beacon / ping loads.
649
650         Because ping loads can outlive the WebProcess, the content extensions rules are passed
651         to the NetworkProcess when starting the Ping load. The PingLoad can then consult those
652         rules upon redirect, on the NetworkProcess side.
653
654         * NetworkProcess/NetworkResourceLoadParameters.cpp:
655         (WebKit::NetworkResourceLoadParameters::encode const):
656         (WebKit::NetworkResourceLoadParameters::decode):
657         * NetworkProcess/NetworkResourceLoadParameters.h:
658         * NetworkProcess/PingLoad.cpp:
659         (WebKit::PingLoad::willPerformHTTPRedirection):
660         (WebKit::PingLoad::contentExtensionsBackend):
661         (WebKit::PingLoad::processContentExtensionRulesForLoad):
662         * NetworkProcess/PingLoad.h:
663         * WebProcess/Network/WebLoaderStrategy.cpp:
664         (WebKit::WebLoaderStrategy::startPingLoad):
665
666 2017-08-21  Adrian Perez de Castro  <aperez@igalia.com>
667
668         [WPE][GTK] Unused variables in UserMediaProcessManager.cpp
669         https://bugs.webkit.org/show_bug.cgi?id=175799
670
671         Reviewed by Alex Christensen.
672
673         The code which uses the "audioExtensionPath" and "videoExtensionPath" variables is guarded
674         with "#if ENABLE(SANDBOX_EXTENSIONS)”, so do the same for the variables themselves.
675
676         * UIProcess/UserMediaProcessManager.cpp: Add missing guards.
677
678 2017-08-21  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
679
680         [PAL] Move spi/mac directory into PAL
681         https://bugs.webkit.org/show_bug.cgi?id=175649
682
683         Reviewed by Myles C. Maxfield.
684
685         * Platform/mac/MenuUtilities.mm:
686         * Shared/mac/WebCoreArgumentCodersMac.mm:
687         * Shared/mac/WebEventFactory.mm:
688         * Shared/mac/WebHitTestResultData.mm:
689         * UIProcess/API/Cocoa/WKWebView.mm:
690         * UIProcess/Cocoa/WebViewImpl.mm:
691         * UIProcess/mac/ServicesController.mm:
692         * UIProcess/mac/TextCheckerMac.mm:
693         * UIProcess/mac/ViewGestureControllerMac.mm:
694         * UIProcess/mac/WKImmediateActionController.h:
695         * UIProcess/mac/WKImmediateActionController.mm:
696         * UIProcess/mac/WKSharingServicePickerDelegate.mm:
697         * UIProcess/mac/WKTextFinderClient.mm:
698         * UIProcess/mac/WebContextMenuProxyMac.mm:
699         * UIProcess/mac/WebPageProxyMac.mm:
700         * WebProcess/cocoa/WebProcessCocoa.mm:
701
702 2017-08-21  Brady Eidson  <beidson@apple.com>
703
704         Split the one SWServer::Connection into SWClientConnection and SWServer::Connection.
705         https://bugs.webkit.org/show_bug.cgi?id=175745
706
707         Reviewed by Andy Estes.
708
709         * CMakeLists.txt:
710         * DerivedSources.make:
711         * WebKit.xcodeproj/project.pbxproj:
712
713         * StorageProcess/ServiceWorker/WebSWServerConnection.cpp: Renamed from Source/WebKit/WebProcess/Storage/WebSWServerConnection.cpp.
714         (WebKit::WebSWServerConnection::WebSWServerConnection):
715         (WebKit::WebSWServerConnection::~WebSWServerConnection):
716         (WebKit::WebSWServerConnection::disconnectedFromWebProcess):
717         (WebKit::WebSWServerConnection::rejectJobInClient):
718         * StorageProcess/ServiceWorker/WebSWServerConnection.h: Copied from Source/WebKit/WebProcess/Storage/WebSWServerConnection.h.
719         (WebKit::WebSWServerConnection::identifier const):
720         * StorageProcess/ServiceWorker/WebSWServerConnection.messages.in: Copied from Source/WebKit/WebProcess/Storage/WebSWServerConnection.messages.in.
721
722         * StorageProcess/StorageToWebProcessConnection.cpp:
723         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
724         (WebKit::StorageToWebProcessConnection::didClose):
725         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
726         (WebKit::StorageToWebProcessConnection::removeSWServerConnection):
727         * StorageProcess/StorageToWebProcessConnection.h:
728
729         * WebProcess/Storage/WebSWClientConnection.cpp: Copied from Source/WebKit/WebProcess/Storage/WebServiceWorkerProvider.cpp.
730         (WebKit::WebSWClientConnection::WebSWClientConnection):
731         (WebKit::WebSWClientConnection::~WebSWClientConnection):
732         (WebKit::WebSWClientConnection::scheduleJobInServer):
733         * WebProcess/Storage/WebSWClientConnection.h: Renamed from Source/WebKit/WebProcess/Storage/WebSWServerConnection.h.
734         (WebKit::WebSWClientConnection::identifier const):
735         * WebProcess/Storage/WebSWClientConnection.messages.in: Renamed from Source/WebKit/WebProcess/Storage/WebSWServerConnection.messages.in.
736
737         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
738         (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
739         * WebProcess/Storage/WebServiceWorkerProvider.h:
740
741         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
742         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
743         (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession):
744         * WebProcess/Storage/WebToStorageProcessConnection.h:
745
746 2017-08-21  Charlie Turner  <cturner@igalia.com>
747
748         MemoryCache::setCapacities assertion failure maxDeadBytes <= totalBytes
749         https://bugs.webkit.org/show_bug.cgi?id=175571
750
751         Reviewed by Antti Koivisto.
752
753         * Shared/CacheModel.cpp:
754         (WebKit::calculateMemoryCacheSizes): Ensure cacheTotalCapacity is
755         set to a reasonable value even in low-memory environments.
756
757 2017-08-20  Chris Dumez  <cdumez@apple.com>
758
759         Simplify calls to LoaderStrategy::startPingLoad()
760         https://bugs.webkit.org/show_bug.cgi?id=175756
761
762         Reviewed by Sam Weinig.
763
764         * WebProcess/Network/WebLoaderStrategy.cpp:
765         (WebKit::WebLoaderStrategy::startPingLoad):
766         * WebProcess/Network/WebLoaderStrategy.h:
767
768 2017-08-18  Chris Dumez  <cdumez@apple.com>
769
770         [Beacon] Improve error reporting
771         https://bugs.webkit.org/show_bug.cgi?id=175723
772
773         Reviewed by Darin Adler.
774
775         Have Ping loads such as beacons report errors via their completion handler.
776         The Beacon API is using this error to log a console message when beacon loads
777         fail, provided that the page is still alive.
778
779         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
780         (WebKit::NetworkConnectionToWebProcess::loadPing):
781         (WebKit::NetworkConnectionToWebProcess::didFinishPingLoad):
782         * NetworkProcess/NetworkConnectionToWebProcess.h:
783         * NetworkProcess/PingLoad.cpp:
784         (WebKit::PingLoad::~PingLoad):
785         (WebKit::PingLoad::didFinish):
786         (WebKit::PingLoad::willPerformHTTPRedirection):
787         (WebKit::PingLoad::didReceiveChallenge):
788         (WebKit::PingLoad::didReceiveResponseNetworkSession):
789         (WebKit::PingLoad::didCompleteWithError):
790         (WebKit::PingLoad::wasBlocked):
791         (WebKit::PingLoad::cannotShowURL):
792         (WebKit::PingLoad::timeoutTimerFired):
793         (WebKit::PingLoad::currentRequest const):
794         (WebKit::PingLoad::makeCrossOriginAccessRequestWithPreflight):
795         * NetworkProcess/PingLoad.h:
796         * WebProcess/Network/NetworkProcessConnection.cpp:
797         (WebKit::NetworkProcessConnection::didFinishPingLoad):
798         * WebProcess/Network/NetworkProcessConnection.h:
799         * WebProcess/Network/NetworkProcessConnection.messages.in:
800         * WebProcess/Network/WebLoaderStrategy.cpp:
801         (WebKit::WebLoaderStrategy::networkProcessCrashed):
802         (WebKit::WebLoaderStrategy::startPingLoad):
803         (WebKit::WebLoaderStrategy::didFinishPingLoad):
804         * WebProcess/Network/WebLoaderStrategy.h:
805
806 2017-08-18  Chris Dumez  <cdumez@apple.com>
807
808         REGRESSION (r220601): Crash when closing google doc after switching the order of tabs in safari
809         https://bugs.webkit.org/show_bug.cgi?id=175721
810         <rdar://problem/33928369>
811
812         Reviewed by Geoffrey Garen.
813
814         Make sure WebProcess::markAllLayersVolatile() does not call WTFMove() multiple times
815         on the same completion handler. Use a RefCounter to hold on to the completion handler
816         and make sure the handler gets called when the RefCounter's value becomes 0.
817
818         * WebProcess/WebProcess.cpp:
819         (WebKit::WebProcess::cancelPrepareToSuspend):
820         (WebKit::WebProcess::markAllLayersVolatile):
821         (WebKit::WebProcess::cancelMarkAllLayersVolatile):
822         * WebProcess/WebProcess.h:
823
824 2017-08-18  Youenn Fablet  <youenn@apple.com>
825
826         [Cache API] Add response body storage
827         https://bugs.webkit.org/show_bug.cgi?id=175658
828
829         Reviewed by Alex Christensen.
830
831         Added IPC serialization of Record response body.
832         Updated CacheStorageEngine implementation as Record has no longer a copy constructor.
833
834         * NetworkProcess/cache/CacheStorageEngine.cpp:
835         (WebKit::CacheStorageEngine::retrieveRecords):
836         (WebKit::CacheStorageEngine::deleteMatchingRecords):
837         * Shared/WebCoreArgumentCoders.cpp:
838         (IPC::encodeSharedBuffer):
839         (IPC::decodeSharedBuffer):
840         (IPC::ArgumentCoder<CacheStorageConnection::Record>::encode):
841         (IPC::ArgumentCoder<CacheStorageConnection::Record>::decode):
842
843 2017-08-18  Brady Eidson  <beidson@apple.com>
844
845         Bounce ServiceWorker jobs to the Storage Process.
846         https://bugs.webkit.org/show_bug.cgi?id=175650
847
848         Reviewed by Andy Estes.
849
850         * CMakeLists.txt:
851         * DerivedSources.make:
852         * WebKit.xcodeproj/project.pbxproj:
853
854         * Platform/Logging.h:
855
856         * StorageProcess/StorageToWebProcessConnection.cpp:
857         (WebKit::StorageToWebProcessConnection::didReceiveMessage):
858         (WebKit::StorageToWebProcessConnection::didClose):
859         (WebKit::StorageToWebProcessConnection::establishSWServerConnection):
860         (WebKit::StorageToWebProcessConnection::removeSWServerConnection):
861         (WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer):
862         * StorageProcess/StorageToWebProcessConnection.h:
863         * StorageProcess/StorageToWebProcessConnection.messages.in:
864
865         * WebProcess/Storage/WebSWServerConnection.cpp: Added.
866         (WebKit::WebSWServerConnection::WebSWServerConnection):
867         (WebKit::WebSWServerConnection::~WebSWServerConnection):
868         (WebKit::WebSWServerConnection::disconnectedFromWebProcess):
869         (WebKit::WebSWServerConnection::scheduleJob):
870         (WebKit::WebSWServerConnection::scheduleStorageJob):
871         * WebProcess/Storage/WebSWServerConnection.h: Copied from Source/WebCore/workers/service/ServiceWorkerJob.h.
872         (WebKit::WebSWServerConnection::create):
873         (WebKit::WebSWServerConnection::identifier const):
874         * WebProcess/Storage/WebSWServerConnection.messages.in: Copied from Source/WebKit/StorageProcess/StorageToWebProcessConnection.messages.in.
875
876         * WebProcess/Storage/WebServiceWorkerProvider.cpp:
877         (WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
878         (WebKit::WebServiceWorkerProvider::scheduleJob): Deleted.
879         * WebProcess/Storage/WebServiceWorkerProvider.h:
880
881         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
882         (WebKit::WebToStorageProcessConnection::didReceiveMessage):
883         (WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession):
884         * WebProcess/Storage/WebToStorageProcessConnection.h:
885
886 2017-08-18  Chris Dumez  <cdumez@apple.com>
887
888         [Beacon] Add support for quota limitation
889         https://bugs.webkit.org/show_bug.cgi?id=175443
890         <rdar://problem/33729002>
891
892         Reviewed by Youenn Fablet.
893
894         WebLoaderStrategy now generates an identifier for ping loads and keep
895         the completion handler in a local HashMap. Once the ping load is done,
896         the network process sends an IPC message back to the WebContent process
897         so that WebLoaderStrategy can look up the completion handler for the
898         ping load and call it.
899
900         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
901         (WebKit::NetworkConnectionToWebProcess::loadPing):
902         (WebKit::NetworkConnectionToWebProcess::didFinishPingLoad):
903         * NetworkProcess/NetworkConnectionToWebProcess.h:
904         * NetworkProcess/PingLoad.cpp:
905         (WebKit::PingLoad::PingLoad):
906         (WebKit::PingLoad::~PingLoad):
907         * NetworkProcess/PingLoad.h:
908         * WebProcess/Network/NetworkProcessConnection.cpp:
909         (WebKit::NetworkProcessConnection::didFinishPingLoad):
910         * WebProcess/Network/NetworkProcessConnection.h:
911         * WebProcess/Network/NetworkProcessConnection.messages.in:
912         * WebProcess/Network/WebLoaderStrategy.cpp:
913         (WebKit::generatePingLoadIdentifier):
914         (WebKit::WebLoaderStrategy::startPingLoad):
915         (WebKit::WebLoaderStrategy::didFinishPingLoad):
916         * WebProcess/Network/WebLoaderStrategy.h:
917
918 2017-08-18  Youenn Fablet  <youenn@apple.com>
919
920         [Cache API] Add a WK2 implementation of CacheStorageConnection
921         https://bugs.webkit.org/show_bug.cgi?id=175640
922
923         Reviewed by Alex Christensen & Chris Dumez.
924
925         Adding WebCacheStorageConnection as an implementation of CacheStorageConnection.
926         Making WebCacheStorageProvider instantiates such class.
927         One WebCacheStorageConnection is created for each session of a given WebProcess.
928
929         WebCacheStorageConnection is sending IPC calls to the network process.
930         Main implementation of the cache API is done in the network process by CacheStorageEngineConnection and CacheStorageEngine.
931         There is one WebCacheStorageConnection per session.
932         WebCacheStorageConnection is passing the session ID for each call to the network process to ensure the right cache storage engine is used.
933
934         CacheStorageEngineConnection mirrors WebCacheStorageConnection on the network process.
935         There is one CacheStorageEngine per session and CacheStorageEngineConnection will select the right CacheStorageEngine using the given session ID.
936
937         CacheStorageEngine is responsible of storing and matching cache API records.
938         Current implementation only keeps in memory the cached objects.
939
940         CacheStorageEngine is keeping (for each different origin) caches and records as a Vector as the order of insertion is important as per spec.
941         It also keeps a list of removed caches. These caches should remain functional until the last web page having access to these is gone.
942         The mechanism to fully remove these caches is not implemented yet.
943
944         Adding IPC encodings for WTF::Expected, CacheQueryOptions, FetchOptions, CacheStorageConnection Record and CacheInfo.
945
946         * CMakeLists.txt:
947         * DerivedSources.make:
948         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
949         (WebKit::NetworkConnectionToWebProcess::didReceiveMessage):
950         (WebKit::generateCacheStorageConnectionIdentifier):
951         (WebKit::NetworkConnectionToWebProcess::createCacheStorageConnection):
952         (WebKit::NetworkConnectionToWebProcess::closeCacheStorageConnection):
953         * NetworkProcess/NetworkConnectionToWebProcess.h:
954         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
955         * NetworkProcess/cache/CacheStorageEngine.cpp: Added.
956         (WebKit::defaultCacheStorageEngine):
957         (WebKit::globalEngineMap):
958         (WebKit::CacheStorageEngine::from):
959         (WebKit::CacheStorageEngine::destroyEngine):
960         (WebKit::CacheStorageEngine::defaultEngine):
961         (WebKit::CacheStorageEngine::open):
962         (WebKit::CacheStorageEngine::remove):
963         (WebKit::CacheStorageEngine::retrieveCaches):
964         (WebKit::CacheStorageEngine::retrieveRecords):
965         (WebKit::CacheStorageEngine::putRecords):
966         (WebKit::CacheStorageEngine::deleteMatchingRecords):
967         (WebKit::CacheStorageEngine::writeCachesToDisk):
968         (WebKit::CacheStorageEngine::readCachesFromDisk):
969         (WebKit::CacheStorageEngine::readCache):
970         (WebKit::CacheStorageEngine::writeCacheRecords):
971         (WebKit::CacheStorageEngine::removeCacheRecords):
972         (WebKit::CacheStorageEngine::cache):
973         (WebKit::CacheStorageEngine::caches const):
974         (WebKit::CacheStorageEngine::records):
975         (WebKit::CacheStorageEngine::queryCache):
976         * NetworkProcess/cache/CacheStorageEngine.h: Added.
977         * NetworkProcess/cache/CacheStorageEngineConnection.cpp: Added.
978         (WebKit::CacheStorageEngineConnection::CacheStorageEngineConnection):
979         (WebKit::CacheStorageEngineConnection::open):
980         (WebKit::CacheStorageEngineConnection::remove):
981         (WebKit::CacheStorageEngineConnection::caches):
982         (WebKit::CacheStorageEngineConnection::records):
983         (WebKit::CacheStorageEngineConnection::deleteMatchingRecords):
984         (WebKit::CacheStorageEngineConnection::putRecords):
985         * NetworkProcess/cache/CacheStorageEngineConnection.h: Added.
986         (WebKit::CacheStorageEngineConnection::create):
987         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in: Added.
988         * Platform/IPC/ArgumentCoders.h:
989         * Shared/WebCoreArgumentCoders.cpp:
990         (IPC::ArgumentCoder<CacheQueryOptions>::encode):
991         (IPC::ArgumentCoder<CacheQueryOptions>::decode):
992         (IPC::ArgumentCoder<FetchOptions>::encode):
993         (IPC::ArgumentCoder<FetchOptions>::decode):
994         (IPC::ArgumentCoder<CacheStorageConnection::CacheInfo>::encode):
995         (IPC::ArgumentCoder<CacheStorageConnection::CacheInfo>::decode):
996         (IPC::ArgumentCoder<CacheStorageConnection::Record>::encode):
997         (IPC::ArgumentCoder<CacheStorageConnection::Record>::decode):
998         * Shared/WebCoreArgumentCoders.h:
999         * WebKit.xcodeproj/project.pbxproj:
1000         * WebProcess/Cache/WebCacheStorageConnection.cpp: Added.
1001         (WebKit::WebCacheStorageConnection::WebCacheStorageConnection):
1002         (WebKit::WebCacheStorageConnection::~WebCacheStorageConnection):
1003         (WebKit::WebCacheStorageConnection::messageSenderConnection):
1004         (WebKit::WebCacheStorageConnection::doOpen):
1005         (WebKit::WebCacheStorageConnection::doRemove):
1006         (WebKit::WebCacheStorageConnection::doRetrieveCaches):
1007         (WebKit::WebCacheStorageConnection::doRetrieveRecords):
1008         (WebKit::WebCacheStorageConnection::doBatchDeleteOperation):
1009         (WebKit::WebCacheStorageConnection::doBatchPutOperation):
1010         (WebKit::WebCacheStorageConnection::openCompleted):
1011         (WebKit::WebCacheStorageConnection::removeCompleted):
1012         (WebKit::WebCacheStorageConnection::updateCaches):
1013         (WebKit::WebCacheStorageConnection::updateRecords):
1014         (WebKit::WebCacheStorageConnection::deleteRecordsCompleted):
1015         (WebKit::WebCacheStorageConnection::putRecordsCompleted):
1016         * WebProcess/Cache/WebCacheStorageConnection.h: Added.
1017         * WebProcess/Cache/WebCacheStorageConnection.messages.in: Added.
1018         * WebProcess/Cache/WebCacheStorageProvider.cpp: Copied from Source/WebKit/WebProcess/Cache/WebCacheStorageProvider.h.
1019         (WebKit::WebCacheStorageProvider::createCacheStorageConnection):
1020         * WebProcess/Cache/WebCacheStorageProvider.h:
1021         * WebProcess/Network/NetworkProcessConnection.cpp:
1022         (WebKit::NetworkProcessConnection::didReceiveMessage):
1023
1024 2017-08-18  Commit Queue  <commit-queue@webkit.org>
1025
1026         Unreviewed, rolling out r220854.
1027         https://bugs.webkit.org/show_bug.cgi?id=175716
1028
1029         I'm not sure we really need this (Requested by KaL on
1030         #webkit).
1031
1032         Reverted changeset:
1033
1034         "[GTK][WPE] Add NTLM authentication enabled API"
1035         https://bugs.webkit.org/show_bug.cgi?id=122952
1036         http://trac.webkit.org/changeset/220854
1037
1038 2017-08-15  Megan Gardner  <megan_gardner@apple.com>
1039
1040         Update to changeSelectionWithTouchAt:baseIsStart:withFlags:
1041         https://bugs.webkit.org/show_bug.cgi?id=175615
1042
1043         Update calls to use the flag versions, as they are used for passing state.
1044         Leave old calls, but set them up to be removed next cycle.
1045
1046         Reviewed by Tim Horton.
1047
1048         * Platform/spi/ios/UIKitSPI.h:
1049         * UIProcess/ios/WKContentViewInteraction.mm:
1050         (selectionChangedWithTouch):
1051         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:]):
1052         (-[WKContentView changeSelectionWithGestureAt:withGesture:withState:withFlags:]):
1053         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:]):
1054         (-[WKContentView changeSelectionWithTouchAt:withSelectionTouch:baseIsStart:withFlags:]):
1055
1056 2017-08-17  Chris Dumez  <cdumez@apple.com>
1057
1058         Regression(r220817): We should only copy the original request headers for Ping loads
1059         https://bugs.webkit.org/show_bug.cgi?id=175679
1060
1061         Reviewed by Youenn Fablet.
1062
1063         For performance reason, we should only copy the original request headers for Ping loads
1064         (Beacon at the moment), not for all CachedResourceRequests.
1065
1066         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1067         (WebKit::NetworkConnectionToWebProcess::loadPing):
1068         * NetworkProcess/NetworkConnectionToWebProcess.h:
1069         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1070         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1071         (WebKit::NetworkResourceLoadParameters::encode const):
1072         (WebKit::NetworkResourceLoadParameters::decode):
1073         * NetworkProcess/NetworkResourceLoadParameters.h:
1074         * NetworkProcess/PingLoad.cpp:
1075         (WebKit::PingLoad::PingLoad):
1076         (WebKit::PingLoad::willPerformHTTPRedirection):
1077         (WebKit::PingLoad::makeCrossOriginAccessRequest):
1078         (WebKit::PingLoad::makeSimpleCrossOriginAccessRequest):
1079         (WebKit::PingLoad::originalRequestHeaders const): Deleted.
1080         * NetworkProcess/PingLoad.h:
1081         * WebProcess/Network/WebLoaderStrategy.cpp:
1082         (WebKit::WebLoaderStrategy::createPingHandle):
1083         * WebProcess/Network/WebLoaderStrategy.h:
1084
1085 2017-08-17  Don Olmstead  <don.olmstead@sony.com>
1086
1087         [PAL] Relocate SessionID to root
1088         https://bugs.webkit.org/show_bug.cgi?id=175684
1089
1090         Reviewed by Alex Christensen.
1091
1092         * NetworkProcess/Downloads/Download.h:
1093         * NetworkProcess/Downloads/DownloadManager.cpp:
1094         * NetworkProcess/NetworkCORSPreflightChecker.h:
1095         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1096         * NetworkProcess/NetworkLoad.cpp:
1097         * NetworkProcess/NetworkLoadParameters.h:
1098         * NetworkProcess/NetworkProcess.cpp:
1099         * NetworkProcess/NetworkProcess.h:
1100         * NetworkProcess/NetworkResourceLoadParameters.h:
1101         * NetworkProcess/NetworkSession.h:
1102         * NetworkProcess/NetworkSocketStream.h:
1103         * NetworkProcess/RemoteNetworkingContext.h:
1104         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1105         * Scripts/webkit/messages.py:
1106         (forward_declarations_and_headers.templates): Deleted.
1107         (class_template_headers.template): Deleted.
1108         * Shared/ChildProcess.cpp:
1109         * Shared/SessionTracker.h:
1110         * Shared/Storage/StorageProcessCreationParameters.h:
1111         * Shared/WebCoreArgumentCoders.cpp:
1112         * Shared/WebPageCreationParameters.h:
1113         * Shared/WebProcessCreationParameters.h:
1114         * Shared/WebsiteDataStoreParameters.h:
1115         * Shared/mac/CookieStorageShim.mm:
1116         * StorageProcess/IndexedDB/WebIDBConnectionToClient.h:
1117         * StorageProcess/StorageProcess.cpp:
1118         * StorageProcess/StorageProcess.h:
1119         * StorageProcess/StorageToWebProcessConnection.h:
1120         * UIProcess/API/APIPageConfiguration.h:
1121         * UIProcess/API/APIWebsiteDataStore.h:
1122         * UIProcess/API/glib/WebKitCookieManager.cpp:
1123         * UIProcess/Plugins/PlugInAutoStartProvider.h:
1124         * UIProcess/WebCookieManagerProxy.h:
1125         * UIProcess/WebProcessPool.cpp:
1126         * UIProcess/WebProcessPool.h:
1127         * UIProcess/WebProcessProxy.h:
1128         * UIProcess/WebsiteData/WebsiteDataStore.h:
1129         * WebProcess/Cookies/WebCookieManager.h:
1130         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
1131         * WebProcess/Databases/WebDatabaseProvider.cpp:
1132         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1133         * WebProcess/Network/NetworkProcessConnection.cpp:
1134         * WebProcess/Network/WebLoaderStrategy.cpp:
1135         * WebProcess/Network/WebSocketStream.cpp:
1136         * WebProcess/Network/WebSocketStream.h:
1137         * WebProcess/Storage/WebToStorageProcessConnection.h:
1138         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1139         * WebProcess/WebCoreSupport/WebPlugInClient.h:
1140         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
1141         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
1142         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
1143         * WebProcess/WebPage/WebPage.cpp:
1144         * WebProcess/WebProcess.h:
1145
1146 2017-08-17  Chris Dumez  <cdumez@apple.com>
1147
1148         REGRESSION (r220601): Crash under ProcessAssertion::markAsInvalidated()
1149         https://bugs.webkit.org/show_bug.cgi?id=175685
1150         <rdar://problem/33868623>
1151
1152         Reviewed by Sam Weinig.
1153
1154         After r220601, it is no longer safe to call a default-initialized WTF::Function.
1155
1156         * UIProcess/ios/ProcessAssertionIOS.mm:
1157         (WebKit::ProcessAssertion::markAsInvalidated):
1158
1159 2017-08-17  Andreas Kling  <akling@apple.com>
1160
1161         Disable CSS regions at compile time
1162         https://bugs.webkit.org/show_bug.cgi?id=175630
1163
1164         Reviewed by Antti Koivisto.
1165
1166         * Configurations/FeatureDefines.xcconfig:
1167
1168 2017-08-17  Wenson Hsieh  <wenson_hsieh@apple.com>
1169
1170         [iOS] Respect type fidelities when copying image elements to the pasteboard
1171         https://bugs.webkit.org/show_bug.cgi?id=175638
1172         <rdar://problem/26556043>
1173
1174         Reviewed by Ryosuke Niwa.
1175
1176         Currently, we treat the case when copying an image enclosed by a link by only writing a URL to the pasteboard.
1177         This patch tweaks logic in WebPage::performActionOnElement to write both an image and a link to the pasteboard
1178         if the hit-tested image element is enclosed by an anchor.
1179
1180         * Platform/spi/ios/UIKitSPI.h:
1181         * WebProcess/WebPage/ios/WebPageIOS.mm:
1182         (WebKit::containingLinkElement):
1183
1184         Tweak this helper to be more restrictive when finding an enclosing 'link' -- only return an element if isLink()
1185         is true, and it is an HTMLAnchorElement. Currently, the isLink() also matches HTMLLinkElements, but this isn't
1186         the intention here.
1187
1188         (WebKit::WebPage::performActionOnElement):
1189
1190 2017-08-17  Jacobo Aragunde Pérez  <jaragunde@igalia.com>
1191
1192         [WPE][GTK] Ensure proper casting of data in gvariants
1193         https://bugs.webkit.org/show_bug.cgi?id=175667
1194
1195         Reviewed by Michael Catanzaro.
1196
1197         g_variant_builder_add requires data to have the correct width for their types, using
1198         casting if necessary. Corrected a call where a single precision float was being put
1199         into a double precision parameter without a cast.
1200
1201         * UIProcess/API/glib/WebKitWebViewSessionState.cpp:
1202         (encodeFrameState):
1203
1204 2017-08-17  Don Olmstead  <don.olmstead@sony.com>
1205
1206         [PAL] Move SessionID into PAL
1207         https://bugs.webkit.org/show_bug.cgi?id=174192
1208
1209         Reviewed by Antti Koivisto.
1210
1211         * NetworkProcess/Downloads/Download.cpp:
1212         (WebKit::Download::Download):
1213         * NetworkProcess/Downloads/Download.h:
1214         (WebKit::Download::Download):
1215         * NetworkProcess/Downloads/DownloadManager.cpp:
1216         (WebKit::DownloadManager::startDownload):
1217         (WebKit::DownloadManager::resumeDownload):
1218         * NetworkProcess/Downloads/DownloadManager.h:
1219         (WebKit::DownloadManager::startDownload):
1220         * NetworkProcess/NetworkCORSPreflightChecker.h:
1221         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
1222         (WebKit::NetworkConnectionToWebProcess::createSocketStream):
1223         (WebKit::storageSession):
1224         (WebKit::NetworkConnectionToWebProcess::startDownload):
1225         (WebKit::NetworkConnectionToWebProcess::convertMainResourceLoadToDownload):
1226         (WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
1227         (WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
1228         (WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
1229         (WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
1230         (WebKit::NetworkConnectionToWebProcess::getRawCookies):
1231         (WebKit::NetworkConnectionToWebProcess::deleteCookie):
1232         (WebKit::NetworkConnectionToWebProcess::ensureLegacyPrivateBrowsingSession):
1233         * NetworkProcess/NetworkConnectionToWebProcess.h:
1234         (WebKit::NetworkConnectionToWebProcess::startDownload):
1235         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
1236         * NetworkProcess/NetworkLoad.cpp:
1237         * NetworkProcess/NetworkLoadParameters.h:
1238         * NetworkProcess/NetworkProcess.cpp:
1239         (WebKit::NetworkProcess::initializeNetworkProcess):
1240         (WebKit::NetworkProcess::destroySession):
1241         (WebKit::fetchDiskCacheEntries):
1242         (WebKit::NetworkProcess::fetchWebsiteData):
1243         (WebKit::NetworkProcess::deleteWebsiteData):
1244         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
1245         (WebKit::NetworkProcess::downloadRequest):
1246         (WebKit::NetworkProcess::resumeDownload):
1247         * NetworkProcess/NetworkProcess.h:
1248         * NetworkProcess/NetworkProcess.messages.in:
1249         * NetworkProcess/NetworkResourceLoadParameters.h:
1250         * NetworkProcess/NetworkResourceLoader.h:
1251         * NetworkProcess/NetworkSession.cpp:
1252         (WebKit::NetworkSession::create):
1253         (WebKit::NetworkSession::defaultSession):
1254         (WebKit::NetworkSession::NetworkSession):
1255         * NetworkProcess/NetworkSession.h:
1256         (WebKit::NetworkSession::sessionID const):
1257         * NetworkProcess/NetworkSocketStream.cpp:
1258         (WebKit::NetworkSocketStream::create):
1259         (WebKit::NetworkSocketStream::NetworkSocketStream):
1260         * NetworkProcess/NetworkSocketStream.h:
1261         * NetworkProcess/RemoteNetworkingContext.h:
1262         * NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
1263         (WebKit::NetworkCache::SpeculativeLoad::SpeculativeLoad):
1264         * NetworkProcess/cocoa/NetworkSessionCocoa.h:
1265         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
1266         (WebKit::configurationForSessionID):
1267         (WebKit::NetworkSessionCocoa::create):
1268         (WebKit::NetworkSessionCocoa::defaultSession):
1269         (WebKit::NetworkSessionCocoa::NetworkSessionCocoa):
1270         * NetworkProcess/soup/NetworkSessionSoup.cpp:
1271         (WebKit::NetworkSessionSoup::NetworkSessionSoup):
1272         * NetworkProcess/soup/NetworkSessionSoup.h:
1273         * Scripts/webkit/messages.py:
1274         (forward_declarations_and_headers.templates): Deleted.
1275         (class_template_headers.template): Deleted.
1276         * Shared/ChildProcess.cpp:
1277         (WebKit::ChildProcess::initialize):
1278         * Shared/SessionTracker.cpp:
1279         (WebKit::staticSessionMap):
1280         (WebKit::SessionTracker::networkSession):
1281         (WebKit::SessionTracker::setSession):
1282         (WebKit::SessionTracker::destroySession):
1283         * Shared/SessionTracker.h:
1284         * Shared/Storage/StorageProcessCreationParameters.h:
1285         * Shared/WebCoreArgumentCoders.cpp:
1286         * Shared/WebCoreArgumentCoders.h:
1287         * Shared/WebPageCreationParameters.h:
1288         * Shared/WebProcessCreationParameters.h:
1289         * Shared/WebsiteDataStoreParameters.h:
1290         * Shared/mac/CookieStorageShim.mm:
1291         (WebKit::webKitCookieStorageCopyRequestHeaderFieldsForURL):
1292         * StorageProcess/IndexedDB/WebIDBConnectionToClient.cpp:
1293         (WebKit::WebIDBConnectionToClient::create):
1294         (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient):
1295         * StorageProcess/IndexedDB/WebIDBConnectionToClient.h:
1296         * StorageProcess/StorageProcess.cpp:
1297         (WebKit::StorageProcess::idbServer):
1298         (WebKit::StorageProcess::fetchWebsiteData):
1299         (WebKit::StorageProcess::deleteWebsiteData):
1300         (WebKit::StorageProcess::deleteWebsiteDataForOrigins):
1301         * StorageProcess/StorageProcess.h:
1302         * StorageProcess/StorageProcess.messages.in:
1303         * StorageProcess/StorageToWebProcessConnection.cpp:
1304         (WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer):
1305         * StorageProcess/StorageToWebProcessConnection.h:
1306         * StorageProcess/StorageToWebProcessConnection.messages.in:
1307         * UIProcess/API/APIPageConfiguration.cpp:
1308         (API::PageConfiguration::setWebsiteDataStore):
1309         (API::PageConfiguration::sessionID):
1310         (API::PageConfiguration::setSessionID):
1311         * UIProcess/API/APIPageConfiguration.h:
1312         * UIProcess/API/APIWebsiteDataStore.cpp:
1313         (API::WebsiteDataStore::defaultDataStore):
1314         (API::WebsiteDataStore::createLegacy):
1315         (API::WebsiteDataStore::WebsiteDataStore):
1316         * UIProcess/API/APIWebsiteDataStore.h:
1317         * UIProcess/API/C/WKCookieManager.cpp:
1318         (WKCookieManagerGetHostnamesWithCookies):
1319         (WKCookieManagerDeleteCookiesForHostname):
1320         (WKCookieManagerDeleteAllCookies):
1321         (WKCookieManagerDeleteAllCookiesModifiedAfterDate):
1322         (WKCookieManagerSetHTTPCookieAcceptPolicy):
1323         (WKCookieManagerGetHTTPCookieAcceptPolicy):
1324         (WKCookieManagerStartObservingCookieChanges):
1325         (WKCookieManagerStopObservingCookieChanges):
1326         * UIProcess/API/Cocoa/WKProcessPool.mm:
1327         (-[WKProcessPool _setCookieAcceptPolicy:]):
1328         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1329         (-[WKWebsiteDataStore _initWithConfiguration:]):
1330         * UIProcess/API/glib/WebKitCookieManager.cpp:
1331         (webkit_cookie_manager_set_accept_policy):
1332         (webkit_cookie_manager_get_accept_policy):
1333         * UIProcess/Network/NetworkProcessProxy.cpp:
1334         (WebKit::NetworkProcessProxy::fetchWebsiteData):
1335         (WebKit::NetworkProcessProxy::deleteWebsiteData):
1336         (WebKit::NetworkProcessProxy::deleteWebsiteDataForOrigins):
1337         * UIProcess/Network/NetworkProcessProxy.h:
1338         * UIProcess/Plugins/PlugInAutoStartProvider.cpp:
1339         (WebKit::PlugInAutoStartProvider::PlugInAutoStartProvider):
1340         (WebKit::PlugInAutoStartProvider::addAutoStartOriginHash):
1341         (WebKit::PlugInAutoStartProvider::autoStartOriginsTableCopy const):
1342         (WebKit::PlugInAutoStartProvider::setAutoStartOriginsTableWithItemsPassingTest):
1343         (WebKit::PlugInAutoStartProvider::didReceiveUserInteraction):
1344         * UIProcess/Plugins/PlugInAutoStartProvider.h:
1345         * UIProcess/Storage/StorageProcessProxy.cpp:
1346         (WebKit::StorageProcessProxy::fetchWebsiteData):
1347         (WebKit::StorageProcessProxy::deleteWebsiteData):
1348         (WebKit::StorageProcessProxy::deleteWebsiteDataForOrigins):
1349         * UIProcess/Storage/StorageProcessProxy.h:
1350         * UIProcess/WebCookieManagerProxy.cpp:
1351         (WebKit::WebCookieManagerProxy::getHostnamesWithCookies):
1352         (WebKit::WebCookieManagerProxy::deleteCookiesForHostname):
1353         (WebKit::WebCookieManagerProxy::deleteAllCookies):
1354         (WebKit::WebCookieManagerProxy::deleteCookie):
1355         (WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince):
1356         (WebKit::WebCookieManagerProxy::setCookie):
1357         (WebKit::WebCookieManagerProxy::setCookies):
1358         (WebKit::WebCookieManagerProxy::getAllCookies):
1359         (WebKit::WebCookieManagerProxy::getCookies):
1360         (WebKit::WebCookieManagerProxy::startObservingCookieChanges):
1361         (WebKit::WebCookieManagerProxy::stopObservingCookieChanges):
1362         (WebKit::WebCookieManagerProxy::setCookieObserverCallback):
1363         (WebKit::WebCookieManagerProxy::registerObserver):
1364         (WebKit::WebCookieManagerProxy::unregisterObserver):
1365         (WebKit::WebCookieManagerProxy::cookiesDidChange):
1366         (WebKit::WebCookieManagerProxy::setHTTPCookieAcceptPolicy):
1367         (WebKit::WebCookieManagerProxy::getHTTPCookieAcceptPolicy):
1368         * UIProcess/WebCookieManagerProxy.h:
1369         * UIProcess/WebCookieManagerProxy.messages.in:
1370         * UIProcess/WebPageProxy.h:
1371         (WebKit::WebPageProxy::sessionID const):
1372         * UIProcess/WebProcessPool.cpp:
1373         (WebKit::WebProcessPool::setAnyPageGroupMightHavePrivateBrowsingEnabled):
1374         (WebKit::WebProcessPool::createNewWebProcess):
1375         (WebKit::WebProcessPool::createWebPage):
1376         (WebKit::WebProcessPool::pageAddedToProcess):
1377         (WebKit::WebProcessPool::pageRemovedFromProcess):
1378         (WebKit::WebProcessPool::download):
1379         (WebKit::WebProcessPool::resumeDownload):
1380         (WebKit::WebProcessPool::addPlugInAutoStartOriginHash):
1381         (WebKit::WebProcessPool::plugInDidReceiveUserInteraction):
1382         * UIProcess/WebProcessPool.h:
1383         * UIProcess/WebProcessPool.messages.in:
1384         * UIProcess/WebProcessProxy.cpp:
1385         (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
1386         (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData):
1387         (WebKit::WebProcessProxy::fetchWebsiteData):
1388         (WebKit::WebProcessProxy::deleteWebsiteData):
1389         (WebKit::WebProcessProxy::deleteWebsiteDataForOrigins):
1390         * UIProcess/WebProcessProxy.h:
1391         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1392         (WebKit::WebsiteDataStore::createNonPersistent):
1393         (WebKit::WebsiteDataStore::create):
1394         (WebKit::WebsiteDataStore::WebsiteDataStore):
1395         (WebKit::WebsiteDataStore::~WebsiteDataStore):
1396         * UIProcess/WebsiteData/WebsiteDataStore.h:
1397         (WebKit::WebsiteDataStore::sessionID const):
1398         * WebProcess/Cookies/WebCookieManager.cpp:
1399         (WebKit::WebCookieManager::getHostnamesWithCookies):
1400         (WebKit::WebCookieManager::deleteCookiesForHostname):
1401         (WebKit::WebCookieManager::deleteAllCookies):
1402         (WebKit::WebCookieManager::deleteCookie):
1403         (WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
1404         (WebKit::WebCookieManager::getAllCookies):
1405         (WebKit::WebCookieManager::getCookies):
1406         (WebKit::WebCookieManager::setCookie):
1407         (WebKit::WebCookieManager::setCookies):
1408         (WebKit::WebCookieManager::notifyCookiesDidChange):
1409         (WebKit::WebCookieManager::startObservingCookieChanges):
1410         (WebKit::WebCookieManager::stopObservingCookieChanges):
1411         * WebProcess/Cookies/WebCookieManager.h:
1412         * WebProcess/Cookies/WebCookieManager.messages.in:
1413         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.cpp:
1414         (WebKit::WebIDBConnectionToServer::create):
1415         (WebKit::WebIDBConnectionToServer::WebIDBConnectionToServer):
1416         * WebProcess/Databases/IndexedDB/WebIDBConnectionToServer.h:
1417         * WebProcess/Databases/WebDatabaseProvider.cpp:
1418         (WebKit::WebDatabaseProvider::idbConnectionToServerForSession):
1419         * WebProcess/Databases/WebDatabaseProvider.h:
1420         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1421         (WebKit::InjectedBundle::setPrivateBrowsingEnabled):
1422         * WebProcess/Network/NetworkProcessConnection.cpp:
1423         (WebKit::NetworkProcessConnection::didCacheResource):
1424         * WebProcess/Network/NetworkProcessConnection.h:
1425         * WebProcess/Network/NetworkProcessConnection.messages.in:
1426         * WebProcess/Network/WebLoaderStrategy.cpp:
1427         (WebKit::WebLoaderStrategy::scheduleLoad):
1428         (WebKit::WebLoaderStrategy::loadResourceSynchronously):
1429         (WebKit::WebLoaderStrategy::createPingHandle):
1430         * WebProcess/Network/WebSocketProvider.cpp:
1431         (WebKit::WebSocketProvider::createSocketStreamHandle):
1432         * WebProcess/Network/WebSocketProvider.h:
1433         * WebProcess/Network/WebSocketStream.cpp:
1434         (WebKit::WebSocketStream::create):
1435         (WebKit::WebSocketStream::WebSocketStream):
1436         * WebProcess/Network/WebSocketStream.h:
1437         * WebProcess/Storage/WebToStorageProcessConnection.cpp:
1438         (WebKit::WebToStorageProcessConnection::idbConnectionToServerForSession):
1439         * WebProcess/Storage/WebToStorageProcessConnection.h:
1440         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1441         (WebKit::WebFrameLoaderClient::convertMainResourceLoadToDownload):
1442         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1443         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
1444         (WebKit::WebPlatformStrategies::cookieRequestHeaderFieldValue):
1445         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
1446         * WebProcess/WebCoreSupport/WebPlugInClient.cpp:
1447         (WebKit::WebPlugInClient::didStartFromOrigin):
1448         * WebProcess/WebCoreSupport/WebPlugInClient.h:
1449         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.h:
1450         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
1451         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
1452         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.cpp:
1453         (WebKit::WebFrameNetworkingContext::ensurePrivateBrowsingSession):
1454         * WebProcess/WebCoreSupport/soup/WebFrameNetworkingContext.h:
1455         * WebProcess/WebPage/WebFrame.cpp:
1456         (WebKit::WebFrame::startDownload):
1457         (WebKit::WebFrame::convertMainResourceLoadToDownload):
1458         * WebProcess/WebPage/WebFrame.h:
1459         * WebProcess/WebPage/WebPage.cpp:
1460         (WebKit::WebPage::setSessionID):
1461         (WebKit::WebPage::updatePreferences):
1462         * WebProcess/WebPage/WebPage.h:
1463         (WebKit::WebPage::sessionID const):
1464         * WebProcess/WebProcess.cpp:
1465         (WebKit::m_webSQLiteDatabaseTracker):
1466         (WebKit::WebProcess::ensurePrivateBrowsingSession):
1467         (WebKit::WebProcess::destroySession):
1468         (WebKit::WebProcess::isPlugInAutoStartOriginHash):
1469         (WebKit::WebProcess::plugInDidStartFromOrigin):
1470         (WebKit::WebProcess::didAddPlugInAutoStartOriginHash):
1471         (WebKit::WebProcess::resetPlugInAutoStartOriginDefaultHashes):
1472         (WebKit::WebProcess::resetPlugInAutoStartOriginHashes):
1473         (WebKit::WebProcess::plugInDidReceiveUserInteraction):
1474         (WebKit::WebProcess::fetchWebsiteData):
1475         (WebKit::WebProcess::deleteWebsiteData):
1476         (WebKit::WebProcess::deleteWebsiteDataForOrigins):
1477         * WebProcess/WebProcess.h:
1478         * WebProcess/WebProcess.messages.in:
1479
1480 2017-08-17  Joseph Pecoraro  <pecoraro@apple.com>
1481
1482         Fix typo: setUpInectedBundleClient
1483         https://bugs.webkit.org/show_bug.cgi?id=175655
1484
1485         Reviewed by Andreas Kling.
1486
1487         * UIProcess/API/Cocoa/WKProcessGroup.mm:
1488         (setUpInjectedBundleClient):
1489         (-[WKProcessGroup initWithInjectedBundleURL:]):
1490
1491 2017-08-17  Carlos Garcia Campos  <cgarcia@igalia.com>
1492
1493         [GTK][WPE] Add NTLM authentication enabled API
1494         https://bugs.webkit.org/show_bug.cgi?id=122952
1495
1496         Reviewed by Michael Catanzaro.
1497
1498         Add API to WebKitWebContext to enable/disable NTLM authentication.
1499
1500         * NetworkProcess/NetworkProcess.h:
1501         * NetworkProcess/NetworkProcess.messages.in:
1502         * NetworkProcess/NetworkProcessCreationParameters.cpp:
1503         (WebKit::NetworkProcessCreationParameters::encode const):
1504         (WebKit::NetworkProcessCreationParameters::decode):
1505         * NetworkProcess/NetworkProcessCreationParameters.h:
1506         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1507         (WebKit::NetworkProcess::platformInitializeNetworkProcess):
1508         (WebKit::NetworkProcess::setNTLMAuthenticationEnabled):
1509         * UIProcess/API/glib/WebKitWebContext.cpp:
1510         (webkit_web_context_get_ntlm_authentication_enabled):
1511         (webkit_web_context_set_ntlm_authentication_enabled):
1512         * UIProcess/API/gtk/WebKitWebContext.h:
1513         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
1514         * UIProcess/API/wpe/WebKitWebContext.h:
1515         * UIProcess/WebProcessPool.h:
1516         * UIProcess/soup/WebProcessPoolSoup.cpp:
1517         (WebKit::WebProcessPool::setNTLMAuthenticationEnabled):
1518
1519 2017-08-16  Andy Estes  <aestes@apple.com>
1520
1521         [Apple Pay] Rename PaymentRequest to ApplePaySessionPaymentRequest
1522         https://bugs.webkit.org/show_bug.cgi?id=175648
1523
1524         Reviewed by Tim Horton.
1525
1526         * Scripts/webkit/messages.py:
1527         (headers_for_type):
1528         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
1529         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::encode):
1530         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest>::decode):
1531         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::ContactFields>::encode):
1532         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::ContactFields>::decode):
1533         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::LineItem>::encode):
1534         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::LineItem>::decode):
1535         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::MerchantCapabilities>::encode):
1536         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::MerchantCapabilities>::decode):
1537         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::ShippingMethod>::encode):
1538         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::ShippingMethod>::decode):
1539         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::TotalAndLineItems>::encode):
1540         (IPC::ArgumentCoder<ApplePaySessionPaymentRequest::TotalAndLineItems>::decode):
1541         (IPC::ArgumentCoder<PaymentRequest>::encode): Deleted.
1542         (IPC::ArgumentCoder<PaymentRequest>::decode): Deleted.
1543         (IPC::ArgumentCoder<PaymentRequest::ContactFields>::encode): Deleted.
1544         (IPC::ArgumentCoder<PaymentRequest::ContactFields>::decode): Deleted.
1545         (IPC::ArgumentCoder<PaymentRequest::LineItem>::encode): Deleted.
1546         (IPC::ArgumentCoder<PaymentRequest::LineItem>::decode): Deleted.
1547         (IPC::ArgumentCoder<PaymentRequest::MerchantCapabilities>::encode): Deleted.
1548         (IPC::ArgumentCoder<PaymentRequest::MerchantCapabilities>::decode): Deleted.
1549         (IPC::ArgumentCoder<PaymentRequest::ShippingMethod>::encode): Deleted.
1550         (IPC::ArgumentCoder<PaymentRequest::ShippingMethod>::decode): Deleted.
1551         (IPC::ArgumentCoder<PaymentRequest::TotalAndLineItems>::encode): Deleted.
1552         (IPC::ArgumentCoder<PaymentRequest::TotalAndLineItems>::decode): Deleted.
1553         * Shared/WebCoreArgumentCoders.h:
1554         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
1555         (WebKit::WebPaymentCoordinatorProxy::showPaymentUI):
1556         (WebKit::WebPaymentCoordinatorProxy::didSelectShippingMethod):
1557         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
1558         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:
1559         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
1560         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
1561         (toShippingMethod):
1562         (WebKit::toPKContactFields):
1563         (WebKit::toPKAddressField):
1564         (WebKit::toPKPaymentSummaryItemType):
1565         (WebKit::toPKPaymentSummaryItem):
1566         (WebKit::toPKPaymentSummaryItems):
1567         (WebKit::toPKMerchantCapabilities):
1568         (WebKit::toPKShippingType):
1569         (WebKit::toPKShippingMethod):
1570         (WebKit::toPKPaymentRequest):
1571         * UIProcess/ApplePay/ios/WebPaymentCoordinatorProxyIOS.mm:
1572         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
1573         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
1574         (WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):
1575         * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
1576         (WebKit::WebPaymentCoordinator::showPaymentUI):
1577         (WebKit::WebPaymentCoordinator::didSelectShippingMethod):
1578         * WebProcess/ApplePay/WebPaymentCoordinator.h:
1579         * WebProcess/ApplePay/WebPaymentCoordinator.messages.in:
1580
1581 2017-08-16  Chris Dumez  <cdumez@apple.com>
1582
1583         Cross origin Beacon requests with a ArrayBuffer / ArrayBufferView payload should not do a CORS preflight
1584         https://bugs.webkit.org/show_bug.cgi?id=175628
1585         <rdar://problem/33919278>
1586
1587         Reviewed by Geoffrey Garen.
1588
1589         Cross origin Beacon requests with a ArrayBuffer / ArrayBufferView payload should not do a CORS preflight.
1590         To achieve this, the following changes were made:
1591         1. Revert r220779 which caused us to use a non CORS-safelisted Content-Type header for such payload
1592         2. Teach PingLoad how to deal with "simple" cross origin requests (i.e. Don't assume we need a CORS
1593            preflight merely because the fetch mode is set to "cors").
1594
1595         * NetworkProcess/NetworkCORSPreflightChecker.cpp:
1596         (WebKit::NetworkCORSPreflightChecker::startPreflight):
1597         * NetworkProcess/NetworkResourceLoadParameters.cpp:
1598         (WebKit::NetworkResourceLoadParameters::encode const):
1599         (WebKit::NetworkResourceLoadParameters::decode):
1600         * NetworkProcess/NetworkResourceLoadParameters.h:
1601         * NetworkProcess/PingLoad.cpp:
1602         (WebKit::PingLoad::PingLoad):
1603         (WebKit::PingLoad::loadRequest):
1604         (WebKit::PingLoad::originalRequestHeaders const):
1605         (WebKit::PingLoad::willPerformHTTPRedirection):
1606         (WebKit::PingLoad::isAllowedRedirect const):
1607         (WebKit::PingLoad::makeCrossOriginAccessRequest):
1608         (WebKit::PingLoad::makeSimpleCrossOriginAccessRequest):
1609         (WebKit::PingLoad::makeCrossOriginAccessRequestWithPreflight):
1610         (WebKit::PingLoad::preflightSuccess):
1611         * NetworkProcess/PingLoad.h:
1612         * WebProcess/Network/WebLoaderStrategy.cpp:
1613         (WebKit::WebLoaderStrategy::createPingHandle):
1614         * WebProcess/Network/WebLoaderStrategy.h:
1615
1616 2017-08-16  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
1617
1618         [PAL] Move spi/ios and spi/win directories into PAL
1619         https://bugs.webkit.org/show_bug.cgi?id=175171
1620
1621         Reviewed by Antti Koivisto.
1622
1623         * UIProcess/Cocoa/NavigationState.mm:
1624         * UIProcess/ios/WKActionSheetAssistant.h:
1625         * UIProcess/ios/WKActionSheetAssistant.mm:
1626         * UIProcess/ios/WKContentViewInteraction.mm:
1627         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
1628         * WebProcess/EntryPoint/mac/XPCService/WebContentServiceEntryPoint.mm:
1629         * WebProcess/cocoa/WebProcessCocoa.mm:
1630
1631 2017-08-16  Miguel Gomez  <magomez@igalia.com>
1632
1633         [GTK] Crash of WebProcess with on-demand AC
1634         https://bugs.webkit.org/show_bug.cgi?id=171161
1635
1636         Reviewed by Carlos Garcia Campos.
1637
1638         Set the viewOverlayRootLayer to the previous layerTreeHost if it exists. This avoids a
1639         crash when reusing the previous layerTreeHost, because it would keep a reference to an
1640         already destroyed viewOverlayRootLayer.
1641
1642         * WebProcess/WebPage/AcceleratedDrawingArea.cpp:
1643         (WebKit::AcceleratedDrawingArea::attachViewOverlayGraphicsLayer):
1644
1645 2017-08-16  Zan Dobersek  <zdobersek@igalia.com>
1646
1647         [CoordGraphics] Simplify CoordinatedGraphicsScene state updates
1648         https://bugs.webkit.org/show_bug.cgi?id=175528
1649         <rdar://problem/33876795>
1650
1651         Reviewed by Carlos Garcia Campos.
1652
1653         Hold the information about state updates in ThreadedCompositor, in the
1654         m_attributes struct. This way we don't need to store the updates in
1655         functors and accumulate them in the CoordinatedGraphicsScene class, but
1656         instead just apply any pending state update or atlas removal before the
1657         scene is rendered.
1658
1659         This removes the need to update the CoordinatedGraphicsScene object from
1660         the main thread with data that ultimately has to be handled on the
1661         composition thread. Similarly, when updating CoordinatedGraphicsScene, we
1662         only need to synchronize on the m_attributes lock object once in order to
1663         retrieve the scene update information, instead of having each functor do
1664         that repeatedly.
1665
1666         Outside of CoordinatedGraphicsScene and ThreadedCompositor classes, the
1667         CompositingCoordinator class now passes the atlases-to-remove Vector by
1668         a const lvalue reference down to ThreadedCompositor, and then manually
1669         clears the Vector. Before the Vector was passed as an rvalue reference,
1670         depending on the ThreadedCompositor code to clear out the original Vector
1671         object by moving its resources into the functor object. This doesn't occur
1672         anymore because the Vector object is now appended to another Vector.
1673
1674         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1675         (WebKit::CoordinatedGraphicsScene::applyStateChanges):
1676         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
1677         (WebKit::CoordinatedGraphicsScene::detach):
1678         (WebKit::CoordinatedGraphicsScene::setActive):
1679         (WebKit::CoordinatedGraphicsScene::syncRemoteContent): Deleted.
1680         (WebKit::CoordinatedGraphicsScene::appendUpdate): Deleted.
1681         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1682         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1683         (WebKit::ThreadedCompositor::renderLayerTree):
1684         (WebKit::ThreadedCompositor::updateSceneState):
1685         (WebKit::ThreadedCompositor::releaseUpdateAtlases):
1686         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1687         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
1688         (WebKit::CompositingCoordinator::flushPendingLayerChanges):
1689         (WebKit::CompositingCoordinator::releaseAtlases):
1690         (WebKit::CompositingCoordinator::clearUpdateAtlases):
1691         * WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
1692         * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
1693         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
1694         (WebKit::ThreadedCoordinatedLayerTreeHost::releaseUpdateAtlases):
1695         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
1696
1697 2017-08-16  Andy Estes  <aestes@apple.com>
1698
1699         [Payment Request] Add an ENABLE flag and an experimental feature preference
1700         https://bugs.webkit.org/show_bug.cgi?id=175622
1701
1702         Reviewed by Tim Horton.
1703
1704         * Configurations/FeatureDefines.xcconfig:
1705         * Shared/WebPreferencesDefinitions.h:
1706         * UIProcess/API/C/WKPreferences.cpp:
1707         (WKPreferencesSetPaymentRequestEnabled):
1708         (WKPreferencesGetPaymentRequestEnabled):
1709         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1710         * WebProcess/WebPage/WebPage.cpp:
1711         (WebKit::WebPage::updatePreferences):
1712
1713 2017-08-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1714
1715         [GTK][WPE] WebKitAutomationSession should set session client to nullptr on dispose
1716         https://bugs.webkit.org/show_bug.cgi?id=175564
1717
1718         Reviewed by Carlos Alberto Lopez Perez.
1719
1720         WebAutomationSession expects its client to be nullptr in the destructor.
1721
1722         * UIProcess/API/glib/WebKitAutomationSession.cpp:
1723         (webkitAutomationSessionDispose):
1724
1725 2017-08-15  Tim Horton  <timothy_horton@apple.com>
1726
1727         WKSnapshotConfiguration is missing from the WebKit umbrella header
1728         https://bugs.webkit.org/show_bug.cgi?id=175614
1729         <rdar://problem/33812691>
1730
1731         Reviewed by Dan Bernstein.
1732
1733         * Shared/API/Cocoa/WebKit.h:
1734         Add WKSnapshotConfiguration, which is a public header.
1735
1736 2017-08-15  Simon Fraser  <simon.fraser@apple.com>
1737
1738         Allow WebCore logging channels to be set from the UI process
1739         https://bugs.webkit.org/show_bug.cgi?id=175608
1740
1741         Reviewed by Tim Horton.
1742
1743         The UI process can now read the "WebCoreLogging" default, and pass it to the web process
1744         via WebProcessCreationParameters, where WebProcess::platformInitializeWebProcess() uses
1745         it to set up WebCore logging channels. Note that these will override channels read from
1746         the web process user defaults domain (but those are hard to set anyway).
1747
1748         * Shared/WebProcessCreationParameters.cpp:
1749         (WebKit::WebProcessCreationParameters::encode const):
1750         (WebKit::WebProcessCreationParameters::decode):
1751         * Shared/WebProcessCreationParameters.h:
1752         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1753         (WebKit::WebProcessPool::platformInitializeWebProcess):
1754         * WebProcess/cocoa/WebProcessCocoa.mm:
1755         (WebKit::WebProcess::platformInitializeWebProcess):
1756
1757 2017-08-15  Don Olmstead  <don.olmstead@sony.com>
1758
1759         [PAL] Move Sleep classes into PAL
1760         https://bugs.webkit.org/show_bug.cgi?id=175456
1761
1762         Reviewed by Ryosuke Niwa.
1763
1764         * UIProcess/mac/WKFullScreenWindowController.h:
1765         * UIProcess/mac/WKFullScreenWindowController.mm:
1766
1767 2017-08-15  Youenn Fablet  <youenn@apple.com>
1768
1769         [Cache API] Adding generic support for CacheStorage and Cache methods
1770         https://bugs.webkit.org/show_bug.cgi?id=175455
1771
1772         Reviewed by Chris Dumez.
1773
1774         * WebKit.xcodeproj/project.pbxproj:
1775         * WebProcess/Cache/WebCacheStorageProvider.h: Added.
1776         * WebProcess/WebPage/WebPage.cpp:
1777         (WebKit::m_cpuLimit):
1778         * WebProcess/WebProcess.cpp:
1779         (WebKit::WebProcess::WebProcess):
1780         * WebProcess/WebProcess.h:
1781         (WebKit::WebProcess::cacheStorageProvider):
1782
1783 2017-08-15  Michael Catanzaro  <mcatanzaro@igalia.com>
1784
1785         Unreviewed, rolling out r220700.
1786
1787         Broke debug bot
1788
1789         Reverted changeset:
1790
1791         "[CoordGraphics] Simplify CoordinatedGraphicsScene state
1792         updates"
1793         https://bugs.webkit.org/show_bug.cgi?id=175528
1794         http://trac.webkit.org/changeset/220700
1795
1796 2017-08-15  Carlos Garcia Campos  <cgarcia@igalia.com>
1797
1798         WebDriver: timeout when JavaScript alert is shown in onload handler
1799         https://bugs.webkit.org/show_bug.cgi?id=175315
1800         <rdar://problem/33788294>
1801
1802         Reviewed by Brian Burg.
1803
1804         When a JavaScript alert is shown in an onload handler, the alert prevents the load from finishing in case of
1805         normal page load strategy, so navigation commands or any other command for which we wait for navigation to
1806         complete end up timing out. There are two selenium tests covering this that are currently timing out:
1807         testShouldHandleAlertOnPageLoad and testShouldHandleAlertOnPageLoadUsingGet. The spec says that in case of page
1808         load timeout we should only fail with timeout error when there isn't an active alert dialog. If the next command
1809         expects an alert it will just work, otherwise it will fail with UnexpectedAlertOpen error when trying to handle
1810         user prompts.
1811
1812         9 Navigation.
1813         https://w3c.github.io/webdriver/webdriver-spec.html#dfn-wait-for-navigation-to-complete
1814
1815         * UIProcess/Automation/WebAutomationSession.cpp:
1816         (WebKit::WebAutomationSession::waitForNavigationToComplete): Do not wait for the timeout when the page is
1817         loading and there's an active alert in case of normal page load strategy.
1818         (WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout): Respond with timeout unless
1819         the page is showing a JavaScript dialog.
1820         (WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout): Ditto.
1821         (WebKit::WebAutomationSession::loadTimerFired): Use respondToPendingPageNavigationCallbacksWithTimeout() and
1822         respondToPendingFrameNavigationCallbacksWithTimeout().
1823         (WebKit::WebAutomationSession::willShowJavaScriptDialog): The page is about to show a JavaScript dialog, so
1824         we wait until the next run loop iteration to give time for the client to show the dialog, then check if page is
1825         loading and the dialog is still present. If that's the case we finish all normal strategy pending navigations.
1826         * UIProcess/Automation/WebAutomationSession.h:
1827         * UIProcess/WebPageProxy.cpp:
1828         (WebKit::WebPageProxy::runJavaScriptAlert): If controlled by automation, notify the session.
1829         (WebKit::WebPageProxy::runJavaScriptConfirm): Ditto.
1830         (WebKit::WebPageProxy::runJavaScriptPrompt): Ditto.
1831         (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): Ditto.
1832
1833 2017-08-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1834
1835         WebDriver: handle click events on option elements
1836         https://bugs.webkit.org/show_bug.cgi?id=174710
1837         <rdar://problem/33459305>
1838
1839         Reviewed by Brian Burg.
1840
1841         Add selectOptionElement method to automation to select an option element according to the WebDriver
1842         specification.
1843
1844         14.1 Element Click.
1845         https://w3c.github.io/webdriver/webdriver-spec.html#element-click
1846
1847         * UIProcess/Automation/Automation.json: Add selectOptionElement method and ElementNotSelectable error.
1848         * UIProcess/Automation/WebAutomationSession.cpp:
1849         (WebKit::WebAutomationSession::selectOptionElement):Send SelectOptionElement message to the web process.
1850         (WebKit::WebAutomationSession::didSelectOptionElement): Notify the driver.
1851         * UIProcess/Automation/WebAutomationSession.h:
1852         * UIProcess/Automation/WebAutomationSession.messages.in: Add DidSelectOptionElement message.
1853         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
1854         (WebKit::elementContainer): Helper to get the container of an element according to the spec.
1855         (WebKit::WebAutomationSessionProxy::computeElementLayout): Use the container element to scroll the view and
1856         compute the in-view center point.
1857         (WebKit::WebAutomationSessionProxy::selectOptionElement): Use HTMLSelectElement::optionSelectedByUser().
1858         * WebProcess/Automation/WebAutomationSessionProxy.h:
1859         * WebProcess/Automation/WebAutomationSessionProxy.messages.in: Add SelectOptionElement message.
1860
1861 2017-08-14  Simon Fraser  <simon.fraser@apple.com>
1862
1863         Remove Proximity Events and related code
1864         https://bugs.webkit.org/show_bug.cgi?id=175545
1865
1866         Reviewed by Daniel Bates.
1867
1868         No platform enables Proximity Events, so remove code inside ENABLE(PROXIMITY_EVENTS)
1869         and other related code.
1870
1871         * CMakeLists.txt:
1872         * Configurations/FeatureDefines.xcconfig:
1873         * WebProcess/WebCoreSupport/WebDeviceProximityClient.cpp: Removed.
1874         * WebProcess/WebCoreSupport/WebDeviceProximityClient.h: Removed.
1875         * WebProcess/WebPage/WebPage.cpp:
1876         (WebKit::m_cpuLimit):
1877
1878 2017-08-14  Simon Fraser  <simon.fraser@apple.com>
1879
1880         Remove ENABLE(REQUEST_AUTOCOMPLETE) code, which was disabled everywhere
1881         https://bugs.webkit.org/show_bug.cgi?id=175504
1882
1883         Reviewed by Sam Weinig.
1884
1885         * Configurations/FeatureDefines.xcconfig:
1886         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
1887         (WebKit::WebFrameLoaderClient::didRequestAutocomplete): Deleted.
1888         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
1889
1890 2017-08-14  Simon Fraser  <simon.fraser@apple.com>
1891
1892         Remove ENABLE_VIEW_MODE_CSS_MEDIA and related code
1893         https://bugs.webkit.org/show_bug.cgi?id=175557
1894
1895         Reviewed by Jon Lee.
1896
1897         No port cares about the ENABLE(VIEW_MODE_CSS_MEDIA) feature, so remove it.
1898
1899         * Configurations/FeatureDefines.xcconfig:
1900
1901 2017-08-14  Andy Estes  <aestes@apple.com>
1902
1903         [Apple Pay] Add support for phonetic contact names
1904         https://bugs.webkit.org/show_bug.cgi?id=175537
1905         <rdar://problem/32002644>
1906
1907         Reviewed by Tim Horton.
1908
1909         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: Soft-linked PKContactFieldPhoneticName.
1910         (WebKit::toPKContactFields): Added code to append PKContactFieldPhoneticName to result if
1911         contactFields.phoneticName is true.
1912         (WebKit::toNSError): Specified PKContactFieldPhoneticName as the contact field for
1913         PaymentError::ContactField::PhoneticName.
1914
1915 2017-08-14  Tim Horton  <timothy_horton@apple.com>
1916
1917         Only create directory and sandbox extension handle for storage directories if they are set
1918         https://bugs.webkit.org/show_bug.cgi?id=175522
1919
1920         Reviewed by Brady Eidson.
1921
1922         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1923         (WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
1924         If using a non-persistent WebsiteDataStore, all the storage directories
1925         are unset, but we still try to create them and make sandbox extensions
1926         for them. This has no effect except a ton of noisy logging, but that
1927         is reason enough to stop.
1928
1929         This is similar to r216053, but for more directories.
1930
1931 2017-08-14  Zan Dobersek  <zdobersek@igalia.com>
1932
1933         [CoordGraphics] Simplify CoordinatedGraphicsScene state updates
1934         https://bugs.webkit.org/show_bug.cgi?id=175528
1935
1936         Reviewed by Carlos Garcia Campos.
1937
1938         Hold the information about state updates in ThreadedCompositor, in the
1939         m_attributes struct. This way we don't need to store the updates in
1940         functors and accumulate them in the CoordinatedGraphicsScene class, but
1941         instead just apply any pending state update or atlas removal before the
1942         scene is rendered.
1943
1944         This removes the need to update the CoordinatedGraphicsScene object from
1945         the main thread with data that ultimately has to be handled on the
1946         composition thread. Similarly, when updating CoordinatedGraphicsScene, we
1947         only need to synchronize on the m_attributes lock object once in order to
1948         retrieve the scene update information, instead of having each functor do
1949         that repeatedly.
1950
1951         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
1952         (WebKit::CoordinatedGraphicsScene::applyStateChanges):
1953         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
1954         (WebKit::CoordinatedGraphicsScene::detach):
1955         (WebKit::CoordinatedGraphicsScene::setActive):
1956         (WebKit::CoordinatedGraphicsScene::syncRemoteContent): Deleted.
1957         (WebKit::CoordinatedGraphicsScene::appendUpdate): Deleted.
1958         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
1959         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
1960         (WebKit::ThreadedCompositor::renderLayerTree):
1961         (WebKit::ThreadedCompositor::updateSceneState):
1962         (WebKit::ThreadedCompositor::releaseUpdateAtlases):
1963         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
1964
1965 2017-08-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1966
1967         [GTK][WPE] Avoid emitting WebKitFaviconDatabase::favicon-changed multiple times while setting an icon
1968         https://bugs.webkit.org/show_bug.cgi?id=175531
1969
1970         Reviewed by Michael Catanzaro.
1971
1972         When webkitFaviconDatabaseSetIconForPageURL() is called, both setIconURLForPageURL() and setIconDataForIconURL()
1973         might notify the client, which ends up emitting the WebKitFaviconDatabase::favicon-changed signal and calling
1974         webkitFaviconDatabaseSetIconURLForPageURL(). Both things are already done by
1975         webkitFaviconDatabaseSetIconForPageURL() itself, so we can just ignore the client notification while setting a
1976         new icon.
1977
1978         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
1979         (webkitFaviconDatabaseSetIconURLForPageURL): Return early if isSettingIcon is true.
1980         (webkitFaviconDatabaseSetIconForPageURL): Set isSettingIcon to true for the scope.
1981
1982 2017-08-14  Carlos Garcia Campos  <cgarcia@igalia.com>
1983
1984         [GTK][WPE] Crash in IconDatabase::IconRecord::setImageData()
1985         https://bugs.webkit.org/show_bug.cgi?id=175527
1986
1987         Reviewed by Žan Doberšek.
1988
1989         The problem is that when setImageData() is called from IconDatabase::readFromDatabase() the shared buffer might
1990         be nullptr, because getImageDataForIconURLFromSQLDatabase() returns nullptr if the icon data is not in the database.
1991
1992         * UIProcess/API/glib/IconDatabase.cpp:
1993         (WebKit::IconDatabase::IconRecord::setImageData): Return early if passed in buffer is nullptr.
1994
1995 2017-08-14  Zan Dobersek  <zdobersek@igalia.com>
1996
1997         [ThreadedCompositor] Improve composition and update state handling
1998         https://bugs.webkit.org/show_bug.cgi?id=172448
1999
2000         Reviewed by Carlos Garcia Campos.
2001
2002         In the ThreadedCompositor and related classes, we now track composition
2003         and scene update states separately. This enables properly piping in the
2004         DisplayRefreshMonitor object, leveraging it for both display refresh
2005         notifications and signalling to the client that the scene update is
2006         completed.
2007
2008         In CompositingRunLoop, two separate states are now used, one for
2009         compositing and the other for scene update. Access to both should be done
2010         while the related Lock object is held. The pending update state is also
2011         tracked in order to schedule any required updates as soon as the current
2012         state update is completed.
2013
2014         In ThreadedCompositor, the information about client notification and
2015         update completion coordination is now also kept under a Lock object,
2016         moving away from atomics. DisplayRefreshMonitor can now utilize just
2017         two methods in order to either schedule an update or report that update
2018         as finished.
2019
2020         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
2021         (WebKit::CompositingRunLoop::CompositingRunLoop):
2022         (WebKit::CompositingRunLoop::scheduleUpdate):
2023         (WebKit::CompositingRunLoop::stopUpdates):
2024         (WebKit::CompositingRunLoop::compositionCompleted):
2025         (WebKit::CompositingRunLoop::updateCompleted):
2026         (WebKit::CompositingRunLoop::updateTimerFired):
2027         (WebKit::CompositingRunLoop::isActive): Deleted.
2028         * Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
2029         (WebKit::CompositingRunLoop::stateLock):
2030         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
2031         (WebKit::m_displayRefreshMonitor):
2032         (WebKit::ThreadedCompositor::sceneUpdateFinished):
2033         (WebKit::ThreadedCompositor::updateSceneState):
2034         (WebKit::ThreadedCompositor::requestDisplayRefreshMonitorUpdate):
2035         (WebKit::ThreadedCompositor::handleDisplayRefreshMonitorUpdate):
2036         (WebKit::ThreadedCompositor::renderNextFrameIfNeeded): Deleted.
2037         (WebKit::ThreadedCompositor::completeCoordinatedUpdateIfNeeded): Deleted.
2038         (WebKit::ThreadedCompositor::coordinateUpdateCompletionWithClient): Deleted.
2039         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
2040         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
2041         (WebKit::ThreadedDisplayRefreshMonitor::requestRefreshCallback):
2042         (WebKit::ThreadedDisplayRefreshMonitor::displayRefreshCallback):
2043
2044 2017-08-13  Manuel Rego Casasnovas  <rego@igalia.com>
2045
2046         Composition underline color is always black
2047         https://bugs.webkit.org/show_bug.cgi?id=174675
2048
2049         Reviewed by Ryosuke Niwa.
2050
2051         This patch uses the current color of the text instead of black
2052         for the composition underline marker.
2053         This makes it visible in the case we have a black/dark background.
2054
2055         * UIProcess/Cocoa/WebViewImpl.mm:
2056         (WebKit::extractUnderlines): If NSUnderlineColorAttributeName
2057         is not present use text color for composition underline.
2058         (WebKit::WebViewImpl::setMarkedText): Use text color
2059         for composition underline in the plain text case.
2060         * UIProcess/gtk/InputMethodFilter.cpp:
2061         (WebKit::InputMethodFilter::handleKeyboardEventWithCompositionResults):
2062         Use text color for composition underline.
2063         (WebKit::InputMethodFilter::updatePreedit): Ditto.
2064         * WebProcess/WebPage/WebPage.cpp:
2065         (WebKit::WebPage::setCompositionForTesting): Ditto.
2066
2067 2017-08-13  Adrian Perez de Castro  <aperez@igalia.com>
2068
2069         [WPE] Implement WebCore::standardUserAgent()
2070         https://bugs.webkit.org/show_bug.cgi?id=175507
2071
2072         Reviewed by Carlos Alberto Lopez Perez.
2073
2074         Implement missing User-Agent handling for the WPE port by sharing the code with the GTK+ port.
2075
2076         * UIProcess/API/glib/WebKitSettings.cpp: Remove preprocessor conditionals for the WPE port.
2077         (webkit_settings_set_user_agent):
2078         (webkit_settings_set_user_agent_with_application_details):
2079         * UIProcess/wpe/WebPageProxyWPE.cpp:
2080         (WebKit::WebPageProxy::standardUserAgent): Remove hardcoded value and make use of WebCore::standardUserAgent().
2081
2082 2017-08-11  Ryosuke Niwa  <rniwa@webkit.org>
2083
2084         Replace DATA_TRANSFER_ITEMS by a runtime flag and add a stub implementation
2085         https://bugs.webkit.org/show_bug.cgi?id=175474
2086         <rdar://problem/33844628>
2087
2088         Reviewed by Wenson Hsieh.
2089
2090         Replaced the build flag by a runtime flag and disabled the feature by default.
2091
2092         * Configurations/FeatureDefines.xcconfig:
2093         * Shared/WebPreferencesDefinitions.h:
2094         * UIProcess/API/C/WKPreferences.cpp:
2095         (WKPreferencesSetDataTransferItemsEnabled): Added to be used by WebKitTestRunner.
2096         (WKPreferencesGetDataTransferItemsEnabled): Ditto.
2097         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2098         * WebProcess/WebPage/WebPage.cpp:
2099         (WebKit::WebPage::updatePreferences):
2100
2101 2017-08-10  Sam Weinig  <sam@webkit.org>
2102
2103         WTF::Function does not allow for reference / non-default constructible return types
2104         https://bugs.webkit.org/show_bug.cgi?id=175244
2105
2106         Reviewed by Chris Dumez.
2107
2108         * UIProcess/WebResourceLoadStatisticsStore.h:
2109         Update the default value for the updateCookiePartitioningForDomainsHandler parameter to be an 
2110         empty lambda, rather than default initialization, which leads to a null WTF::Function. This allows
2111         us to remove support for calling null WTF::Function. No change in behavior.
2112
2113 2017-08-11  Adrian Perez de Castro  <aperez@igalia.com>
2114
2115         [WPE] Build failure with Clang 4.0.1: no matching conversion for functional-style cast from 'pointer' (aka 'unsigned short *') to 'WTF::String'
2116         https://bugs.webkit.org/show_bug.cgi?id=175477
2117
2118         Reviewed by Žan Doberšek.
2119
2120         * Shared/wpe/WebEventFactory.cpp:
2121         (WebKit::singleCharacterStringForKeyEvent): Cast to UChar* to make
2122         compiler choose the correct WTF::String constructor.
2123
2124 2017-08-11  Carlos Garcia Campos  <cgarcia@igalia.com>
2125
2126         [Soup] Cannot access HTTPS sites using a HTTP proxy that requires authentication
2127         https://bugs.webkit.org/show_bug.cgi?id=175378
2128
2129         Reviewed by Sergio Villar Senin.
2130
2131         In case of HTTPS resource with a proxy, libsoup uses a tunnel internally, that uses its own SoupMessage during
2132         the proxy authentication. We were ignoring authentication requests for other messages.
2133
2134         * NetworkProcess/soup/NetworkDataTaskSoup.cpp:
2135         (WebKit::NetworkDataTaskSoup::authenticateCallback): Only return early if the message does't match and it's not
2136         HTTPS resource over a proxy.
2137         (WebKit::NetworkDataTaskSoup::authenticate): Use the soup message from the authentication challenge.
2138         (WebKit::NetworkDataTaskSoup::continueAuthenticate): Ditto.
2139
2140 2017-08-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2141
2142         [Soup] Do not spawn the network process to setup cookie persistent storage
2143         https://bugs.webkit.org/show_bug.cgi?id=175424
2144
2145         Reviewed by Sergio Villar Senin.
2146
2147         The persistent storage configuration is saved and passed to network process as creation parameters, so we don't
2148         need to spawn the network process to configure it, when it's created eventually it will use the configuration.
2149
2150         * UIProcess/soup/WebCookieManagerProxySoup.cpp:
2151         (WebKit::WebCookieManagerProxy::setCookiePersistentStorage): Use sendToNetworkingProcess() instead of
2152         endToNetworkingProcessRelaunchingIfNecessary().
2153
2154 2017-08-10  Carlos Garcia Campos  <cgarcia@igalia.com>
2155
2156         [GTK][WPE] Assertion failure in TimerBase inside WebCore::IconRecord::setImageData
2157         https://bugs.webkit.org/show_bug.cgi?id=173866
2158         <rdar://problem/33122050>
2159
2160         Reviewed by Michael Catanzaro.
2161
2162         IconDatabase creates and destroys IconRecord objects in both database and main thread. If the IconRecord has a
2163         valid icon, its Image could be created in one thread and destroyed in another, something that is not expected to
2164         happen, because Image has a Timer member. Since we have all the data and we are decoding it right after creating
2165         the Image, we don't really need to keep the Image object around, we could simply take a reference of the encoded
2166         data and the decoded native image to be returned by synchronousIconForPageURL().
2167
2168         * UIProcess/API/glib/IconDatabase.cpp:
2169         (WebKit::IconDatabase::IconRecord::image): Return NativeImagePtr now.
2170         (WebKit::IconDatabase::IconRecord::setImageData): Create a BitmapImage to decode it and keep a reference to the
2171         encoded data and decoded native image.
2172         (WebKit::IconDatabase::IconRecord::snapshot const): Use m_imageData to get the encoded data.
2173         (WebKit::IconDatabase::synchronousIconForPageURL): Return the native image and whether the icon is known or not.
2174         (WebKit::IconDatabase::IconRecord::loadImageFromResource): Deleted.
2175         * UIProcess/API/glib/IconDatabase.h:
2176         * UIProcess/API/glib/WebKitFaviconDatabase.cpp:
2177         (getIconSurfaceSynchronously): Use new API.
2178
2179 2017-08-10  Dan Bernstein  <mitz@apple.com>
2180
2181         Restored svn:ignore values that went missing when the project got renamed.
2182
2183         * WebKit.xcodeproj: Added property svn:ignore.
2184
2185 2017-08-10  Brady Eidson  <beidson@apple.com>
2186
2187         Rename the source files for the WTF persistent coders.
2188         https://bugs.webkit.org/show_bug.cgi?id=175441
2189
2190         Reviewed by Tim Horton.
2191
2192         * NetworkProcess/cache/NetworkCacheCoders.h:
2193         * NetworkProcess/cache/NetworkCacheKey.cpp:
2194         * NetworkProcess/cache/NetworkCacheKey.h:
2195         * UIProcess/API/APIContentRuleListStore.cpp:
2196
2197 2017-08-10  John Wilander  <wilander@apple.com>
2198
2199         Resource Load Statistics: Increase grandfathering time to 7 days
2200         https://bugs.webkit.org/show_bug.cgi?id=175414
2201         <rdar://problem/33818046>
2202
2203         Reviewed by Brent Fulgham.
2204
2205         * UIProcess/WebResourceLoadStatisticsStore.h:
2206
2207 2017-08-10  John Wilander  <wilander@apple.com>
2208
2209         Resource Load Statistics: Add significant figures to telemetry calls
2210         https://bugs.webkit.org/show_bug.cgi?id=175442
2211         <rdar://problem/33834834>
2212
2213         Reviewed by Brent Fulgham.
2214
2215         With this change, logged values are allowed to have 3 significant figures
2216         as opposed to today's 0 which is wrong.
2217
2218         * UIProcess/WebResourceLoadStatisticsTelemetry.cpp:
2219         (WebKit::submitTopList):
2220         (WebKit::WebResourceLoadStatisticsTelemetry::calculateAndSubmit):
2221
2222 2017-08-10  Mark Lam  <mark.lam@apple.com>
2223
2224         Apply the UNLIKELY macro to some unlikely things.
2225         https://bugs.webkit.org/show_bug.cgi?id=175440
2226         <rdar://problem/33834767>
2227
2228         Reviewed by Yusuke Suzuki.
2229
2230         * WebProcess/WebPage/WebPage.cpp:
2231         (WebKit::WebPage::getBytecodeProfile):
2232
2233 2017-08-10  Chris Dumez  <cdumez@apple.com>
2234
2235         Turn on support for Beacon API by default in STP
2236         https://bugs.webkit.org/show_bug.cgi?id=175445
2237         <rdar://problem/33836379>
2238
2239         Reviewed by Youenn Fablet.
2240
2241         * Shared/WebPreferencesDefinitions.h:
2242
2243 2017-08-10  Ross Kirsling  <ross.kirsling@sony.com>
2244
2245         Fix iOS simulator build after change "[WTF] Move TextStream into WTF"
2246         https://bugs.webkit.org/show_bug.cgi?id=175211
2247
2248         Reviewed by Myles C. Maxfield.
2249
2250         * UIProcess/API/Cocoa/WKWebView.mm:
2251         (-[WKWebView _scrollByContentOffset:]):
2252         (-[WKWebView _navigationGestureDidBegin]):
2253
2254 2017-08-10  Chris Dumez  <cdumez@apple.com>
2255
2256         [Beacon] Do connect-src CSP check on redirects as well
2257         https://bugs.webkit.org/show_bug.cgi?id=175410
2258         <rdar://problem/33815470>
2259
2260         Reviewed by Youenn Fablet.
2261
2262         Pass CSP Response headers to the NetworkProcess via NetworkResourceLoadParameters
2263         when doing a PingLoad. This allows PingLoad to do CSP checks (in particular
2264         connect-src ones) in case the ping load gets redirected. Those checks need to be
2265         done on the NetworkProcess side at this point because there is no guarantee the
2266         WebContent process is still around.
2267
2268         To do the CSP checks, PingLoad lazily reconstructs a ContentSecurityPolicy object
2269         from the CSP response headers.
2270
2271         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2272         (WebKit::NetworkResourceLoadParameters::encode const):
2273         (WebKit::NetworkResourceLoadParameters::decode):
2274         * NetworkProcess/NetworkResourceLoadParameters.h:
2275         * NetworkProcess/PingLoad.cpp:
2276         (WebKit::PingLoad::willPerformHTTPRedirection):
2277         (WebKit::PingLoad::contentSecurityPolicy):
2278         * NetworkProcess/PingLoad.h:
2279         * WebProcess/Network/WebLoaderStrategy.cpp:
2280         (WebKit::WebLoaderStrategy::createPingHandle):
2281         * WebProcess/Network/WebLoaderStrategy.h:
2282
2283 2017-08-10  Brian Burg  <bburg@apple.com>
2284
2285         WKPreferences should conform to NSCopying
2286         https://bugs.webkit.org/show_bug.cgi?id=175303
2287         <rdar://problem/33764939>
2288
2289         Reviewed by Dan Bernstein.
2290
2291         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2292         Add conformance in the private header, as there is not consensus that this
2293         needs to be API.
2294
2295         * UIProcess/API/Cocoa/WKPreferences.mm:
2296         (-[WKPreferences copyWithZone:]):
2297         Copy the wrapped WebPreferences instance and return its wrapper.
2298
2299 2017-08-10  Michael Catanzaro  <mcatanzaro@igalia.com>
2300
2301         REGRESSION(r220515) [GTK][CMake] Build with ENABLE_GEOLOCATION fails on Debian Jessie
2302         https://bugs.webkit.org/show_bug.cgi?id=175426
2303
2304         Reviewed by Carlos Alberto Lopez Perez.
2305
2306         * PlatformGTK.cmake:
2307
2308 2017-08-10  Brady Eidson  <beidson@apple.com>
2309
2310         Add ServiceWorkerJob.
2311         https://bugs.webkit.org/show_bug.cgi?id=175241
2312
2313         Reviewed by Tim Horton.
2314
2315         * CMakeLists.txt:
2316         * WebKit.xcodeproj/project.pbxproj:
2317
2318         * WebProcess/Storage/WebServiceWorkerProvider.cpp: Added.
2319         (WebKit::WebServiceWorkerProvider::singleton):
2320         (WebKit::WebServiceWorkerProvider::WebServiceWorkerProvider):
2321         (WebKit::WebServiceWorkerProvider::scheduleJob):
2322         * WebProcess/Storage/WebServiceWorkerProvider.h: Added.
2323
2324         * WebProcess/WebProcess.cpp:
2325         (WebKit::WebProcess::initializeWebProcess):
2326
2327 2017-08-10  Tim Horton  <timothy_horton@apple.com>
2328
2329         Remove some unused lambda captures so that WebKit builds with -Wunused-lambda-capture
2330         https://bugs.webkit.org/show_bug.cgi?id=175436
2331         <rdar://problem/33667497>
2332
2333         Reviewed by Simon Fraser.
2334
2335         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
2336         (WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame):
2337         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2338         (WebKit::WebsiteDataStore::topPrivatelyControlledDomainsWithWebsiteData):
2339
2340 2017-08-10  Michael Catanzaro  <mcatanzaro@igalia.com>
2341
2342         Remove ENABLE_GAMEPAD_DEPRECATED
2343         https://bugs.webkit.org/show_bug.cgi?id=175361
2344
2345         Reviewed by Carlos Garcia Campos.
2346
2347         * Configurations/FeatureDefines.xcconfig:
2348
2349 2017-08-10  Zan Dobersek  <zdobersek@igalia.com>
2350
2351         [GTK] Don't use --whole-archive linking flags for the WebKit2 target libraries
2352         https://bugs.webkit.org/show_bug.cgi?id=175416
2353
2354         Reviewed by Carlos Garcia Campos.
2355
2356         * PlatformGTK.cmake: Drop the ADD_WHOLE_ARCHIVE_TO_LIBRARIES instruction
2357         for the WebKit2 target. This unnecessarily bundles complete archive
2358         files both into the main .so library as well as single executables that
2359         are linked against the WebKit2 target.
2360
2361 2017-08-09  Chris Dumez  <cdumez@apple.com>
2362
2363         Disable Beacon API on WK1 DRT and WK2 when not using NETWORK_SESSION
2364         https://bugs.webkit.org/show_bug.cgi?id=175401
2365
2366         Reviewed by Brady Eidson.
2367
2368         * UIProcess/API/C/WKPreferences.cpp:
2369         (WKPreferencesSetBeaconAPIEnabled):
2370         (WKPreferencesGetBeaconAPIEnabled):
2371         * WebProcess/WebPage/WebPage.cpp:
2372         (WebKit::WebPage::updatePreferences):
2373         * config.h:
2374
2375 2017-08-09  Yoshiaki Jitsukawa  <Yoshiaki.Jitsukawa@sony.com>
2376
2377         [PAL] Move spi/cocoa and spi/cg directories into PAL
2378         https://bugs.webkit.org/show_bug.cgi?id=175175
2379
2380         Reviewed by Myles C. Maxfield.
2381
2382         * NetworkProcess/CustomProtocols/Cocoa/LegacyCustomProtocolManagerCocoa.mm:
2383         * NetworkProcess/Downloads/mac/DownloadMac.mm:
2384         * Platform/cocoa/SharedMemoryCocoa.cpp:
2385         * Platform/mac/LayerHostingContext.mm:
2386         * Shared/Cocoa/DataDetectionResult.mm:
2387         * Shared/Cocoa/WebCoreArgumentCodersCocoa.mm:
2388         * Shared/cf/CookieStorageUtilsCF.mm:
2389         * Shared/ios/InteractionInformationAtPosition.mm:
2390         * Shared/mac/HangDetectionDisablerMac.mm:
2391         * Shared/mac/RemoteLayerBackingStore.mm:
2392         * Shared/mac/RemoteLayerTreePropertyApplier.mm:
2393         * UIProcess/API/Cocoa/WKWebView.mm:
2394         * UIProcess/API/mac/WKView.mm:
2395         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.h:
2396         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
2397         * UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
2398         * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
2399         * UIProcess/Cocoa/WebViewImpl.h:
2400         * UIProcess/Cocoa/WebViewImpl.mm:
2401         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2402         * UIProcess/ios/ViewGestureControllerIOS.mm:
2403         * UIProcess/ios/WKContentView.mm:
2404         * UIProcess/ios/WKContentViewInteraction.mm:
2405         * UIProcess/ios/WKPDFPageNumberIndicator.mm:
2406         * UIProcess/ios/WKScrollView.mm:
2407         * UIProcess/mac/RemoteLayerTreeHost.mm:
2408         * UIProcess/mac/ServicesController.mm:
2409         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
2410         * UIProcess/mac/ViewGestureControllerMac.mm:
2411         * UIProcess/mac/ViewSnapshotStore.mm:
2412         * UIProcess/mac/WKViewLayoutStrategy.mm:
2413         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2414         * WebProcess/WebPage/WebPage.cpp:
2415         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
2416         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2417         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2418         * WebProcess/cocoa/WebProcessCocoa.mm:
2419
2420 2017-08-09  John Wilander  <wilander@apple.com>
2421
2422         Resource Load Statistics: Increase grandfathering time to 3 days
2423         https://bugs.webkit.org/show_bug.cgi?id=175414
2424         <rdar://problem/33818046>
2425
2426         Reviewed by Brent Fulgham.
2427
2428         * UIProcess/WebResourceLoadStatisticsStore.h:
2429
2430 2017-08-09  Jeremy Jones  <jeremyj@apple.com>
2431
2432         Invalidate PlaybackSessionManager in same fashion as VideoFullscreenManager.
2433         https://bugs.webkit.org/show_bug.cgi?id=175399
2434         rdar://problem/33663344
2435
2436         Reviewed by Eric Carlson.
2437
2438         Invalidate PlaybackSessionManager when WebPage is destructed.
2439
2440         * WebProcess/WebPage/WebPage.cpp:
2441         (WebKit::WebPage::~WebPage):
2442         * WebProcess/cocoa/PlaybackSessionManager.h:
2443         * WebProcess/cocoa/PlaybackSessionManager.mm:
2444         (WebKit::PlaybackSessionManager::~PlaybackSessionManager):
2445         (WebKit::PlaybackSessionManager::invalidate):
2446
2447 2017-08-09  Don Olmstead  <don.olmstead@sony.com>
2448
2449         [WTF] Move TextStream into WTF
2450         https://bugs.webkit.org/show_bug.cgi?id=175211
2451
2452         Reviewed by Myles C. Maxfield.
2453
2454         * Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
2455         * Shared/VisibleContentRectUpdateInfo.cpp:
2456         * Shared/VisibleContentRectUpdateInfo.h:
2457         * Shared/mac/RemoteLayerTreeTransaction.mm:
2458         * UIProcess/API/Cocoa/WKWebView.mm:
2459         * UIProcess/ios/WKContentView.mm:
2460         * UIProcess/ios/WKContentViewInteraction.h:
2461         * UIProcess/ios/WKContentViewInteraction.mm:
2462         (WebKit::operator<<):
2463         * UIProcess/ios/WebPageProxyIOS.mm:
2464         * WebProcess/WebPage/ios/WebPageIOS.mm:
2465         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.h:
2466         * WebProcess/WebPage/mac/PlatformCAAnimationRemote.mm:
2467
2468 2017-08-09  Andy Estes  <aestes@apple.com>
2469
2470         Part 3 of: Rename DatabaseProcess to StorageProcess
2471         https://bugs.webkit.org/show_bug.cgi?id=175034
2472
2473         Reviewed by Brady Eidson.
2474
2475         We tried renaming com.apple.WebKit.Databases to com.apple.WebKit.Storage in r219986, but
2476         this prevented trunk WebKit from running on iOS 11 devices. This is because launchd keeps a
2477         codesigned cache of XPC services, and refuses to launch services that aren't in the cache.
2478
2479         It's not possibe for us to rebuild the cache with the new service name (only Apple's
2480         production build system can do this), and disabling the cache or opting WebKit's XPC
2481         services out of the cache might have a negative impact on our performance testing.
2482
2483         For now we'll retain the name "com.apple.WebKit.Databases" on iOS 11 devices to work around
2484         this issue. If we find a way to allow the new service to run without impacting performance,
2485         we can revert this change.
2486
2487         We will rename the service to "com.apple.WebKit.Storage" on macOS and iOS Simulator, and in
2488         a follow-up patch we'll use the new service name on post-iOS 11 device builds.
2489
2490         * Configurations/BaseTarget.xcconfig: Defined WK_STORAGE_SERVICE_PRODUCT_NAME to be
2491         com.apple.WebKit.Databases by default, and overrode it to com.apple.WebKit.Storage on macOS
2492         and iOS Simulator.
2493         * Configurations/StorageService.xcconfig: Changed PRODUCT_NAME to $(WK_STORAGE_SERVICE_PRODUCT_NAME).
2494         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2495         (WebKit::serviceName): Changed to return "com.apple.WebKit.Storage" on macOS and
2496         iOS Simulator platforms.
2497         * WebKit.xcodeproj/project.pbxproj: Updated the "Copy XPC services for engineering builds"
2498         build phase to use WK_STORAGE_SERVICE_PRODUCT_NAME.
2499
2500 2017-08-09  Commit Queue  <commit-queue@webkit.org>
2501
2502         Unreviewed, rolling out r220466, r220477, and r220487.
2503         https://bugs.webkit.org/show_bug.cgi?id=175411
2504
2505         This change broke existing API tests and follow up fixes did
2506         not resolve all the issues. (Requested by ryanhaddad on
2507         #webkit).
2508
2509         Reverted changesets:
2510
2511         https://bugs.webkit.org/show_bug.cgi?id=175244
2512         http://trac.webkit.org/changeset/220466
2513
2514         "WTF::Function does not allow for reference / non-default
2515         constructible return types"
2516         https://bugs.webkit.org/show_bug.cgi?id=175244
2517         http://trac.webkit.org/changeset/220477
2518
2519         https://bugs.webkit.org/show_bug.cgi?id=175244
2520         http://trac.webkit.org/changeset/220487
2521
2522 2017-08-09  Chris Dumez  <cdumez@apple.com>
2523
2524         [Beacon][NetworkSession] Support CORS-preflighting on redirects
2525         https://bugs.webkit.org/show_bug.cgi?id=175386
2526         <rdar://problem/33801370>
2527
2528         Reviewed by Youenn Fablet.
2529
2530         Add support to Beacon for doing CORS-preflighting upon redirect to a different
2531         domain.
2532
2533         * NetworkProcess/NetworkCORSPreflightChecker.h:
2534         * NetworkProcess/PingLoad.cpp:
2535         (WebKit::PingLoad::PingLoad):
2536         (WebKit::PingLoad::~PingLoad):
2537         (WebKit::PingLoad::loadRequest):
2538         (WebKit::PingLoad::securityOrigin const):
2539         (WebKit::PingLoad::willPerformHTTPRedirection):
2540         (WebKit::PingLoad::didReceiveResponseNetworkSession):
2541         (WebKit::PingLoad::needsCORSPreflight const):
2542         (WebKit::PingLoad::doCORSPreflight):
2543         * NetworkProcess/PingLoad.h:
2544
2545 2017-08-09  Jeremy Jones  <jeremyj@apple.com>
2546
2547         Use MPAVRoutingController instead of deprecated versions.
2548         https://bugs.webkit.org/show_bug.cgi?id=175063
2549         rdar://problem/33301230
2550
2551         Reviewed by Tim Horton.
2552
2553         Remove dependence on deprecated classes MPAVRoutingSheet and MPAudioVideoRoutingPopoverController.
2554
2555         * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
2556         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
2557         (-[WKAirPlayRoutePicker dealloc]):
2558         (-[WKAirPlayRoutePicker show:fromRect:]):
2559         (-[WKAirPlayRoutePicker popoverControllerDidDismissPopover:]): Deleted.
2560         (-[WKAirPlayRoutePicker _presentAirPlayPopoverAnimated:fromRect:]): Deleted.
2561         (-[WKAirPlayRoutePicker _windowWillRotate:]): Deleted.
2562         (-[WKAirPlayRoutePicker _windowDidRotate:]): Deleted.
2563         (-[WKAirPlayRoutePicker _dismissAirPlayRoutePickerIPad]): Deleted.
2564         (-[WKAirPlayRoutePicker showAirPlayPickerIPad:fromRect:]): Deleted.
2565         (-[WKAirPlayRoutePicker showAirPlayPickerIPhone:]): Deleted.
2566
2567 2017-08-09  Sam Weinig  <sam@webkit.org>
2568
2569         WTF::Function does not allow for reference / non-default constructible return types
2570         https://bugs.webkit.org/show_bug.cgi?id=175244
2571
2572         Reviewed by Chris Dumez.
2573
2574         * UIProcess/WebResourceLoadStatisticsStore.h:
2575         Update the default value for the updateCookiePartitioningForDomainsHandler parameter to be an 
2576         empty lambda, rather than default initialization, which leads to a null WTF::Function. This allows
2577         us to remove support for calling null WTF::Function. No change in behavior.
2578
2579 2017-08-09  Wenson Hsieh  <wenson_hsieh@apple.com>
2580
2581         [iOS DnD] ENABLE_DRAG_SUPPORT should be turned off for iOS 10 and enabled by default
2582         https://bugs.webkit.org/show_bug.cgi?id=175392
2583         <rdar://problem/33783207>
2584
2585         Reviewed by Tim Horton and Megan Gardner.
2586
2587         Tweak FeatureDefines to enable drag and drop by default, and disable only on unsupported platforms (i.e. iOS 10).
2588
2589         * Configurations/FeatureDefines.xcconfig:
2590
2591 2017-08-09  Brady Eidson  <beidson@apple.com>
2592
2593         ServiceWorker experimental feature should not be on by default (definitely not ready).
2594         https://bugs.webkit.org/show_bug.cgi?id=175389
2595
2596         Rubberstamped by Andy Estes.
2597
2598         * Shared/WebPreferencesDefinitions.h: false, not DEFAULT_EXPERIMENTAL_FEATURES_ENABLED
2599
2600 2017-08-09  Ryan Haddad  <ryanhaddad@apple.com>
2601
2602         Unreviewed, rolling out r220457.
2603
2604         This change introduced API test failures.
2605
2606         Reverted changeset:
2607
2608         "WTF::Function does not allow for reference / non-default
2609         constructible return types"
2610         https://bugs.webkit.org/show_bug.cgi?id=175244
2611         http://trac.webkit.org/changeset/220457
2612
2613 2017-08-09  Daniel Bates  <dabates@apple.com>
2614
2615         REGRESSION (r219013): OAuth flows are broken when redirecting back to application after authentication
2616         https://bugs.webkit.org/show_bug.cgi?id=175247
2617         <rdar://problem/33679804>
2618
2619         Reviewed by Brady Eidson.
2620
2621         Add SPI WKNavigationAction._isRedirect to query whether the navigation was in response to receiving
2622         a redirect response. The majority of the WebKit change is plumbing this knowledge through to connect
2623         it with the SPI.
2624
2625         * Shared/NavigationActionData.cpp:
2626         (WebKit::NavigationActionData::encode const):
2627         (WebKit::NavigationActionData::decode):
2628         Encode and decode the boolean NavigationActionData::isRedirect.
2629         * Shared/NavigationActionData.h:
2630         * UIProcess/API/APINavigationAction.h:
2631         * UIProcess/API/Cocoa/WKNavigationAction.mm:
2632         (-[WKNavigationAction _isRedirect]): Added.
2633         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
2634         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2635         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Set NavigationActionData::isRedirect
2636         depending on whether the navigation is in response to receiving a redirect response.
2637         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2638
2639 2017-08-09  Sam Weinig  <sam@webkit.org>
2640
2641         WTF::Function does not allow for reference / non-default constructible return types
2642         https://bugs.webkit.org/show_bug.cgi?id=175244
2643
2644         Reviewed by Chris Dumez.
2645
2646         * UIProcess/WebResourceLoadStatisticsStore.h:
2647         Update the default value for the updateCookiePartitioningForDomainsHandler parameter to be an 
2648         empty lambda, rather than default initialization, which leads to a null WTF::Function. This allows
2649         us to remove support for calling null WTF::Function. No change in behavior.
2650
2651 2017-08-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2652
2653         Unreviewed, rolling out r220393.
2654
2655         This patch regresses the performance of WebPage::editorState.
2656
2657         Reverted changeset:
2658
2659         "[iOS WK2] WKWebView schedules nonstop layout after pressing
2660         cmb+b,i,u inside a contenteditable div"
2661         https://bugs.webkit.org/show_bug.cgi?id=175116
2662         http://trac.webkit.org/changeset/220393
2663
2664 2017-08-08  Chris Dumez  <cdumez@apple.com>
2665
2666         [Beacon] Add support for CORS-preflighting for WK2 / NETWORK_SESSION
2667         https://bugs.webkit.org/show_bug.cgi?id=175264
2668         <rdar://problem/33547793>
2669
2670         Reviewed by Youenn Fablet.
2671
2672         Implement CORS-preflighting for beacons with a payload that has a non
2673         safelisted MIME type, as per:
2674         - https://w3c.github.io/beacon/#privacy
2675         - https://www.w3.org/TR/beacon/#sec-processing-model
2676
2677         CORS-preflighting is completely handled on Network Process side because
2678         a beacon request can outlive its page and therefore its WebContent
2679         process. This requires us to pass a little more information to the
2680         Network process, in particular the source origin and the corsMode.
2681
2682         The current implementation does not currently deal with CORS preflights
2683         needed upon a redirect. This will be added in a follow-up.
2684
2685         * CMakeLists.txt:
2686         * NetworkProcess/NetworkCORSPreflightChecker.cpp: Added.
2687         (WebKit::NetworkCORSPreflightChecker::NetworkCORSPreflightChecker):
2688         (WebKit::NetworkCORSPreflightChecker::~NetworkCORSPreflightChecker):
2689         (WebKit::NetworkCORSPreflightChecker::startPreflight):
2690         (WebKit::NetworkCORSPreflightChecker::willPerformHTTPRedirection):
2691         (WebKit::NetworkCORSPreflightChecker::didReceiveChallenge):
2692         (WebKit::NetworkCORSPreflightChecker::didReceiveResponseNetworkSession):
2693         (WebKit::NetworkCORSPreflightChecker::didReceiveData):
2694         (WebKit::NetworkCORSPreflightChecker::didCompleteWithError):
2695         (WebKit::NetworkCORSPreflightChecker::didSendData):
2696         (WebKit::NetworkCORSPreflightChecker::wasBlocked):
2697         (WebKit::NetworkCORSPreflightChecker::cannotShowURL):
2698         * NetworkProcess/NetworkCORSPreflightChecker.h: Added.
2699         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
2700         (WebKit::NetworkConnectionToWebProcess::loadPing):
2701         * NetworkProcess/NetworkConnectionToWebProcess.h:
2702         * NetworkProcess/NetworkResourceLoadParameters.cpp:
2703         (WebKit::NetworkResourceLoadParameters::encode const):
2704         (WebKit::NetworkResourceLoadParameters::decode):
2705         * NetworkProcess/NetworkResourceLoadParameters.h:
2706         * NetworkProcess/PingLoad.cpp: Added.
2707         (WebKit::PingLoad::PingLoad):
2708         (WebKit::PingLoad::~PingLoad):
2709         (WebKit::PingLoad::startNetworkLoad):
2710         (WebKit::PingLoad::willPerformHTTPRedirection):
2711         (WebKit::PingLoad::didReceiveChallenge):
2712         (WebKit::PingLoad::didReceiveResponseNetworkSession):
2713         (WebKit::PingLoad::didReceiveData):
2714         (WebKit::PingLoad::didCompleteWithError):
2715         (WebKit::PingLoad::didSendData):
2716         (WebKit::PingLoad::wasBlocked):
2717         (WebKit::PingLoad::cannotShowURL):
2718         (WebKit::PingLoad::timeoutTimerFired):
2719         (WebKit::PingLoad::needsCORSPreflight const):
2720         (WebKit::PingLoad::doCORSPreflight):
2721         * NetworkProcess/PingLoad.h:
2722         * WebKit.xcodeproj/project.pbxproj:
2723         * WebProcess/Network/WebLoaderStrategy.cpp:
2724         (WebKit::WebLoaderStrategy::createPingHandle):
2725         * WebProcess/Network/WebLoaderStrategy.h:
2726
2727 2017-08-08  Megan Gardner  <megan_gardner@apple.com>
2728
2729         Remove old and unused pointIsInAssistedNode definition
2730         https://bugs.webkit.org/show_bug.cgi?id=175335
2731
2732         Stage removal here to allow removal from UIKit.
2733         Replaced by textInteractionGesture:shouldBeginAtPoint:
2734
2735         Reviewed by Tim Horton.
2736
2737         * Platform/spi/ios/UIKitSPI.h:
2738         * UIProcess/ios/WKContentViewInteraction.mm:
2739         (-[WKContentView pointIsInAssistedNode:]): Deleted.
2740
2741 2017-08-08  Michael Catanzaro  <mcatanzaro@igalia.com>
2742
2743         Unreviewed, fix Ubuntu LTS build
2744         https://bugs.webkit.org/show_bug.cgi?id=174490
2745
2746         * UIProcess/glib/RemoteInspectorClient.cpp:
2747         (WebKit::RemoteInspectorClient::RemoteInspectorClient):
2748
2749 2017-08-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2750
2751         Unreviewed, fix the Mac debug build after r220418.
2752
2753         * UIProcess/Cocoa/WebViewImpl.mm:
2754         (WebKit::WebViewImpl::prepareForMoveToWindow):
2755
2756 2017-08-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2757
2758         [Mac WK2] WebViewImpl should hold a weak pointer to its WKWebView or WKView
2759         https://bugs.webkit.org/show_bug.cgi?id=175302
2760         <rdar://problem/33762116>
2761
2762         Reviewed by Tim Horton.
2763
2764         Refactor WebViewImpl's m_view from a raw pointer to a WeakObjCPtr to ensure that it is automatically cleared out
2765         when the WKWebView or WKView are destroyed, and also changes several places where we implicitly block capture
2766         the WebViewImpl to only capture a WeakPtr to the WebViewImpl. Most of the changes here are boilerplate
2767         adjustments for how m_view is now a weak pointer.
2768
2769         Test: WKWebViewMacEditingTests.DoNotCrashWhenInterpretingKeyEventWhileDeallocatingView.
2770
2771         * Shared/mac/WeakObjCPtr.h:
2772         (WebKit::WeakObjCPtr::operator ValueType * const):
2773         * UIProcess/Cocoa/WebViewImpl.h:
2774         * UIProcess/Cocoa/WebViewImpl.mm:
2775         (WebKit::WebViewImpl::updateTouchBar):
2776         (WebKit::WebViewImpl::updateMediaTouchBar):
2777         (WebKit::WebViewImpl::WebViewImpl):
2778         (WebKit::WebViewImpl::~WebViewImpl):
2779         (WebKit::WebViewImpl::window):
2780         (WebKit::WebViewImpl::resignFirstResponder):
2781         (WebKit::WebViewImpl::isFocused const):
2782         (WebKit::WebViewImpl::renewGState):
2783         (WebKit::WebViewImpl::setFrameAndScrollBy):
2784         (WebKit::WebViewImpl::updateWindowAndViewFrames):
2785         (WebKit::WebViewImpl::updateLayer):
2786         (WebKit::WebViewImpl::printOperationWithPrintInfo):
2787         (WebKit::WebViewImpl::updateContentInsetsIfAutomatic):
2788         (WebKit::WebViewImpl::setLayoutMode):
2789         (WebKit::WebViewImpl::intrinsicDeviceScaleFactor const):
2790         (WebKit::WebViewImpl::windowDidBecomeKey):
2791         (WebKit::WebViewImpl::windowDidResignKey):
2792         (WebKit::WebViewImpl::windowDidChangeScreen):
2793         (WebKit::WebViewImpl::mightBeginDragWhileInactive):
2794         (WebKit::WebViewImpl::acceptsFirstMouse):
2795         (WebKit::WebViewImpl::shouldDelayWindowOrderingForEvent):
2796         (WebKit::WebViewImpl::windowResizeMouseLocationIsInVisibleScrollerThumb):
2797         (WebKit::WebViewImpl::viewWillMoveToWindow):
2798         (WebKit::WebViewImpl::viewDidMoveToWindow):
2799         (WebKit::WebViewImpl::viewDidChangeBackingProperties):
2800         (WebKit::WebViewImpl::hitTest):
2801         (WebKit::WebViewImpl::postFakeMouseMovedEventForFlagsChangedEvent):
2802         (WebKit::WebViewImpl::colorSpace):
2803         (WebKit::WebViewImpl::prepareForMoveToWindow):
2804         (WebKit::WebViewImpl::notifyInputContextAboutDiscardedComposition):
2805         (WebKit::WebViewImpl::pressureChangeWithEvent):
2806         (WebKit::WebViewImpl::fullScreenWindowController):
2807         (WebKit::WebViewImpl::executeSavedCommandBySelector):
2808         (WebKit::WebViewImpl::validRequestorForSendAndReturnTypes):
2809         (WebKit::WebViewImpl::handleRequestedCandidates):
2810         (WebKit::WebViewImpl::preferencesDidChange):
2811         (WebKit::WebViewImpl::setTextIndicator):
2812         (WebKit::WebViewImpl::dismissContentRelativeChildWindowsFromViewOnly):
2813         (WebKit::WebViewImpl::accessibilityRegisterUIProcessTokens):
2814         (WebKit::WebViewImpl::sendToolTipMouseExited):
2815         (WebKit::WebViewImpl::sendToolTipMouseEntered):
2816         (WebKit::WebViewImpl::toolTipChanged):
2817         (WebKit::WebViewImpl::setAcceleratedCompositingRootLayer):
2818         (WebKit::WebViewImpl::updateThumbnailViewLayer):
2819         (WebKit::WebViewImpl::setInspectorAttachmentView):
2820         (WebKit::WebViewImpl::inspectorAttachmentView):
2821         (WebKit::WebViewImpl::draggedImage):
2822         (WebKit::WebViewImpl::draggingEntered):
2823         (WebKit::WebViewImpl::draggingUpdated):
2824         (WebKit::WebViewImpl::draggingExited):
2825         (WebKit::WebViewImpl::performDragOperation):
2826         (WebKit::WebViewImpl::hitTestForDragTypes):
2827         (WebKit::WebViewImpl::startWindowDrag):
2828         (WebKit::WebViewImpl::dragImageForView):
2829         (WebKit::WebViewImpl::setPromisedDataForImage):
2830         (WebKit::WebViewImpl::setPromisedDataForAttachment):
2831         (WebKit::WebViewImpl::takeViewSnapshot):
2832         (WebKit::WebViewImpl::scrollWheel):
2833         (WebKit::WebViewImpl::magnifyWithEvent):
2834         (WebKit::WebViewImpl::rotateWithEvent):
2835         (WebKit::WebViewImpl::doneWithKeyEvent):
2836         (WebKit::WebViewImpl::interpretKeyEvent):
2837         (WebKit::WebViewImpl::firstRectForCharacterRange):
2838         (WebKit::WebViewImpl::characterIndexForPoint):
2839         (WebKit::WebViewImpl::performKeyEquivalent):
2840         (WebKit::WebViewImpl::keyUp):
2841         (WebKit::WebViewImpl::keyDown):
2842         (WebKit::WebViewImpl::mouseMoved):
2843         (WebKit::WebViewImpl::windowIsFrontWindowUnderMouse):
2844         (WebKit::WebViewImpl::userInterfaceLayoutDirection):
2845
2846 2017-08-08  Filip Pizlo  <fpizlo@apple.com>
2847
2848         Baseline JIT should do caging
2849         https://bugs.webkit.org/show_bug.cgi?id=175037
2850
2851         Reviewed by Mark Lam.
2852         
2853         Use a better API to disable disabling the primitive gigacage.
2854
2855         * WebProcess/WebProcess.cpp:
2856         (WebKit::m_webSQLiteDatabaseTracker):
2857         (WebKit::primitiveGigacageDisabled): Deleted.
2858
2859 2017-08-08  John Wilander  <wilander@apple.com>
2860
2861         Resource Load Statistics: Clear web processes' state on history removal
2862         https://bugs.webkit.org/show_bug.cgi?id=175271
2863         <rdar://problem/33756560>
2864
2865         Reviewed by Chris Dumez.
2866
2867         https://bugs.webkit.org/show_bug.cgi?id=175090 introduced state
2868         in the web process and that state needs to be cleared when the
2869         UI process' statistics are cleared as part of history removal.
2870
2871         * UIProcess/WebProcessPool.cpp:
2872         (WebKit::WebProcessPool::clearResourceLoadStatistics):
2873         * UIProcess/WebProcessPool.h:
2874         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2875         (WebKit::WebsiteDataStore::removeData):
2876         (WebKit::WebsiteDataStore::clearResourceLoadStatisticsInWebProcesses):
2877         * UIProcess/WebsiteData/WebsiteDataStore.h:
2878         * WebProcess/WebProcess.cpp:
2879         (WebKit::WebProcess::clearResourceLoadStatistics):
2880         * WebProcess/WebProcess.h:
2881         * WebProcess/WebProcess.messages.in:
2882
2883 2017-08-08  Adrian Perez de Castro  <aperez@igalia.com>
2884
2885         [WPE] Implement WebsiteDataStore::defaultApplicationCacheDirectory() and friends
2886         https://bugs.webkit.org/show_bug.cgi?id=175322
2887
2888         Reviewed by Carlos Garcia Campos.
2889
2890         This makes WPE use the same implementation as the GTK+ port, with a preprocessor switch to choose the name of
2891         the base directory inside the user XDG cache directory.
2892
2893         * PlatformGTK.cmake: Add APIWebsiteDataStoreGLib.cpp to the build sources and remove APIWebsiteDataStoreGtk.cpp.
2894         * PlatformWPE.cmake: Add APIWebsiteDataStoreGLib.cpp to the built sources.
2895         * UIProcess/API/APIWebsiteDataStore.cpp: Remove now dead code.
2896         * UIProcess/API/glib/APIWebsiteDataStoreGLib.cpp: Renamed from Source/WebKit/UIProcess/API/gtk/APIWebsiteDataStoreGtk.cpp.
2897         (API::WebsiteDataStore::defaultApplicationCacheDirectory):
2898         (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
2899         (API::WebsiteDataStore::defaultLocalStorageDirectory):
2900         (API::WebsiteDataStore::defaultMediaKeysStorageDirectory):
2901         (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
2902         (API::WebsiteDataStore::defaultResourceLoadStatisticsDirectory):
2903
2904 2017-08-08  Ryan Haddad  <ryanhaddad@apple.com>
2905
2906         Unreviewed, rolling out r220368.
2907
2908         This change caused WK1 tests to exit early with crashes.
2909
2910         Reverted changeset:
2911
2912         "Baseline JIT should do caging"
2913         https://bugs.webkit.org/show_bug.cgi?id=175037
2914         http://trac.webkit.org/changeset/220368
2915
2916 2017-08-08  Michael Catanzaro  <mcatanzaro@igalia.com>
2917
2918         [CMake] Properly test if compiler supports compiler flags
2919         https://bugs.webkit.org/show_bug.cgi?id=174490
2920
2921         Reviewed by Konstantin Tokarev.
2922
2923         * CMakeLists.txt:
2924         * PlatformGTK.cmake:
2925
2926 2017-08-07  Carlos Garcia Campos  <cgarcia@igalia.com>
2927
2928         Web Automation: setUserInputForCurrentJavaScriptPrompt should fail if current dialog is not a prompt
2929         https://bugs.webkit.org/show_bug.cgi?id=175261
2930
2931         Reviewed by Brian Burg.
2932
2933         According to the spec, send alert text command should fail if the current dialog is not a prompt. This patch
2934         adds JavaScriptDialogType enum to API::AutomationSessionClient and a new virtual method to ask the client about
2935         the type of the current dialog. WebAutomationSession::setUserInputForCurrentJavaScriptPrompt() uses the new
2936         client method to check the type of the current dialog and fail in case it's not a prompt. Cocoa needs an
2937         implementation, for now it always returns Prompt as the type to keep compatibility.
2938
2939         18.4 Send Alert Text.
2940         https://w3c.github.io/webdriver/webdriver-spec.html#send-alert-text
2941
2942         This fixes selenium test testSettingTheValueOfAnAlertThrows.
2943
2944         * UIProcess/API/APIAutomationSessionClient.h:
2945         (API::AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage):
2946         * UIProcess/API/glib/WebKitAutomationSession.cpp:
2947         * UIProcess/API/glib/WebKitWebView.cpp:
2948         (webkitWebViewGetCurrentScriptDialogType):
2949         * UIProcess/API/glib/WebKitWebViewPrivate.h:
2950         * UIProcess/Automation/Automation.json:
2951         * UIProcess/Automation/WebAutomationSession.cpp:
2952         (WebKit::WebAutomationSession::setUserInputForCurrentJavaScriptPrompt):
2953         * UIProcess/Cocoa/AutomationSessionClient.h:
2954         * UIProcess/Cocoa/AutomationSessionClient.mm:
2955         (WebKit::AutomationSessionClient::typeOfCurrentJavaScriptDialogOnPage):
2956
2957 2017-08-08  Wenson Hsieh  <wenson_hsieh@apple.com>
2958
2959         [iOS WK2] WKWebView schedules nonstop layout after pressing cmb+b,i,u inside a contenteditable div
2960         https://bugs.webkit.org/show_bug.cgi?id=175116
2961         <rdar://problem/28279301>
2962
2963         Reviewed by Darin Adler and Ryosuke Niwa.
2964
2965         Refactors WebPage::editorState to only use the StyleProperties derived from EditingStyle, instead of inserting
2966         and removing a temporary node to figure out the style. Also adds hooks to notify the UI delegate of EditorState
2967         changes.
2968
2969         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
2970         * UIProcess/API/Cocoa/WKWebView.mm:
2971         (nsTextAlignment):
2972         (dictionaryRepresentationForEditorState):
2973         (-[WKWebView _didChangeEditorState]):
2974
2975         Alerts the private UI delegate of UI-side EditorState updates.
2976
2977         (-[WKWebView _web_editorStateDidChange]):
2978         (-[WKWebView _executeEditCommand:argument:completion:]):
2979         * UIProcess/API/Cocoa/WKWebViewInternal.h:
2980         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2981         * UIProcess/API/mac/WKView.mm:
2982         (-[WKView _web_editorStateDidChange]):
2983         * UIProcess/Cocoa/WebViewImpl.h:
2984         * UIProcess/Cocoa/WebViewImpl.mm:
2985         (WebKit::WebViewImpl::selectionDidChange):
2986         * UIProcess/WebPageProxy.cpp:
2987         (WebKit::WebPageProxy::executeEditCommand):
2988
2989         Change executeEditCommand(name, callback) to executeEditCommand(name, argument, callback) and lift out of iOS
2990         platform code and into WebPage.cpp.
2991
2992         * UIProcess/WebPageProxy.h:
2993         * UIProcess/ios/WKContentViewInteraction.mm:
2994         (-[WKContentView executeEditCommandWithCallback:]):
2995         (-[WKContentView _selectionChanged]):
2996         * UIProcess/ios/WebPageProxyIOS.mm:
2997         (WebKit::WebPageProxy::executeEditCommand): Deleted.
2998
2999         Move the iOS-specific implementation of executeEditCommand that invokes a callback when the web process responds
3000         out of WebPageProxyIOS, and into cross-platform WebPageProxy code. Additionally, add a parameter for the edit
3001         command's argument.
3002
3003         * WebProcess/WebPage/WebPage.cpp:
3004         (WebKit::WebPage::editorState const):
3005
3006         Use EditingStyle::styleAtSelectionStart instead of Editor::styleForSelectionStart when computing an EditorState.
3007         Tweak bold, italic and underline to use EditingStyle TriStates.
3008
3009         (WebKit::shouldEnsureEditorStateUpdateAfterExecutingCommand):
3010         (WebKit::WebPage::executeEditCommandWithCallback):
3011         * WebProcess/WebPage/WebPage.h:
3012         * WebProcess/WebPage/WebPage.messages.in:
3013         * WebProcess/WebPage/ios/WebPageIOS.mm:
3014         (WebKit::WebPage::executeEditCommandWithCallback): Deleted.
3015
3016 2017-08-08  Zan Dobersek  <zdobersek@igalia.com>
3017
3018         [TexMap] Don't expose GraphicsContext3D object
3019         https://bugs.webkit.org/show_bug.cgi?id=175310
3020
3021         Reviewed by Carlos Garcia Campos.
3022
3023         * Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
3024         (WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
3025         Stop using GraphicsContext3D directly and instead use the
3026         TextureMapper::clearColor() method to achieve the same result.
3027
3028 2017-08-07  Carlos Garcia Campos  <cgarcia@igalia.com>
3029
3030         [GTK] Implement JavaScript dialog methods of API::AutomationSessionClient
3031         https://bugs.webkit.org/show_bug.cgi?id=175259
3032
3033         Reviewed by Michael Catanzaro.
3034
3035         Move the default implementation of WebKitScriptDialog from WebKitWebView platform specific files to their own
3036         files. Implement all JavaScript dialog methods of API::AutomationSessionClient in WebKitAutomationSession. For
3037         now it only works when the user doesn't override WebKitWebView::script-dialog signal and default implementation
3038         is used.
3039
3040         * PlatformGTK.cmake: Add new files to compilation.
3041         * PlatformWPE.cmake: Ditto.
3042         * UIProcess/API/glib/WebKitAutomationSession.cpp:
3043         (webkitAutomationSessionCreate): Pass the WebKitWebContext to the constructor and keep a pointer to it in session.
3044         * UIProcess/API/glib/WebKitAutomationSessionPrivate.h:
3045         * UIProcess/API/glib/WebKitScriptDialogPrivate.h:
3046         * UIProcess/API/glib/WebKitWebContext.cpp:
3047         * UIProcess/API/glib/WebKitWebView.cpp:
3048         (webkitWebViewRunJavaScriptAlert): Set the currently script dialog for the scope of the function.
3049         (webkitWebViewRunJavaScriptConfirm): Ditto.
3050         (webkitWebViewRunJavaScriptPrompt): Ditto.
3051         (webkitWebViewRunJavaScriptBeforeUnloadConfirm): Ditto.
3052         (webkitWebViewIsShowingScriptDialog): Ask current dialog if there's one.
3053         (webkitWebViewGetCurrentScriptDialogMessage): Ditto.
3054         (webkitWebViewSetCurrentScriptDialogUserInput): Ditto.
3055         (webkitWebViewAcceptCurrentScriptDialog): Ditto.
3056         (webkitWebViewDismissCurrentScriptDialog): Ditto.
3057         * UIProcess/API/glib/WebKitWebViewPrivate.h:
3058         * UIProcess/API/gtk/WebKitScriptDialogGtk.cpp: Added.
3059         (webkitWebViewCreateJavaScriptDialog): Moved from WebKitWebViewGtk.cpp.
3060         (webkitScriptDialogRun): Run the dialog, this code is moved from WebKitWebViewGtk.cpp.
3061         (webkitScriptDialogIsRunning): Return true if the script dialog has a native dialog running.
3062         (webkitScriptDialogAccept): Send Ok or Close response to the native dialog depending on the dialog type.
3063         (webkitScriptDialogDismiss): Send Close response to the native dialog.
3064         (webkitScriptDialogSetUserInput): Set the given text on the prompt dialog entry.
3065         * UIProcess/API/gtk/WebKitWebViewGtk.cpp:
3066         (webkitWebViewScriptDialog): Simply call webkitScriptDialogRun() now.
3067         * UIProcess/API/wpe/WebKitScriptDialogWPE.cpp: Copied from Source/WebKit/UIProcess/API/glib/WebKitAutomationSessionPrivate.h.
3068         (webkitScriptDialogRun):
3069         (webkitScriptDialogIsRunning):
3070         (webkitScriptDialogAccept):
3071         (webkitScriptDialogDismiss):
3072         (webkitScriptDialogSetUserInput):
3073
3074 2017-08-07  Devin Rousso  <drousso@apple.com>
3075
3076         Web Inspector: Preview Canvas path when viewing a recording
3077         https://bugs.webkit.org/show_bug.cgi?id=174967
3078
3079         Reviewed by Brian Burg.
3080
3081         * Shared/WebPreferencesDefinitions.h:
3082         * UIProcess/API/C/WKPreferencesRefPrivate.h:
3083         * UIProcess/API/C/WKPreferences.cpp:
3084         (WKPreferencesSetInspectorAdditionsEnabled):
3085         (WKPreferencesGetInspectorAdditionsEnabled):
3086         * WebProcess/WebPage/WebPage.cpp:
3087         (WebKit::WebPage::updatePreferences):
3088         Add plumbing for new InspectorAdditions runtime flag.
3089
3090         * WebProcess/WebPage/WebInspectorUI.cpp:
3091         (WebKit::WebInspectorUI::WebInspectorUI):
3092         Enable InspectorAdditions by default in the WebInspector page.
3093
3094 2017-08-07  Filip Pizlo  <fpizlo@apple.com>
3095
3096         Baseline JIT should do caging
3097         https://bugs.webkit.org/show_bug.cgi?id=175037
3098
3099         Reviewed by Mark Lam.
3100         
3101         Use a better API to disable disabling the primitive gigacage.
3102
3103         * WebProcess/WebProcess.cpp:
3104         (WebKit::m_webSQLiteDatabaseTracker):
3105         (WebKit::primitiveGigacageDisabled): Deleted.
3106
3107 2017-08-06  Filip Pizlo  <fpizlo@apple.com>
3108
3109         Primitive auxiliaries and JSValue auxiliaries should have separate gigacages
3110         https://bugs.webkit.org/show_bug.cgi?id=174919
3111
3112         Reviewed by Keith Miller.
3113         
3114         The disable callback is all about the primitive gigacage.
3115
3116         * WebProcess/WebProcess.cpp:
3117         (WebKit::primitiveGigacageDisabled):
3118         (WebKit::m_webSQLiteDatabaseTracker):
3119         (WebKit::gigacageDisabled): Deleted.
3120
3121 2017-08-07  Brian Burg  <bburg@apple.com>
3122
3123         Remove CANVAS_PATH compilation guard
3124         https://bugs.webkit.org/show_bug.cgi?id=175207
3125
3126         Reviewed by Sam Weinig.
3127
3128         * Configurations/FeatureDefines.xcconfig:
3129
3130 2017-08-07  Carlos Alberto Lopez Perez  <clopez@igalia.com>
3131
3132         [WPE][CMake] Only pass pkg-config CFLAGS from (E)GL when not using libepoxy.
3133         https://bugs.webkit.org/show_bug.cgi?id=175125
3134
3135         Reviewed by Michael Catanzaro.
3136
3137         * CMakeLists.txt: When using libepoxy avoid passing the CFLAGS from (E)GL,
3138         and instead pass the libepoxy ones.
3139
3140 2017-08-07  Carlos Alberto Lopez Perez  <clopez@igalia.com>
3141
3142         [GTK][WPE] CFLAGS from pkg-config for (E)GL are not passed to WebKit
3143         https://bugs.webkit.org/show_bug.cgi?id=175125
3144
3145         Unreviewed follow-up fix after r220326.
3146
3147         * CMakeLists.txt: Move the block appending to WebKit2_LIBRARIES
3148         below where the list itself is created.
3149
3150 2017-08-05  Carlos Garcia Campos  <cgarcia@igalia.com>
3151
3152         [GTK][WPE] Add API to provide browser information required by automation
3153         https://bugs.webkit.org/show_bug.cgi?id=175130
3154
3155         Reviewed by Michael Catanzaro.
3156
3157         When a new automation session is started, the web driver receives some required capabilities from the client,
3158         like browser name and version. The session should be rejected if those required capabilities don't match with
3159         the actual browser that is launched. We don't know that information in WebKit, so we need to add API so that
3160         users can provide it when a new session request is made. This patch adds boxed object WebKitApplicationInfo that
3161         can be used to set the application name and version. This object can be set to a WebKitAutomationSession when
3162         WebKitWebContext::automation-started signal is emitted.
3163
3164         * PlatformGTK.cmake:
3165         * PlatformWPE.cmake:
3166         * UIProcess/API/glib/WebKitApplicationInfo.cpp: Added.
3167         (webkit_application_info_new):
3168         (webkit_application_info_ref):
3169         (webkit_application_info_unref):
3170         (webkit_application_info_set_name):
3171         (webkit_application_info_get_name):
3172         (webkit_application_info_set_version):
3173         (webkit_application_info_get_version):
3174         * UIProcess/API/glib/WebKitAutomationSession.cpp:
3175         (webkitAutomationSessionDispose):
3176         (webkit_automation_session_class_init):
3177         (webkitAutomationSessionGetBrowserName):
3178         (webkitAutomationSessionGetBrowserVersion):
3179         (webkit_automation_session_set_application_info):
3180         (webkit_automation_session_get_application_info):
3181         * UIProcess/API/glib/WebKitAutomationSessionPrivate.h:
3182         * UIProcess/API/glib/WebKitWebContext.cpp:
3183         * UIProcess/API/gtk/WebKitApplicationInfo.h: Added.
3184         * UIProcess/API/gtk/WebKitAutomationSession.h:
3185         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
3186         * UIProcess/API/gtk/docs/webkit2gtk-docs.sgml:
3187         * UIProcess/API/gtk/webkit2.h:
3188         * UIProcess/API/wpe/WebKitApplicationInfo.h: Added.
3189         * UIProcess/API/wpe/WebKitAutomationSession.h:
3190         * UIProcess/API/wpe/webkit.h:
3191
3192 2017-08-06  Carlos Alberto Lopez Perez  <clopez@igalia.com>
3193
3194         [GTK][WPE] CFLAGS from pkg-config for (E)GL are not passed to WebKit
3195         https://bugs.webkit.org/show_bug.cgi?id=175125
3196
3197         Reviewed by Michael Catanzaro.
3198
3199         Some platforms define cflags on the (E)GL pkg-config files that we
3200         need to pass to the build system when including the (E)GL headers.
3201         And we are already doing this when building WebCore (after r184954).
3202
3203         But now we need to do this also on WebKit (former WebKit2) because
3204         we include (E)GL headers (and make use of them) on the UIProcess.
3205
3206         * CMakeLists.txt:
3207
3208 2017-08-05  Carlos Garcia Campos  <cgarcia@igalia.com>
3209
3210         WebDriver: Implement page load strategy
3211         https://bugs.webkit.org/show_bug.cgi?id=175183
3212
3213         Reviewed by Brian Burg.
3214
3215         Split pending navigation maps into normal and eager, and use one or the other depending on the received page
3216         load strategy. We need to keep different maps for every page load strategy because every command could use a
3217         different strategy.
3218
3219         * UIProcess/Automation/WebAutomationSession.cpp:
3220         (WebKit::WebAutomationSession::waitForNavigationToComplete): Extract page load strategy from parameter and pass
3221         it to waitForNavigationToCompleteOnPage() and waitForNavigationToCompleteOnFrame().
3222         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnPage): Return early if page load strategy is
3223         none. Otherwise at the pening callback to the normal or eager map depeding on the page load straegy.
3224         (WebKit::WebAutomationSession::waitForNavigationToCompleteOnFrame): Ditto.
3225         (WebKit::respondToPendingNavigationCallbacksWithTimeout): Helper to send pening navigation callback in case of
3226         timeout failure.
3227         (WebKit::WebAutomationSession::loadTimerFired): Call finishPendingNavigationsWithTimeoutFailure() with all the maps.
3228         (WebKit::WebAutomationSession::navigateBrowsingContext): Extract page load strategy from parameter and pass it
3229         to waitForNavigationToCompleteOnPage().
3230         (WebKit::WebAutomationSession::goBackInBrowsingContext): Ditto.
3231         (WebKit::WebAutomationSession::goForwardInBrowsingContext): Ditto.
3232         (WebKit::WebAutomationSession::reloadBrowsingContext): Ditto.
3233         (WebKit::WebAutomationSession::navigationOccurredForFrame): Use the normal maps.
3234         (WebKit::WebAutomationSession::documentLoadedForFrame): Stop timeout timer and dispatch eager pending navigations.
3235         * UIProcess/Automation/WebAutomationSession.h:
3236         * UIProcess/WebPageProxy.cpp:
3237         (WebKit::WebPageProxy::didFinishDocumentLoadForFrame): Notify the automation session.
3238
3239 2017-08-05  Carlos Garcia Campos  <cgarcia@igalia.com>
3240
3241         WebDriver: use in-view center point for clicks instead of bounding box center point
3242         https://bugs.webkit.org/show_bug.cgi?id=174863
3243
3244         Reviewed by Simon Fraser.
3245
3246         Change computeElementLayout to also return the in-view center point and whether it's obscured by another
3247         element.
3248
3249         * UIProcess/Automation/Automation.json: Add optional inViewCenterPoint to the result and isObscured.
3250         * UIProcess/Automation/WebAutomationSession.cpp:
3251         (WebKit::WebAutomationSession::didComputeElementLayout): Handle inViewCenterPoint and isObscured.
3252         * UIProcess/Automation/WebAutomationSession.h:
3253         * UIProcess/Automation/WebAutomationSession.messages.in:
3254         * WebProcess/Automation/WebAutomationSessionProxy.cpp:
3255         (WebKit::elementInViewClientCenterPoint): Get the client in-view center point and whether it's obscured
3256         according to the spec.
3257         (WebKit::WebAutomationSessionProxy::computeElementLayout): Pass inViewCenterPoint and isObscured to
3258         DidComputeElementLayout message.
3259
3260 2017-08-05  Brian Burg  <bburg@apple.com>
3261
3262         Web Automation: files selected for upload should be matched against 'accept' attribute values case-insensitively
3263         https://bugs.webkit.org/show_bug.cgi?id=175191
3264         <rdar://problem/33725790>
3265
3266         Reviewed by Carlos Garcia Campos.
3267
3268         Values of the "accept" attribute are to be compared in a case-insensitive manner, per
3269         https://html.spec.whatwg.org/multipage/input.html#file-upload-state-(type=file)
3270
3271         Except for converting MIME types and extensions to lowercase, most of these changes
3272         were lost in a rebase prior to landing the patch.
3273
3274         * UIProcess/Automation/WebAutomationSession.cpp:
3275         (WebKit::fileCanBeAcceptedForUpload): Fix some issues:
3276         - Handle a file ending in a period.
3277         - Handle MIME type inference failing.
3278         - Convert extensions and MIMEs to lower case, per specification.
3279
3280         (WebKit::WebAutomationSession::handleRunOpenPanel):
3281         - Strip the leading period from file extensions.
3282         - These range converters crash unless the API::Array is retained by a local variable.
3283
3284 2017-08-04  Youenn Fablet  <youenn@apple.com>
3285
3286         [Cache API] Add Cache and CacheStorage IDL definitions
3287         https://bugs.webkit.org/show_bug.cgi?id=175201
3288
3289         Reviewed by Brady Eidson.
3290
3291         * Shared/WebPreferencesDefinitions.h:
3292         * WebProcess/InjectedBundle/InjectedBundle.cpp:
3293         (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
3294         * WebProcess/WebPage/WebPage.cpp:
3295         (WebKit::WebPage::updatePreferences):
3296
3297 2017-08-04  Brian Burg  <bburg@apple.com>
3298
3299         Expose WKPreferences SPI for toggling mock capture devices prompt
3300         https://bugs.webkit.org/show_bug.cgi?id=175227
3301         <rdar://problem/33734528>
3302
3303         Reviewed by Youenn Fablet.
3304
3305         * UIProcess/API/Cocoa/WKPreferences.mm:
3306         (-[WKPreferences _mockCaptureDevicesPromptEnabled]):
3307         (-[WKPreferences _setMockCaptureDevicesPromptEnabled:]):
3308         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3309
3310 2017-08-04  Brian Burg  <bburg@apple.com>
3311
3312         Fix typo in WKPreferences _iceCandidateFiltertingEnabled property
3313         https://bugs.webkit.org/show_bug.cgi?id=175224
3314
3315         Reviewed by Tim Horton.
3316
3317         * UIProcess/API/Cocoa/WKPreferences.mm:
3318         (-[WKPreferences _iceCandidateFilteringEnabled]):
3319         (-[WKPreferences _iceCandidateFiltertingEnabled]): Deleted.
3320         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
3321
3322 2017-08-04  Chris Dumez  <cdumez@apple.com>
3323
3324         [Beacon] Update sendBeacon to use the CachedResourceLoader
3325         https://bugs.webkit.org/show_bug.cgi?id=175192
3326         <rdar://problem/33725923>
3327
3328         Reviewed by Youenn Fablet.
3329
3330         Deal with new Beacon CachedResource type.
3331
3332         * WebProcess/Network/WebLoaderStrategy.cpp:
3333         (WebKit::maximumBufferingTime):
3334
3335 2017-08-04  John Wilander  <wilander@apple.com>
3336
3337         Resource Load Statistics: Report user interaction immediately, but only when needed
3338         https://bugs.webkit.org/show_bug.cgi?id=175090
3339         <rdar://problem/33685546>
3340
3341         Reviewed by Chris Dumez.
3342
3343         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
3344         (WKBundleClearResourceLoadStatistics):
3345             Test infrastructure. Ends up calling
3346             WebCore::ResourceLoadObserver::clearState().
3347         * WebProcess/InjectedBundle/API/c/WKBundlePrivate.h:
3348
3349 2017-08-04  Matt Lewis  <jlewis3@apple.com>
3350
3351         Unreviewed, rolling out r220288.
3352
3353         This broke multiple builds.
3354
3355         Reverted changeset:
3356
3357         "Use MPAVRoutingController instead of deprecated versions."
3358         https://bugs.webkit.org/show_bug.cgi?id=175063
3359         http://trac.webkit.org/changeset/220288
3360
3361 2017-08-04  Jeremy Jones  <jeremyj@apple.com>
3362
3363         Use MPAVRoutingController instead of deprecated versions.
3364         https://bugs.webkit.org/show_bug.cgi?id=175063
3365         rdar://problem/33301230
3366
3367         Reviewed by Tim Horton.
3368
3369         Remove dependence on deprecated classes MPAVRoutingSheet and MPAudioVideoRoutingPopoverController.
3370
3371         * UIProcess/ios/forms/WKAirPlayRoutePicker.h:
3372         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
3373         (-[WKAirPlayRoutePicker dealloc]):
3374         (-[WKAirPlayRoutePicker show:fromRect:]):
3375         (-[WKAirPlayRoutePicker popoverControllerDidDismissPopover:]): Deleted.
3376         (-[WKAirPlayRoutePicker _presentAirPlayPopoverAnimated:fromRect:]): Deleted.
3377         (-[WKAirPlayRoutePicker _windowWillRotate:]): Deleted.
3378         (-[WKAirPlayRoutePicker _windowDidRotate:]): Deleted.
3379         (-[WKAirPlayRoutePicker _dismissAirPlayRoutePickerIPad]): Deleted.
3380         (-[WKAirPlayRoutePicker showAirPlayPickerIPad:fromRect:]): Deleted.
3381         (-[WKAirPlayRoutePicker showAirPlayPickerIPhone:]): Deleted.
3382
3383 2017-08-04  Tim Horton  <timothy_horton@apple.com>
3384
3385         viewport-fit changes during animated resize can cause layout size to get stuck
3386         https://bugs.webkit.org/show_bug.cgi?id=175169
3387         <rdar://problem/33684697>
3388
3389         Reviewed by Simon Fraser.
3390
3391         If we get a commit that changes viewport-fit state while an animated
3392         resize is underway, and that change causes the client to push a new
3393         minimumLayoutSizeOverride, the new size will be lost forever, and we
3394         will get stuck laying out at the wrong size.
3395
3396         This is because we unconditionally apply avoidsUnsafeArea for every commit,
3397         while most other changes that come in from a commit are ignored if we're
3398         inside animated resize. To fix, also ignore avoidsUnsafeArea changes during
3399         animated resize, by moving the code that keeps track of it into WKWebView
3400         like all of the rest, and read it out of the commit in didCommitLayerTree
3401         *after* the animated-resize early-return.
3402
3403         Also, fix the associated layout tests by adding a missing assignment
3404         in _computedContentInset, which was broken in r220138.
3405
3406         * UIProcess/API/Cocoa/WKWebView.mm:
3407         (-[WKWebView _initializeWithConfiguration:]):
3408         (-[WKWebView _setHasCustomContentView:loadedMIMEType:]):
3409         (-[WKWebView _processDidExit]):
3410         (-[WKWebView _didCommitLayerTree:]):
3411         (-[WKWebView _setAvoidsUnsafeArea:]):
3412         (-[WKWebView _safeAreaShouldAffectObscuredInsets]):
3413         (-[WKWebView _didChangeAvoidsUnsafeArea:]): Deleted.
3414         * UIProcess/API/Cocoa/WKWebViewInternal.h:
3415         * UIProcess/PageClient.h:
3416         * UIProcess/WebPageProxy.cpp:
3417         (WebKit::WebPageProxy::resetState):
3418         (WebKit::WebPageProxy::setAvoidsUnsafeArea): Deleted.
3419         * UIProcess/WebPageProxy.h:
3420         (WebKit::WebPageProxy::avoidsUnsafeArea const): Deleted.
3421         * UIProcess/ios/PageClientImplIOS.h:
3422         * UIProcess/ios/PageClientImplIOS.mm:
3423         (WebKit::PageClientImpl::didChangeAvoidsUnsafeArea): Deleted.
3424         * UIProcess/ios/WebPageProxyIOS.mm:
3425         (WebKit::WebPageProxy::didCommitLayerTree):
3426
3427 2017-08-04  Matt Lewis  <jlewis3@apple.com>
3428
3429         Unreviewed, rolling out r220271.
3430
3431         Rolling out due to Layout Test failing on iOS Simulator.
3432
3433         Reverted changeset:
3434
3435         "Remove STREAMS_API compilation guard"
3436         https://bugs.webkit.org/show_bug.cgi?id=175165
3437         http://trac.webkit.org/changeset/220271
3438
3439 2017-08-03  Sam Weinig  <sam@webkit.org>
3440
3441         [Cleanup] Remove ScriptGlobalObject
3442         https://bugs.webkit.org/show_bug.cgi?id=175173
3443
3444         Reviewed by Darin Adler.
3445
3446         * WebProcess/WebPage/RemoteWebInspectorUI.cpp:
3447         (WebKit::RemoteWebInspectorUI::windowObjectCleared):
3448         * WebProcess/WebPage/WebInspectorUI.cpp:
3449         (WebKit::WebInspectorUI::windowObjectCleared):
3450         Remove call to ScriptGlobalObject::set&nbs