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