Unreviewed build fix after r226211.
[WebKit-https.git] / Source / WebKit / ChangeLog
1 2018-01-08  Frederic Wang  <fwang@igalia.com>
2
3         Unreviewed build fix after r226211.
4
5         * UIProcess/API/Cocoa/WKPreferencesPrivate.h: Use WK_IOS_TBA for iOS.
6
7 2018-01-08  Youenn Fablet  <youenn@apple.com>
8
9         navigator.onLine does not work inside service workers
10         https://bugs.webkit.org/show_bug.cgi?id=181079
11         <rdar://problem/36178606>
12
13         Reviewed by Darin Adler.
14
15         Added support for a callback called for each service worker proxy creation.
16         Callback is used by WTR to inject a self.internals object used for testing.
17
18         * WebProcess/InjectedBundle/API/c/WKBundle.cpp:
19         (WKBundleSetServiceWorkerProxyCreationCallback):
20         * WebProcess/InjectedBundle/API/c/WKBundle.h:
21         * WebProcess/InjectedBundle/InjectedBundle.cpp:
22         (WebKit::InjectedBundle::setServiceWorkerProxyCreationCallback):
23         * WebProcess/InjectedBundle/InjectedBundle.h:
24
25 2018-01-07  David Kilzer  <ddkilzer@apple.com>
26
27         Enable -Wcast-qual for WebInspectorUI, WebKitLegacy, WebKit projects
28         <https://webkit.org/b/181256>
29         <rdar://problem/36281730>
30
31         Reviewed by Darin Adler.
32
33         * Configurations/Base.xcconfig:
34         (WARNING_CFLAGS): Add -Wcast-qual.
35         * NetworkProcess/cache/NetworkCacheCodersCocoa.cpp:
36         (WTF::Persistence::encodeCertificateChain): Include
37         TypeCastsCF.h from WTF, and use
38         checked_cf_cast<SecCertificateRef>() to fix warning.
39         * Platform/cocoa/WKCrashReporter.mm:
40         (WebKit::setCrashReportApplicationSpecificInformation):
41         - Move `oldMessage` check above nullptr check to fix a leak when
42           passing in nullptr after previously setting the crash string.
43         - Change C-style cast to const_cast<char*>() to fix warning.
44         * PluginProcess/mac/PluginProcessShim.mm:
45         (WebKit::shim_shmat): Change C-style cast to
46         const_cast<void*>() to fix warning.
47         * Shared/Authentication/mac/AuthenticationManager.mac.mm:
48         (WebKit::leafCertificate): Include TypeCastsCF.h from
49         WTF, and use checked_cf_cast<SecCertificateRef>() to fix
50         warning.
51         * Shared/cf/ArgumentCodersCF.cpp:
52         (IPC::encode): Use static_cast<>(const_cast<void*>() to
53         fix warnings since the CFTypeID has already been
54         checked.
55         * Shared/mac/WebCoreArgumentCodersMac.mm:
56         (IPC::decodeNSError): Use an `auto` variable to hold the
57         CFMutableDictionaryRef, then WTFMove() to assign it back to
58         `userInfo`.
59         * UIProcess/Cocoa/WebViewImpl.mm:
60         (WebKit::takeWindowSnapshot): Include TypeCastsCF.h from
61         WTF, and use checked_cf_cast<CGImageRef>() to fix
62         warning.
63
64 2018-01-07  Konstantin Tokarev  <annulen@yandex.ru>
65
66         [cmake] Unset CMAKE_REQUIRED_LIBRARIES after check_function_exists test
67         https://bugs.webkit.org/show_bug.cgi?id=181371
68
69         Reviewed by Michael Catanzaro.
70
71         This variable is used by check_function_exists internally, its value
72         should be never used for anything else.
73
74         * CMakeLists.txt:
75
76 2018-01-05  Dan Bernstein  <mitz@apple.com>
77
78         REGRESSION (r226218): iOS-only assets are installed on macOS
79         https://bugs.webkit.org/show_bug.cgi?id=181362
80
81         Reviewed by Anders Carlsson.
82
83         * Configurations/WebKit.xcconfig: Exclude everything under Resources/ios when not targeting
84           iOS.
85
86         * Resources/ios: Added.
87         * Resources/ios/iOS.xcassets: Moved from Source/WebKit/WebKit.xcassets.
88         * Resources/ios/iOS.xcassets/LockMini.imageset/NavigationBarLockMini@2x.pdf: Set the
89           svn:mime-type property.
90         * Resources/ios/iOS.xcassets/LockMini.imageset/NavigationBarLockMini@3x.pdf: Ditto.
91
92         * Resources/mac: Added.
93         * Resources/mac/mediaIcon.pdf: Moved here…
94         * Resources/mediaIcon.pdf: …from here.
95
96         * WebKit.xcassets: Moved under Resources/ios.
97
98         * WebKit.xcodeproj/project.pbxproj: Created an ios group under the Resources group, and
99           cleaned up the mac group. Removed the Recovered References group.
100
101 2018-01-05  John Wilander  <wilander@apple.com>
102
103         Storage Access API: Refactor to make naming accurate and explicit, simplify access table, and prepare for access removal for page
104         https://bugs.webkit.org/show_bug.cgi?id=181357
105         <rdar://problem/36331031>
106
107         Reviewed by Alex Christensen.
108
109         This change does the following:
110         - Changes function and message names to reflect how this feature
111           was eventually implemented, i.e. access per frame.
112         - Makes it explicit that the UI process is only involved in
113           granting storage access and not removing storage access.
114           The latter is done directly by the web process.
115         - Simplifies the network process' entry map since only needs to
116           be able to give access to one domain in one frame at a time.
117           Access goes away on frame navigation so there can only be one
118           domain at a time per frame. Also, the map now uses pageIDs as
119           main keys to prepare for efficient access removal for all
120           frames under a page.
121         - Fixes a bug in so that a cross-origin iframe with the same
122           partition as the top frame correctly is handled as already
123           having access.
124
125         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
126         (WebKit::NetworkConnectionToWebProcess::removeStorageAccessForFrame):
127         (WebKit::NetworkConnectionToWebProcess::removeStorageAccess): Deleted.
128         * NetworkProcess/NetworkConnectionToWebProcess.h:
129         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
130         * NetworkProcess/NetworkProcess.cpp:
131         (WebKit::NetworkProcess::hasStorageAccessForFrame):
132         (WebKit::NetworkProcess::grantStorageAccessForFrame):
133         (WebKit::NetworkProcess::hasStorageAccessForPrevalentDomains): Deleted.
134         (WebKit::NetworkProcess::updateStorageAccessForPrevalentDomains): Deleted.
135         * NetworkProcess/NetworkProcess.h:
136         * NetworkProcess/NetworkProcess.messages.in:
137         * UIProcess/Network/NetworkProcessProxy.cpp:
138         (WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
139         (WebKit::NetworkProcessProxy::grantStorageAccessForFrame):
140         (WebKit::NetworkProcessProxy::hasStorageAccessForPrevalentDomains): Deleted.
141         (WebKit::NetworkProcessProxy::updateStorageAccessForPrevalentDomains): Deleted.
142         * UIProcess/Network/NetworkProcessProxy.h:
143         * UIProcess/WebResourceLoadStatisticsStore.cpp:
144         (WebKit::WebResourceLoadStatisticsStore::WebResourceLoadStatisticsStore):
145         (WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
146         (WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
147         * UIProcess/WebResourceLoadStatisticsStore.h:
148         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
149         (WebKit::WebsiteDataStore::hasStorageAccessForFrameHandler):
150         (WebKit::WebsiteDataStore::grantStorageAccessForFrameHandler):
151         (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
152         (WebKit::WebsiteDataStore::hasStorageAccessForPrevalentDomainsHandler): Deleted.
153         (WebKit::WebsiteDataStore::updateStorageAccessForPrevalentDomainsHandler): Deleted.
154         * UIProcess/WebsiteData/WebsiteDataStore.h:
155         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
156         (WebKit::WebFrameLoaderClient::detachedFromParent2):
157         (WebKit::WebFrameLoaderClient::dispatchWillChangeDocument):
158
159 2018-01-05  Youenn Fablet  <youenn@apple.com>
160
161         Implement Cache API partitioning based on ClientOrigin
162         https://bugs.webkit.org/show_bug.cgi?id=181240
163
164         Reviewed by Alex Christensen.
165
166         open and retrieveCaches now take a ClientOrigin instead of a String.
167         Updated cache filesystem path computation to take both client origin and top origin.
168
169         When clearing an origin, caches whose client origin or top origin matches the origin are cleared.
170         Caches are added to the web site data of their client origin with their corresponding cache size.
171         Caches are added to the web site data of their top origin with a size equal to 0.
172
173         Updated memory representation dumping used for test to include both top and client origins.
174
175         * NetworkProcess/NetworkProcess.cpp:
176         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
177         * NetworkProcess/cache/CacheStorageEngine.cpp:
178         (WebKit::CacheStorage::Engine::cachesRootPath):
179         (WebKit::CacheStorage::Engine::open):
180         (WebKit::CacheStorage::Engine::remove):
181         (WebKit::CacheStorage::Engine::retrieveCaches):
182         (WebKit::CacheStorage::Engine::readCachesFromDisk):
183         (WebKit::CacheStorage::Engine::removeCaches):
184         (WebKit::CacheStorage::Engine::fetchEntries):
185         (WebKit::CacheStorage::Engine::clearCachesForOrigin):
186         (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
187         (WebKit::CacheStorage::Engine::representation):
188         * NetworkProcess/cache/CacheStorageEngine.h:
189         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
190         (WebKit::CacheStorage::Cache::Cache):
191         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
192         (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory):
193         (WebKit::CacheStorage::Caches::Caches):
194         (WebKit::CacheStorage::Caches::storeOrigin):
195         (WebKit::CacheStorage::Caches::readOrigin):
196         (WebKit::CacheStorage::Caches::open):
197         * NetworkProcess/cache/CacheStorageEngineCaches.h:
198         (WebKit::CacheStorage::Caches::create):
199         (WebKit::CacheStorage::Caches::origin const):
200         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
201         (WebKit::CacheStorageEngineConnection::open):
202         (WebKit::CacheStorageEngineConnection::caches):
203         (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
204         * NetworkProcess/cache/CacheStorageEngineConnection.h:
205         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
206         * WebProcess/Cache/WebCacheStorageConnection.cpp:
207         (WebKit::WebCacheStorageConnection::doOpen):
208         (WebKit::WebCacheStorageConnection::doRetrieveCaches):
209         (WebKit::WebCacheStorageConnection::clearMemoryRepresentation):
210         * WebProcess/Cache/WebCacheStorageConnection.h:
211
212 2018-01-05  Megan Gardner  <megan_gardner@apple.com>
213
214         Show Keyboard when re-launching WKWebView with a previously focused element
215         https://bugs.webkit.org/show_bug.cgi?id=181353
216
217         Reviewed by Tim Horton.
218
219         When relaunching an app with a WKWebView, restore the keyboard if there was a previously
220         focused element that was being assisted. The element was already being tracked, we just
221         needed to not bail on showing the keyboard for instances where it was a state change that
222         caused the element to be refocused.
223
224         * UIProcess/PageClient.h:
225         * UIProcess/WebPageProxy.h:
226         * UIProcess/WebPageProxy.messages.in:
227         * UIProcess/ios/PageClientImplIOS.h:
228         * UIProcess/ios/PageClientImplIOS.mm:
229         (WebKit::PageClientImpl::startAssistingNode):
230         * UIProcess/ios/WKContentView.h:
231         * UIProcess/ios/WKContentViewInteraction.h:
232         * UIProcess/ios/WKContentViewInteraction.mm:
233         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
234         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]): Deleted.
235         * UIProcess/ios/WebPageProxyIOS.mm:
236         (WebKit::WebPageProxy::startAutoscrollAtPosition):
237         (WebKit::WebPageProxy::startAssistingNode):
238         * WebProcess/WebPage/WebPage.cpp:
239         (WebKit::WebPage::setActivityState):
240         (WebKit::WebPage::elementDidFocus):
241         * WebProcess/WebPage/WebPage.h:
242
243 2018-01-05  Alex Christensen  <achristensen@webkit.org>
244
245         Restrict navigation-time WKWebsiteDataStore swapping to main frame navigations
246         https://bugs.webkit.org/show_bug.cgi?id=181217
247
248         Reviewed by Tim Horton.
249
250         If we swap during an iframe navigation, then we get a page in a strange state.
251         The intent of the main frame navigation WKWebsiteDataStore swap is that
252         that is a time when we can change storages without a page in an inconsistent state.
253
254         * UIProcess/Cocoa/NavigationState.mm:
255         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
256
257 2018-01-05  Alex Christensen  <achristensen@webkit.org>
258
259         Add WKBundleFrameCreateFrameHandle
260         https://bugs.webkit.org/show_bug.cgi?id=181232
261         <rdar://problem/35926696>
262
263         Reviewed by Tim Horton.
264
265         InjectedBundle clients wanting to sent a _WKFrameHandle cannot without this function.
266         Before, they would just send the WKBundleFrameRef which would be changed into a WKFrameRef
267         in the UIProcess by WebProcessProxy::transformHandlesToObjects, but there is no ObjC equivalent
268         of WKFrameRef, so we were just getting a WKObject when we wanted a _WKFrameHandle.
269         We can't change WebProcessProxy::transformHandlesToObjects without being incompatible with the 
270         existing C API, so let's add a way for clients to say "I want a _WKFrameHandle".
271
272         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
273         (WKBundleFrameCreateFrameHandle):
274         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
275
276 2018-01-05  Wenson Hsieh  <wenson_hsieh@apple.com>
277
278         [Attachment Support] Add a way to write blob data to a file URL from the UI process
279         https://bugs.webkit.org/show_bug.cgi?id=181236
280
281         Reviewed by Brady Eidson.
282
283         Add support for writing a blob to a designated file path. In WebKit, this is mainly plumbing writeBlobToFilePath
284         through WebPageProxy to the network process.
285
286         * NetworkProcess/FileAPI/NetworkBlobRegistry.cpp:
287         (WebKit::NetworkBlobRegistry::writeBlobToFilePath):
288
289         Call out to the BlobRegistryImpl to write blobs to the file path. Additionally grant sandbox extensions for any
290         file-backed blob parts corresponding to the given blob URL.
291
292         (WebKit::NetworkBlobRegistry::filesInBlob):
293
294         Introduce a version of filesInBlob that doesn't check against the NetworkConnectionToWebProcess. This is used
295         when the UI process is the driver for writing a blob.
296
297         * NetworkProcess/FileAPI/NetworkBlobRegistry.h:
298         * NetworkProcess/NetworkProcess.cpp:
299         (WebKit::NetworkProcess::writeBlobToFilePath):
300
301         Temporarily grant sandbox access to the given file path.
302
303         * NetworkProcess/NetworkProcess.h:
304         * NetworkProcess/NetworkProcess.messages.in:
305         * Shared/WebCoreArgumentCoders.cpp:
306         (IPC::ArgumentCoder<PromisedBlobInfo>::encode):
307         (IPC::ArgumentCoder<PromisedBlobInfo>::decode):
308         (IPC::ArgumentCoder<PromisedBlobData>::encode): Deleted.
309         (IPC::ArgumentCoder<PromisedBlobData>::decode): Deleted.
310
311         Remove PromisedBlobData (see WebCore/ChangeLog for more information).
312
313         * Shared/WebCoreArgumentCoders.h:
314         * UIProcess/Network/NetworkProcessProxy.cpp:
315         (WebKit::NetworkProcessProxy::didClose):
316
317         If the network process is terminated, flush any pending callbacks in m_writeBlobToFilePathCallbackMap, passing
318         in a failure result (success := false) and clearing the callback map.
319
320         (WebKit::NetworkProcessProxy::writeBlobToFilePath):
321         (WebKit::NetworkProcessProxy::didWriteBlobToFilePath):
322         * UIProcess/Network/NetworkProcessProxy.h:
323         * UIProcess/Network/NetworkProcessProxy.messages.in:
324         * UIProcess/WebPageProxy.cpp:
325         (WebKit::WebPageProxy::writeBlobToFilePath):
326         * UIProcess/WebPageProxy.h:
327
328 2018-01-05  Dan Bernstein  <mitz@apple.com>
329
330         Add injected bundle equivalents of DOMHTMLDocument (DOMHTMLDocumentExtensions)
331         https://bugs.webkit.org/show_bug.cgi?id=181345
332
333         Reviewed by Tim Horton.
334
335         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h: Declared new methods.
336         * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm:
337         (-[WKDOMDocument createDocumentFragmentWithMarkupString:baseURL:]): Added. Calls WebCore’s
338           createFragmentFromMarkup.
339         (-[WKDOMDocument createDocumentFragmentWithText:]): Added. Calls WebCore’s
340           createFragmentFromText.
341
342 2018-01-05  Don Olmstead  <don.olmstead@sony.com>
343
344         [Curl] Add implementation stubs for Network Cache
345         https://bugs.webkit.org/show_bug.cgi?id=181343
346
347         Reviewed by Alex Christensen.
348
349         * NetworkProcess/cache/NetworkCacheCodersCurl.cpp: Added.
350         (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode):
351         (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode):
352         * NetworkProcess/cache/NetworkCacheDataCurl.cpp: Added.
353         (WebKit::NetworkCache::Data::Data):
354         (WebKit::NetworkCache::Data::empty):
355         (WebKit::NetworkCache::Data::data const):
356         (WebKit::NetworkCache::Data::isNull const):
357         (WebKit::NetworkCache::Data::apply const):
358         (WebKit::NetworkCache::Data::subrange const):
359         (WebKit::NetworkCache::concatenate):
360         (WebKit::NetworkCache::Data::adoptMap):
361         * NetworkProcess/cache/NetworkCacheIOChannelCurl.cpp: Added.
362         (WebKit::NetworkCache::IOChannel::IOChannel):
363         (WebKit::NetworkCache::IOChannel::~IOChannel):
364         (WebKit::NetworkCache::IOChannel::open):
365         (WebKit::NetworkCache::IOChannel::read):
366         (WebKit::NetworkCache::IOChannel::write):
367         * PlatformWin.cmake:
368
369 2018-01-05  Don Olmstead  <don.olmstead@sony.com>
370
371         [Curl] Update method declarations in WebKit
372         https://bugs.webkit.org/show_bug.cgi?id=181342
373
374         Reviewed by Alex Christensen.
375
376         * NetworkProcess/Downloads/curl/DownloadCurl.cpp:
377         (WebKit::Download::resume):
378         * NetworkProcess/curl/RemoteNetworkingContextCurl.cpp:
379         (WebKit::RemoteNetworkingContext::ensurePrivateBrowsingSession): Deleted.
380         (WebKit::RemoteNetworkingContext::blockedError const): Deleted.
381
382 2018-01-05  Don Olmstead  <don.olmstead@sony.com>
383
384         WebFullScreenManager should compile when ENABLE(VIDEO) is off
385         https://bugs.webkit.org/show_bug.cgi?id=181338
386
387         Reviewed by Alex Christensen.
388
389         * WebProcess/FullScreen/WebFullScreenManager.cpp:
390         (WebKit::WebFullScreenManager::didEnterFullScreen):
391         (WebKit::WebFullScreenManager::willExitFullScreen):
392         * WebProcess/FullScreen/WebFullScreenManager.h:
393
394 2018-01-05  Andy Estes  <aestes@apple.com>
395
396         [Apple Pay] Disable Apple Pay on platforms that don't have PassKit.framework
397         https://bugs.webkit.org/show_bug.cgi?id=181335
398         <rdar://problem/36311296>
399
400         Reviewed by Brady Eidson.
401
402         When Safari is running in the macOS Base System, PassKit.framework is not available.
403         If we fail to dlopen PassKit, we should disable Apple Pay.
404
405         * UIProcess/API/C/WKPreferences.cpp:
406         (WKPreferencesSetApplePayEnabled):
407         * UIProcess/API/Cocoa/WKWebView.mm:
408         (-[WKWebView _initializeWithConfiguration:]):
409         * UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
410         * UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
411         (WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks):
412         (WebKit::WebPaymentCoordinatorProxy::platformSupportsPayments):
413
414 2018-01-05  Dan Bernstein  <mitz@apple.com>
415
416         Fixed the build following AppKit API deprecations in a recent SDKs
417
418         * UIProcess/mac/WKFullScreenWindowController.mm:
419         (-[WKFullScreenWindowController enterFullScreen:]): Suppressed deprecation warnings.
420         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Ditto.
421         (-[WKFullScreenWindowController exitFullScreen]): Ditto.
422         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Ditto.
423         (-[WKFullScreenWindowController completeFinishExitFullScreenAnimationAfterRepaint]): Ditto.
424         (-[WKFullScreenWindowController _startEnterFullScreenAnimationWithDuration:]): Ditto.
425         (-[WKFullScreenWindowController _startExitFullScreenAnimationWithDuration:]): Ditto.
426         * UIProcess/mac/WKPrintingView.mm:
427         (-[WKPrintingView _setAutodisplay:]): Ditto.
428
429 2018-01-05  Matt Lewis  <jlewis3@apple.com>
430
431         Unreviewed, rolling out r226401.
432
433         This caused timeouts on multiple platforms.
434
435         Reverted changeset:
436
437         "Implement Cache API partitioning based on ClientOrigin"
438         https://bugs.webkit.org/show_bug.cgi?id=181240
439         https://trac.webkit.org/changeset/226401
440
441 2018-01-05  Joseph Pecoraro  <pecoraro@apple.com>
442
443         ServiceWorkers: Enable UserTiming / ResourceTiming
444         https://bugs.webkit.org/show_bug.cgi?id=181297
445         <rdar://problem/36307306>
446
447         Reviewed by Youenn Fablet.
448
449         * WebProcess/Storage/WebSWContextManagerConnection.cpp:
450         (WebKit::WebSWContextManagerConnection::updatePreferencesStore):
451         Enable Resource Timing / User Timing for the ServiceWorker process.
452
453 2018-01-04  Zan Dobersek  <zdobersek@igalia.com>
454
455         Unreviewed GTK+ build fix.
456
457         * UIProcess/API/glib/WebKitUserMediaPermissionRequest.cpp:
458         (webkit_user_media_permission_is_for_audio_device):
459         Call UserMediaPermissionRequestProxy::requiresAudioCapture().
460         (webkit_user_media_permission_is_for_video_device):
461         Call UserMediaPermissionRequestProxy::requiresVideoCapture().
462
463 2018-01-04  Don Olmstead  <don.olmstead@sony.com>
464
465         [Curl] Fix compilation error in WebFrameNetworkingContext
466         https://bugs.webkit.org/show_bug.cgi?id=181312
467
468         Reviewed by Alex Christensen.
469
470         * WebProcess/WebCoreSupport/curl/WebFrameNetworkingContext.cpp:
471         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
472
473 2018-01-04  Tim Horton  <timothy_horton@apple.com>
474
475         WKWebView loses minimum layout size overrides that happen while the process is terminated
476         https://bugs.webkit.org/show_bug.cgi?id=181306
477         <rdar://problem/34398288>
478
479         Reviewed by Dan Bernstein.
480
481         * Shared/WebPageCreationParameters.cpp:
482         (WebKit::WebPageCreationParameters::encode const):
483         (WebKit::WebPageCreationParameters::decode):
484         * Shared/WebPageCreationParameters.h:
485         * UIProcess/API/Cocoa/WKWebView.mm:
486         (-[WKWebView _didRelaunchProcess]): Deleted.
487         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
488         * UIProcess/WebPageProxy.cpp:
489         (WebKit::WebPageProxy::creationParameters):
490         * UIProcess/WebPageProxy.h:
491         * UIProcess/ios/PageClientImplIOS.mm:
492         (WebKit::PageClientImpl::didRelaunchProcess):
493         * UIProcess/ios/WebPageProxyIOS.mm:
494         (WebKit::WebPageProxy::setViewportConfigurationMinimumLayoutSize):
495         (WebKit::WebPageProxy::setForceAlwaysUserScalable):
496         (WebKit::WebPageProxy::setMaximumUnobscuredSize):
497         * WebProcess/WebPage/WebPage.cpp:
498         (WebKit::WebPage::WebPage):
499         Pass the current viewport minimum layout size and maximum unobscured size
500         in the WebPageCreationParameters instead of re-sending them in _didRelaunchProcess.
501
502         The previous approach was problematic when _dispatchSetMinimumLayoutSize:
503         was changed to not re-send identical updates, because if the client calls 
504         _overrideLayoutParametersWithMinimumLayoutSize before the Web Content process
505         is re-launched (after terminating), we would cache the size, attempt to send it,
506         fail silently (because the process is not launched), and then in _didRelaunchProcess
507         we would choose not to re-send (after the process is successfully relaunched)
508         because we think we already sent the new value.
509
510         Add isValid() checks to our message sends. Ideally send() would assert
511         if the process is not alive to avoid problems like this, but it doesn't (yet).
512
513         Get rid of WKWebView's _didRelaunchProcess, because it does nothing now.
514
515 2018-01-04  Stephan Szabo  <stephan.szabo@sony.com>
516
517         NetworkProcess cache files use functions from unistd.h without explicitly including it
518         https://bugs.webkit.org/show_bug.cgi?id=181261
519
520         Reviewed by Alex Christensen.
521
522         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
523         * NetworkProcess/cache/NetworkCacheData.cpp:
524
525 2018-01-04  Keith Rollin  <krollin@apple.com>
526
527         Add commas
528         https://bugs.webkit.org/show_bug.cgi?id=181295
529         <rdar://problem/35802295>
530
531         Reviewed by Brent Fulgham.
532
533         Fix a problem introduced in r226226 where the emitted JSON didn't
534         include some required commas.
535
536         * NetworkProcess/NetworkResourceLoader.cpp:
537         (WebKit::NetworkResourceLoader::logCookieInformation const):
538
539 2018-01-04  Eric Carlson  <eric.carlson@apple.com>
540
541         [MediaStream] Add Mock screen capture source
542         https://bugs.webkit.org/show_bug.cgi?id=181291
543         <rdar://problem/36298164>
544
545         Reviewed by Dean Jackson.
546
547         * Shared/WebCoreArgumentCoders.cpp:
548         (IPC::ArgumentCoder<MediaConstraints>::decode):
549         (IPC::ArgumentCoder<CaptureDevice>::encode): Deleted, moved to CaptureDevice.h
550         (IPC::ArgumentCoder<CaptureDevice>::decode): Ditto.
551         * Shared/WebCoreArgumentCoders.h:
552
553         * UIProcess/API/Cocoa/WKWebViewPrivate.h: Add _WKCaptureDeviceDisplay.
554         * UIProcess/Cocoa/UIDelegate.mm:
555         (WebKit::requestUserMediaAuthorizationForDevices): Deal with display capture.
556         (WebKit::UIDelegate::UIClient::decidePolicyForUserMediaPermissionRequest): Ditto.
557
558         * UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
559         (WebKit::UserMediaPermissionRequestManagerProxy::userMediaAccessWasDenied): requiresAudio -> requiresAudioCapture.
560         (WebKit::UserMediaPermissionRequestManagerProxy::searchForGrantedRequest const): Never reuse
561         a previously granted display capture request.
562
563         * UIProcess/UserMediaPermissionRequestProxy.cpp:
564         (WebKit::UserMediaPermissionRequestProxy::allow): Search the eligible devices instead of asking
565         the source center to find devices.
566         * UIProcess/UserMediaPermissionRequestProxy.h:
567         (WebKit::UserMediaPermissionRequestProxy::requiresAudioCapture const): Renamed.
568         (WebKit::UserMediaPermissionRequestProxy::requiresVideoCapture const): Ditto.
569         (WebKit::UserMediaPermissionRequestProxy::requiresDisplayCapture const): New.
570         (WebKit::UserMediaPermissionRequestProxy::requiresAudio const): Deleted.
571         (WebKit::UserMediaPermissionRequestProxy::requiresVideo const): Deleted.
572
573 2018-01-04  Youenn Fablet  <youenn@apple.com>
574
575         FetchResponse should set its internal response text encoding name
576         https://bugs.webkit.org/show_bug.cgi?id=181284
577
578         Reviewed by Alex Christensen.
579
580         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
581         (WebKit::ServiceWorkerClientFetch::didReceiveResponse): Set default encoding to UTF-8.
582
583 2018-01-04  Youenn Fablet  <youenn@apple.com>
584
585         Implement Cache API partitioning based on ClientOrigin
586         https://bugs.webkit.org/show_bug.cgi?id=181240
587
588         Reviewed by Alex Christensen.
589
590         open and retrieveCaches now take a ClientOrigin instead of a String.
591         Updated cache filesystem path computation to take both client origin and top origin.
592
593         When clearing an origin, caches whose client origin or top origin matches the origin are cleared.
594         Caches are added to the web site data of their client origin with their corresponding cache size.
595         Caches are added to the web site data of their top origin with a size equal to 0.
596
597         Updated memory representation dumping used for test to include both top and client origins.
598
599         * NetworkProcess/NetworkProcess.cpp:
600         (WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
601         * NetworkProcess/cache/CacheStorageEngine.cpp:
602         (WebKit::CacheStorage::Engine::cachesRootPath):
603         (WebKit::CacheStorage::Engine::open):
604         (WebKit::CacheStorage::Engine::remove):
605         (WebKit::CacheStorage::Engine::retrieveCaches):
606         (WebKit::CacheStorage::Engine::readCachesFromDisk):
607         (WebKit::CacheStorage::Engine::removeCaches):
608         (WebKit::CacheStorage::Engine::fetchEntries):
609         (WebKit::CacheStorage::Engine::clearCachesForOrigin):
610         (WebKit::CacheStorage::Engine::clearMemoryRepresentation):
611         (WebKit::CacheStorage::Engine::representation):
612         * NetworkProcess/cache/CacheStorageEngine.h:
613         * NetworkProcess/cache/CacheStorageEngineCache.cpp:
614         (WebKit::CacheStorage::Cache::Cache):
615         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
616         (WebKit::CacheStorage::Caches::retrieveOriginFromDirectory):
617         (WebKit::CacheStorage::Caches::Caches):
618         (WebKit::CacheStorage::Caches::storeOrigin):
619         (WebKit::CacheStorage::Caches::readOrigin):
620         (WebKit::CacheStorage::Caches::open):
621         * NetworkProcess/cache/CacheStorageEngineCaches.h:
622         (WebKit::CacheStorage::Caches::create):
623         (WebKit::CacheStorage::Caches::origin const):
624         * NetworkProcess/cache/CacheStorageEngineConnection.cpp:
625         (WebKit::CacheStorageEngineConnection::open):
626         (WebKit::CacheStorageEngineConnection::caches):
627         (WebKit::CacheStorageEngineConnection::clearMemoryRepresentation):
628         * NetworkProcess/cache/CacheStorageEngineConnection.h:
629         * NetworkProcess/cache/CacheStorageEngineConnection.messages.in:
630         * WebProcess/Cache/WebCacheStorageConnection.cpp:
631         (WebKit::WebCacheStorageConnection::doOpen):
632         (WebKit::WebCacheStorageConnection::doRetrieveCaches):
633         (WebKit::WebCacheStorageConnection::clearMemoryRepresentation):
634         * WebProcess/Cache/WebCacheStorageConnection.h:
635
636 2018-01-04  Youenn Fablet  <youenn@apple.com>
637
638         Service Worker should expose redirect mode for navigation loads as manual
639         https://bugs.webkit.org/show_bug.cgi?id=181067
640
641         Reviewed by Alex Christensen.
642
643         * WebProcess/Storage/ServiceWorkerClientFetch.cpp:
644         (WebKit::ServiceWorkerClientFetch::didReceiveResponse):
645
646 2018-01-03  Wenson Hsieh  <wenson_hsieh@apple.com>
647
648         [Attachment Support] Create attachment elements when dropping files on iOS
649         https://bugs.webkit.org/show_bug.cgi?id=181192
650         <rdar://problem/36280945>
651
652         Reviewed by Tim Horton.
653
654         Make some minor adjustments for changes to the pasteboard in WebCore. See WebCore/ChangeLog for more detail.
655         Teaches WebPasteboardProxy et. al. to plumb PasteboardItemInfo from the UI process to the web process via the
656         new `InformationForItemAtIndex` codepath.
657
658         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
659         (WebKit::WebPasteboardProxy::informationForItemAtIndex):
660         (WebKit::WebPasteboardProxy::getFilenamesForDataInteraction): Deleted.
661         * UIProcess/WebPasteboardProxy.h:
662         * UIProcess/WebPasteboardProxy.messages.in:
663         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
664         (WebKit::WebPlatformStrategies::informationForItemAtIndex):
665         (WebKit::WebPlatformStrategies::getFilenamesForDataInteraction): Deleted.
666         * WebProcess/WebCoreSupport/WebPlatformStrategies.h:
667
668 2018-01-03  Ting-Wei Lan  <lantw44@gmail.com>
669
670         Replace hard-coded paths in shebangs with #!/usr/bin/env
671         https://bugs.webkit.org/show_bug.cgi?id=181040
672
673         Reviewed by Alex Christensen.
674
675         * Scripts/generate-forwarding-headers.pl:
676
677 2018-01-03  Wenson Hsieh  <wenson_hsieh@apple.com>
678
679         [Attachment Support] Add plumbing for starting a drag with promised blob data
680         https://bugs.webkit.org/show_bug.cgi?id=181201
681
682         Reviewed by Tim Horton.
683
684         Add boilerplate plumbing for PrepareToDragPromisedBlob, which delivers blob promises to the UI process when
685         dragging, respectively.
686
687         * Scripts/webkit/messages.py:
688         (headers_for_type):
689         * Shared/WebCoreArgumentCoders.cpp:
690         (IPC::encodeTypesAndData):
691         (IPC::decodeTypesAndData):
692         (IPC::ArgumentCoder<PasteboardWebContent>::encode):
693         (IPC::ArgumentCoder<PasteboardWebContent>::decode):
694         (IPC::ArgumentCoder<PasteboardImage>::encode):
695         (IPC::ArgumentCoder<PasteboardImage>::decode):
696         (IPC::ArgumentCoder<PromisedBlobInfo>::encode):
697         (IPC::ArgumentCoder<PromisedBlobInfo>::decode):
698
699         Add IPC support PromisedBlobInfo's additionalTypes and additionalData.
700
701         (IPC::encodeClientTypesAndData): Deleted.
702         (IPC::decodeClientTypesAndData): Deleted.
703
704         Rename these helper functions and move them to the top of the file.
705
706         * UIProcess/Cocoa/WebViewImpl.h:
707         * UIProcess/Cocoa/WebViewImpl.mm:
708         (WebKit::WebViewImpl::prepareToDragPromisedBlob):
709         * UIProcess/PageClient.h:
710         (WebKit::PageClient::prepareToDragPromisedBlob):
711         * UIProcess/WebPageProxy.cpp:
712         (WebKit::WebPageProxy::prepareToDragPromisedBlob):
713         * UIProcess/WebPageProxy.h:
714         * UIProcess/WebPageProxy.messages.in:
715         * UIProcess/ios/PageClientImplIOS.h:
716         * UIProcess/ios/PageClientImplIOS.mm:
717         (WebKit::PageClientImpl::prepareToDragPromisedBlob):
718         * UIProcess/ios/WKContentViewInteraction.h:
719         * UIProcess/ios/WKContentViewInteraction.mm:
720         (-[WKContentView _prepareToDragPromisedBlob:]):
721         * UIProcess/mac/PageClientImplMac.h:
722         * UIProcess/mac/PageClientImplMac.mm:
723         (WebKit::PageClientImpl::prepareToDragPromisedBlob):
724         * WebProcess/WebCoreSupport/WebDragClient.cpp:
725         (WebKit::WebDragClient::prepareToDragPromisedBlob):
726         * WebProcess/WebCoreSupport/WebDragClient.h:
727         * WebProcess/WebPage/WebPage.cpp:
728         (WebKit::WebPage::prepareToDragPromisedBlob):
729         * WebProcess/WebPage/WebPage.h:
730
731 2018-01-03  David Kilzer  <ddkilzer@apple.com>
732
733         REGRESSION (r212929): WKSnapshotConfiguration may leak an NSNumber when deallocated
734         <https://webkit.org/b/181274>
735
736         Reviewed by Joseph Pecoraro.
737
738         * UIProcess/API/Cocoa/WKSnapshotConfiguration.mm:
739         (-[WKSnapshotConfiguration dealloc]): Implement method and
740         release _snapshotWidth.
741
742 2018-01-03  John Wilander  <wilander@apple.com>
743
744         Storage Access API: Refactor XPC for access removal to go straight from the web process to the network process
745         https://bugs.webkit.org/show_bug.cgi?id=181270
746         <rdar://problem/36289544>
747
748         Reviewed by Alex Christensen.
749
750         This change refactors how the web process tells the network process
751         to remove storage access. Previously, this was done over the UI process
752         just like requests for storage access. But since no further reasoning
753         is needed, the message should go straight from the web process to the
754         network process for performance reasons and to minimize the risk of a
755         race.
756
757         As a consequence, the XPC code for storage access removal in the UI
758         process is deleted.
759
760         * NetworkProcess/NetworkConnectionToWebProcess.cpp:
761         (WebKit::NetworkConnectionToWebProcess::removeStorageAccess):
762         * NetworkProcess/NetworkConnectionToWebProcess.h:
763         * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
764         * NetworkProcess/NetworkProcess.cpp:
765         (WebKit::NetworkProcess::removeStorageAccess): Deleted.
766         * NetworkProcess/NetworkProcess.h:
767         * NetworkProcess/NetworkProcess.messages.in:
768         * UIProcess/Network/NetworkProcessProxy.cpp:
769         (WebKit::NetworkProcessProxy::removeStorageAccess): Deleted.
770         * UIProcess/Network/NetworkProcessProxy.h:
771         * UIProcess/WebPageProxy.cpp:
772         (WebKit::WebPageProxy::requestStorageAccess):
773         (WebKit::WebPageProxy::removeStorageAccess): Deleted.
774         * UIProcess/WebPageProxy.h:
775         * UIProcess/WebPageProxy.messages.in:
776         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
777         (WebKit::WebsiteDataStore::requestStorageAccess):
778         (WebKit::WebsiteDataStore::removeStorageAccess): Deleted.
779         * UIProcess/WebsiteData/WebsiteDataStore.h:
780         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
781         (WebKit::WebFrameLoaderClient::detachedFromParent2):
782         (WebKit::WebFrameLoaderClient::dispatchWillChangeDocument):
783
784 2018-01-03  David Kilzer  <ddkilzer@apple.com>
785
786         com.apple.WebKit.Networking crash in com.apple.Foundation: -[__NSOperationInternal _start:]
787         <https://webkit.org/b/181272>
788         <rdar://problem/35657310>
789
790         Reviewed by Alex Christensen.
791
792         * NetworkProcess/cocoa/NetworkSessionCocoa.mm:
793         (downgradeRequest): Remove unnecessary -autorelease.
794
795 2018-01-03  Brent Fulgham  <bfulgham@apple.com>
796
797         [macOS] Constant frame dropping during Flash video playback
798         https://bugs.webkit.org/show_bug.cgi?id=181249
799         <rdar://problem/34843448>
800
801         Reviewed by Eric Carlson.
802
803         Review of logs during jerky flash video playback shows a few IOKit properties are being blocked by the sandbox,
804         which prevents some high-efficiency codecs from being used. Add 'AppleGVAKeyDoesNotExist', 'IODVDBundleName', and
805         'IOGVA*Encode' to the whitelist.
806
807         * PluginProcess/mac/com.apple.WebKit.plugin-common.sb.in:
808
809 2018-01-03  Michael Catanzaro  <mcatanzaro@igalia.com>
810
811         [GTK] Add web process API to detect when form is submitted via JavaScript
812         https://bugs.webkit.org/show_bug.cgi?id=173915
813
814         Reviewed by Carlos Garcia Campos.
815
816         Epiphany relies on the DOM submit event to detect when a form has been submitted. However,
817         for historical reasons, the submit event is not emitted when a form is submitted by
818         JavaScript. It is therefore not currently possible for a web browser to reliably detect form
819         submission and not possible to implement a robust password storage feature. In order to
820         avoid this problem, this patch adds a new WebKitWebPage signal, will-submit-form, that
821         browsers can use in preference to a DOM event listener.
822
823         Unfortunately, this signal is not available for WPE because it depends on the DOM API.
824
825         There are two submission events, WEBKIT_FORM_SUBMISSION_WILL_SEND_DOM_EVENT and
826         WEBKIT_FORM_SUBMISSION_WILL_COMPLETE. WEBKIT_FORM_SUBMISSION_WILL_SEND_DOM_EVENT
827         occurs earlier than WEBKIT_FORM_SUBMISSION_WILL_COMPLETE and can be used to retrieve form
828         values before websites receive the DOM submit event. This is useful as some websites like
829         to delete form values right before a submit would normally happen in order to attempt to
830         defeat browser password managers. There are two tricks to note: JavaScript can cancel form
831         submission immediately after this event occurs (by returning false in an onsubmit handler),
832         and, for historical reasons, this event will not occur at all when form submission is
833         triggered by JavaScript. WEBKIT_FORM_SUBMISSION_WILL_COMPLETE occurs next, and is more
834         straightforward: it is always emitted when a form is about to be submitted, when it is too
835         late to cancel.
836
837         The recommended way to reliably retrieve password form values would be to watch for both
838         events, use the form value detected in WEBKIT_FORM_SUBMISSION_WILL_SEND_DOM_EVENT
839         if that event is emitted, and use the value detected later in
840         WEBKIT_FORM_SUBMISSION_WILL_COMPLETE otherwise.
841
842         Since one of the signal arguments is an enum, we now have to run glib-mkenums for the web
843         process API. And that has resulted in this patch also adding GType goo for
844         WebKitConsoleMessageLevel and WebKitConsoleMessageSource that was previously missing. Any
845         applications that for some unlikely reason want to use these enums in properties or signals
846         will be happy.
847
848         * PlatformGTK.cmake:
849         * UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
850         * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
851         (webkit_web_page_class_init):
852         * WebProcess/InjectedBundle/API/gtk/WebKitWebPage.h:
853         * WebProcess/InjectedBundle/API/gtk/WebKitWebProcessEnumTypes.cpp.template: Added.
854         * WebProcess/InjectedBundle/API/gtk/WebKitWebProcessEnumTypes.h.template: Added.
855
856 2018-01-03  Carlos Garcia Campos  <cgarcia@igalia.com>
857
858         Unreviewed. Really fix plugin process after r226327.
859
860         * PluginProcess/unix/PluginProcessMainUnix.cpp:
861
862 2018-01-02  Brent Fulgham  <bfulgham@apple.com>
863
864         [macOS, iOS] Adopt new secure coding APIs in WebKit
865         https://bugs.webkit.org/show_bug.cgi?id=181085
866         <rdar://problem/34837397>
867
868         Reviewed by Tim Horton.
869
870         Update WebKit code to use NSSecureCoding when the underlying operating system supports it. Use new
871         wrapper functions so the same code can be built on all supported OS releases, while enabling
872         seure coding when possible.
873
874         Note that NSView-based classes cannot be migrated at present due to AppKit not supporting NSSecureCoding
875         in its class hierarchy.
876
877         Tested by exising TestWebKitAPI tests for Coding and data transfer.
878
879         * Platform/ios/AccessibilityIOS.mm:
880         (WebKit::newAccessibilityRemoteToken): Encode using NSSecureCoding.
881         * UIProcess/API/Cocoa/WKPreferences.h:
882         * UIProcess/API/Cocoa/WKPreferences.mm:
883         (+[WKPreferences supportsSecureCoding]): Added to enable NSSecureCoding.
884         * UIProcess/API/Cocoa/WKProcessPool.h:
885         * UIProcess/API/Cocoa/WKProcessPool.mm:
886         (+[WKProcessPool supportsSecureCoding]): Ditto.
887         * UIProcess/API/Cocoa/WKUserContentController.h:
888         * UIProcess/API/Cocoa/WKUserContentController.mm:
889         (+[WKUserContentController supportsSecureCoding]): Ditto.
890         * UIProcess/API/Cocoa/WKWebView.mm:
891         (-[WKWebView initWithCoder:]): Use coding initialization that supports secure coding if
892         it is available in the supplied class.
893         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
894         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
895         (+[WKWebViewConfiguration supportsSecureCoding]): Added to enable NSSecureCoding.
896         (-[WKWebViewConfiguration initWithCoder:]): Use secure coding when possible.
897         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
898         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
899         (+[WKWebsiteDataStore supportsSecureCoding]): Added to enable NSSecureCoding.
900         * UIProcess/API/Cocoa/_WKApplicationManifest.h:
901         * UIProcess/API/Cocoa/_WKApplicationManifest.mm:
902         (+[_WKApplicationManifest supportsSecureCoding]): Added to enable NSSecureCoding.
903         (-[_WKApplicationManifest initWithCoder:]): Use secure coding when possible.
904
905 2017-12-28  Yusuke Suzuki  <utatane.tea@gmail.com>
906
907         Remove std::chrono completely
908         https://bugs.webkit.org/show_bug.cgi?id=181186
909
910         Reviewed by Alex Christensen.
911
912         Use MonotonicTime, WallTime, and Seconds instead.
913         Changes are mechanical ones.
914
915         * NetworkProcess/NetworkProcess.cpp:
916         (WebKit::NetworkProcess::deleteWebsiteData):
917         * NetworkProcess/NetworkProcess.h:
918         * NetworkProcess/NetworkProcess.messages.in:
919         * NetworkProcess/cache/CacheStorageEngineCaches.cpp:
920         (WebKit::CacheStorage::Caches::clear):
921         * NetworkProcess/cache/NetworkCache.cpp:
922         (WebKit::NetworkCache::responseHasExpired):
923         (WebKit::NetworkCache::responseNeedsRevalidation):
924         (WebKit::NetworkCache::makeStoreDecision):
925         (WebKit::NetworkCache::Cache::clear):
926         (WebKit::NetworkCache::Cache::storeData):
927         * NetworkProcess/cache/NetworkCache.h:
928         * NetworkProcess/cache/NetworkCacheEntry.cpp:
929         (WebKit::NetworkCache::Entry::Entry):
930         (WebKit::NetworkCache::Entry::asJSON const):
931         * NetworkProcess/cache/NetworkCacheEntry.h:
932         (WebKit::NetworkCache::Entry::timeStamp const):
933         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
934         (WebKit::NetworkCache::fileTimes):
935         (WebKit::NetworkCache::updateFileModificationTimeIfNeeded):
936         * NetworkProcess/cache/NetworkCacheFileSystem.h:
937         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
938         (WebKit::NetworkCache::IOChannel::IOChannel):
939         * NetworkProcess/cache/NetworkCacheSpeculativeLoadManager.cpp:
940         (WebKit::NetworkCache::responseNeedsRevalidation):
941         (WebKit::NetworkCache::canRevalidate):
942         * NetworkProcess/cache/NetworkCacheStorage.cpp:
943         (WebKit::NetworkCache::Storage::readRecord):
944         (WebKit::NetworkCache::Storage::clear):
945         (WebKit::NetworkCache::computeRecordWorth):
946         * NetworkProcess/cache/NetworkCacheStorage.h:
947         Bump the cache version. We now change the data in persistent cache.
948         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.cpp:
949         (WebKit::NetworkCache::SubresourceInfo::SubresourceInfo):
950         (WebKit::NetworkCache::SubresourcesEntry::SubresourcesEntry):
951         * NetworkProcess/cache/NetworkCacheSubresourcesEntry.h:
952         (WebKit::NetworkCache::SubresourceInfo::lastSeen const):
953         (WebKit::NetworkCache::SubresourceInfo::firstSeen const):
954         (WebKit::NetworkCache::SubresourcesEntry::timeStamp const):
955         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
956         (WebKit::NetworkProcess::clearHSTSCache):
957         (WebKit::clearNSURLCache):
958         (WebKit::NetworkProcess::clearDiskCache):
959         * NetworkProcess/curl/NetworkProcessCurl.cpp:
960         (WebKit::NetworkProcess::clearDiskCache):
961         * NetworkProcess/mac/NetworkProcessMac.mm:
962         (WebKit::NetworkProcess::clearCacheForAllOrigins):
963         * NetworkProcess/soup/NetworkProcessSoup.cpp:
964         (WebKit::NetworkProcess::clearCacheForAllOrigins):
965         (WebKit::NetworkProcess::clearDiskCache):
966         * Platform/IPC/ArgumentCoders.cpp:
967         (IPC::ArgumentCoder<WallTime>::encode):
968         (IPC::ArgumentCoder<WallTime>::decode):
969         (IPC::ArgumentCoder<std::chrono::system_clock::time_point>::encode): Deleted.
970         (IPC::ArgumentCoder<std::chrono::system_clock::time_point>::decode): Deleted.
971         * Platform/IPC/ArgumentCoders.h:
972         * PluginProcess/PluginProcess.cpp:
973         (WebKit::PluginProcess::deleteWebsiteData):
974         * PluginProcess/PluginProcess.h:
975         * PluginProcess/PluginProcess.messages.in:
976         * Scripts/webkit/messages.py:
977         (headers_for_type):
978         * Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
979         (WebKit::RemoteLayerBackingStore::lastDisplayTime const):
980         * Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
981         (WebKit::RemoteLayerBackingStore::RemoteLayerBackingStore):
982         (WebKit::RemoteLayerBackingStore::display):
983         * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.h:
984         * Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.mm:
985         (WebKit::RemoteLayerBackingStoreCollection::markBackingStoreVolatile):
986         (WebKit::RemoteLayerBackingStoreCollection::volatilityTimerFired):
987         * Shared/WebCoreArgumentCoders.cpp:
988         (IPC::ArgumentCoder<RecentSearch>::decode):
989         (IPC::ArgumentCoder<WallTime>::encode): Deleted.
990         (IPC::ArgumentCoder<WallTime>::decode): Deleted.
991         * Shared/WebCoreArgumentCoders.h:
992         * StorageProcess/StorageProcess.cpp:
993         (WebKit::StorageProcess::deleteWebsiteData):
994         * StorageProcess/StorageProcess.h:
995         * StorageProcess/StorageProcess.messages.in:
996         * UIProcess/API/C/WKApplicationCacheManager.cpp:
997         (WKApplicationCacheManagerDeleteAllEntries):
998         * UIProcess/API/C/WKCookieManager.cpp:
999         (WKCookieManagerDeleteAllCookiesModifiedAfterDate):
1000         * UIProcess/API/C/WKKeyValueStorageManager.cpp:
1001         (WKKeyValueStorageManagerDeleteAllEntries):
1002         * UIProcess/API/C/WKResourceCacheManager.cpp:
1003         (WKResourceCacheManagerClearCacheForAllOrigins):
1004         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1005         (WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
1006         (WKWebsiteDataStoreStatisticsClearThroughWebsiteDataRemoval):
1007         (WKWebsiteDataStoreRemoveAllFetchCaches):
1008         (WKWebsiteDataStoreRemoveAllIndexedDatabases):
1009         (WKWebsiteDataStoreRemoveAllServiceWorkerRegistrations):
1010         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1011         (toSystemClockTime):
1012         (-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]):
1013         * UIProcess/API/glib/WebKitWebContext.cpp:
1014         (webkit_web_context_clear_cache):
1015         * UIProcess/API/glib/WebKitWebsiteDataManager.cpp:
1016         (webkit_website_data_manager_clear):
1017         * UIProcess/DrawingAreaProxy.h:
1018         * UIProcess/Network/NetworkProcessProxy.cpp:
1019         (WebKit::NetworkProcessProxy::deleteWebsiteData):
1020         * UIProcess/Network/NetworkProcessProxy.h:
1021         * UIProcess/Plugins/PluginProcessManager.cpp:
1022         (WebKit::PluginProcessManager::deleteWebsiteData):
1023         * UIProcess/Plugins/PluginProcessManager.h:
1024         * UIProcess/Plugins/PluginProcessProxy.cpp:
1025         (WebKit::PluginProcessProxy::deleteWebsiteData):
1026         * UIProcess/Plugins/PluginProcessProxy.h:
1027         * UIProcess/Storage/StorageProcessProxy.cpp:
1028         (WebKit::StorageProcessProxy::deleteWebsiteData):
1029         * UIProcess/Storage/StorageProcessProxy.h:
1030         * UIProcess/WebCookieManagerProxy.cpp:
1031         (WebKit::WebCookieManagerProxy::deleteAllCookiesModifiedSince):
1032         * UIProcess/WebCookieManagerProxy.h:
1033         * UIProcess/WebProcessProxy.cpp:
1034         (WebKit::WebProcessProxy::deleteWebsiteData):
1035         * UIProcess/WebProcessProxy.h:
1036         * UIProcess/WebResourceLoadStatisticsStore.cpp:
1037         (WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
1038         * UIProcess/WebResourceLoadStatisticsStore.h:
1039         * UIProcess/WebStorage/LocalStorageDatabaseTracker.cpp:
1040         (WebKit::LocalStorageDatabaseTracker::deleteDatabasesModifiedSince):
1041         * UIProcess/WebStorage/LocalStorageDatabaseTracker.h:
1042         * UIProcess/WebStorage/StorageManager.cpp:
1043         (WebKit::StorageManager::deleteLocalStorageOriginsModifiedSince):
1044         * UIProcess/WebStorage/StorageManager.h:
1045         * UIProcess/WebsiteData/Cocoa/WebsiteDataStoreCocoa.mm:
1046         (WebKit::WebsiteDataStore::platformRemoveRecentSearches):
1047         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1048         (WebKit::WebsiteDataStore::removeData):
1049         (WebKit::WebsiteDataStore::removeMediaKeys):
1050         * UIProcess/WebsiteData/WebsiteDataStore.h:
1051         * UIProcess/gtk/WebPageProxyGtk.cpp:
1052         (WebKit::WebsiteDataStore::platformRemoveRecentSearches):
1053         * UIProcess/wpe/WebPageProxyWPE.cpp:
1054         (WebKit::WebsiteDataStore::platformRemoveRecentSearches):
1055         * WebProcess/Cookies/WebCookieManager.cpp:
1056         (WebKit::WebCookieManager::deleteAllCookiesModifiedSince):
1057         * WebProcess/Cookies/WebCookieManager.h:
1058         * WebProcess/Cookies/WebCookieManager.messages.in:
1059         * WebProcess/Plugins/PluginView.cpp:
1060         (WebKit::lastModifiedDateMS):
1061         * WebProcess/WebProcess.cpp:
1062         (WebKit::WebProcess::deleteWebsiteData):
1063         * WebProcess/WebProcess.h:
1064         * WebProcess/WebProcess.messages.in:
1065
1066 2018-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
1067
1068         [Attachment Support] Introduce data structures and IPC support for writing promised blobs
1069         https://bugs.webkit.org/show_bug.cgi?id=181189
1070
1071         Reviewed by Tim Horton.
1072
1073         Add IPC support for PromisedBlobInfo and PromisedBlobData. See WebCore/ChangeLog for more detail.
1074
1075         * Shared/WebCoreArgumentCoders.cpp:
1076         (IPC::ArgumentCoder<PromisedBlobData>::encode):
1077         (IPC::ArgumentCoder<PromisedBlobData>::decode):
1078         (IPC::ArgumentCoder<PromisedBlobInfo>::encode):
1079         (IPC::ArgumentCoder<PromisedBlobInfo>::decode):
1080         * Shared/WebCoreArgumentCoders.h:
1081
1082 2018-01-02  Michael Catanzaro  <mcatanzaro@igalia.com>
1083
1084         REGRESSION(r223253): Broke ResourceLoadStatistics layout tests for non-Cocoa ports
1085         https://bugs.webkit.org/show_bug.cgi?id=181231
1086
1087         Reviewed by Alex Christensen.
1088
1089         Add new C API for use by WebKitTestRunner.
1090
1091         * UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
1092         (WKWebsiteDataStoreIsStatisticsRegisteredAsSubFrameUnder):
1093         (WKWebsiteDataStoreIsStatisticsRegisteredAsRedirectingTo):
1094         * UIProcess/API/C/WKWebsiteDataStoreRef.h:
1095
1096 2018-01-02  Jiewen Tan  <jiewen_tan@apple.com>
1097
1098         Add a WebAuthentication runtime feature flag
1099         https://bugs.webkit.org/show_bug.cgi?id=181220
1100         <rdar://problem/36055305>
1101
1102         Reviewed by Brent Fulgham.
1103
1104         Renames the CredentialManagement runtime feature flag into WebAuthentication.
1105
1106         * Shared/WebPreferences.yaml:
1107         * UIProcess/API/C/WKPreferences.cpp:
1108         (WKPreferencesSetWebAuthenticationEnabled):
1109         (WKPreferencesGetWebAuthenticationEnabled):
1110         (WKPreferencesSetCredentialManagementEnabled): Deleted.
1111         (WKPreferencesGetCredentialManagementEnabled): Deleted.
1112         * UIProcess/API/C/WKPreferencesRefPrivate.h:
1113         * WebProcess/WebPage/WebPage.cpp:
1114         (WebKit::WebPage::updatePreferences):
1115
1116 2018-01-02  Michael Catanzaro  <mcatanzaro@igalia.com>
1117
1118         REGRESSION(r226327): [GTK] Plugin process is broken
1119         https://bugs.webkit.org/show_bug.cgi?id=181187
1120
1121         Unreviewed, fix PluginProcessMainUnix after r226327.
1122
1123         * PluginProcess/unix/PluginProcessMainUnix.cpp:
1124
1125 2018-01-02  Tim Horton  <timothy_horton@apple.com>
1126
1127         Fix the build on platforms where UICurrentUserInterfaceIdiomIsPad is defined to false
1128         https://bugs.webkit.org/show_bug.cgi?id=181218
1129
1130         Reviewed by Alex Christensen.
1131
1132         * Platform/spi/ios/UIKitSPI.h:
1133         (currentUserInterfaceIdiomIsPad):
1134         * UIProcess/ios/SmartMagnificationController.mm:
1135         (WebKit::SmartMagnificationController::didCollectGeometryForSmartMagnificationGesture):
1136         * UIProcess/ios/WKContentViewInteraction.mm:
1137         (-[WKFormInputSession setAccessoryViewCustomButtonTitle:]):
1138         (-[WKContentView _requiresKeyboardWhenFirstResponder]):
1139         (-[WKContentView _displayFormNodeInputView]):
1140         (-[WKContentView requiresAccessoryView]):
1141         (-[WKContentView _updateAccessory]):
1142         * UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
1143         (-[WKAirPlayRoutePicker show:fromRect:]):
1144         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1145         (-[WKFileUploadPanel _showPhotoPickerWithSourceType:]):
1146         (-[WKFileUploadPanel _presentMenuOptionForCurrentInterfaceIdiom:]):
1147         * UIProcess/ios/forms/WKFormInputControl.mm:
1148         (-[WKDateTimePicker initWithView:datePickerMode:]):
1149         (-[WKFormInputControl initWithView:]):
1150         * UIProcess/ios/forms/WKFormSelectControl.mm:
1151         (-[WKFormSelectControl initWithView:]):
1152         On platforms where UICurrentUserInterfaceIdiomIsPad is defined to false,
1153         blocks that conditionally execute based on its value are unreachable.
1154         This causes the compiler to complain. Hide it away inside an inline function
1155         and make use of that everywhere we used to use the macro.
1156
1157 2018-01-02  Alex Christensen  <achristensen@webkit.org>
1158
1159         Remove SVN file accidentally added in r226160
1160         https://bugs.webkit.org/show_bug.cgi?id=180934
1161
1162         * UIProcess/WebPageProxy.cpp.orig: Removed.
1163
1164 2018-01-02  Alex Christensen  <achristensen@webkit.org>
1165
1166         Use BlockPtrs and lambdas instead of new/delete to pass parameters to blocks in WebViewImpl::performDragOperation
1167         https://bugs.webkit.org/show_bug.cgi?id=180795
1168
1169         Reviewed by Brent Fulgham.
1170
1171         * UIProcess/Cocoa/WebViewImpl.mm:
1172         (WebKit::WebViewImpl::performDragOperation):
1173
1174 2018-01-02  Michael Catanzaro  <mcatanzaro@igalia.com>
1175
1176         [WPE][GTK] Implement the assignment of ProcessIdentifiers to child processes
1177         https://bugs.webkit.org/show_bug.cgi?id=181187
1178
1179         Reviewed by Brady Eidson.
1180
1181         * Shared/ChildProcess.cpp: Make the ProcessIdentifier mandatory.
1182         (WebKit::ChildProcess::initialize):
1183         * Shared/unix/ChildProcessMain.cpp: Initialize ChildProcessInitializationParameters with the
1184         ProcessIdentifier.
1185         (WebKit::ChildProcessMainBase::parseCommandLine):
1186         * UIProcess/Launcher/glib/ProcessLauncherGLib.cpp: Copy the ProcessIdentifier from
1187         LaunchOptions into argv.
1188         (WebKit::ProcessLauncher::launchProcess):
1189         * WebProcess/wpe/WebProcessMainWPE.cpp: Expect the WPE socket ID later in the command line.
1190
1191 2018-01-02  Alex Christensen  <achristensen@webkit.org>
1192
1193         Use new WebsiteDataStore passed in through decidePolicyForNavigation SPI
1194         https://bugs.webkit.org/show_bug.cgi?id=180897
1195         <rdar://problem/35535328>
1196
1197         Reviewed by Brent Fulgham.
1198
1199         * Shared/WebsitePoliciesData.cpp:
1200         (WebKit::WebsitePoliciesData::applyToDocumentLoader):
1201         * UIProcess/Cocoa/NavigationState.mm:
1202         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
1203         * UIProcess/WebPageProxy.cpp:
1204         (WebKit::WebPageProxy::changeWebsiteDataStore):
1205         * UIProcess/WebPageProxy.h:
1206         * UIProcess/WebProcessPool.cpp:
1207         (WebKit::WebProcessPool::pageBeginUsingWebsiteDataStore):
1208         (WebKit::WebProcessPool::pageEndUsingWebsiteDataStore):
1209         (WebKit::WebProcessPool::pageAddedToProcess): Deleted.
1210         (WebKit::WebProcessPool::pageRemovedFromProcess): Deleted.
1211         * UIProcess/WebProcessPool.h:
1212         * UIProcess/WebProcessProxy.cpp:
1213         (WebKit::WebProcessProxy::addExistingWebPage):
1214         (WebKit::WebProcessProxy::removeWebPage):
1215         * WebProcess/WebCoreSupport/mac/WebFrameNetworkingContext.mm:
1216         (WebKit::WebFrameNetworkingContext::ensureWebsiteDataStoreSession):
1217
1218 2018-01-02  Alex Christensen  <achristensen@webkit.org>
1219
1220         Only use CookieStorageShim when we aren't using NetworkSession
1221         https://bugs.webkit.org/show_bug.cgi?id=180766
1222
1223         Reviewed by Brent Fulgham.
1224
1225         * Shared/mac/CookieStorageShim.h:
1226         * Shared/mac/CookieStorageShim.mm:
1227         * WebProcess/WebProcess.cpp:
1228         (WebKit::WebProcess::initializeWebProcess):
1229
1230 2018-01-02  Alex Christensen  <achristensen@webkit.org>
1231
1232         Clean up context menu code
1233         https://bugs.webkit.org/show_bug.cgi?id=181074
1234
1235         Reviewed by Brent Fulgham.
1236
1237         Use Ref instead of RefPtr where possible.
1238         Use move semantics instead of copying from const references when possible.
1239         Remove dead iOS code.  Reduce allocations.  Add stub for WPE.
1240
1241         * UIProcess/API/APIContextMenuClient.h:
1242         (API::ContextMenuClient::getContextMenuFromProposedMenu):
1243         (API::ContextMenuClient::getContextMenuFromProposedMenuAsync):
1244         (API::ContextMenuClient::showContextMenu):
1245         * UIProcess/API/C/WKPage.cpp:
1246         (WKPageSetPageContextMenuClient):
1247         * UIProcess/API/gtk/PageClientImpl.cpp:
1248         (WebKit::PageClientImpl::createContextMenuProxy):
1249         * UIProcess/API/gtk/PageClientImpl.h:
1250         * UIProcess/PageClient.h:
1251         * UIProcess/WebContextMenuListenerProxy.cpp:
1252         (WebKit::WebContextMenuListenerProxy::useContextMenuItems):
1253         * UIProcess/WebContextMenuProxy.cpp:
1254         (WebKit::WebContextMenuProxy::WebContextMenuProxy):
1255         * UIProcess/WebContextMenuProxy.h:
1256         * UIProcess/WebPageProxy.cpp:
1257         (WebKit::WebPageProxy::showContextMenu):
1258         (WebKit::WebPageProxy::internalShowContextMenu): Deleted.
1259         * UIProcess/WebPageProxy.h:
1260         * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
1261         (WebKit::WebContextMenuProxyGtk::showContextMenuWithItems):
1262         (WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk):
1263         * UIProcess/gtk/WebContextMenuProxyGtk.h:
1264         (WebKit::WebContextMenuProxyGtk::create):
1265         * UIProcess/ios/PageClientImplIOS.h:
1266         * UIProcess/ios/PageClientImplIOS.mm:
1267         (WebKit::PageClientImpl::createContextMenuProxy): Deleted.
1268         * UIProcess/mac/PageClientImplMac.h:
1269         * UIProcess/mac/PageClientImplMac.mm:
1270         (WebKit::PageClientImpl::createContextMenuProxy):
1271         * UIProcess/mac/WebContextMenuProxyMac.h:
1272         (WebKit::WebContextMenuProxyMac::create):
1273         * UIProcess/mac/WebContextMenuProxyMac.mm:
1274         (WebKit::WebContextMenuProxyMac::WebContextMenuProxyMac):
1275         (WebKit::WebContextMenuProxyMac::showContextMenuWithItems):
1276         (WebKit::WebContextMenuProxyMac::showContextMenu):
1277
1278 == Rolled over to ChangeLog-2018-01-01 ==