Unreviewed, fix GCC warning by using #include
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-01-02  Yusuke Suzuki  <utatane.tea@gmail.com>
2
3         Unreviewed, fix GCC warning by using #include
4         https://bugs.webkit.org/show_bug.cgi?id=181189
5
6         This file is included in C++ files. Use #include instead of #import to suppress warning in GCC.
7
8         * platform/PromisedBlobInfo.h:
9
10 2017-12-28  Yusuke Suzuki  <utatane.tea@gmail.com>
11
12         Remove std::chrono completely
13         https://bugs.webkit.org/show_bug.cgi?id=181186
14
15         Reviewed by Alex Christensen.
16
17         Use MonotonicTime, WallTime, and Seconds instead.
18         Changes are mechanical ones. But persistent network cache data is changed.
19         So we bump the version number of the cache storage.
20
21         * Modules/indexeddb/server/IDBServer.cpp:
22         (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
23         (WebCore::IDBServer::removeAllDatabasesForOriginPath):
24         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesModifiedSince):
25         (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):
26         * Modules/indexeddb/server/IDBServer.h:
27         * Modules/webdatabase/DatabaseTracker.cpp:
28         (WebCore::DatabaseTracker::deleteDatabasesModifiedSince):
29         * Modules/webdatabase/DatabaseTracker.h:
30         * dom/Document.cpp:
31         (WebCore::Document::lastModified):
32         * html/HTMLMediaElement.cpp:
33         (WebCore::HTMLMediaElement::clearMediaCache):
34         * html/HTMLMediaElement.h:
35         (WebCore::HTMLMediaElement::clearMediaCache):
36         * loader/CrossOriginPreflightResultCache.cpp:
37         (WebCore::parseAccessControlMaxAge):
38         (WebCore::CrossOriginPreflightResultCacheItem::parse):
39         (WebCore::CrossOriginPreflightResultCacheItem::allowsRequest const):
40         * loader/CrossOriginPreflightResultCache.h:
41         * loader/cache/CachedResource.cpp:
42         (WebCore::CachedResource::CachedResource):
43         (WebCore::CachedResource::freshnessLifetime const):
44         (WebCore::CachedResource::responseReceived):
45         (WebCore::CachedResource::updateResponseAfterRevalidation):
46         * loader/cache/CachedResource.h:
47         * platform/FileSystem.cpp:
48         (WebCore::FileSystem::getFileModificationTime):
49         * platform/FileSystem.h:
50         * platform/SearchPopupMenu.h:
51         * platform/cocoa/SearchPopupMenuCocoa.h:
52         * platform/cocoa/SearchPopupMenuCocoa.mm:
53         (WebCore::toSystemClockTime):
54         (WebCore::toNSDateFromSystemClock):
55         (WebCore::removeRecentlyModifiedRecentSearches):
56         * platform/graphics/MediaPlayer.cpp:
57         (WebCore::MediaPlayer::clearMediaCache):
58         * platform/graphics/MediaPlayer.h:
59         * platform/graphics/MediaPlayerPrivate.h:
60         (WebCore::MediaPlayerPrivateInterface::clearMediaCache):
61         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
62         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
63         (WebCore::toSystemClockTime):
64         (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):
65         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
66         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
67         (WebCore::MediaPlayerPrivateQTKit::clearMediaCache):
68         * platform/network/CacheValidation.cpp:
69         (WebCore::computeCurrentAge):
70         (WebCore::computeFreshnessLifetimeForHTTPFamily):
71         (WebCore::updateRedirectChainStatus):
72         (WebCore::redirectChainAllowsReuse):
73         (WebCore::parseCacheControlDirectives):
74         * platform/network/CacheValidation.h:
75         (WebCore::RedirectChainCacheStatus::RedirectChainCacheStatus):
76         * platform/network/HTTPParsers.cpp:
77         (WebCore::parseHTTPDate):
78         * platform/network/HTTPParsers.h:
79         * platform/network/PlatformCookieJar.h:
80         * platform/network/ResourceResponseBase.cpp:
81         (WebCore::ResourceResponseBase::cacheControlMaxAge const):
82         (WebCore::parseDateValueInHeader):
83         (WebCore::ResourceResponseBase::date const):
84         (WebCore::ResourceResponseBase::age const):
85         (WebCore::ResourceResponseBase::expires const):
86         (WebCore::ResourceResponseBase::lastModified const):
87         * platform/network/ResourceResponseBase.h:
88         * platform/network/cf/CookieJarCFNet.cpp:
89         (WebCore::deleteAllCookiesModifiedSince):
90         * platform/network/curl/CookieJarCurl.cpp:
91         (WebCore::CookieJarCurlFileSystem::deleteAllCookiesModifiedSince):
92         (WebCore::deleteAllCookiesModifiedSince):
93         * platform/network/curl/CookieJarCurl.h:
94         * platform/network/curl/CurlCacheEntry.cpp:
95         (WebCore::CurlCacheEntry::CurlCacheEntry):
96         (WebCore::CurlCacheEntry::isCached):
97         (WebCore::CurlCacheEntry::parseResponseHeaders):
98         * platform/network/curl/CurlCacheEntry.h:
99         * platform/network/mac/CookieJarMac.mm:
100         (WebCore::deleteAllCookiesModifiedSince):
101         * platform/network/soup/CookieJarSoup.cpp:
102         (WebCore::deleteAllCookiesModifiedSince):
103         * platform/win/SearchPopupMenuWin.cpp:
104         (WebCore::SearchPopupMenuWin::loadRecentSearches):
105         * rendering/RenderSearchField.cpp:
106         (WebCore::RenderSearchField::addSearchResult):
107
108 2018-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
109
110         [Attachment Support] Introduce data structures and IPC support for writing promised blobs
111         https://bugs.webkit.org/show_bug.cgi?id=181189
112
113         Reviewed by Tim Horton.
114
115         Introduces a new header containing structs to be used for writing blob data when dragging. PromisedBlobInfo
116         represents information needed to declare data on the pasteboard that will eventually be provided via a Blob.
117         This includes the type and filename of the Blob-backed content. PromisedBlobData represents information needed
118         to actually deliver the Blob's content to the platform, and is sent some time after its corresponding
119         PromisedBlobInfo. The content may either be in the form of a file path (as is the case using the previous
120         declareAndWriteAttachment codepath) or a data buffer (which we would use if the Blob is not already backed by a
121         file on disk).
122
123         No new tests, since there is no observable change in functionality yet.
124
125         * WebCore.xcodeproj/project.pbxproj:
126         * platform/PromisedBlobInfo.h: Added.
127         (WebCore::PromisedBlobInfo::operator bool const):
128         (WebCore::PromisedBlobData::hasData const):
129         (WebCore::PromisedBlobData::hasFile const):
130         (WebCore::PromisedBlobData::operator bool const):
131         (WebCore::PromisedBlobData::fulfills const):
132
133 2018-01-02  Brady Eidson  <beidson@apple.com>
134
135         Make MessagePortChannel::takeAllMessagesFromRemote asynchronous.
136         https://bugs.webkit.org/show_bug.cgi?id=181205
137
138         Reviewed by Alex Christensen.
139
140         No new tests (No behavior change)
141
142         This is needed for the ongoing WK2 MessagePort work.
143
144         For WK1 in-process MessagePorts it is still synchronous; no behavior change.
145
146         * dom/InProcessMessagePortChannel.cpp:
147         (WebCore::InProcessMessagePortChannel::takeAllMessagesFromRemote):
148         * dom/InProcessMessagePortChannel.h:
149
150         * dom/MessagePort.cpp:
151         (WebCore::MessagePort::dispatchMessages):
152         * dom/MessagePortChannel.h:
153
154 2018-01-02  Jiewen Tan  <jiewen_tan@apple.com>
155
156         Add a WebAuthentication runtime feature flag
157         https://bugs.webkit.org/show_bug.cgi?id=181220
158         <rdar://problem/36055305>
159
160         Reviewed by Brent Fulgham.
161
162         This patch basically renames the CredentialManagement runtime feature flag into
163         WebAuthentication runtime feature flag.
164
165         No tests.
166
167         * Modules/credentialmanagement/BasicCredential.idl:
168         * Modules/credentialmanagement/CredentialsContainer.idl:
169         * Modules/credentialmanagement/NavigatorCredentials.idl:
170         * Modules/webauthn/PublicKeyCredential.idl:
171         * page/RuntimeEnabledFeatures.h:
172         (WebCore::RuntimeEnabledFeatures::setWebAuthenticationEnabled):
173         (WebCore::RuntimeEnabledFeatures::webAuthenticationEnabled const):
174         (WebCore::RuntimeEnabledFeatures::setCredentialManagementEnabled): Deleted.
175         (WebCore::RuntimeEnabledFeatures::credentialManagementEnabled const): Deleted.
176
177 2018-01-02  Wenson Hsieh  <wenson_hsieh@apple.com>
178
179         [Attachment Support] Don't Blob-convert images and attachments with https:, http: or data: urls
180         https://bugs.webkit.org/show_bug.cgi?id=181143
181         <rdar://problem/36200381>
182
183         Reviewed by Tim Horton.
184
185         Clients such as Mail would expect pasting or dropping an image with src="https://..." to result in the source
186         URL being preserved (i.e. staying as remote images) instead of creating image attachments out of them. This
187         patch hooks into the shouldConvertToBlob() check added in r226272 so that it applies to attachment element
188         replacement as well.
189
190         Test: WKAttachmentTests.DoNotInsertDataURLImagesAsAttachments
191
192         * editing/cocoa/WebContentReaderCocoa.mm:
193         (WebCore::shouldConvertToBlob):
194         (WebCore::replaceRichContentWithAttachments):
195
196 2018-01-02  Brady Eidson  <beidson@apple.com>
197
198         Identify MessagePorts by a globally unique MessagePortIdentifier.
199         https://bugs.webkit.org/show_bug.cgi?id=181172
200
201         Reviewed by Alex Christensen.
202
203         No new tests (Behavior change covered by all existing tests).
204
205         This cleans up the abstract MessagePortChannel interface to be in terms of identifiers
206         instead of actual MessagePort objects.
207         
208         The identifiers are compounded with the current ProcessIdentifier meaning they are global
209         across all processes for the running UI process, enabling easy cross-process communication.
210         
211         (Actual cross-process communication comes in a followup)
212         
213         * WebCore.xcodeproj/project.pbxproj:
214         
215         * dom/InProcessMessagePortChannel.cpp:
216         (WebCore::InProcessMessagePortChannel::createChannelBetweenPorts):
217         (WebCore::InProcessMessagePortChannel::isConnectedTo):
218         (WebCore::InProcessMessagePortChannel::entangleWithRemoteIfOpen):
219         (WebCore::InProcessMessagePortChannel::entangleIfOpen): Deleted.
220         * dom/InProcessMessagePortChannel.h:
221         
222         * dom/MessageChannel.cpp:
223         (WebCore::MessageChannel::MessageChannel):
224         (WebCore::m_port2):
225         
226         * dom/MessagePort.cpp:
227         (WebCore::allMessagePortsLock):
228         (WebCore::MessagePort::ref const):
229         (WebCore::MessagePort::deref const):
230         (WebCore::MessagePort::existingMessagePortForIdentifier):
231         (WebCore::MessagePort::MessagePort):
232         (WebCore::MessagePort::~MessagePort):
233         (WebCore::MessagePort::postMessage):
234         (WebCore::MessagePort::entangleWithRemote):
235         (WebCore::MessagePort::entanglePorts):
236         (WebCore::MessagePort::entangle): Deleted.
237         * dom/MessagePort.h:
238         
239         * dom/MessagePortChannel.h:
240         
241         * dom/MessagePortIdentifier.h: Added.
242         (WebCore::operator==):
243         (WebCore::MessagePortIdentifier::encode const):
244         (WebCore::MessagePortIdentifier::decode):
245         (WebCore::MessagePortIdentifier::hash const):
246         (WTF::MessagePortIdentifierHash::hash):
247         (WTF::MessagePortIdentifierHash::equal):
248         (WTF::HashTraits<WebCore::MessagePortIdentifier>::emptyValue):
249         (WTF::HashTraits<WebCore::MessagePortIdentifier>::constructDeletedValue):
250         (WTF::HashTraits<WebCore::MessagePortIdentifier>::isDeletedValue):
251
252 2018-01-02  Youenn Fablet  <youenn@apple.com>
253
254         Memory cache should not reuse resources with different credential fetch option
255         https://bugs.webkit.org/show_bug.cgi?id=181212
256
257         Reviewed by Alex Christensen.
258
259         Covered by rebased test.
260
261         * loader/cache/CachedResourceLoader.cpp:
262         (WebCore::CachedResourceLoader::determineRevalidationPolicy const):
263
264 2018-01-02  Jiewen Tan  <jiewen_tan@apple.com>
265
266         Update Credential Management API for WebAuthentication
267         https://bugs.webkit.org/show_bug.cgi?id=181082
268         <rdar://problem/36055239>
269
270         Reviewed by Brent Fulgham.
271
272         Part 2/2
273
274         This patch implements Core API from Credential Management API: https://www.w3.org/TR/credential-management-1/#core.
275         which is required by WebAuthN. It also sets the CredentialManagement runtime flag to enable testing. Note that it
276         introduces a dummy PublicKeyCredential interface for testing functionalities of the Credential interface, which
277         cannot be instantiated.
278
279         Tests: http/wpt/credential-management/credentialscontainer-create-basics.https.html
280                http/wpt/credential-management/credentialscontainer-get-basics.https.html
281                http/wpt/credential-management/credentialscontainer-preventSilentAccess-basics.https.html
282                http/wpt/credential-management/idl.https.html
283
284         * CMakeLists.txt:
285         * DerivedSources.make:
286         * Modules/credentialmanagement/BasicCredential.cpp:
287         (WebCore::BasicCredential::BasicCredential):
288         (WebCore::BasicCredential::type const):
289         * Modules/credentialmanagement/BasicCredential.h:
290         (WebCore::BasicCredential::discovery const):
291         * Modules/credentialmanagement/BasicCredential.idl:
292         * Modules/credentialmanagement/CredentialCreationOptions.h:
293         * Modules/credentialmanagement/CredentialCreationOptions.idl:
294         * Modules/credentialmanagement/CredentialRequestOptions.h:
295         * Modules/credentialmanagement/CredentialRequestOptions.idl:
296         * Modules/credentialmanagement/CredentialsContainer.cpp:
297         (WebCore::CredentialsContainer::CredentialsContainer):
298         (WebCore::CredentialsContainer::isSameOriginWithItsAncestors):
299         (WebCore::CredentialsContainer::dispatchTask):
300         (WebCore::CredentialsContainer::get):
301         (WebCore::CredentialsContainer::store):
302         (WebCore::CredentialsContainer::isCreate):
303         (WebCore::CredentialsContainer::preventSilentAccess):
304         * Modules/credentialmanagement/CredentialsContainer.h:
305         (WebCore::CredentialsContainer::create):
306         (WebCore::CredentialsContainer::CredentialsContainer): Deleted.
307         * Modules/credentialmanagement/CredentialsContainer.idl:
308         * Modules/credentialmanagement/NavigatorCredentials.cpp:
309         (WebCore::NavigatorCredentials::credentials):
310         * Modules/credentialmanagement/NavigatorCredentials.h:
311         * Modules/credentialmanagement/NavigatorCredentials.idl:
312         * Modules/webauthn/PublicKeyCredential.cpp: Copied from Source/WebCore/Modules/credentialmanagement/BasicCredential.cpp.
313         (WebCore::PublicKeyCredential::PublicKeyCredential):
314         (WebCore::PublicKeyCredential::collectFromCredentialStore):
315         (WebCore::PublicKeyCredential::discoverFromExternalSource):
316         (WebCore::PublicKeyCredential::store):
317         (WebCore::PublicKeyCredential::create):
318         * Modules/webauthn/PublicKeyCredential.h: Copied from Source/WebCore/Modules/credentialmanagement/BasicCredential.cpp.
319         * Modules/webauthn/PublicKeyCredential.idl: Copied from Source/WebCore/Modules/credentialmanagement/BasicCredential.idl.
320         * Sources.txt:
321         * WebCore.xcodeproj/project.pbxproj:
322         * bindings/js/WebCoreBuiltinNames.h:
323         * page/RuntimeEnabledFeatures.h:
324
325 2018-01-02  Oleksandr Skachkov  <gskachkov@gmail.com>
326
327         WebAssembly: sending module to iframe fails
328         https://bugs.webkit.org/show_bug.cgi?id=179263
329
330         Reviewed by JF Bastien.
331
332         Allow use WebAssembly.Module as input parameters for postMessage 
333         in window and iframe object. To prevent sending message to iframe
334         that is not ready, in iframe-* test we are waiting message from
335         iframe only after that we send message to it.   
336
337         Tests: wasm/iframe-parent-postmessage.html
338                wasm/iframe-postmessage.html
339                wasm/window-postmessage.html
340
341         * bindings/js/SerializedScriptValue.cpp:
342         (WebCore::CloneSerializer::dumpIfTerminal):
343         * bindings/js/SerializedScriptValue.h:
344         * page/DOMWindow.cpp:
345         (WebCore::DOMWindow::postMessage):
346
347 == Rolled over to ChangeLog-2018-01-01 ==