be3c729be0c80ee01f9d7029810e417370b422da
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
2
3         [SOUP] Custom URI schemes don't work for requests containing a fragment identifier
4         https://bugs.webkit.org/show_bug.cgi?id=145969
5
6         Reviewed by Sergio Villar Senin.
7
8         Use the WebKitSoupRequestGeneric request instead of creating a new one
9         from the SoupRequest URI, since that is the network one and doesn't
10         contain the fragment identifier part.
11
12         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.cpp:
13         (WebKit::CustomProtocolManagerImpl::start):
14
15 2015-06-15  Hyungwook Lee  <hyungwook.lee@navercorp.com>
16
17         [EFL] Make send/receive messages to communicate the Web and UI Processes using Injected Bundle.
18         https://bugs.webkit.org/show_bug.cgi?id=145685
19
20         Reviewed by Gyuyoung Kim.
21
22         To have extensible port specific API facility using Injected Bundle,
23         we need to load libewebkit_extension_manager.so in default that is same as what gtk port does.
24
25         * UIProcess/API/efl/ewk_context.cpp:
26         (EwkContext::EwkContext):
27         (EwkContext::~EwkContext):
28         (EwkContext::findOrCreateWrapper):
29         (bundlePathForExtension):
30         (EwkContext::create): Deleted.
31         * UIProcess/API/efl/ewk_context_private.h:
32         * WebProcess/efl/ExtensionManagerEfl.cpp:
33         (WebKit::ExtensionManagerEfl::initialize):
34
35 2015-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
36
37         [SOUP] Move WebKitSoupRequestGeneric to platform layer
38         https://bugs.webkit.org/show_bug.cgi?id=145968
39
40         Reviewed by Sergio Villar Senin.
41
42         * PlatformEfl.cmake: Remove WebKitSoupRequestGeneric.
43         * PlatformGTK.cmake: Ditto.
44         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.cpp:
45         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.h:
46
47 2015-06-15  Csaba Osztrogonác  <ossy@webkit.org>
48
49         Fix unused private field warning in PageBanner.h
50         https://bugs.webkit.org/show_bug.cgi?id=145925
51
52         Reviewed by Darin Adler.
53
54         * WebProcess/WebPage/PageBanner.cpp:
55         (WebKit::PageBanner::~PageBanner):
56         * WebProcess/WebPage/PageBanner.h: Initialize m_type, m_webPage, m_mouseDownInBanner, and m_isHidden here instead of in the constructor.
57         * WebProcess/WebPage/mac/PageBannerMac.mm: Use PLATFORM(MAC) instead of !PLATFORM(IOS), they are same in objc files.
58
59 2015-06-15  Carlos Garcia Campos  <cgarcia@igalia.com>
60
61         [SOUP] Make WebKitSoupRequestGeneric independent from CustomProtocolManagerImpl
62         https://bugs.webkit.org/show_bug.cgi?id=145966
63
64         Reviewed by Sergio Villar Senin.
65
66         Add WebKitSoupRequestGenericClient with start and finish methods,
67         that are implemented by WebKitSoupRequestGeneric.
68         This allows us to move WebKitSoupRequestGeneric to platform layer.
69
70         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.cpp:
71         (WebKit::CustomProtocolManagerImpl::registerScheme):
72         (WebKit::CustomProtocolManagerImpl::start):
73         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.h:
74         * WebProcess/soup/WebKitSoupRequestGeneric.cpp:
75         (webkitSoupRequestGenericSendAsync):
76         (webkitSoupRequestGenericSendFinish):
77         * WebProcess/soup/WebKitSoupRequestGeneric.h:
78         * WebProcess/soup/WebKitSoupRequestGenericClient.h: Added.
79
80 2015-06-14  Dan Bernstein  <mitz@apple.com>
81
82         Fixed the build.
83
84         * mac/postprocess-framework-headers.sh:
85
86 2015-06-14  Michael Catanzaro  <mcatanzaro@igalia.com>
87
88         Format string misuse in DatabaseProcessIDBConnection.cpp and UniqueIDBDatabaseBackingStoreSQLite.cpp
89         https://bugs.webkit.org/show_bug.cgi?id=145960
90
91         Reviewed by Darin Adler.
92
93         Use PRIu64 and PRIi64 to print uint64_t and int64_t, respectively. These things are
94         different types on x86_64 Linux (unsigned long) and on Mac (unsigned long long).
95
96         * DatabaseProcess/IndexedDB/DatabaseProcessIDBConnection.cpp:
97         (WebKit::DatabaseProcessIDBConnection::getOrEstablishIDBDatabaseMetadata):
98         (WebKit::DatabaseProcessIDBConnection::deleteDatabase):
99         (WebKit::DatabaseProcessIDBConnection::openTransaction):
100         (WebKit::DatabaseProcessIDBConnection::beginTransaction):
101         (WebKit::DatabaseProcessIDBConnection::commitTransaction):
102         (WebKit::DatabaseProcessIDBConnection::resetTransaction):
103         (WebKit::DatabaseProcessIDBConnection::rollbackTransaction):
104         (WebKit::DatabaseProcessIDBConnection::changeDatabaseVersion):
105         (WebKit::DatabaseProcessIDBConnection::createObjectStore):
106         (WebKit::DatabaseProcessIDBConnection::deleteObjectStore):
107         (WebKit::DatabaseProcessIDBConnection::clearObjectStore):
108         (WebKit::DatabaseProcessIDBConnection::createIndex):
109         (WebKit::DatabaseProcessIDBConnection::deleteIndex):
110         (WebKit::DatabaseProcessIDBConnection::putRecord):
111         (WebKit::DatabaseProcessIDBConnection::getRecord):
112         (WebKit::DatabaseProcessIDBConnection::count):
113         (WebKit::DatabaseProcessIDBConnection::deleteRange):
114         (WebKit::DatabaseProcessIDBConnection::openCursor):
115         (WebKit::DatabaseProcessIDBConnection::cursorAdvance):
116         (WebKit::DatabaseProcessIDBConnection::cursorIterate):
117         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
118         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteObjectStore):
119         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::clearObjectStore):
120         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteIndex):
121         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::generateKeyNumber):
122         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::keyExistsInObjectStore):
123         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::putRecord):
124         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::uncheckedPutIndexRecord):
125         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteRecord):
126         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRecordFromObjectStore):
127         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRangeRecordFromObjectStore):
128         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::advanceCursor):
129
130 2015-06-14  Dan Bernstein  <mitz@apple.com>
131
132         [Cocoa] Clean up postprocess-framework-headers.sh
133         https://bugs.webkit.org/show_bug.cgi?id=145962
134
135         Reviewed by Darin Adler.
136
137         * mac/postprocess-framework-headers.sh: Gather all the sed options in a variable, and then
138         run sed only once on each header. Also, correctly exit with the sed return value if it
139         fails.
140
141 2015-06-13  Chris Dumez  <cdumez@apple.com>
142
143         [WK2] API::Navigation objects are leaked on history navigation to HistoryItems in PageCache
144         https://bugs.webkit.org/show_bug.cgi?id=145948
145
146         Reviewed by Darin Adler.
147
148         API::Navigation objects were leaked on history navigation to
149         HistoryItems in PageCache. In such case, we would create 2 Navigation
150         objects instead of 1 and the first one would be leaked. The reason
151         we create the second one is because we fail to pass along the
152         navigationID from the UIProcess to the WebProcess and then back to the
153         UIProcess. On the IPC back to the UIProcess, the navigationID ends up
154         being 0 so the UIProcess creates a new Navigation object, thinking that
155         the load was triggered by the WebContent process.
156
157         We now pass along the navigationID, even if the HistoryItem is in the
158         PageCache and we end up reusing the cached DocumentLoader, instead of
159         creating a new one. A new updateCachedDocumentLoader() delegate is
160         added to the FrameLoaderClient, similarly to the pre-existing
161         createDocumentLoader() but for the case where the DocumentLoader gets
162         reused.
163
164         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
165         (WebKit::WebFrameLoaderClient::updateCachedDocumentLoader):
166         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
167         * WebProcess/WebPage/WebPage.cpp:
168         (WebKit::WebPage::goForward):
169         (WebKit::WebPage::goBack):
170         (WebKit::WebPage::goToBackForwardItem):
171         (WebKit::WebPage::updateCachedDocumentLoader):
172         * WebProcess/WebPage/WebPage.h:
173
174 2015-06-12  Gavin Barraclough  <barraclough@apple.com>
175
176         Add private API to force page to always run at foreground priority
177         https://bugs.webkit.org/show_bug.cgi?id=145946
178         <rdar://problem/21267221>
179
180         Reviewed by Anders Carlsson.
181
182         * UIProcess/API/Cocoa/WKWebView.mm:
183         (-[WKWebView initWithFrame:configuration:]):
184             - copy _alwaysRunsAtForegroundPriority to WebPageConfiguration.
185         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
186         (-[WKWebViewConfiguration copyWithZone:]):
187         (-[WKWebViewConfiguration _alwaysRunsAtForegroundPriority]):
188         (-[WKWebViewConfiguration _setAlwaysRunsAtForegroundPriority:]):
189             - added _alwaysRunsAtForegroundPriority.
190         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
191             - added _alwaysRunsAtForegroundPriority.
192         * UIProcess/WebPageProxy.cpp:
193         (WebKit::WebPageProxy::WebPageProxy):
194             - initialize m_alwaysRunsAtForegroundPriority.
195         (WebKit::WebPageProxy::updateActivityToken):
196             - if m_alwaysRunsAtForegroundPriority is set always take the foreground activity token.
197         * UIProcess/WebPageProxy.h:
198             - added m_alwaysRunsAtForegroundPriority, alwaysRunsAtForegroundPriority.
199
200 2015-06-12  Anders Carlsson  <andersca@apple.com>
201
202         Reimplement WKResourceCacheManagerRef on top of WKWebsiteDataStoreRef
203         https://bugs.webkit.org/show_bug.cgi?id=145951
204
205         Reviewed by Darin Adler.
206
207         * UIProcess/API/C/WKContext.cpp:
208         (WKContextGetResourceCacheManager):
209         * UIProcess/API/C/WKResourceCacheManager.cpp:
210         (WKResourceCacheManagerGetTypeID):
211         (toWebsiteDataTypes):
212         (WKResourceCacheManagerGetCacheOrigins):
213         (WKResourceCacheManagerClearCacheForOrigin):
214         (WKResourceCacheManagerClearCacheForAllOrigins):
215
216 2015-06-12  Anders Carlsson  <andersca@apple.com>
217
218         Reimplement WKApplicationCacheManagerRef as WKWebsiteDataStoreRef
219         https://bugs.webkit.org/show_bug.cgi?id=145950
220
221         Reviewed by Dan Bernstein.
222
223         * UIProcess/API/C/WKAPICast.h:
224         * UIProcess/API/C/WKApplicationCacheManager.cpp:
225         (WKApplicationCacheManagerGetTypeID):
226         (WKApplicationCacheManagerGetApplicationCacheOrigins):
227         (WKApplicationCacheManagerDeleteEntriesForOrigin):
228         (WKApplicationCacheManagerDeleteAllEntries):
229         * UIProcess/API/C/WKContext.cpp:
230         (WKContextGetApplicationCacheManager):
231         (WKContextGetPluginSiteDataManager):
232
233 2015-06-12  Anders Carlsson  <andersca@apple.com>
234
235         Clean up IndexedDB website data retrieval and removal
236         https://bugs.webkit.org/show_bug.cgi?id=145941
237
238         Reviewed by Andreas Kling.
239
240         - Use SecurityOrigin instead of SecurityOriginData; It's not possible to pass SecurityOriginData
241         safely between threads.
242         
243         - Use std::chrono instead of double for modification times.
244         
245         - Get rid of endTime since it's not used.
246         
247         - Change deleteIndexedDatabaseEntriesForOrigin to deleteIndexedDatabaseEntriesForOrigins and make it take
248         a vector of origins instead of a single one.
249
250         - Get rid of deleteAllIndexedDatabaseEntries.
251
252         - Change SecurityOriginData::securityOrigin to call isolatedCopy on the origin components, since it's common
253         to pass origins to other threads and we want that to be safe.
254
255         * DatabaseProcess/DatabaseProcess.cpp:
256         (WebKit::DatabaseProcess::fetchWebsiteData):
257         (WebKit::DatabaseProcess::deleteWebsiteData):
258         (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins):
259         (WebKit::DatabaseProcess::indexedDatabaseOrigins):
260         (WebKit::removeAllDatabasesForOriginPath):
261         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigins):
262         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesModifiedSince):
263         (WebKit::DatabaseProcess::getIndexedDatabaseOrigins): Deleted.
264         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigin): Deleted.
265         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesModifiedBetweenDates): Deleted.
266         (WebKit::DatabaseProcess::deleteAllIndexedDatabaseEntries): Deleted.
267         * DatabaseProcess/DatabaseProcess.h:
268         * Shared/SecurityOriginData.cpp:
269         (WebKit::SecurityOriginData::securityOrigin):
270
271 2015-06-12  Antti Koivisto  <antti@apple.com>
272
273         Network Cache: Use SHA1 for header checksum
274         https://bugs.webkit.org/show_bug.cgi?id=145928
275
276         Reviewed by Chris Dumez.
277
278         Use SHA1 everywhere for consistency and robustness.
279
280         * NetworkProcess/cache/NetworkCacheStorage.cpp:
281         (WebKit::NetworkCache::Storage::bodyPathForKey):
282         (WebKit::NetworkCache::RecordMetaData::RecordMetaData):
283         (WebKit::NetworkCache::decodeRecordMetaData):
284         (WebKit::NetworkCache::decodeRecordHeader):
285         (WebKit::NetworkCache::encodeRecordMetaData):
286         (WebKit::NetworkCache::Storage::encodeRecord):
287         (WebKit::NetworkCache::hashData): Deleted.
288
289             This was the last user of 32 bit hashes in cache code.
290
291         * NetworkProcess/cache/NetworkCacheStorage.h:
292
293             Also bump the cache version number as recent changes have changed the format.
294             Old caches would transition fine but this makes it easier to identify which version user has.
295
296 2015-06-12  Simon Fraser  <simon.fraser@apple.com>
297
298         [iOS WK2] Video with reflection crashes WebKit and Safari
299         https://bugs.webkit.org/show_bug.cgi?id=145905
300         rdar://problem/18364939
301
302         Reviewed by Anders Carlsson.
303         
304         On iOS, AVPlayerLayers are contained inside a WebVideoContainerLayer, but
305         the layer type is still LayerTypeAVPlayerLayer.
306         
307         Avoid throwing exceptions when cloning such layers by checking the layer class.
308
309         * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.mm:
310         (WebKit::PlatformCALayerRemoteCustom::clone):
311
312 2015-06-12  Csaba Osztrogonác  <ossy@webkit.org>
313
314         [EFL] Fix unused private field warning in WebContextMenuProxyEfl.cpp
315         https://bugs.webkit.org/show_bug.cgi?id=145911
316
317         Reviewed by Darin Adler.
318
319         * UIProcess/efl/WebContextMenuProxyEfl.cpp:
320         (WebKit::WebContextMenuProxyEfl::WebContextMenuProxyEfl): Deleted.
321         * UIProcess/efl/WebContextMenuProxyEfl.h:
322
323 2015-06-12  Zan Dobersek  <zdobersek@igalia.com>
324
325         Unreviewed build fix after r185502.
326
327         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
328         GRefPtr.h header has been moved to a different place.
329
330 2015-06-12  Zan Dobersek  <zdobersek@igalia.com>
331
332         [GLib] Move files under Source/WTF/wtf/gobject to Source/WTF/wtf/glib
333         https://bugs.webkit.org/show_bug.cgi?id=145799
334
335         Reviewed by Carlos Garcia Campos.
336
337         Update header inclusions for headers that have been moved
338         to Source/WTF/wtf/glib/.
339
340         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
341         * NetworkProcess/cache/NetworkCacheIOChannel.h:
342         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
343         * NetworkProcess/soup/NetworkProcessSoup.cpp:
344         * PlatformEfl.cmake:
345         * PlatformGTK.cmake:
346         * Shared/Downloads/soup/DownloadSoup.cpp:
347         * Shared/Network/CustomProtocols/soup/CustomProtocolManagerImpl.h:
348         * Shared/PrintInfo.h:
349         * Shared/gtk/ArgumentCodersGtk.cpp:
350         * Shared/gtk/ArgumentCodersGtk.h:
351         * Shared/gtk/KeyedDecoder.h:
352         * Shared/gtk/KeyedEncoder.h:
353         * Shared/gtk/ProcessExecutablePathGtk.cpp:
354         * UIProcess/API/gtk/WebKitBackForwardList.cpp:
355         * UIProcess/API/gtk/WebKitBackForwardListItem.cpp:
356         * UIProcess/API/gtk/WebKitColorChooser.h:
357         * UIProcess/API/gtk/WebKitContextMenu.cpp:
358         * UIProcess/API/gtk/WebKitContextMenuItem.cpp:
359         * UIProcess/API/gtk/WebKitCookieManager.cpp:
360         * UIProcess/API/gtk/WebKitDownload.cpp:
361         * UIProcess/API/gtk/WebKitDownloadClient.cpp:
362         * UIProcess/API/gtk/WebKitFaviconDatabase.cpp:
363         * UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
364         * UIProcess/API/gtk/WebKitFindController.cpp:
365         * UIProcess/API/gtk/WebKitFormClient.cpp:
366         * UIProcess/API/gtk/WebKitFormSubmissionRequest.cpp:
367         * UIProcess/API/gtk/WebKitInjectedBundleClient.cpp:
368         * UIProcess/API/gtk/WebKitJavascriptResult.cpp:
369         * UIProcess/API/gtk/WebKitLoaderClient.cpp:
370         * UIProcess/API/gtk/WebKitMimeInfo.cpp:
371         * UIProcess/API/gtk/WebKitNavigationAction.cpp:
372         * UIProcess/API/gtk/WebKitNavigationPolicyDecision.cpp:
373         * UIProcess/API/gtk/WebKitPolicyClient.cpp:
374         * UIProcess/API/gtk/WebKitPrintOperation.cpp:
375         * UIProcess/API/gtk/WebKitResponsePolicyDecision.cpp:
376         * UIProcess/API/gtk/WebKitUIClient.cpp:
377         * UIProcess/API/gtk/WebKitURISchemeRequest.cpp:
378         * UIProcess/API/gtk/WebKitUserContentManager.cpp:
379         * UIProcess/API/gtk/WebKitWebContext.cpp:
380         * UIProcess/API/gtk/WebKitWebInspector.cpp:
381         * UIProcess/API/gtk/WebKitWebResource.cpp:
382         * UIProcess/API/gtk/WebKitWebView.cpp:
383         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
384         * UIProcess/InspectorServer/WebSocketServer.h:
385         * UIProcess/InspectorServer/gtk/WebInspectorServerGtk.cpp:
386         * UIProcess/InspectorServer/soup/WebSocketServerSoup.cpp:
387         * UIProcess/Launcher/gtk/ProcessLauncherGtk.cpp:
388         * UIProcess/Plugins/gtk/PluginInfoCache.h:
389         * UIProcess/Plugins/unix/PluginProcessProxyUnix.cpp:
390         * UIProcess/gtk/DragAndDropHandler.cpp:
391         * UIProcess/gtk/GestureController.h:
392         * UIProcess/gtk/InputMethodFilter.cpp:
393         * UIProcess/gtk/InputMethodFilter.h:
394         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
395         * UIProcess/gtk/WebPopupMenuProxyGtk.cpp:
396         * UIProcess/gtk/WebPopupMenuProxyGtk.h:
397         * UIProcess/gtk/WebProcessPoolGtk.cpp:
398         * WebProcess/Cookies/soup/WebCookieManagerSoup.cpp:
399         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
400         * WebProcess/InjectedBundle/API/gtk/WebKitWebHitTestResult.cpp:
401         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
402         * WebProcess/WebPage/WebPage.h:
403         * WebProcess/WebPage/gtk/LayerTreeHostGtk.h:
404         * WebProcess/WebPage/gtk/PrinterListGtk.h:
405         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
406         * WebProcess/WebPage/gtk/WebPrintOperationGtk.cpp:
407         * WebProcess/WebPage/gtk/WebPrintOperationGtk.h:
408         * WebProcess/gtk/WebGtkExtensionManager.h:
409         * WebProcess/soup/WebKitSoupRequestInputStream.cpp:
410         * WebProcess/soup/WebProcessSoup.cpp:
411         * WebProcess/soup/WebSoupRequestManager.h:
412
413 2015-06-12  Antti Koivisto  <antti@apple.com>
414
415         Network Cache: Use SHA1 for key hash
416         https://bugs.webkit.org/show_bug.cgi?id=143829
417
418         Reviewed by Anders Carlsson.
419
420         For consistency with blobs, use SHA1 instead of MD5.
421
422         * NetworkProcess/cache/NetworkCacheCoders.cpp:
423         (WebKit::NetworkCache::Coder<MD5::Digest>::encode): Deleted.
424         (WebKit::NetworkCache::Coder<MD5::Digest>::decode): Deleted.
425
426             No longer needed.
427
428         * NetworkProcess/cache/NetworkCacheCoders.h:
429         * NetworkProcess/cache/NetworkCacheKey.cpp:
430         (WebKit::NetworkCache::hashString):
431         (WebKit::NetworkCache::Key::computeHash):
432         * NetworkProcess/cache/NetworkCacheKey.h:
433
434 2015-06-12  Csaba Osztrogonác  <ossy@webkit.org>
435
436         Fix mismatched-tags warning in Source/WebKit2/UIProcess/gtk/InputMethodFilter.h
437         https://bugs.webkit.org/show_bug.cgi?id=145923
438
439         Reviewed by Carlos Garcia Campos.
440
441         * UIProcess/gtk/InputMethodFilter.h:
442
443 2015-06-12  Antti Koivisto  <antti@apple.com>
444
445         Use SHA1 for cache coder checksums
446         https://bugs.webkit.org/show_bug.cgi?id=145880
447
448         Reviewed by Anders Carlsson.
449
450         Make cache data error detection more robust by using SHA1 for checksums.
451
452         * NetworkProcess/cache/NetworkCacheDecoder.cpp:
453         (WebKit::NetworkCache::Decoder::Decoder):
454         (WebKit::NetworkCache::Decoder::decodeFixedLengthData):
455         (WebKit::NetworkCache::Decoder::decodeNumber):
456         (WebKit::NetworkCache::Decoder::verifyChecksum):
457         * NetworkProcess/cache/NetworkCacheDecoder.h:
458         * NetworkProcess/cache/NetworkCacheEncoder.cpp:
459         (WebKit::NetworkCache::Encoder::Encoder):
460         (WebKit::NetworkCache::Encoder::grow):
461         (WebKit::NetworkCache::Encoder::updateChecksumForData):
462         (WebKit::NetworkCache::Encoder::encodeFixedLengthData):
463         (WebKit::NetworkCache::Encoder::encodeNumber):
464         (WebKit::NetworkCache::Encoder::encodeChecksum):
465         * NetworkProcess/cache/NetworkCacheEncoder.h:
466         (WebKit::NetworkCache::Encoder::buffer):
467         (WebKit::NetworkCache::Encoder::bufferSize):
468         (WebKit::NetworkCache::Encoder::updateChecksumForNumber):
469
470 2015-06-12  Csaba Osztrogonác  <ossy@webkit.org>
471
472         [EFL] Fix deprecated declarations warnings related to WK2 versioned structs
473         https://bugs.webkit.org/show_bug.cgi?id=145913
474
475         Reviewed by Gyuyoung Kim.
476
477         * UIProcess/API/efl/ewk_favicon_database.cpp:
478         (EwkFaviconDatabase::EwkFaviconDatabase):
479         * UIProcess/efl/ContextHistoryClientEfl.cpp:
480         (WebKit::ContextHistoryClientEfl::ContextHistoryClientEfl):
481         * UIProcess/efl/ContextMenuClientEfl.cpp:
482         (ContextMenuClientEfl::ContextMenuClientEfl):
483         * UIProcess/efl/DownloadManagerEfl.cpp:
484         (WebKit::DownloadManagerEfl::DownloadManagerEfl):
485         * UIProcess/efl/FindClientEfl.cpp:
486         (WebKit::FindClientEfl::FindClientEfl):
487         * UIProcess/efl/FormClientEfl.cpp:
488         (WebKit::FormClientEfl::FormClientEfl):
489         * UIProcess/efl/PageUIClientEfl.cpp:
490         (WebKit::PageUIClientEfl::PageUIClientEfl):
491
492 2015-06-11  Mark Lam  <mark.lam@apple.com>
493
494         WebCore::reportException() needs to be able to accept a raw thrown value in addition to Exception objects.
495         https://bugs.webkit.org/show_bug.cgi?id=145872
496
497         Reviewed by Michael Saboff.
498
499         * WebProcess/InjectedBundle/InjectedBundle.cpp:
500         (WebKit::InjectedBundle::reportException):
501         - Don't assume we have an Exception object.  Let WebCore::reportException() take
502           care of it.
503
504 2015-06-11  Carlos Alberto Lopez Perez  <clopez@igalia.com>
505
506         [CMake] Unreviewed build fix after r185479.
507
508         * CMakeLists.txt: Unlist the files that r185479 deleted.
509
510 2015-06-11  Anders Carlsson  <andersca@apple.com>
511
512         Get rid of WebOriginDataManager
513         https://bugs.webkit.org/show_bug.cgi?id=145896
514
515         Reviewed by Andreas Kling.
516
517         * DatabaseProcess/DatabaseProcess.cpp:
518         (WebKit::DatabaseProcess::DatabaseProcess): Deleted.
519         (WebKit::DatabaseProcess::getOrigins): Deleted.
520         (WebKit::DatabaseProcess::deleteEntriesForOrigin): Deleted.
521         (WebKit::DatabaseProcess::deleteEntriesModifiedBetweenDates): Deleted.
522         (WebKit::DatabaseProcess::deleteAllEntries): Deleted.
523         * DatabaseProcess/DatabaseProcess.h:
524         * DerivedSources.make:
525         * UIProcess/API/C/WKAPICast.h:
526         * UIProcess/API/C/WKContext.cpp:
527         * UIProcess/Databases/DatabaseProcessProxy.cpp:
528         (WebKit::DatabaseProcessProxy::didReceiveMessage): Deleted.
529         * UIProcess/WebOriginDataManagerProxy.cpp: Removed.
530         (WebKit::WebOriginDataManagerProxy::supplementName): Deleted.
531         (WebKit::WebOriginDataManagerProxy::create): Deleted.
532         (WebKit::WebOriginDataManagerProxy::WebOriginDataManagerProxy): Deleted.
533         (WebKit::WebOriginDataManagerProxy::~WebOriginDataManagerProxy): Deleted.
534         (WebKit::WebOriginDataManagerProxy::processPoolDestroyed): Deleted.
535         (WebKit::WebOriginDataManagerProxy::processDidClose): Deleted.
536         (WebKit::WebOriginDataManagerProxy::shouldTerminate): Deleted.
537         (WebKit::WebOriginDataManagerProxy::refWebContextSupplement): Deleted.
538         (WebKit::WebOriginDataManagerProxy::derefWebContextSupplement): Deleted.
539         (WebKit::CallbackSynchronizer::create): Deleted.
540         (WebKit::CallbackSynchronizer::~CallbackSynchronizer): Deleted.
541         (WebKit::CallbackSynchronizer::taskStarted): Deleted.
542         (WebKit::CallbackSynchronizer::taskCompleted): Deleted.
543         (WebKit::CallbackSynchronizer::CallbackSynchronizer): Deleted.
544         (WebKit::createSynchronizedCallback): Deleted.
545         (WebKit::sendMessageToAllProcessesInProcessPool): Deleted.
546         (WebKit::WebOriginDataManagerProxy::getOrigins): Deleted.
547         (WebKit::WebOriginDataManagerProxy::didGetOrigins): Deleted.
548         (WebKit::WebOriginDataManagerProxy::deleteEntriesForOrigin): Deleted.
549         (WebKit::WebOriginDataManagerProxy::deleteEntriesModifiedBetweenDates): Deleted.
550         (WebKit::WebOriginDataManagerProxy::didDeleteEntries): Deleted.
551         (WebKit::WebOriginDataManagerProxy::deleteAllEntries): Deleted.
552         (WebKit::WebOriginDataManagerProxy::didDeleteAllEntries): Deleted.
553         * UIProcess/WebOriginDataManagerProxy.h: Removed.
554         * UIProcess/WebOriginDataManagerProxy.messages.in: Removed.
555         * UIProcess/WebProcessPool.cpp:
556         * WebKit2.xcodeproj/project.pbxproj:
557         * WebProcess/OriginData/WebOriginDataManager.cpp: Removed.
558         (WebKit::WebOriginDataManager::WebOriginDataManager): Deleted.
559         (WebKit::WebOriginDataManager::getOrigins): Deleted.
560         (WebKit::WebOriginDataManager::deleteEntriesForOrigin): Deleted.
561         (WebKit::WebOriginDataManager::deleteEntriesModifiedBetweenDates): Deleted.
562         (WebKit::WebOriginDataManager::deleteAllEntries): Deleted.
563         * WebProcess/OriginData/WebOriginDataManager.h: Removed.
564         * WebProcess/OriginData/WebOriginDataManager.messages.in: Removed.
565         * WebProcess/OriginData/WebOriginDataManagerSupplement.h: Removed.
566         (WebKit::WebOriginDataManagerSupplement::WebOriginDataManagerSupplement): Deleted.
567         (WebKit::WebOriginDataManagerSupplement::~WebOriginDataManagerSupplement): Deleted.
568         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
569         * WebProcess/WebPage/WebPage.cpp:
570         * WebProcess/WebProcess.cpp:
571         (WebKit::WebProcess::~WebProcess):
572         (WebKit::WebProcess::WebProcess): Deleted.
573         (WebKit::WebProcess::getOrigins): Deleted.
574         (WebKit::WebProcess::deleteEntriesForOrigin): Deleted.
575         (WebKit::WebProcess::deleteEntriesModifiedBetweenDates): Deleted.
576         (WebKit::WebProcess::deleteAllEntries): Deleted.
577         * WebProcess/WebProcess.h:
578         * WebProcess/cocoa/WebProcessCocoa.mm:
579
580 2015-06-11  Matt Rajca  <mrajca@apple.com>
581
582         Media Session: Add plumbing for media control event delivery.
583         https://bugs.webkit.org/show_bug.cgi?id=145859
584
585         Reviewed by Anders Carlsson.
586
587         * UIProcess/API/C/WKPage.cpp:
588         (WKPageHandleMediaEvent):
589         * UIProcess/API/C/WKPagePrivate.h:
590         * UIProcess/WebPageProxy.cpp:
591         (WebKit::WebPageProxy::handleMediaEvent):
592         * UIProcess/WebPageProxy.h:
593         * WebProcess/WebPage/WebPage.cpp:
594         (WebKit::WebPage::handleMediaEvent):
595         * WebProcess/WebPage/WebPage.h:
596         * WebProcess/WebPage/WebPage.messages.in:
597
598 2015-06-11  Myles C. Maxfield  <mmaxfield@apple.com>
599
600         [OS X] Decoding fonts may return nil when using force click
601         https://bugs.webkit.org/show_bug.cgi?id=145890
602
603         Reviewed by Beth Dakin.
604
605         [NSFontDescriptor fontDescriptorWithFontAttributes] might return nil, which
606         causes the encoding of an NSFont to erroneously return true.
607
608         * Shared/mac/ArgumentCodersMac.mm:
609         (IPC::decode):
610
611 2015-06-11  Anders Carlsson  <andersca@apple.com>
612
613         Reimplement WKOriginDataManager in terms of API::WebsiteDataStore
614         https://bugs.webkit.org/show_bug.cgi?id=145889
615
616         Reviewed by Dan Bernstein.
617
618         * UIProcess/API/C/WKAPICast.h:
619         * UIProcess/API/C/WKContext.cpp:
620         (WKContextGetOriginDataManager):
621         * UIProcess/API/C/WKOriginDataManager.cpp:
622         (WKOriginDataManagerGetTypeID):
623         (WKOriginDataManagerGetOrigins):
624         (WKOriginDataManagerDeleteEntriesForOrigin):
625         (WKOriginDataManagerDeleteEntriesModifiedBetweenDates):
626         (WKOriginDataManagerDeleteAllEntries):
627
628 2015-06-11  Brent Fulgham  <bfulgham@apple.com>
629
630         Full screen video space can be resized to 1pt wide
631         https://bugs.webkit.org/show_bug.cgi?id=145895
632         <rdar://problem/20907914>
633
634         Reviewed by Simon Fraser.
635
636         Prior to the upcoming OS X, full screen mode was not resizable. Now that it is,
637         we need to set a minimum window width that is large enough to hold the media
638         controls. This makes our full-screen video behave the same as the QuickTimeX player.
639
640         * UIProcess/mac/WKFullScreenWindowController.mm:
641         (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]): Active that new
642         kWKLayoutModeDynamicSizeWithMinimumViewSize style, and set the minimum view size to
643         be the width of our media controls, with 20 pixels of padding on either side.
644         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Set the layout
645         mode back to the default style.
646
647 2015-06-11  Jon Lee  <jonlee@apple.com>
648
649         Update media controls JS and CSS to use picture-in-picture
650         https://bugs.webkit.org/show_bug.cgi?id=145827
651         <rdar://problem/21311576>
652
653         Reviewed by Dean Jackson.
654
655         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
656         (InitWebCoreSystemInterface): Deleted GetMediaUIImageData.
657
658 2015-06-11  Alex Christensen  <achristensen@webkit.org>
659
660         Speculative build fix for GTK after r185463.
661
662         * CMakeLists.txt:
663         Remove WebPluginSiteDataManager.cpp from CMake build.
664
665 2015-06-11  Anders Carlsson  <andersca@apple.com>
666
667         Remove WebPluginSiteDataManager
668         https://bugs.webkit.org/show_bug.cgi?id=145884
669
670         Reviewed by Andreas Kling.
671
672         * PluginProcess/PluginProcess.cpp:
673         (WebKit::PluginProcess::clearSiteData): Deleted.
674         * PluginProcess/PluginProcess.h:
675         * PluginProcess/PluginProcess.messages.in:
676         * UIProcess/API/C/WKAPICast.h:
677         * UIProcess/API/C/WKContext.cpp:
678         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
679         * UIProcess/Plugins/PluginProcessManager.cpp:
680         (WebKit::PluginProcessManager::clearSiteData): Deleted.
681         * UIProcess/Plugins/PluginProcessManager.h:
682         * UIProcess/Plugins/PluginProcessProxy.cpp:
683         (WebKit::PluginProcessProxy::clearSiteData): Deleted.
684         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch): Deleted.
685         (WebKit::PluginProcessProxy::didFinishLaunching): Deleted.
686         (WebKit::PluginProcessProxy::didClearSiteData): Deleted.
687         * UIProcess/Plugins/PluginProcessProxy.h:
688         * UIProcess/Plugins/PluginProcessProxy.messages.in:
689         * UIProcess/Plugins/WebPluginSiteDataManager.cpp: Removed.
690         (WebKit::WebPluginSiteDataManager::GetSitesWithDataState::GetSitesWithDataState): Deleted.
691         (WebKit::WebPluginSiteDataManager::GetSitesWithDataState::getSitesWithDataForNextPlugin): Deleted.
692         (WebKit::WebPluginSiteDataManager::GetSitesWithDataState::didGetSitesWithDataForSinglePlugin): Deleted.
693         (WebKit::WebPluginSiteDataManager::ClearSiteDataState::ClearSiteDataState): Deleted.
694         (WebKit::WebPluginSiteDataManager::ClearSiteDataState::clearSiteDataForNextPlugin): Deleted.
695         (WebKit::WebPluginSiteDataManager::ClearSiteDataState::didClearSiteDataForSinglePlugin): Deleted.
696         (WebKit::WebPluginSiteDataManager::create): Deleted.
697         (WebKit::WebPluginSiteDataManager::WebPluginSiteDataManager): Deleted.
698         (WebKit::WebPluginSiteDataManager::~WebPluginSiteDataManager): Deleted.
699         (WebKit::WebPluginSiteDataManager::invalidate): Deleted.
700         (WebKit::WebPluginSiteDataManager::getSitesWithData): Deleted.
701         (WebKit::WebPluginSiteDataManager::didGetSitesWithData): Deleted.
702         (WebKit::WebPluginSiteDataManager::clearSiteData): Deleted.
703         (WebKit::WebPluginSiteDataManager::didClearSiteData): Deleted.
704         (WebKit::WebPluginSiteDataManager::didGetSitesWithDataForSinglePlugin): Deleted.
705         (WebKit::WebPluginSiteDataManager::didGetSitesWithDataForAllPlugins): Deleted.
706         (WebKit::WebPluginSiteDataManager::didClearSiteDataForSinglePlugin): Deleted.
707         (WebKit::WebPluginSiteDataManager::didClearSiteDataForAllPlugins): Deleted.
708         * UIProcess/Plugins/WebPluginSiteDataManager.h: Removed.
709         (WebKit::WebPluginSiteDataManager::processPool): Deleted.
710         (WebKit::WebPluginSiteDataManager::clearProcessPool): Deleted.
711         * UIProcess/WebProcessPool.cpp:
712         (WebKit::WebProcessPool::~WebProcessPool): Deleted.
713         * UIProcess/WebProcessPool.h:
714         * UIProcess/WebProcessProxy.cpp:
715         * WebKit2.xcodeproj/project.pbxproj:
716
717 2015-06-11  Anders Carlsson  <andersca@apple.com>
718
719         Make WKWebsiteDataStoreRef backed by an API::WebsiteDataStore
720         https://bugs.webkit.org/show_bug.cgi?id=145882
721
722         Reviewed by Dan Bernstein.
723
724         * UIProcess/API/C/WKAPICast.h:
725         * UIProcess/API/C/WKContext.cpp:
726         (WKContextGetPluginSiteDataManager):
727         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
728         (WKPluginSiteDataManagerGetTypeID):
729         (WKPluginSiteDataManagerGetSitesWithData):
730         (WKPluginSiteDataManagerClearSiteData):
731         (WKPluginSiteDataManagerClearAllSiteData):
732
733 2015-06-11  Antti Koivisto  <antti@apple.com>
734
735         Network process crashes decoding invalid cache entry on 32bit system
736         https://bugs.webkit.org/show_bug.cgi?id=145842
737         rdar://problem/21228334
738
739         Reviewed by Anders Carlsson.
740
741         After cache scheme changes we may end up decoding invalid cache entries. This is by design,
742         we should just fail decoding and delete these entries.
743
744         However Decoder::bufferIsLargeEnoughToContain test in some cases would allow corrupted large
745         sizes due to overflow in 32bit pointer math and we would crash when allocating a string.
746
747         * NetworkProcess/cache/NetworkCacheCoders.cpp:
748         (WebKit::NetworkCache::Coder<CString>::decode):
749         (WebKit::NetworkCache::decodeStringText):
750         (WebKit::NetworkCache::Coder<WebCore::CertificateInfo>::decode):
751         (WebKit::NetworkCache::Coder<MD5::Digest>::encode):
752         * NetworkProcess/cache/NetworkCacheCoders.h:
753         * NetworkProcess/cache/NetworkCacheDecoder.cpp:
754         (WebKit::NetworkCache::Decoder::Decoder):
755         (WebKit::NetworkCache::Decoder::bufferIsLargeEnoughToContain):
756
757             Reshuffle to avoid sum.
758
759         (WebKit::NetworkCache::Decoder::decodeFixedLengthData):
760         * NetworkProcess/cache/NetworkCacheDecoder.h:
761         (WebKit::NetworkCache::Decoder::bufferSize):
762         (WebKit::NetworkCache::Decoder::currentOffset):
763         (WebKit::NetworkCache::Decoder::length): Deleted.
764         (WebKit::NetworkCache::Decoder::isInvalid): Deleted.
765         (WebKit::NetworkCache::Decoder::markInvalid): Deleted.
766
767             Remove these, they are not really used or needed.
768
769 2015-06-10  Anders Carlsson  <andersca@apple.com>
770
771         Rewrite WKPluginSiteDataManager using WebsiteDataStore functions
772         https://bugs.webkit.org/show_bug.cgi?id=145868
773
774         Reviewed by Antti Koivisto.
775
776         * UIProcess/API/C/WKPluginSiteDataManager.cpp:
777         (WKPluginSiteDataManagerGetSitesWithData):
778         (WKPluginSiteDataManagerClearSiteData):
779         (WKPluginSiteDataManagerClearAllSiteData):
780         (toNPClearSiteDataFlags): Deleted.
781         * UIProcess/Plugins/WebPluginSiteDataManager.h:
782         (WebKit::WebPluginSiteDataManager::processPool):
783
784 2015-06-11  Antti Koivisto  <antti@apple.com>
785
786         3% cold PLT regression from network cache on iOS
787         https://bugs.webkit.org/show_bug.cgi?id=145694
788         rdar://problem/21158245
789
790         Reviewed by Chris Dumez.
791
792         Cache does not help in cold page loads but it shouldn't' be hurting either. Write I/O needs to be toned down a bit.
793
794         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
795         (WebKit::NetworkCache::IOChannel::IOChannel):
796         (WebKit::NetworkCache::IOChannel::open):
797
798             Dispatch channels inherit their I/O priority from the target queue. Use background queue for write I/O.
799
800         * NetworkProcess/cache/NetworkCacheStorage.cpp:
801         (WebKit::NetworkCache::Storage::Storage):
802         (WebKit::NetworkCache::Storage::dispatchPendingReadOperations):
803         (WebKit::NetworkCache::Storage::dispatchPendingWriteOperations):
804
805             Only write one file at a time instead of maximum of three.
806
807         (WebKit::NetworkCache::Storage::retrieve):
808
809             For consistency with store prepend new entries here too.
810
811         (WebKit::NetworkCache::Storage::store):
812
813             Delay start of the first write operation by 1s.
814             Prepend instead of append to the pending write deque so retrieveFromMemory lookup finds newest entries first in case of duplicates
815
816         (WebKit::NetworkCache::Storage::traverse):
817         * NetworkProcess/cache/NetworkCacheStorage.h:
818
819 2015-06-10  Yongjun Zhang  <yongjun_zhang@apple.com>
820
821         Don't send touch events on link preview.
822         https://bugs.webkit.org/show_bug.cgi?id=145863
823
824         Disable web touch event recognizer on link preview. We do the same when finding nodes in inspector or when long press gesture
825         is recognized (by _cancelAllTouches). 
826
827         Reviewed by Beth Dakin.
828
829         * UIProcess/ios/WKContentViewInteraction.mm:
830         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]): Remove touch event gesture recognizer on preview start.
831         (-[WKContentView didDismissPreviewViewController:committing:]): Add the gesture recognizer back on dismiss.
832
833 2015-06-10  Anders Carlsson  <andersca@apple.com>
834
835         WKWebsiteDataStore should handle removing plug-in data for individual records
836         https://bugs.webkit.org/show_bug.cgi?id=145864
837
838         Reviewed by Beth Dakin.
839
840         * PluginProcess/PluginProcess.cpp:
841         (WebKit::PluginProcess::deleteWebsiteDataForHostNames):
842         * PluginProcess/PluginProcess.h:
843         * PluginProcess/PluginProcess.messages.in:
844         * UIProcess/Plugins/PluginProcessManager.cpp:
845         (WebKit::PluginProcessManager::deleteWebsiteDataForHostNames):
846         * UIProcess/Plugins/PluginProcessManager.h:
847         * UIProcess/Plugins/PluginProcessProxy.cpp:
848         (WebKit::PluginProcessProxy::deleteWebsiteDataForHostNames):
849         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
850         (WebKit::PluginProcessProxy::didFinishLaunching):
851         (WebKit::PluginProcessProxy::didDeleteWebsiteDataForHostNames):
852         * UIProcess/Plugins/PluginProcessProxy.h:
853         * UIProcess/Plugins/PluginProcessProxy.messages.in:
854         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
855         (WebKit::WebsiteDataStore::removeData):
856
857 2015-06-10  Anders Carlsson  <andersca@apple.com>
858
859         WKWebsiteDataStore should handle removing plug-in data
860         https://bugs.webkit.org/show_bug.cgi?id=145862
861
862         Reviewed by Sam Weinig.
863
864         * PluginProcess/PluginProcess.cpp:
865         (WebKit::PluginProcess::deleteWebsiteData):
866         * PluginProcess/PluginProcess.h:
867         * PluginProcess/PluginProcess.messages.in:
868         * UIProcess/Plugins/PluginProcessManager.cpp:
869         (WebKit::PluginProcessManager::deleteWebsiteData):
870         * UIProcess/Plugins/PluginProcessManager.h:
871         * UIProcess/Plugins/PluginProcessProxy.cpp:
872         (WebKit::PluginProcessProxy::~PluginProcessProxy):
873         (WebKit::PluginProcessProxy::deleteWebsiteData):
874         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
875         (WebKit::PluginProcessProxy::didFinishLaunching):
876         (WebKit::PluginProcessProxy::didDeleteWebsiteData):
877         * UIProcess/Plugins/PluginProcessProxy.h:
878         * UIProcess/Plugins/PluginProcessProxy.messages.in:
879         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
880         (WebKit::WebsiteDataStore::removeData):
881
882 2015-06-10  Brent Fulgham  <bfulgham@apple.com>
883
884         [WK2] Do not indicate Media Keys are present when they are not
885         https://bugs.webkit.org/show_bug.cgi?id=145713
886         <rdar://problem/19752566>
887
888         Reviewed by Dean Jackson.
889
890         Correct the reporting of Media Key presence by checking for the actual
891         media key file, not just the directory. Sometimes the directory will exist
892         with no media key files (e.g., if a user navigates to the directory using
893         the Finder).
894
895         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
896         (WebKit::computeMediaKeyFile): Moved earlier in file so it could be used by
897         the 'mediaKeyOrigins' method.
898         (WebKit::WebsiteDataStore::mediaKeyOrigins): Only indicate we have a media key
899         origin if the folder actually contains the media key file.
900         (WebKit::WebsiteDataStore::removeMediaKeys): Use the existing 'computeMediaKeyFile',
901         rather than manually building the file from strings.
902
903 2015-06-09  Anders Carlsson  <andersca@apple.com>
904
905         Support fetching website data
906         https://bugs.webkit.org/show_bug.cgi?id=145828
907
908         Reviewed by Darin Adler.
909
910         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
911         (WebKit::WebsiteDataStore::fetchData):
912         (WebKit::WebsiteDataStore::plugins):
913         * UIProcess/WebsiteData/WebsiteDataStore.h:
914
915 2015-06-10  Zan Dobersek  <zdobersek@igalia.com>
916
917         Unreviewed. Fixing the build for the GTK port with Clang.
918
919         * UIProcess/gtk/InputMethodFilter.h: Add the <functional> header inclusion
920         to avoid compilation errors due to missing std::function<>.
921
922 2015-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
923
924         [GTK] Move KeyBindingTranslator from platform to WebKit2 layer
925         https://bugs.webkit.org/show_bug.cgi?id=145840
926
927         Reviewed by Martin Robinson.
928
929         It's currently used only by WebKit2 in the UI process and it's
930         another file built twice because of the GTK2 plugin process.
931
932         * PlatformGTK.cmake:
933         * UIProcess/API/gtk/WebKitWebViewBase.cpp:
934         * UIProcess/gtk/KeyBindingTranslator.cpp: Renamed from Source/WebCore/platform/gtk/KeyBindingTranslator.cpp.
935         (WebKit::backspaceCallback):
936         (WebKit::selectAllCallback):
937         (WebKit::cutClipboardCallback):
938         (WebKit::copyClipboardCallback):
939         (WebKit::pasteClipboardCallback):
940         (WebKit::toggleOverwriteCallback):
941         (WebKit::popupMenuCallback):
942         (WebKit::showHelpCallback):
943         (WebKit::deleteFromCursorCallback):
944         (WebKit::moveCursorCallback):
945         (WebKit::KeyBindingTranslator::KeyBindingTranslator):
946         (WebKit::KeyBindingTranslator::commandsForKeyEvent):
947         * UIProcess/gtk/KeyBindingTranslator.h: Renamed from Source/WebCore/platform/gtk/KeyBindingTranslator.h.
948         (WebKit::KeyBindingTranslator::addPendingEditorCommand):
949
950 2015-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
951
952         [GTK] Get rid of GetEditorCommandsForKeyEvent sync message
953         https://bugs.webkit.org/show_bug.cgi?id=145598
954
955         Reviewed by Žan Doberšek.
956
957         We are sending GetEditorCommandsForKeyEvent sync message from web
958         process to the UI process for every key pressed. And if the
959         keydown event doesn't handle the key, the message is sent again
960         for the keypress event, so in many cases it happens twice per
961         keypress. We can get the list of commands when the key press event
962         happens in the web view, and send it to the web process as part of
963         the keyboard event like mac port does. In the web process,
964         commands not inserting text will be handled by keydown and the
965         rest in keypress without having to use any other IPC message for that.
966
967         * Shared/NativeWebKeyboardEvent.h: Add command list parameter to
968         the constructor.
969         * Shared/WebEvent.h: Add GTK specific constructor that receives a
970         list of commands and whether the event was handled by input methods.
971         (WebKit::WebKeyboardEvent::commands): Returns the list of commands.
972         * Shared/WebEventConversion.cpp:
973         (WebKit::WebKit2PlatformKeyboardEvent::WebKit2PlatformKeyboardEvent):
974         Also copy the commands and handledByInputMethod member.
975         * Shared/WebKeyboardEvent.cpp:
976         (WebKit::WebKeyboardEvent::WebKeyboardEvent): Implement GTK
977         specific constructor that receives a list of commands and whether
978         the event was handled by input methods.
979         (WebKit::WebKeyboardEvent::encode): Encode commands and handledByInputMethod.
980         (WebKit::WebKeyboardEvent::decode): Decode commands and handledByInputMethod.
981         * Shared/gtk/NativeWebKeyboardEventGtk.cpp:
982         (WebKit::NativeWebKeyboardEvent::NativeWebKeyboardEvent): Add
983         command list parameter to the constructor.
984         * Shared/gtk/WebEventFactory.cpp:
985         (WebKit::WebEventFactory::createWebKeyboardEvent): Use the new
986         WebKeyboardEvent constructor and simplify the code. We don't need
987         to explicitly set VK_PROCESSKEY as windows virtual key code when
988         the event was handled by input methods. The WebCore event handler
989         already does that.
990         * Shared/gtk/WebEventFactory.h:
991         * UIProcess/API/gtk/PageClientImpl.cpp:
992         (WebKit::PageClientImpl::getEditorCommandsForKeyEvent): Deleted.
993         * UIProcess/API/gtk/PageClientImpl.h:
994         * UIProcess/API/gtk/WebKitWebViewBase.cpp: Add a
995         KeyBindingTranslator member.
996         (webkitWebViewBaseKeyPressEvent): Use the new
997         InputMethodFilter::filterKeyEvent() API and get the list of
998         commands for the key when events was not handled by input methods.
999         (webkitWebViewBaseKeyReleaseEvent): Use the new
1000         InputMethodFilter::filterKeyEvent() API.
1001         * UIProcess/PageClient.h:
1002         * UIProcess/WebPageProxy.messages.in: Remove GetEditorCommandsForKeyEvent message.
1003         * UIProcess/gtk/InputMethodFilter.cpp:
1004         (WebKit::InputMethodFilter::handleKeyboardEvent): Call the
1005         completation handler.
1006         (WebKit::InputMethodFilter::handleKeyboardEventWithCompositionResults): Ditto.
1007         (WebKit::InputMethodFilter::filterKeyEvent): Use a completion
1008         handler for the task, so that the caller (the web view) can handle
1009         the keyboard event.
1010         * UIProcess/gtk/InputMethodFilter.h:
1011         * UIProcess/gtk/WebPageProxyGtk.cpp:
1012         (WebKit::WebPageProxy::getEditorCommandsForKeyEvent): Deleted.
1013         * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
1014         (WebKit::WebEditorClient::handleKeyboardEvent): Return earlier if
1015         the event was handled by input methods. And get the list of
1016         commands from the PlatformKeyboardEvent instead of sending a sync
1017         message to the UI process.
1018         (WebKit::WebEditorClient::handleInputMethodKeydown): If the event
1019         was handled by inpout methods, set the event as default handled so
1020         that the WebCore event handler sets VK_PROCESSKEY as windows
1021         virtual key code.
1022         (WebKit::WebEditorClient::getEditorCommandsForKeyEvent): Deleted.
1023
1024 2015-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>
1025
1026         Unreviewed. Fix GTK build after r185412.
1027
1028         Add missing include.
1029
1030         * NetworkProcess/cache/NetworkCacheFileSystem.cpp:
1031
1032 2015-06-10  Antti Koivisto  <antti@apple.com>
1033
1034         NetworkCache: Delete old cache versions
1035         https://bugs.webkit.org/show_bug.cgi?id=145800
1036
1037         Reviewed by Darin Adler.
1038
1039         * CMakeLists.txt:
1040         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
1041         (WebKit::NetworkCache::BlobStorage::synchronize):
1042         * NetworkProcess/cache/NetworkCacheFileSystem.cpp: Added.
1043         (WebKit::NetworkCache::directoryEntryType):
1044         (WebKit::NetworkCache::traverseDirectory):
1045
1046             Pass entry type as callback argument.
1047
1048         (WebKit::NetworkCache::deleteDirectoryRecursively):
1049
1050             Add helper.
1051
1052         (WebKit::NetworkCache::fileTimes):
1053         (WebKit::NetworkCache::updateFileModificationTimeIfNeeded):
1054         * NetworkProcess/cache/NetworkCacheFileSystem.h: Copied from Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystemPosix.h.
1055
1056             Move code to cpp.
1057
1058         (WebKit::NetworkCache::traverseDirectory): Deleted.
1059         (WebKit::NetworkCache::traverseCacheFiles): Deleted.
1060         (WebKit::NetworkCache::fileTimes): Deleted.
1061         (WebKit::NetworkCache::updateFileModificationTimeIfNeeded): Deleted.
1062         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h: Removed.
1063         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1064         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
1065         (WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache):
1066         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1067         (WebKit::NetworkCache::makeBlobDirectoryPath):
1068         (WebKit::NetworkCache::traverseRecordsFiles):
1069
1070             Move cache hierarchy aware traversal code here from NetworkCacheFileSystem (for better layering).
1071             Rename for clarity.
1072
1073         (WebKit::NetworkCache::deleteEmptyRecordsDirectories):
1074
1075             Factor to a function.
1076
1077         (WebKit::NetworkCache::Storage::Storage):
1078         (WebKit::NetworkCache::Storage::synchronize):
1079         (WebKit::NetworkCache::Storage::traverse):
1080         (WebKit::NetworkCache::Storage::clear):
1081
1082             Use traverseRecordsFiles for traversal.
1083
1084         (WebKit::NetworkCache::Storage::shrink):
1085         (WebKit::NetworkCache::Storage::deleteOldVersions):
1086
1087             Delete version subdirectories with version number less than the current version.
1088             Remove code for clearing unversioned V1 caches. No one should have them.
1089
1090         * NetworkProcess/cache/NetworkCacheStorage.h:
1091         * UIProcess/API/APIUserContentExtensionStore.cpp:
1092         * WebKit2.xcodeproj/project.pbxproj:
1093
1094 2015-06-10  Zan Dobersek  <zdobersek@igalia.com>
1095
1096         [GTK] Web Inspector is broken
1097         https://bugs.webkit.org/show_bug.cgi?id=145836
1098
1099         Reviewed by Carlos Garcia Campos.
1100
1101         * PlatformGTK.cmake: Thread the InspectorBackendCommands.js file as a separate
1102         dependency of InspectorGResourceBundle.xml. It can't be listed under the InspectorFiles
1103         variable and then searched via the CMake glob command because it probably won't exist
1104         at the time the command is run (since it's copied into the specified path), so it won't
1105         be listed among the dependencies at all.
1106
1107 2015-06-09  Anders Carlsson  <andersca@apple.com>
1108
1109         Fix build.
1110
1111         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
1112         (WebKit::WebPluginSiteDataManager::GetSitesWithDataState::getSitesWithDataForNextPlugin):
1113
1114 2015-06-09  Anders Carlsson  <andersca@apple.com>
1115
1116         Change the PluginProcessManager data fetching function to take a completion handler
1117         https://bugs.webkit.org/show_bug.cgi?id=145821
1118
1119         Reviewed by Sam Weinig.
1120
1121         * UIProcess/Plugins/PluginProcessManager.cpp:
1122         (WebKit::PluginProcessManager::fetchWebsiteData):
1123         (WebKit::PluginProcessManager::getSitesWithData): Deleted.
1124         * UIProcess/Plugins/PluginProcessManager.h:
1125         * UIProcess/Plugins/PluginProcessProxy.cpp:
1126         (WebKit::generateCallbackID):
1127         (WebKit::PluginProcessProxy::~PluginProcessProxy):
1128         (WebKit::PluginProcessProxy::fetchWebsiteData):
1129         (WebKit::PluginProcessProxy::pluginProcessCrashedOrFailedToLaunch):
1130         (WebKit::PluginProcessProxy::didFinishLaunching):
1131         (WebKit::PluginProcessProxy::didGetSitesWithData):
1132         (WebKit::PluginProcessProxy::getSitesWithData): Deleted.
1133         * UIProcess/Plugins/PluginProcessProxy.h:
1134         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
1135         (WebKit::WebPluginSiteDataManager::GetSitesWithDataState::getSitesWithDataForNextPlugin):
1136
1137 2015-06-09  Anders Carlsson  <andersca@apple.com>
1138
1139         Add code to keep track of plug-in data host names in website data records
1140         https://bugs.webkit.org/show_bug.cgi?id=145818
1141
1142         Reviewed by Andreas Kling.
1143
1144         * Shared/WebsiteData/WebsiteData.cpp:
1145         (WebKit::WebsiteData::encode):
1146         (WebKit::WebsiteData::decode):
1147         * Shared/WebsiteData/WebsiteData.h:
1148         * UIProcess/WebsiteData/WebsiteDataRecord.cpp:
1149         (WebKit::WebsiteDataRecord::displayNameForPluginDataHostName):
1150         (WebKit::WebsiteDataRecord::addPluginDataHostName):
1151         (WebKit::WebsiteDataRecord::displayNameForCookieHostName): Deleted.
1152         * UIProcess/WebsiteData/WebsiteDataRecord.h:
1153         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
1154         (WebKit::WebsiteDataStore::fetchData):
1155
1156 2015-06-09  Anders Carlsson  <andersca@apple.com>
1157
1158         Add Plug-in type declarations to WKWebsiteDataRecord and friends
1159         https://bugs.webkit.org/show_bug.cgi?id=145816
1160
1161         Reviewed by Andreas Kling.
1162
1163         * Shared/WebsiteData/WebsiteDataTypes.h:
1164         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
1165         (dataTypesToString):
1166         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
1167         (WebKit::toWebsiteDataTypes):
1168         (WebKit::toWKWebsiteDataTypes):
1169         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h:
1170
1171 2015-06-09  Antti Koivisto  <antti@apple.com>
1172
1173         REGRESSION(r185262): NetworkCache is in wrong location on OS X
1174         https://bugs.webkit.org/show_bug.cgi?id=145812
1175
1176         Reviewed by Anders Carlsson.
1177
1178         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1179         (WebKit::WebProcessPool::legacyPlatformDefaultWebSQLDatabaseDirectory):
1180         (WebKit::WebProcessPool::legacyPlatformDefaultLocalStorageDirectory):
1181         (WebKit::WebProcessPool::legacyPlatformDefaultMediaKeysStorageDirectory):
1182         (WebKit::WebProcessPool::isNetworkCacheEnabled):
1183
1184             Make sure static functions that use NSUserDefaults call registerUserDefaultsIfNeeded() first.
1185
1186 2015-06-09  Yusuke Suzuki  <utatane.tea@gmail.com>
1187
1188         Crash when passing Symbol to NPAPI plugin objects
1189         https://bugs.webkit.org/show_bug.cgi?id=145798
1190
1191         Reviewed by Darin Adler.
1192
1193         When the symbol is passed, `propertyName.publicName()` becomes nullptr.
1194         So dereferencing it causes null dereference errors.
1195         At first, this bug appears in the https://bugs.webkit.org/show_bug.cgi?id=145556,
1196         plugin[@@toStringTag] ("string" + plugin) causes SEGV in plugins/embed-inside-object.html test.
1197
1198         This patch avoids it by early returning when the symbols are passed.
1199         Methods for symbols are not implemented in the NPObject side, so it works correctly.
1200
1201         * WebProcess/Plugins/Netscape/JSNPObject.cpp:
1202         (WebKit::npIdentifierFromIdentifier):
1203         (WebKit::JSNPObject::callMethod):
1204         (WebKit::JSNPObject::getOwnPropertySlot):
1205         (WebKit::JSNPObject::put):
1206         (WebKit::JSNPObject::deleteProperty):
1207         (WebKit::JSNPObject::propertyGetter):
1208         (WebKit::JSNPObject::methodGetter):
1209
1210 2015-06-09  Carlos Garcia Campos  <cgarcia@igalia.com>
1211
1212         [SOUP] Network Cache: Give more priority to reads over writes in IO WorkQueue
1213         https://bugs.webkit.org/show_bug.cgi?id=145791
1214
1215         Reviewed by Sergio Villar Senin.
1216
1217         Keep using G_PRIORITY_DEFAULT for reads, but use
1218         G_PRIORITY_DEFAULT_IDLE for writes now.
1219
1220         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
1221         (WebKit::NetworkCache::outputStreamWriteReadyCallback): Use
1222         G_PRIORITY_DEFAULT_IDLE for write async operations.
1223         (WebKit::NetworkCache::IOChannel::write): Pass
1224         G_PRIORITY_DEFAULT_IDLE to runTaskInQueue().
1225
1226 2015-06-09  Carlos Garcia Campos  <cgarcia@igalia.com>
1227
1228         [SOUP] Network Cache: run the IO completion handler in the given queue instead of the whole operation
1229         https://bugs.webkit.org/show_bug.cgi?id=145797
1230
1231         Reviewed by Žan Doberšek.
1232
1233         I misunderstood what the WorkQueue parameter meant in the IO
1234         channel operations. It's the queue where the completion handler
1235         should be run, not the whole operation. Since our operations are
1236         already non-blocking, we can just run the read/writes in the main
1237         thread, and schedule the completion handler in the given work
1238         queue when the operation finishes.
1239
1240         * NetworkProcess/cache/NetworkCacheIOChannel.h:
1241         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
1242         (WebKit::NetworkCache::inputStreamReadReadyCallback):
1243         (WebKit::NetworkCache::IOChannel::read):
1244         (WebKit::NetworkCache::IOChannel::readSync):
1245         (WebKit::NetworkCache::outputStreamWriteReadyCallback):
1246         (WebKit::NetworkCache::IOChannel::write):
1247
1248 2015-06-09  David Kilzer  <ddkilzer@apple.com>
1249
1250         REGRESSION (r185357): Fix build for iOS 8.x
1251
1252         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1253         (fallbackIconForFile): Add cast prior to iOS 9.
1254
1255 2015-06-09  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1256
1257         [EFL] Fix a crash on MiniBrowser when running on debug mode
1258         https://bugs.webkit.org/show_bug.cgi?id=145793
1259
1260         Reviewed by Carlos Garcia Campos.
1261
1262         r185314 missed to initialize parameters.diskCacheDirectory with configuration's one.
1263
1264         * UIProcess/efl/WebProcessPoolEfl.cpp:
1265         (WebKit::WebProcessPool::platformInitializeWebProcess):
1266
1267 2015-06-09  Csaba Osztrogonác  <ossy@webkit.org>
1268
1269         [cmake] Fix the style issues in cmake project files
1270         https://bugs.webkit.org/show_bug.cgi?id=145755
1271
1272         Reviewed by Darin Adler.
1273
1274         * CMakeLists.txt:
1275         * PlatformGTK.cmake:
1276         * PlatformMac.cmake:
1277
1278 2015-06-02  Jon Honeycutt  <jhoneycutt@apple.com>
1279
1280         [iOS] UI process memory spike, hang when uploading a very large JPEG
1281
1282         <https://bugs.webkit.org/show_bug.cgi?id=145567>
1283         <rdar://problem/21206699>
1284
1285         When uploading an image, we generate a thumbnail to use for an icon
1286         that sits next to the control. To do this, we load the image and draw
1287         it into a thumbnail-sized canvas. This can be very expensive for large
1288         images.
1289
1290         To fix this, we'll use CGImageSource API, which will allow us to get
1291         any existing thumbnail that exists in the source file.
1292
1293         Reviewed by Darin Adler.
1294
1295         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1296         (squareCropRectForSize):
1297         Use std::round, based on Darin's review feedback that a) rintf is
1298         incorrect in 64-bit systems where CGFloat is a double, b) rintf uses a
1299         variable rounding mode, which is undesirable.
1300         (squareImage):
1301         Changed to take a CGImageRef.
1302         Use RetainPtr and +[UIImage imageWithCGImage:] to match other code in
1303         this file.
1304         (thumbnailSizedImageForImage):
1305         Changed to take a CGImageRef and to use iconSideLength.
1306         (iconForImageFile):
1307         Create an image source for the file, then use CGImageSource API to
1308         generate a thumbnail.
1309         (-[_WKImageFileUploadItem initWithFileURL:originalImage:]): Deleted.
1310         (-[_WKImageFileUploadItem displayImage]):
1311         Use iconForImageFile() rather than trying to generate an icon from the
1312         UIImage.
1313         (-[WKFileUploadPanel _uploadItemForImageData:imageName:successBlock:failureBlock:]):
1314         Removed originalImage parameter; _WKImageFileUploadItem no longer uses
1315         it.
1316         (-[WKFileUploadPanel _uploadItemForJPEGRepresentationOfImage:successBlock:failureBlock:]):
1317         (-[WKFileUploadPanel _uploadItemForImage:withAssetURL:successBlock:failureBlock:]):
1318
1319 2015-06-08  Dan Bernstein  <mitz@apple.com>
1320
1321         [Cocoa] Use generics in framework headers
1322         https://bugs.webkit.org/show_bug.cgi?id=145781
1323
1324         Reviewed by Sam Weinig.
1325
1326         * mac/postprocess-framework-headers.sh: Use the parameter to WK_ARRAY and WK_SET.
1327
1328 2015-06-08  Chris Dumez  <cdumez@apple.com>
1329
1330         Access GCController instance via GCController::singleton() instead of a free function
1331         https://bugs.webkit.org/show_bug.cgi?id=145776
1332
1333         Reviewed by Darin Adler.
1334
1335         Access GCController instance via GCController::singleton() instead of a
1336         free function as per coding style and for consistency with other
1337         singleton classes in the codebase.
1338
1339         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1340         (WebKit::InjectedBundle::garbageCollectJavaScriptObjects):
1341         (WebKit::InjectedBundle::garbageCollectJavaScriptObjectsOnAlternateThreadForDebugging):
1342         * WebProcess/WebProcess.cpp:
1343         (WebKit::WebProcess::terminate):
1344         (WebKit::WebProcess::didClose):
1345         (WebKit::WebProcess::garbageCollectJavaScriptObjects):
1346         (WebKit::WebProcess::setJavaScriptGarbageCollectorTimerEnabled):
1347
1348 2015-06-08  Anders Carlsson  <andersca@apple.com>
1349
1350         Include IndexedDB databases in -[WKWebsiteDataStore allWebsiteDataTypes]
1351         https://bugs.webkit.org/show_bug.cgi?id=145775
1352
1353         Reviewed by Simon Fraser.
1354
1355         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
1356         (+[WKWebsiteDataStore allWebsiteDataTypes]):
1357
1358 2015-06-08  Anders Carlsson  <andersca@apple.com>
1359
1360         Move the snapshot layer contents SPI to the web view
1361         https://bugs.webkit.org/show_bug.cgi?id=145771
1362
1363         Reviewed by Geoffrey Garen.
1364
1365         We need to potentially ask the web page to take a snapshot of the current item,
1366         so move the SPI to WKWebView and name it appropriately.
1367
1368         * UIProcess/API/Cocoa/WKBackForwardListItem.mm:
1369         (-[WKBackForwardListItem _snapshotLayerContents]): Deleted.
1370         * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h: Removed.
1371         * UIProcess/API/Cocoa/WKWebView.mm:
1372         (-[WKWebView _snapshotLayerContentsForBackForwardListItem:]):
1373         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
1374         * WebKit2.xcodeproj/project.pbxproj:
1375
1376 2015-06-08  Brady Eidson  <beidson@apple.com>
1377
1378         Completely remove all IDB properties/constructors when it is disabled at runtime.
1379         rdar://problem/18429374 and https://bugs.webkit.org/show_bug.cgi?id=137034
1380
1381         Reviewed by Geoffrey Garen.
1382
1383         * WebProcess/WebProcess.cpp:
1384         (WebKit::WebProcess::WebProcess): Enable IDB at runtime if it's enabled at compile time.
1385
1386 2015-06-08  Michael Catanzaro  <mcatanzaro@igalia.com>
1387
1388         [SOUP] Performs DNS prefetch when a proxy is configured (information leak)
1389         https://bugs.webkit.org/show_bug.cgi?id=145542
1390
1391         Reviewed by Alexey Proskuryakov.
1392
1393         Add documentation to webkit_web_context_prefetch_dns to indicate that the function does
1394         nothing if the system configuration indicates we should use a proxy to resolve the host.
1395
1396         * UIProcess/API/gtk/WebKitWebContext.cpp:
1397
1398 2015-06-08  Carlos Garcia Campos  <cgarcia@igalia.com>
1399
1400         REGRESSION(r185251): [GTK] webkit_web_context_set_disk_cache_directory() doesn't work when using shared secondary process model after r185251
1401         https://bugs.webkit.org/show_bug.cgi?id=145751
1402
1403         Reviewed by Darin Adler.
1404
1405         In r185251 the CFNetwork cache was disabled in the web process,
1406         but it also removed the disk cache directory web process
1407         initialization parameter. While we support networking in the web
1408         process when shared secondary process model is used, the network
1409         cache should still work. We can remove this if we eventually
1410         switch to use the network process unconditionally.
1411
1412         * Shared/WebProcessCreationParameters.cpp:
1413         (WebKit::WebProcessCreationParameters::encode): Encode disk cache directory.
1414         (WebKit::WebProcessCreationParameters::decode): Decode disk cache directory.
1415         * Shared/WebProcessCreationParameters.h: Bring back disk cache directory only for soup.
1416         * UIProcess/gtk/WebProcessPoolGtk.cpp:
1417         (WebKit::WebProcessPool::platformInitializeWebProcess): Initialize disk cache directory parameter.
1418         * WebProcess/soup/WebProcessSoup.cpp:
1419         (WebKit::WebProcess::platformInitializeWebProcess): Use the disck cache directory parameter again.
1420
1421 2015-06-08  Csaba Osztrogonác  <ossy@webkit.org>
1422
1423         [GTK] Remove the unused scroll function from WebPageGtk.cpp
1424         https://bugs.webkit.org/show_bug.cgi?id=145756
1425
1426         Reviewed by Carlos Garcia Campos.
1427
1428         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
1429         (WebKit::scroll): Deleted.
1430
1431 2015-06-08  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1432
1433         REGRESSION(r185262): [EFL] Modify legacyPlatformDefaultNetworkCacheDirectory() according to network cache
1434         https://bugs.webkit.org/show_bug.cgi?id=145752
1435
1436         Reviewed by Carlos Garcia Campos.
1437
1438         EFL port needs to add different prefix for network cache directory since r185262.
1439         Modify it basedon GTK port fix.
1440
1441         * UIProcess/efl/WebProcessPoolEfl.cpp:
1442         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
1443
1444 2015-06-07  Carlos Garcia Campos  <cgarcia@igalia.com>
1445
1446         REGRESSION(r185262): [GTK] webkit_web_context_set_disk_cache_directory() doesn't work after r185262
1447         https://bugs.webkit.org/show_bug.cgi?id=145735
1448
1449         Reviewed by Darin Adler.
1450
1451         * NetworkProcess/soup/NetworkProcessSoup.cpp:
1452         (WebKit::NetworkProcess::platformInitializeNetworkProcess): Use
1453         the directory name to clear the old cache, since the disk cache
1454         subdirectory is now added in the UI process.
1455         * UIProcess/API/gtk/WebKitWebContext.cpp:
1456         (webkit_web_context_set_disk_cache_directory): Update the
1457         WebProcessPool configuration to override the disk cache directory.
1458         * UIProcess/WebProcessPool.cpp:
1459         (WebKit::WebProcessPool::ensureNetworkProcess): Use the
1460         configuration to get the disk cache directory.
1461         (WebKit::WebProcessPool::WebProcessPool): Remove
1462         m_diskCacheDirectory member initialization.
1463         * UIProcess/WebProcessPool.h: Remove m_diskCacheDirectory member.
1464         * UIProcess/gtk/WebProcessPoolGtk.cpp:
1465         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
1466         Append the disk cache subdirectory.
1467
1468 2015-06-07  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1469
1470         [EFL][GTK] Fix build  break since r185262
1471         https://bugs.webkit.org/show_bug.cgi?id=145724
1472
1473         Unreviewed, fix build break for EFL and GTK ports.
1474
1475         * UIProcess/API/APIWebsiteDataStore.cpp:
1476         (API::WebsiteDataStore::defaultLocalStorageDirectory):
1477         (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
1478         (API::WebsiteDataStore::defaultNetworkCacheDirectory):
1479         (API::WebsiteDataStore::defaultApplicationCacheDirectory):
1480         (API::WebsiteDataStore::defaultMediaKeysStorageDirectory):
1481         (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
1482         * UIProcess/efl/WebProcessPoolEfl.cpp:
1483         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
1484         (WebKit::WebProcessPool::platformDefaultDiskCacheDirectory): Deleted.
1485         * WebProcess/soup/WebProcessSoup.cpp:
1486         (WebKit::WebProcess::platformInitializeWebProcess):
1487
1488 2015-06-06  Dan Bernstein  <mitz@apple.com>
1489
1490         Don’t enable manual sandboxing in the iOS Simulator. This should fix all the tests timing out.
1491
1492         * Configurations/DebugRelease.xcconfig:
1493
1494 2015-06-06  Dan Bernstein  <mitz@apple.com>
1495
1496         [iOS] Can’t debug with Development XPC services due to automatic sandboxing
1497         https://bugs.webkit.org/show_bug.cgi?id=145731
1498
1499         Rubber-stamped by Darin Adler.
1500
1501         In iOS, the XPC services are automatically sandboxed based on their entitlements. The
1502         sandbox doesn’t allow them to re-exec, which is necessary for linking against engineering
1503         builds of the WebKit frameworks placed in a non-system location.
1504
1505         The solution is to opt Engineering builds into manual sandboxing.
1506
1507         * Configurations/BaseTarget.xcconfig:
1508         - Add ENABLE_MANUAL_SANDBOXING to
1509           GCC_PREPROCESSOR_DEFINITIONS when WK_MANUAL_SANDBOXING_ENABLED is YES.
1510         - Set WK_MANUAL_SANDBOXING_ENABLED to YES for OS X, because we always use manual
1511           sandboxing on that platform.
1512
1513         * Configurations/DebugRelease.xcconfig: Removed unused definition of DEBUG_OR_RELEASE. Set
1514           WK_MANUAL_SANDBOXING_ENABLED to YES for all engineering builds.
1515
1516         * Configurations/BaseXPCService.xcconfig: Define CODE_SIGN_ENTITLEMENTS for iOS to be empty
1517           if the service is not installed; to use the base entitlements file from Configurations if
1518           manual sandboxing is not enabled; and to use a derived entitlements file, which doesn’t
1519           specify a sandbox profile, if manual sandboxing is enabled.
1520
1521         * Configurations/DatabaseService.Development.xcconfig: Define
1522           WK_XPC_SERVICE_IOS_ENTITLEMENTS_BASE and let BaseXPCService.xcconfig define
1523           CODE_SIGN_ENTITLEMENTS for iOS.
1524
1525         * Configurations/DatabaseService.xcconfig: Ditto.
1526         * Configurations/NetworkService.Development.xcconfig: Ditto.
1527         * Configurations/NetworkService.xcconfig: Ditto.
1528         * Configurations/WebContentService.Development.xcconfig: Ditto.
1529         * Configurations/WebContentService.xcconfig: Ditto.
1530
1531         * WebKit2.xcodeproj/project.pbxproj:
1532         - In the Derived Sources target, added a Derive Entitlements for Manual Sandboxing script
1533           build phase. When building for iOS with manual sandboxing enabled, it creates copies of
1534           the iOS entitlements files with a -no-sandbox suffix and the seatbelt-profiles key
1535           removed.
1536         - In the WebKit target, added a Copy iOS Sandbox Profiles for Manual Sandboxing script build
1537           phase. When building for iOS with manual sandboxing enabled, it copies the iOS sandbox
1538           profiles into the framework, so that the services can apply them to themselves at runtime.
1539
1540         * Shared/ios/ChildProcessIOS.mm:
1541         (WebKit::ChildProcess::initializeSandbox): Use ENABLE(MANUAL_SANDBOXING) and don’t define it
1542         here.
1543
1544         * WebProcess/cocoa/WebProcessCocoa.mm:
1545         (WebKit::WebProcess::initializeSandbox): Use ENABLE(MANUAL_SANDBOXING) instead of defining
1546         and using ENABLE_MANUAL_WEBPROCESS_SANDBOXING here.
1547
1548 2015-06-06  Anders Carlsson  <andersca@apple.com>
1549
1550         Remove support from getting plug-in information from Carbon resources
1551         https://bugs.webkit.org/show_bug.cgi?id=145730
1552
1553         Reviewed by Dan Bernstein.
1554
1555         No current plug-in versions use this feature, and both Chrome and Mozilla for
1556         Mac stopped looking at Carbon resources years ago.
1557
1558         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
1559         (WebKit::NetscapePluginModule::getPluginInfo):
1560         (WebKit::ResourceMap::ResourceMap): Deleted.
1561         (WebKit::ResourceMap::~ResourceMap): Deleted.
1562         (WebKit::ResourceMap::isValid): Deleted.
1563         (WebKit::getStringListResource): Deleted.
1564         (WebKit::getPluginInfoFromCarbonResources): Deleted.
1565
1566 2015-06-05  Anders Carlsson  <andersca@apple.com>
1567
1568         Only allow plug-ins to create custom MIME property lists on older versions of OS X
1569         https://bugs.webkit.org/show_bug.cgi?id=145716
1570
1571         Reviewed by Dan Bernstein.
1572
1573         * PluginProcess/EntryPoint/mac/LegacyProcess/PluginProcessMain.mm:
1574         * Shared/Plugins/Netscape/NetscapePluginModule.h:
1575         * Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm:
1576         (WebKit::getMIMETypesFromPluginBundle):
1577         * UIProcess/Plugins/PluginProcessProxy.h:
1578         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
1579
1580 2015-06-05  Chris Dumez  <cdumez@apple.com>
1581
1582         [WK2][iOS] Limit the number of vnodes used by the WebContent processes
1583         https://bugs.webkit.org/show_bug.cgi?id=145672
1584         <rdar://problem/21126637>
1585
1586         Reviewed by Antti Koivisto.
1587
1588         Have the WebContent process register a vnode pressure handler on iOS,
1589         which calls the memory pressure handler.
1590
1591         On non-critical pressure, it will prune dead resources from the memory
1592         cache, which should free up some vnodes. On critical pressure, the
1593         handler will clear the PageCache and do a JS GC, which should free even
1594         more vnodes.
1595
1596         * WebProcess/cocoa/WebProcessCocoa.mm:
1597         (WebKit::WebProcess::platformInitializeWebProcess):
1598
1599 2015-06-05  Anders Carlsson  <andersca@apple.com>
1600
1601         Fix refacto, don't put IndexedDB databases in the cache directory
1602         https://bugs.webkit.org/show_bug.cgi?id=145714
1603
1604         Reviewed by Antti Koivisto.
1605
1606         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
1607         (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
1608
1609 2015-06-05  Anders Carlsson  <andersca@apple.com>
1610
1611         Make the network cache directory part of WKContextConfigurationRef
1612         https://bugs.webkit.org/show_bug.cgi?id=145711
1613
1614         Reviewed by Antti Koivisto.
1615
1616         Also, make the UI process be in control of where we place the new network cache.
1617         When using the Modern WebKit API, put the cache in ~/Library/Caches/<Bundle ID>/WebKit/NetworkCache,
1618         and put the cache in ~/Library/Caches/<Bundle ID>/WebKitCache otherwise (this is just for Safari).
1619
1620         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1621         (WebKit::NetworkCache::Storage::open):
1622         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1623         (API::ProcessPoolConfiguration::createWithLegacyOptions):
1624         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
1625         (API::ProcessPoolConfiguration::copy):
1626         * UIProcess/API/APIProcessPoolConfiguration.h:
1627         * UIProcess/API/C/WKContext.cpp:
1628         (WKContextSetDiskCacheDirectory): Deleted.
1629         * UIProcess/API/C/WKContextConfigurationRef.cpp:
1630         (WKContextConfigurationCopyDiskCacheDirectory):
1631         (WKContextConfigurationSetDiskCacheDirectory):
1632         * UIProcess/API/C/WKContextConfigurationRef.h:
1633         * UIProcess/API/C/WKContextPrivate.h:
1634         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1635         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
1636         (WebKit::WebProcessPool::legacyPlatformDefaultNetworkCacheDirectory):
1637         (WebKit::WebProcessPool::isNetworkCacheEnabled):
1638         (WebKit::WebProcessPool::platformDefaultDiskCacheDirectory): Deleted.
1639         * UIProcess/WebProcessPool.cpp:
1640         (WebKit::legacyWebsiteDataStoreConfiguration):
1641         (WebKit::WebProcessPool::WebProcessPool):
1642         (WebKit::WebProcessPool::ensureNetworkProcess):
1643         (WebKit::WebProcessPool::diskCacheDirectory): Deleted.
1644         * UIProcess/WebProcessPool.h:
1645
1646 2015-06-05  Anders Carlsson  <andersca@apple.com>
1647
1648         Make the application cache directory part of WKContextConfigurationRef
1649         https://bugs.webkit.org/show_bug.cgi?id=145704
1650
1651         Reviewed by Geoffrey Garen.
1652
1653         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1654         (API::ProcessPoolConfiguration::createWithLegacyOptions):
1655         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
1656         (API::ProcessPoolConfiguration::copy):
1657         * UIProcess/API/APIProcessPoolConfiguration.h:
1658         * UIProcess/API/C/WKContext.cpp:
1659         (WKContextSetApplicationCacheDirectory): Deleted.
1660         * UIProcess/API/C/WKContextConfigurationRef.cpp:
1661         (WKContextConfigurationCopyApplicationCacheDirectory):
1662         (WKContextConfigurationSetApplicationCacheDirectory):
1663         * UIProcess/API/C/WKContextConfigurationRef.h:
1664         * UIProcess/API/C/WKContextPrivate.h:
1665         * UIProcess/WebProcessPool.cpp:
1666         (WebKit::WebProcessPool::WebProcessPool):
1667         (WebKit::WebProcessPool::createNewWebProcess):
1668         (WebKit::WebProcessPool::applicationCacheDirectory): Deleted.
1669         * UIProcess/WebProcessPool.h:
1670
1671 2015-06-05  Mark Lam  <mark.lam@apple.com>
1672
1673         finally blocks should not set the exception stack trace when re-throwing the exception.
1674         https://bugs.webkit.org/show_bug.cgi?id=145525
1675
1676         Reviewed by Geoffrey Garen.
1677
1678         * WebProcess/InjectedBundle/InjectedBundle.cpp:
1679         (WebKit::InjectedBundle::reportException):
1680         - Changed to use the new Exception object.
1681
1682 2015-06-05  Anders Carlsson  <andersca@apple.com>
1683
1684         Disable the CFNetwork cache in the web process
1685         https://bugs.webkit.org/show_bug.cgi?id=145700
1686         rdar://problem/20243343
1687
1688         Reviewed by Geoffrey Garen.
1689
1690         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1691         (WebKit::NetworkCache::Storage::open):
1692         * Shared/WebProcessCreationParameters.cpp:
1693         (WebKit::WebProcessCreationParameters::WebProcessCreationParameters): Deleted.
1694         (WebKit::WebProcessCreationParameters::encode): Deleted.
1695         (WebKit::WebProcessCreationParameters::decode): Deleted.
1696         * Shared/WebProcessCreationParameters.h:
1697         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1698         (WebKit::WebProcessPool::platformInitializeWebProcess): Deleted.
1699         * UIProcess/WebProcessPool.cpp:
1700         (WebKit::WebProcessPool::createNewWebProcess): Deleted.
1701         * WebProcess/WebProcess.cpp:
1702         (WebKit::WebProcess::WebProcess): Deleted.
1703         (WebKit::WebProcess::initializeWebProcess): Deleted.
1704         * WebProcess/WebProcess.h:
1705         * WebProcess/cocoa/WebProcessCocoa.mm:
1706         (WebKit::WebProcess::platformClearResourceCaches):
1707         (WebKit::WebProcess::platformInitializeWebProcess):
1708         (WebKit::WebProcess::platformSetCacheModel): Deleted.
1709         (WebKit::WebProcess::platformTerminate): Deleted.
1710
1711 2015-06-05  Anders Carlsson  <andersca@apple.com>
1712
1713         Consolidate default website data directory computations
1714         https://bugs.webkit.org/show_bug.cgi?id=145698
1715
1716         Reviewed by Andreas Kling.
1717
1718         * UIProcess/API/APIProcessPoolConfiguration.cpp:
1719         (API::ProcessPoolConfiguration::ProcessPoolConfiguration):
1720         * UIProcess/API/APIWebsiteDataStore.h:
1721         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
1722         (API::WebsiteDataStore::defaultApplicationCacheDirectory):
1723         (API::WebsiteDataStore::defaultNetworkCacheDirectory):
1724         (API::WebsiteDataStore::defaultIndexedDBDatabaseDirectory):
1725         (API::WebsiteDataStore::defaultLocalStorageDirectory):
1726         (API::WebsiteDataStore::defaultMediaKeysStorageDirectory):
1727         (API::WebsiteDataStore::defaultWebSQLDatabaseDirectory):
1728         (API::WebsiteDataStore::defaultDataStoreConfiguration):
1729         (API::applicationCacheDirectory): Deleted.
1730
1731 2015-06-01  Jon Honeycutt  <jhoneycutt@apple.com>
1732
1733         [iOS] Uploading an animated GIF from the photo library uploads a JPEG
1734
1735         <https://bugs.webkit.org/show_bug.cgi?id=145539>
1736         <rdar://problem/19760877
1737
1738         Selecting a photo from the photo library using UIImagePickerController
1739         results in an NSDictionary with image info and a UIImage with the
1740         image. It's not possible to get the original image data from the
1741         UIImage, only a PNG or JPEG representation, so we were getting a JPEG
1742         representation and uploading that to the server. For animated GIFs,
1743         this meant a JPEG representation of the first frame.
1744
1745         To fix this, we'll get the asset URL, if available, and use the Photos
1746         API to query for the original image data.
1747
1748         Reviewed by Andy Estes and Joe Pecoraro.
1749
1750         * UIProcess/ios/forms/WKFileUploadPanel.mm:
1751         Soft link the Photos framework.
1752
1753         (-[WKFileUploadPanel _uploadItemForImageData:originalImage:imageName:successBlock:failureBlock:]):
1754         Save the image's data to a temporary location, and create a
1755         _WKImageFileUploadItem. Code moved from
1756         -_uploadItemFromMediaInfo:successBlock:failureBlock:.
1757
1758         (-[WKFileUploadPanel _uploadItemForJPEGRepresentationOfImage:successBlock:failureBlock:]):
1759         Get a JPEG representation of the UIImage, and create an upload item
1760         from that data.
1761
1762         (uploadImageNameFromUTI):
1763         Return a filename for the uploaded image based on the UTI.
1764
1765         (-[WKFileUploadPanel _uploadItemForImage:withAssetURL:successBlock:failureBlock:]):
1766         Fetch the photo asset with the given asset URL. Create an image manager
1767         object, and request the image data for the photo asset. Create an
1768         upload item from that data. If we fail, fall back to a JPEG
1769         representation.
1770
1771         (-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):
1772         Return early if the media item is not an image type. If it is, and we
1773         have an asset URL, try to create an upload item for the native image.
1774         If we don't have an asset URL, use a JPEG representation of the image.
1775
1776 2015-06-04  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1777
1778         REGRESSION(r185091): Crash happens on indexdb tests
1779         https://bugs.webkit.org/show_bug.cgi?id=145549
1780
1781         Reviewed by Darin Adler.
1782
1783         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp: Remove leakRef() use.
1784         (WebKit::WebIDBServerConnection::didCreateObjectStore):
1785         (WebKit::WebIDBServerConnection::didCreateIndex):
1786         (WebKit::WebIDBServerConnection::didDeleteIndex):
1787         (WebKit::WebIDBServerConnection::didPutRecord):
1788         (WebKit::WebIDBServerConnection::didGetRecord):
1789         (WebKit::WebIDBServerConnection::didOpenCursor):
1790         (WebKit::WebIDBServerConnection::didAdvanceCursor):
1791         (WebKit::WebIDBServerConnection::didIterateCursor):
1792         (WebKit::WebIDBServerConnection::didCount):
1793         (WebKit::WebIDBServerConnection::didDeleteRange):
1794         (WebKit::WebIDBServerConnection::didClearObjectStore):
1795         (WebKit::WebIDBServerConnection::didDeleteObjectStore):
1796         (WebKit::WebIDBServerConnection::didChangeDatabaseVersion):
1797
1798 2015-06-04  Joseph Pecoraro  <pecoraro@apple.com>
1799
1800         Web Inspector: REGRESSION: dragged node in the DOM Tree isn't positioned correctly
1801         https://bugs.webkit.org/show_bug.cgi?id=143912
1802
1803         Reviewed by Simon Fraser.
1804
1805         * UIProcess/mac/PageClientImpl.mm:
1806         (WebKit::PageClientImpl::setDragImage):
1807         When using the WKWebView, convert the position from the WKView's
1808         coordinate system to the WKWebView's.
1809
1810         * UIProcess/API/Cocoa/WKWebView.mm:
1811         (-[WKWebView draggingUpdated:]):
1812         * UIProcess/API/mac/WKView.mm:
1813         (-[WKView _dragImageForView:withImage:at:linkDrag:]):
1814         Whitespace cleanup in original drag code.
1815
1816 2015-06-04  Dan Bernstein  <mitz@apple.com>
1817
1818         Fixed the build.
1819
1820         * UIProcess/API/Cocoa/WKErrorPrivate.h:
1821
1822 2015-06-04  Dan Bernstein  <mitz@apple.com>
1823
1824         Renamed the WebKit2SandboxProfiles target to Sandbox Profiles.
1825
1826         Rubber-stamped by Anders Carlsson.
1827
1828         * WebKit2.xcodeproj/project.pbxproj: Renamed the target. For now, added an aggregate
1829         target with the old name that depends on the renamed target. We can remove it once the build
1830         system doesn’t reference to old name.
1831
1832 2015-06-03  Dan Bernstein  <mitz@apple.com>
1833
1834         [Cocoa] Expose interruptedForPolicyChangeError
1835         https://bugs.webkit.org/show_bug.cgi?id=145627
1836
1837         Reviewed by Anders Carlsson.
1838
1839         * UIProcess/API/Cocoa/WKErrorPrivate.h: Added WKErrorCodeFrameLoadInterruptedByPolicyChange with the same value as
1840         kWKErrorCodeFrameLoadInterruptedByPolicyChange.
1841
1842 2015-06-04  Chris Dumez  <cdumez@apple.com>
1843
1844         [WK2] Prune more resources from the MemoryCache before process suspension
1845         https://bugs.webkit.org/show_bug.cgi?id=145633
1846
1847         Reviewed by Andreas Kling.
1848
1849         * NetworkProcess/NetworkProcess.cpp:
1850         (WebKit::NetworkProcess::lowMemoryHandler):
1851         (WebKit::NetworkProcess::initializeNetworkProcess):
1852         (WebKit::NetworkProcess::processWillSuspendImminently):
1853         (WebKit::NetworkProcess::prepareToSuspend):
1854         * NetworkProcess/NetworkProcess.h:
1855         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
1856         (WebKit::NetworkProcess::platformLowMemoryHandler):
1857         * PluginProcess/PluginProcess.cpp:
1858         (WebKit::PluginProcess::initializeProcess):
1859
1860         Update low memory handler prototype to match WebCore changes.
1861
1862         * WebProcess/WebProcess.cpp:
1863         (WebKit::WebProcess::actualPrepareToSuspend):
1864
1865         Pass Synchronous::Yes argument to MemoryPressureHandler::releaseMemory()
1866         to request that the memory is free up synchronously (e.g. synchronous
1867         JS garbage collection) as the process is about to be suspended.
1868         Previously, the memory pressure handler was trying to detect this case
1869         by checking if the system was really under memory pressure but this was
1870         a bit hackish and it wouldn't work if the process happened to get
1871         suspended while the system was under memory pressure.
1872
1873 2015-06-03  Carlos Alberto Lopez Perez  <clopez@igalia.com>
1874
1875         [GTK] [Wayland] Build is broken on trunk
1876         https://bugs.webkit.org/show_bug.cgi?id=142879
1877
1878         Reviewed by Carlos Garcia Campos.
1879
1880         * WebProcess/WebPage/gtk/LayerTreeHostGtk.cpp:
1881         (WebKit::LayerTreeHostGtk::makeContextCurrent): When Wayland target
1882         is enabled GLNativeWindowType is not an u_int64 type.
1883         Cast contextID to avoid a build failure.
1884
1885 2015-06-03  Dan Bernstein  <mitz@apple.com>
1886
1887         Made WKBackForwardListItemPrivate.h a private header after it was added as internal in r185183.
1888
1889         * WebKit2.xcodeproj/project.pbxproj:
1890
1891 2015-06-03  Hyungwook Lee  <hyungwook.lee@navercorp.com>
1892
1893         [EFL] Implement window_object_cleared callback in EwkPageClient.
1894         https://bugs.webkit.org/show_bug.cgi?id=145603
1895
1896         Reviewed by Gyuyoung Kim.
1897
1898         We need to provide right timing for custom JS API that may need to work at the beginning of the page.
1899
1900         * UIProcess/API/efl/tests/extensions/extension_sample.cpp:
1901         * WebProcess/InjectedBundle/API/efl/ewk_page.cpp:
1902         (EwkPage::EwkPage):
1903         (EwkPage::didStartProvisionalLoadForFrame):
1904         (EwkPage::didClearWindowObjectForFrame):
1905         (EwkPage::didFinishDocumentLoadForFrame):
1906         * WebProcess/InjectedBundle/API/efl/ewk_page.h:
1907         * WebProcess/InjectedBundle/API/efl/ewk_page_private.h:
1908
1909 2015-06-03  Anders Carlsson  <andersca@apple.com>
1910
1911         Add SPI that returns the snapshot layer contents for a given back/forward list item
1912         https://bugs.webkit.org/show_bug.cgi?id=145621
1913
1914         Reviewed by Dan Bernstein.
1915
1916         * UIProcess/API/Cocoa/WKBackForwardListItem.mm:
1917         (-[WKBackForwardListItem _snapshotLayerContents]):
1918         * UIProcess/API/Cocoa/WKBackForwardListItemInternal.h:
1919         * UIProcess/API/Cocoa/WKBackForwardListItemPrivate.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKBackForwardListItemInternal.h.
1920         * WebKit2.xcodeproj/project.pbxproj:
1921
1922 2015-06-02  Hyungwook Lee  <hyungwook.lee@navercorp.com>
1923
1924         [EFL] Implement load_started callback in EwkPageClient.
1925         https://bugs.webkit.org/show_bug.cgi?id=145545
1926
1927         Reviewed by Gyuyoung Kim.
1928
1929         We need to provide load_started callback to web extension module.
1930
1931         * UIProcess/API/efl/tests/extensions/extension_sample.cpp:
1932         * WebProcess/InjectedBundle/API/efl/ewk_page.cpp:
1933         (EwkPage::EwkPage):
1934         (EwkPage::remove):
1935         (EwkPage::didStartProvisionalLoadForFrame):
1936         (EwkPage::didFinishDocumentLoadForFrame):
1937         * WebProcess/InjectedBundle/API/efl/ewk_page.h:
1938         * WebProcess/InjectedBundle/API/efl/ewk_page_private.h:
1939
1940 2015-06-02  Gavin Barraclough  <barraclough@apple.com>
1941
1942         PDFs always think they're visible on iOS.
1943         https://bugs.webkit.org/show_bug.cgi?id=145493
1944         <rdar://problem/19668879>
1945
1946         Reviewed by Andreas Kling & Sam Weinig.
1947
1948         The problem here is that WKContentView is currently responsible for notifying the WebPageProxy
1949         that the visibility may have changed, but when a PDF isn't showing the WKContentView isn't in
1950         the view hierarchy and doesn't receive the didMoveToWindow notifications – and the WKPDFView
1951         (which is in the view hierarchy) does not listen for these events.
1952
1953         Visibility of the page should really just track the visibility of the WKWebView (and when
1954         actually assessing the visibility it largely does - the page client checks the web view's
1955         visibility, bar a FIXME, and the foreground/background check, which needs to change).
1956         So notifications should really just come from the WKWebView.
1957
1958         The WKWebView already listens for the didMoveToWindow notification, it just was only updating
1959         the IsInWindow flag. Instead just update all flags, and the call to viewStateDidChange from
1960         WKContentView can just be removed.
1961
1962         There is one problem with this in that it would reverse the order of the calls to
1963         viewStateDidChange & _updateForScreen:, which would mean the the view would become visible before
1964         updating the screen pixel density. To fix this, moving the call to _updateForScreen:
1965         to willMoveToWindow:, to ensure it occurs before the page becomes visible.
1966
1967         This will also change behavior on Mac for WKWebView clients, in coalescing all view state changes
1968         within the didMoveToWindow call. This is the direction we intended to go in anyway (the plan is
1969         to remove the mayHaveChanged argument from viewStateDidChange - we're currently adding unnecessary
1970         IPC traffic).
1971
1972         * UIProcess/API/Cocoa/WKWebView.mm:
1973         (-[WKWebView didMoveToWindow]):
1974             - should update all view state flags.
1975         * UIProcess/API/ios/WKViewIOS.mm:
1976         (-[WKView didMoveToWindow]):
1977             - added to match WKWebView.mm, for WebKitTestRunner.
1978         * UIProcess/ios/WKContentView.mm:
1979         (-[WKContentView willMoveToWindow:]):
1980             - should _updateForScreen:
1981         (-[WKContentView didMoveToWindow]): Deleted.
1982             - functionality moved to -[WKWebView didMoveToWindow], -[WKContentView didMoveToWindow].
1983
1984 2015-06-02  Chris Dumez  <cdumez@apple.com>
1985
1986         [iOS][WK2] Always mark layers as volatile for background pages
1987         https://bugs.webkit.org/show_bug.cgi?id=145547
1988         <rdar://problem/20663184>
1989
1990         Reviewed by Simon Fraser.
1991
1992         We previously marked layers as volatile when the WebProcess was about
1993         to be suspended. Most of the time the WebProcess gets suspended when a
1994         page goes into the background. However, it is not always true (see
1995         radar), in which case the layers won't be marked as volatile and use
1996         memory even though they are not visible.
1997
1998         We now mark layers as volatile as soon as the page goes into the
1999         background, instead of relying on the WebProcess suspension mechanism
2000         to do so.
2001
2002         A new ApplicationDidEnterBackground IPC message from the UIProcess to
2003         the WebProcess is added (in addition to the pre-existing
2004         ApplicationWillEnterForeground one). When the WebProcess receives this
2005         message, it will freeze the layer tree state and mark the layers as
2006         volatile (with a timer to keep retrying if needed), similarly to what
2007         is already done in WebProcess::actualPrepareToSuspend().
2008         When the ApplicationWillEnterForeground is received, we unfreeze the
2009         layer tree state. The layers' volatile state will be automatically
2010         updated when they are displayed (see setBufferVolatility() call in
2011         RemoteLayerBackingStore::display()).
2012
2013         * UIProcess/WebPageProxy.h:
2014         * UIProcess/ios/WKContentView.mm:
2015         (-[WKContentView _applicationDidEnterBackground:]):
2016         * UIProcess/ios/WebPageProxyIOS.mm:
2017         (WebKit::WebPageProxy::applicationDidEnterBackground):
2018         * WebProcess/WebPage/WebPage.cpp:
2019         (WebKit::WebPage::WebPage):
2020         (WebKit::WebPage::setLayerTreeStateIsFrozen):
2021         (WebKit::WebPage::markLayersVolatileImmediatelyIfPossible):
2022         * WebProcess/WebPage/WebPage.h:
2023         * WebProcess/WebPage/WebPage.messages.in:
2024         * WebProcess/WebPage/ios/WebPageIOS.mm:
2025         (WebKit::WebPage::volatilityTimerFired):
2026         (WebKit::WebPage::applicationDidEnterBackground):
2027         (WebKit::WebPage::applicationWillEnterForeground):
2028         * WebProcess/WebProcess.cpp:
2029         (WebKit::WebProcess::markAllLayersVolatileIfPossible):
2030         (WebKit::WebProcess::setAllLayerTreeStatesFrozen):
2031
2032 2015-06-02  Brady Eidson  <beidson@apple.com>
2033
2034         WebKit policy delegate should suggest if a navigation should be allowed to open URLs externally.
2035         rdar://problem/21025301 and https://bugs.webkit.org/show_bug.cgi?id=145280
2036         
2037         Reviewed by Alex Christensen.
2038
2039         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2040         (WebKit::PDFPlugin::clickedLink):
2041         
2042         * WebProcess/Plugins/PluginView.cpp:
2043         (WebKit::PluginView::performFrameLoadURLRequest):
2044         (WebKit::PluginView::loadURL):
2045         
2046         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
2047         (WebKit::WebContextMenuClient::searchWithGoogle):
2048         
2049         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2050         (WebKit::WebFrameLoaderClient::dispatchCreatePage):
2051         
2052         * WebProcess/WebPage/WebInspector.cpp:
2053         (WebKit::WebInspector::openInNewTab):
2054         
2055         * WebProcess/WebPage/WebPage.cpp:
2056         (WebKit::WebPage::loadURLInFrame):
2057         (WebKit::WebPage::loadRequest):
2058         (WebKit::WebPage::loadDataImpl):
2059         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
2060
2061 2015-06-02  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2062
2063         REGRESSION(r185091): Crash happens on indexdb tests
2064         https://bugs.webkit.org/show_bug.cgi?id=145549
2065
2066         Reviewed by Csaba Osztrogonác.
2067
2068         r185091 caused crash on some indexeddb tests. The crash happens because IDBDatabaseError::create() doesn't
2069         dereference count by using ptr(). It makes a crash when dereferencing on ~Ref() destructor. To fix this issue,
2070         this patch uses leakRef() instead of ptr().
2071
2072         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
2073         (WebKit::WebIDBServerConnection::didCreateObjectStore):
2074         (WebKit::WebIDBServerConnection::didCreateIndex):
2075         (WebKit::WebIDBServerConnection::didDeleteIndex):
2076         (WebKit::WebIDBServerConnection::didPutRecord):
2077         (WebKit::WebIDBServerConnection::didGetRecord):
2078         (WebKit::WebIDBServerConnection::didOpenCursor):
2079         (WebKit::WebIDBServerConnection::didAdvanceCursor):
2080         (WebKit::WebIDBServerConnection::didIterateCursor):
2081         (WebKit::WebIDBServerConnection::didCount):
2082         (WebKit::WebIDBServerConnection::didDeleteRange):
2083         (WebKit::WebIDBServerConnection::didClearObjectStore):
2084         (WebKit::WebIDBServerConnection::didDeleteObjectStore):
2085         (WebKit::WebIDBServerConnection::didChangeDatabaseVersion):
2086
2087 2015-06-01  Enrica Casucci  <enrica@apple.com>
2088
2089         [iOS] Hardware Keyboard: All combinations for arrow keys with Shift do not extend the selection.
2090         https://bugs.webkit.org/show_bug.cgi?id=145538
2091         rdar://problem/18504199
2092
2093         Reviewed by Darin Adler.
2094
2095         The extend parameter was ignored in all the functions below.
2096
2097         * UIProcess/ios/WKContentViewInteraction.mm:
2098         (-[WKContentView _moveUp:withHistory:]):
2099         (-[WKContentView _moveDown:withHistory:]):
2100         (-[WKContentView _moveLeft:withHistory:]):
2101         (-[WKContentView _moveRight:withHistory:]):
2102         (-[WKContentView _moveToStartOfWord:withHistory:]):
2103         (-[WKContentView _moveToStartOfParagraph:withHistory:]):
2104         (-[WKContentView _moveToStartOfLine:withHistory:]):
2105         (-[WKContentView _moveToStartOfDocument:withHistory:]):
2106         (-[WKContentView _moveToEndOfWord:withHistory:]):
2107         (-[WKContentView _moveToEndOfParagraph:withHistory:]):
2108         (-[WKContentView _moveToEndOfLine:withHistory:]):
2109         (-[WKContentView _moveToEndOfDocument:withHistory:]):
2110
2111 2015-06-01  Anders Carlsson  <andersca@apple.com>
2112
2113         Use xpc_connection_set_oneshot_instance where possible
2114         https://bugs.webkit.org/show_bug.cgi?id=145535
2115         rdar://problem/21109994
2116
2117         Reviewed by Sam Weinig.
2118
2119         Use xpc_connection_set_oneshot_instance where possible; this will make sure that the 
2120         web process instances go away when the web process exits.
2121
2122         * UIProcess/Launcher/mac/ProcessLauncherMac.mm:
2123         (WebKit::connectToService):
2124         (WebKit::connectToReExecService):
2125
2126 2015-06-01  Enrica Casucci  <enrica@apple.com>
2127
2128         [iOS] Hardware Keyboard: Command + left arrow does not work.
2129         https://bugs.webkit.org/show_bug.cgi?id=145531
2130         rdar://problem/18576402
2131
2132         Reviewed by Anders Carlsson.
2133
2134         We were calling a non existent command (moveToStartOfLine) instead of
2135         moveToBeginningOfLine.
2136
2137         * UIProcess/ios/WKContentViewInteraction.mm:
2138         (-[WKContentView _moveToStartOfLine:withHistory:]):
2139
2140 2015-06-01  Brady Eidson  <beidson@apple.com>
2141
2142         Add WKTR support for "should open external URLs".
2143         https://bugs.webkit.org/show_bug.cgi?id=145505
2144
2145         Reviewed by Darin Adler.
2146
2147         Expose C-spi to allow WKTR to set this bit on new loads:
2148         * UIProcess/API/C/WKPage.cpp:
2149         (WKPageLoadURLWithShouldOpenExternalURLsPolicy):
2150         * UIProcess/API/C/WKPagePrivate.h:
2151         
2152         Expose the bit on NavigationAction for the policy delegate:        
2153         * WebProcess/InjectedBundle/API/c/WKBundleNavigationAction.cpp:
2154         (WKBundleNavigationActionGetShouldOpenExternalURLs):
2155         * WebProcess/InjectedBundle/API/c/WKBundleNavigationActionPrivate.h: Copied from Tools/WebKitTestRunner/WorkQueueManager.h.
2156
2157         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.cpp:
2158         (WebKit::InjectedBundleNavigationAction::InjectedBundleNavigationAction):
2159         * WebProcess/InjectedBundle/InjectedBundleNavigationAction.h:
2160         (WebKit::InjectedBundleNavigationAction::shouldOpenExternalURLs):
2161     
2162         * WebKit2.xcodeproj/project.pbxproj:
2163
2164 2015-06-01  Gavin Barraclough  <barraclough@apple.com>
2165
2166         PDFs always think they're visible on iOS.
2167         https://bugs.webkit.org/show_bug.cgi?id=145493
2168         <rdar://problem/19668879>
2169
2170         Unreviewed roll-out.
2171
2172         Temporarily reverting this change – will need a workaround for test harness craziness.
2173
2174         * UIProcess/API/Cocoa/WKWebView.mm:
2175         (-[WKWebView didMoveToWindow]):
2176         (-[WKWebView setOpaque:]):
2177         * UIProcess/ios/WKContentView.mm:
2178         (-[WKContentView willMoveToWindow:]):
2179         (-[WKContentView didMoveToWindow]):
2180         (-[WKContentView browsingContextController]):
2181
2182 2015-06-01  Csaba Osztrogonác  <ossy@webkit.org>
2183
2184         [EFL] Remove unused const variable from EwkView.cpp
2185         https://bugs.webkit.org/show_bug.cgi?id=145512
2186
2187         Reviewed by Gyuyoung Kim.
2188
2189         * UIProcess/API/efl/EwkView.cpp:
2190
2191 2015-06-01  Csaba Osztrogonác  <ossy@webkit.org>
2192
2193         [cmake] Suppress unused parameter warnings in WebKit2 and TestNetscapePlugIn
2194         https://bugs.webkit.org/show_bug.cgi?id=145264
2195
2196         Reviewed by Carlos Garcia Campos.
2197
2198         * CMakeLists.txt: Use COMPILE_FLAGS instead of CMAKE_<C|CXX>_FLAGS to put -Wno-unused-parameter after -Wextra.
2199
2200 2015-05-31  Gavin Barraclough  <barraclough@apple.com>
2201
2202         PDFs always think they're visible on iOS.
2203         https://bugs.webkit.org/show_bug.cgi?id=145493
2204         <rdar://problem/19668879>
2205
2206         Reviewed by Andreas Kling.
2207
2208         The problem here is that WKContentView is currently responsible for notifying the WebPageProxy
2209         that the visibility may have changed, but when a PDF isn't showing the WKContentView isn't in
2210         the view hierarchy and doesn't receive the didMoveToWindow notifications – and the WKPDFView
2211         (which is in the view hierarchy) does not listen for these events.
2212
2213         Visibility of the page should really just track the visibility of the WKWebView (and when
2214         actually assessing the visibility it largely does - the page client checks the web view's
2215         visibility, bar a FIXME, and the foreground/background check, which needs to change).
2216         So notifications should really just come from the WKWebView.
2217
2218         The WKWebView already listens for the didMoveToWindow notification, it just was only updating
2219         the IsInWindow flag. Instead just update all flags, and the call to viewStateDidChange from
2220         WKContentView can just be removed.
2221
2222         There is one problem with this in that it would reverse the order of the calls to
2223         viewStateDidChange & _updateForScreen:, which would mean the the view would become visible before
2224         updating the screen pixel density. To fix this, move the call to _updateForScreen: to
2225         willMoveToWindow:, to ensure it occurs before the page becomes visible.
2226
2227         This will also change behavior on Mac for WKWebView clients, in coalescing all view state changes
2228         within the didMoveToWindow call. This is the direction we intended to go in anyway (the plan is
2229         to remove the mayHaveChanged argument from viewStateDidChange - we're currently adding unnecessary
2230         IPC traffic).
2231
2232         * UIProcess/API/Cocoa/WKWebView.mm:
2233         (-[WKWebView didMoveToWindow]):
2234             - should update all view state flags.
2235         * UIProcess/ios/WKContentView.mm:
2236         (-[WKContentView willMoveToWindow:]):
2237             - should _updateForScreen:
2238         (-[WKContentView didMoveToWindow]): Deleted.
2239             - functionality moved to -[WKWebView didMoveToWindow], -[WKContentView didMoveToWindow].
2240
2241 2015-05-30  Brady Eidson  <beidson@apple.com>
2242
2243         Make FrameLoader methods that take PassRefPtr<Event> take raw pointers instead.
2244         https://bugs.webkit.org/show_bug.cgi?id=145495
2245
2246         Reviewed by Alexey Proskuryakov.
2247
2248         * WebProcess/WebPage/WebPage.cpp:
2249         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick):
2250
2251 2015-05-29  Joseph Pecoraro  <pecoraro@apple.com>
2252
2253         Web Inspector: Crash closing a related tab with Web Inspector open while page is refreshing
2254         https://bugs.webkit.org/show_bug.cgi?id=145488
2255
2256         Reviewed by Alexey Proskuryakov.
2257
2258         * WebProcess/WebPage/WebInspector.h:
2259         * WebProcess/WebPage/WebInspector.cpp:
2260         (WebKit::WebInspector::~WebInspector):
2261         Ensure, no matter how we close, that we have invalidated the
2262         frontend connection of which we are the client.
2263
2264         (WebKit::WebInspector::createInspectorPage):
2265         This member variable will never be null.
2266
2267 2015-05-29  Andreas Kling  <akling@apple.com>
2268
2269         [iOS] When bouncing back from max pinch zoom scale, scaleChangeRate should be 0.
2270         <https://webkit.org/b/145487>
2271         <rdar://problem/20989389>
2272
2273         Reviewed by Benjamin Poulain.
2274
2275         Make sure we don't send WebCore some velocity data with non-zero scaleChangeRate
2276         when we bounce back from being pinch-zoomed past the maximum scale.
2277
2278         This fixes an issue where the bounce-back animation would cause a burst of
2279         unnecessary tile generation.
2280
2281         * WebProcess/WebPage/ios/WebPageIOS.mm:
2282         (WebKit::adjustVelocityDataForBoundedScale):
2283         (WebKit::WebPage::updateVisibleContentRects):
2284
2285 2015-05-29  Jon Lee  <jonlee@apple.com>
2286
2287         Fix preferences for wireless playback
2288         https://bugs.webkit.org/show_bug.cgi?id=145477
2289         rdar://problem/21166767
2290
2291         Reviewed by Anders Carlsson.
2292
2293         * UIProcess/API/C/WKPreferences.cpp: Add missing preference calls in C API.
2294         * UIProcess/API/C/WKPreferencesRef.h:
2295
2296 2015-05-29  Enrica Casucci  <enrica@apple.com>
2297
2298         [iOS] Cursor hidden in text area once it scrolls.
2299         https://bugs.webkit.org/show_bug.cgi?id=145451
2300         rdar://problem/20356413
2301
2302         Reviewed by Simon Fraser.
2303
2304         This patch fixes both the touch scrolling inside the
2305         overflow area as well as the programmatic scroll that
2306         occurs when inserting a new line. The first issue is fixed by
2307         implementing the chrome client methods didLayout,
2308         didStartOverflowScroll and didEndOverflowScroll. The second
2309         required changing the implementation of notifyRevealedSelectionByScrollingFrame.
2310         We not only need to notify the client to redraw the selection,
2311         but we also need to recompute the editorState, because scrolling
2312         might have occurred.
2313         I've removed the NotifyRevealedSelection message that was not needed
2314         any longer, since EditorStateChanged will do exactly what we want.
2315
2316         * UIProcess/WebPageProxy.h:
2317         * UIProcess/WebPageProxy.messages.in:
2318         * UIProcess/ios/WebPageProxyIOS.mm:
2319         (WebKit::WebPageProxy::editorStateChanged):
2320         (WebKit::WebPageProxy::notifyRevealedSelection): Deleted.
2321         * WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
2322         (WebKit::WebChromeClient::notifyRevealedSelectionByScrollingFrame):
2323         (WebKit::WebChromeClient::didLayout):
2324         (WebKit::WebChromeClient::didStartOverflowScroll):
2325         (WebKit::WebChromeClient::didEndOverflowScroll):
2326
2327 2015-05-29  Chris Dumez  <cdumez@apple.com>
2328
2329         [iOS] Update WebContent process sandbox profile for AWD logging
2330         https://bugs.webkit.org/show_bug.cgi?id=145473
2331         <rdar://problem/20543269>
2332
2333         Reviewed by Darin Adler.
2334
2335         Update WebContent process sandbox profile for AWD logging.
2336
2337         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
2338
2339 2015-05-29  Anders Carlsson  <andersca@apple.com>
2340
2341         WebKit.framework installs or references Mac-only headers on iOS
2342         https://bugs.webkit.org/show_bug.cgi?id=145471
2343         rdar://problem/21161459
2344
2345         Reviewed by Dan Bernstein.
2346
2347         * UIProcess/API/C/mac/WKInspectorPrivateMac.h:
2348         Add an #if !TARGET_OS_IPHONE guard around the entire header.
2349
2350 2015-05-29  Anders Carlsson  <andersca@apple.com>
2351
2352         WKScriptMessageInternal.h should be a project header, not a private header
2353         https://bugs.webkit.org/show_bug.cgi?id=145464
2354         rdar://problem/21161639
2355
2356         Reviewed by Dan Bernstein.
2357
2358         * WebKit2.xcodeproj/project.pbxproj:
2359
2360 2015-05-28  Alexey Proskuryakov  <ap@apple.com>
2361
2362         Clean up VisitedLinkProvider teardown
2363         https://bugs.webkit.org/show_bug.cgi?id=145450
2364         rdar://problem/20244726
2365
2366         Reviewed by Brady Eidson.
2367
2368         * UIProcess/VisitedLinkProvider.cpp:
2369         (WebKit::VisitedLinkProvider::~VisitedLinkProvider):
2370
2371 2015-05-28  Brady Eidson  <beidson@apple.com>
2372
2373         Change method of signaling "should open external urls" to WebKit.
2374         https://bugs.webkit.org/show_bug.cgi?id=145454
2375
2376         Reviewed by Dan Bernstein.
2377
2378         Making this a property on the request was never a good idea.
2379
2380         Adding a new extensible load SPI seems much better.
2381
2382         * Shared/API/Cocoa/_WKNSURLRequestExtras.h: Removed.
2383         * Shared/API/Cocoa/_WKNSURLRequestExtras.mm: Removed.
2384
2385         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
2386         (-[WKBrowsingContextController loadRequest:userData:]): Since this API is deprecated,
2387           it always gets the default restrictive behavior.
2388
2389         * UIProcess/API/Cocoa/WKWebView.mm:
2390         (-[WKWebView loadRequest:]):
2391         (-[WKWebView loadRequest:withOptions:]): Take an options dictionary that, for now, 
2392           only supports one option.
2393         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2394
2395         * WebKit2.xcodeproj/project.pbxproj:
2396
2397 2015-05-28  Anders Carlsson  <andersca@apple.com>
2398
2399         Make sure that we create the private WebKit.framework symlinks last
2400         https://bugs.webkit.org/show_bug.cgi?id=145442
2401         <rdar://problem/21142213>
2402
2403         Reviewed by Dan Bernstein.
2404
2405         Move the "Add Symlinks in /System/Library/PrivateFrameworks/WebKit.framework" build phase to
2406         the "All" aggregate target. Also update the script now that INSTALL_PATH is different.
2407
2408         * WebKit2.xcodeproj/project.pbxproj:
2409
2410 2015-05-28  Said Abou-Hallawa  <sabouhallawa@apple.com>
2411
2412         Code clean up for extracting information from the mix of WritingMode and TextDirection
2413         https://bugs.webkit.org/show_bug.cgi?id=143399
2414
2415         Reviewed by Darin Adler.
2416
2417         * Shared/WebPopupItem.h:
2418         * UIProcess/API/C/efl/WKAPICastEfl.h:
2419         * UIProcess/WebPopupMenuProxy.h:
2420         enum TextDirection is moved from TextFlags.h to WritingMode.h. So include
2421         WritingMode.h instead of including TextFlags.h.
2422
2423 2015-05-28  Antti Koivisto  <antti@apple.com>
2424
2425         Disable network cache for old clients
2426         https://bugs.webkit.org/show_bug.cgi?id=145418
2427
2428         Reviewed by Andreas Kling.
2429
2430         Follow-up: Don't do linked-on-or-after checks for iOS Safari.
2431
2432         * UIProcess/Cocoa/VersionChecks.mm:
2433         (WebKit::linkTimeVersion):
2434         (WebKit::linkedOnOrAfter):
2435
2436 2015-05-28  Matt Rajca  <mrajca@apple.com>
2437
2438         Add ENABLE_MEDIA_SESSION feature flag (which is off by default).
2439         https://bugs.webkit.org/show_bug.cgi?id=145415
2440
2441         Reviewed by Eric Carlson.
2442
2443         * Configurations/FeatureDefines.xcconfig:
2444
2445 2015-05-28  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2446
2447         Unreviewed, Fix build break since r184930.
2448
2449         * UIProcess/Storage/StorageManager.cpp:
2450         (WebKit::StorageManager::createTransientLocalStorageMap): Pass a pointer of SecurityOrigin
2451         in isSameSchemeHostPort().
2452
2453 2015-05-28  Zan Dobersek  <zdobersek@igalia.com>
2454
2455         Unreviewed. Fixing the build after r184950.
2456
2457         * UIProcess/Storage/StorageManager.cpp:
2458         (WebKit::StorageManager::createSessionStorageMap): getOrCreateStorageArea()
2459         now expects a Ref<WebCore::SecurityOrigin> object.
2460
2461 2015-05-28  Zan Dobersek  <zdobersek@igalia.com>
2462
2463         [WK2] Handle WebCore::SecurityOrigin objects through Ref<> where possible
2464         https://bugs.webkit.org/show_bug.cgi?id=145373
2465
2466         Reviewed by Andreas Kling.
2467
2468         WebCore::SecurityOrigin creation functions in most cases return a
2469         Ref<WebCore::SecurityOrigin> object. In the WebKit2 layer, those objects
2470         were still largely converted to RefPtr<>s.
2471
2472         This patch switches to using Ref<> where possible. The remaining uses of
2473         RefPtr<WebCore::SecurityOrigin> are present due to HashTables, to-be-copied
2474         Vectors, WebCore::DatabaseManager::origins() API and code where non-null
2475         WebCore::SecurityOrigin can't be guaranteed.
2476
2477         * DatabaseProcess/DatabaseProcess.cpp:
2478         (WebKit::DatabaseProcess::deleteIndexedDatabaseEntriesForOrigin):
2479         * NetworkProcess/NetworkProcess.cpp:
2480         (WebKit::cfURLCacheOrigins):
2481         * UIProcess/Storage/LocalStorageDatabase.cpp:
2482         (WebKit::LocalStorageDatabase::create):
2483         (WebKit::LocalStorageDatabase::LocalStorageDatabase):
2484         (WebKit::LocalStorageDatabase::openDatabase):
2485         (WebKit::LocalStorageDatabase::close):
2486         * UIProcess/Storage/LocalStorageDatabase.h:
2487         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
2488         (WebKit::LocalStorageDatabaseTracker::origins):
2489         * UIProcess/Storage/LocalStorageDatabaseTracker.h:
2490         * UIProcess/Storage/StorageManager.cpp:
2491         (WebKit::StorageManager::StorageArea::securityOrigin):
2492         (WebKit::StorageManager::TransientLocalStorageNamespace::getOrCreateStorageArea):
2493         (WebKit::StorageManager::TransientLocalStorageNamespace::origins):
2494         (WebKit::StorageManager::TransientLocalStorageNamespace::clearStorageAreasMatchingOrigin):
2495         (WebKit::StorageManager::StorageArea::create):
2496         (WebKit::StorageManager::StorageArea::StorageArea):
2497         (WebKit::StorageManager::StorageArea::openDatabaseAndImportItemsIfNeeded):
2498         (WebKit::StorageManager::LocalStorageNamespace::getOrCreateStorageArea):
2499         (WebKit::StorageManager::LocalStorageNamespace::didDestroyStorageArea):
2500         (WebKit::StorageManager::SessionStorageNamespace::origins):
2501         (WebKit::StorageManager::SessionStorageNamespace::clearStorageAreasMatchingOrigin):
2502         (WebKit::StorageManager::SessionStorageNamespace::getOrCreateStorageArea):
2503         * UIProcess/WebPageProxy.cpp:
2504         (WebKit::WebPageProxy::reachedApplicationCacheOriginQuota):
2505         * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp:
2506         (WebKit::WebApplicationCacheManager::getApplicationCacheOrigins):
2507         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2508         (WebKit::InjectedBundle::setApplicationCacheOriginQuota):
2509         (WebKit::InjectedBundle::resetApplicationCacheOriginQuota):
2510         * WebProcess/ResourceCache/WebResourceCacheManager.cpp:
2511         (WebKit::WebResourceCacheManager::returnCacheOrigins):
2512         (WebKit::WebResourceCacheManager::clearCacheForOrigin):
2513         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
2514         (WebKit::WebDatabaseManager::deleteDatabaseWithNameForOrigin):
2515         (WebKit::WebDatabaseManager::deleteDatabasesForOrigin):
2516         (WebKit::WebDatabaseManager::setQuotaForOrigin):
2517
2518 2015-05-19  Jon Honeycutt  <jhoneycutt@apple.com>
2519
2520         [iOS] When viewing an MJPEG stream as the main resource, only the first
2521         frame paints
2522
2523         <https://bugs.webkit.org/show_bug.cgi?id=145185>
2524         <rdar://problem/20124694>
2525
2526         Reviewed by Darin Adler.
2527
2528         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2529         (WebKit::WebFrameLoaderClient::willReplaceMultipartContent):
2530         Tell the WebPage that we will replace multipart content.
2531
2532         (WebKit::WebFrameLoaderClient::didReplaceMultipartContent):
2533         Tell the WebPage that we did replace multipart content.
2534
2535         * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
2536         * WebProcess/WebPage/DrawingArea.h:
2537
2538         * WebProcess/WebPage/WebPage.cpp:
2539         (WebKit::WebPage::willReplaceMultipartContent):
2540         Save the exposed content rect.
2541         (WebKit::WebPage::didReplaceMultipartContent):
2542         Restore the exposed content rect that was saved before this load. This
2543         fixes the issue for WK2.
2544
2545         * WebProcess/WebPage/WebPage.h:
2546
2547         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
2548         * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
2549         (WebKit::RemoteLayerTreeDrawingArea::exposedContentRect):
2550
2551 2015-05-22  Jon Lee  <jonlee@apple.com>
2552
2553         Fix macros for wireless playback
2554         https://bugs.webkit.org/show_bug.cgi?id=145239
2555         rdar://problem/21049541
2556
2557         Reviewed by Anders Carlsson.
2558
2559         Encompass the logic within ENABLE(WIRELESS_TARGET_PLAYBACK). Update property name.
2560
2561         * UIProcess/API/Cocoa/WKWebView.mm:
2562         (-[WKWebView initWithFrame:configuration:]):
2563         * UIProcess/API/Cocoa/WKWebViewConfiguration.h: Update names. Add a WKDeprecated
2564         category section.
2565         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
2566         (-[WKWebViewConfiguration init]): Update name of variables to reflect new property names.
2567         (-[WKWebViewConfiguration copyWithZone:]): Ditto.
2568         (-[WKWebViewConfiguration mediaPlaybackAllowsAirPlay]): Get and set off of the new
2569         variable.
2570         (-[WKWebViewConfiguration setMediaPlaybackAllowsAirPlay:]): Ditto.
2571         (-[WKWebViewConfiguration mediaPlaybackRequiresUserAction]): Ditto.
2572         (-[WKWebViewConfiguration setMediaPlaybackRequiresUserAction:]): Ditto.
2573
2574 2015-05-27  Brady Eidson  <beidson@apple.com>
2575
2576         Add a "should open urls externally" flag to DocumentLoader.
2577         rdar://problem/21025301 and https://bugs.webkit.org/show_bug.cgi?id=145417
2578
2579         Reviewed by Geoff Garen.
2580
2581         Rename "user initiated" to "should open external URLs":
2582         * Shared/API/Cocoa/_WKNSURLRequestExtras.h:
2583         * Shared/API/Cocoa/_WKNSURLRequestExtras.mm:
2584         (-[NSURLRequest _web_shouldOpenExternalURLs]):
2585         (-[NSMutableURLRequest _web_setShouldOpenExternalURLs:]):
2586         (-[NSURLRequest _web_isUserInitiated]): Deleted.
2587         (-[NSMutableURLRequest _web_setIsUserInitiated:]): Deleted.
2588         
2589         Hold the new flag as a bool, and encode/decode it across IPC:
2590         * Shared/NavigationActionData.cpp:
2591         (WebKit::NavigationActionData::encode):
2592         (WebKit::NavigationActionData::decode):
2593         (WebKit::NavigationActionData::NavigationActionData): Deleted.
2594         * Shared/NavigationActionData.h:
2595
2596         * UIProcess/API/APINavigationAction.h: Add accessor for the bool flag.
2597
2598         * UIProcess/API/C/WKPage.cpp:
2599         (WKPageLoadURLWithUserData): Use "ShouldNotAllow" in the legacy C API for now.
2600         (WKPageLoadURLRequestWithUserData): Ditto.
2601
2602         * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
2603         (-[WKBrowsingContextController loadRequest:userData:]): Set the value of the flag
2604           based on whether or not the initiating NSURLRequest was user initiated.
2605
2606         * UIProcess/API/Cocoa/WKNavigationAction.mm:
2607         (-[WKNavigationAction _shouldOpenExternalURLs]): Add accessor for the bool flag.
2608         * UIProcess/API/Cocoa/WKNavigationActionPrivate.h:
2609
2610         * UIProcess/API/Cocoa/WKWebView.mm:
2611         (-[WKWebView loadRequest:]): Set the value of the flag based on whether or not the
2612           initiating NSURLRequest was user initiated.
2613
2614         * UIProcess/WebPageProxy.cpp:
2615         (WebKit::WebPageProxy::loadRequest): Pass the value down to the WebProcess to load.
2616         (WebKit::WebPageProxy::loadFile): Ditto, but always with "ShouldNotAllow".
2617         * UIProcess/WebPageProxy.h:
2618
2619         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2620         (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): Translate 
2621           the NavigationAction flag to a bool in the NavigationActionData object.
2622
2623         * WebProcess/WebPage/WebPage.cpp:
2624         (WebKit::WebPage::loadRequest): Set the value of the flag in the FrameLoadRequest that
2625           will be loaded.
2626         * WebProcess/WebPage/WebPage.h:
2627         * WebProcess/WebPage/WebPage.messages.in:
2628
2629 2015-05-27  Anders Carlsson  <andersca@apple.com>
2630
2631         Can't load local files in WKWebView from containerized app
2632         https://bugs.webkit.org/show_bug.cgi?id=145424
2633         rdar://problem/20831176
2634
2635         Reviewed by Dan Bernstein.
2636
2637         Allow the network process to load local files from its bundle as long as it has
2638         the sandbox extensions to do so.
2639
2640         This was originally added to only allow SSO to read the Info.plist inside its own application
2641         bundle, but being able to read the application bundle from within the network process should be OK.
2642
2643         * Resources/SandboxProfiles/ios/com.apple.WebKit.Networking.sb:
2644
2645 2015-05-27  Andreas Kling  <akling@apple.com>
2646
2647         [WK2] Local storage areas should get torn down when they have no remaining references.
2648         <https://webkit.org/b/143339>
2649         <rdar://problem/20156436>
2650
2651         Reviewed by Darin Adler.
2652
2653         Let StorageNamespaceImpl own its StorageAreaMaps weakly instead of through RefPtr.
2654         Ownership is flipped so that StorageAreaMap refs the StorageNamespaceImpl instead.
2655         This allows the StorageAreaMaps to get destroyed once all of its clients are gone.
2656
2657         Practically speaking, this means that the garbage collector now decides when local
2658         storage databases can be closed, instead of us keeping them open for the lifetime
2659         of the web process.
2660
2661         For session storage, it works a bit differently. In the web process, they get torn
2662         down when their last client disappears, but they stay alive in the UI process.
2663         If/when the web process asks the UI process to open session storage for an origin,
2664         the UI process checks if one already exists, and if so, just updates the ID of the
2665         old storage with the new one provided by the web process.
2666
2667         * UIProcess/Storage/StorageManager.cpp:
2668         (WebKit::StorageManager::StorageArea::isSessionStorage):
2669         (WebKit::StorageManager::createTransientLocalStorageMap):
2670         (WebKit::StorageManager::createSessionStorageMap):
2671         (WebKit::StorageManager::destroyStorageMap):
2672         * WebProcess/Storage/StorageAreaImpl.cpp:
2673         (WebKit::StorageAreaImpl::securityOrigin):
2674         * WebProcess/Storage/StorageAreaImpl.h:
2675         * WebProcess/Storage/StorageAreaMap.cpp:
2676         (WebKit::StorageAreaMap::StorageAreaMap):
2677         (WebKit::StorageAreaMap::~StorageAreaMap):
2678         * WebProcess/Storage/StorageAreaMap.h:
2679         (WebKit::StorageAreaMap::securityOrigin):
2680         * WebProcess/Storage/StorageNamespaceImpl.cpp:
2681         (WebKit::StorageNamespaceImpl::didDestroyStorageAreaMap):
2682         (WebKit::StorageNamespaceImpl::storageArea):
2683         * WebProcess/Storage/StorageNamespaceImpl.h:
2684
2685 2015-05-27  Antti Koivisto  <antti@apple.com>
2686
2687         Disable network cache for old clients
2688         https://bugs.webkit.org/show_bug.cgi?id=145418
2689         rdar://problem/21126587
2690
2691         Reviewed by Andy Estes.
2692
2693         Old clients might use NSURLCache API to clear the cache. New cache requires use of new APIs.
2694
2695         * UIProcess/Cocoa/VersionChecks.h: Added.
2696         * UIProcess/Cocoa/VersionChecks.mm: Added.
2697
2698             Add linked-on-or-after check mechanism similar to WebKit1.
2699
2700         (WebKit::linkTimeVersion):
2701         (WebKit::linkedOnOrAfter):
2702         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
2703         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
2704
2705             Use it when deciding whether to enable the cache.
2706
2707         * WebKit2.xcodeproj/project.pbxproj:
2708
2709 2015-05-27  Dean Jackson  <dino@apple.com>
2710
2711         img.currentSrc problem in strict mode with old picturefill
2712         https://bugs.webkit.org/show_bug.cgi?id=144095
2713         <rdar://problem/21087013>
2714
2715         Reviewed by Simon Fraser.
2716
2717         Add a PICTURE_SIZES flag.
2718
2719         * Configurations/FeatureDefines.xcconfig:
2720
2721 2015-05-27  Chris Dumez  <cdumez@apple.com>
2722
2723         Assertion hit in WebPage::didChangeSelection()
2724         https://bugs.webkit.org/show_bug.cgi?id=145413
2725         <rdar://problem/21001129>
2726
2727         Reviewed by Ryosuke Niwa.
2728
2729         We sometimes hit the "ASSERT(layoutCount == view->layoutCount())"
2730         assertion in WebPage::didChangeSelection(). We manage to prevent
2731         synchronous layouts in most cases when calling editorState(). However,
2732         it seems it can still happen in some cases. Crashing in this case seems
2733         overkill and can be annoying to other developers, especially
2734         considering the implications are only on performance.
2735
2736         This patch drops the assertion.
2737
2738         * WebProcess/WebPage/WebPage.cpp:
2739         (WebKit::WebPage::didChangeSelection): Deleted.
2740
2741 2015-05-27  Anders Carlsson  <andersca@apple.com>
2742
2743         Address a follow-up review comment from Darin.
2744
2745         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2746         (WebKit::WebsiteDataStore::removeMediaKeys):
2747
2748 2015-05-26  Anders Carlsson  <andersca@apple.com>
2749
2750         WKWebsiteDataStore should handle media keys
2751         https://bugs.webkit.org/show_bug.cgi?id=145394
2752         rdar://problem/20617794.
2753
2754         Reviewed by Darin Adler.
2755
2756         * Shared/WebsiteData/WebsiteDataTypes.h:
2757         Add WebsiteDataTypeMediaKeys enum.
2758
2759         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
2760         (API::WebsiteDataStore::defaultDataStoreConfiguration):
2761         Set up mediaKeysStorageDirectory.
2762
2763         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
2764         (dataTypesToString):
2765         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
2766         (WebKit::toWebsiteDataTypes):
2767         (WebKit::toWKWebsiteDataTypes):
2768         * UIProcess/API/Cocoa/WKWebsiteDataRecordPrivate.h: Added.
2769         Add _WKWebsiteDataTypeMediaKeys.
2770
2771         * UIProcess/WebProcessPool.cpp:
2772         (WebKit::legacyWebsiteDataStoreConfiguration):
2773         Set up mediaKeysStorageDirectory.
2774
2775         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2776         (WebKit::WebsiteDataStore::WebsiteDataStore):
2777         Set m_mediaKeysStorageDirectory.
2778
2779         (WebKit::WebsiteDataStore::fetchData):
2780         Make CallbackAggregator ThreadSafeRefCounted.
2781         Handle WebsiteDataTypeMediaKeys by calling mediaKeyOrigins on our background queue.
2782
2783         (WebKit::WebsiteDataStore::removeData):
2784         Make CallbackAggregator ThreadSafeRefCounted.
2785         Handle WebsiteDataTypeMediaKeys by calling removeMediaKeys on our background queue.
2786
2787         (WebKit::WebsiteDataStore::mediaKeyOrigins):
2788         Compute the origins.
2789
2790         (WebKit::computeMediaKeyFile):
2791         Add helper function that returns the media key given a containing directory.
2792
2793         (WebKit::WebsiteDataStore::removeMediaKeys):
2794         Remove media key files.
2795
2796         * UIProcess/WebsiteData/WebsiteDataStore.h:
2797         Add new members.
2798
2799         * WebKit2.xcodeproj/project.pbxproj:
2800         Add new files.
2801
2802 2015-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>
2803
2804         Unreviewed. Update OptionsGTK.cmake and NEWS for 2.9.2 release.
2805
2806         * gtk/NEWS: Add release notes for 2.9.2.
2807
2808 2015-05-27  Carlos Garcia Campos  <cgarcia@igalia.com>
2809
2810         [SOUP] Network Cache: Handle the case when we fail to create the IO stream
2811         https://bugs.webkit.org/show_bug.cgi?id=145406
2812
2813         Reviewed by Sergio Villar Senin.
2814
2815         We were asserting in that case, but it can happen that we
2816         fail to create the stream. It happened to me after r184690, that
2817         changed the NetworkCache::Key hash. Since this was not expected to
2818         happen, the async operation never finished and the completion
2819         handler never called, leaving resources loading forever. We
2820         should make sure we call the completion handler with an error
2821         code, so that the load finishes and the entry is silently removed
2822         from the cache.
2823
2824         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
2825         (WebKit::NetworkCache::IOChannel::read):
2826         (WebKit::NetworkCache::IOChannel::readSync):
2827         (WebKit::NetworkCache::IOChannel::write):
2828
2829 2015-05-26  Carlos Garcia Campos  <cgarcia@igalia.com>
2830
2831         Network Cache: Add cache capacity to the totals of JSON file
2832         https://bugs.webkit.org/show_bug.cgi?id=145246
2833
2834         Reviewed by Antti Koivisto.
2835
2836         * NetworkProcess/cache/NetworkCache.cpp:
2837         (WebKit::NetworkCache::Cache::dumpContentsToFile):
2838         * NetworkProcess/cache/NetworkCacheStorage.h:
2839         (WebKit::NetworkCache::Storage::capacity):
2840
2841 2015-05-26  Anders Carlsson  <andersca@apple.com>
2842
2843         Add a symlink for every file inside /S/L/F/WebKit.framework to the PrivateFrameworks mirror.
2844
2845         rdar://problem/21111232.
2846
2847         Reviewed by Dan Bernstein.
2848
2849         * WebKit2.xcodeproj/project.pbxproj:
2850
2851 2015-05-26  Hunseop Jeong  <hs85.jeong@samsung.com>
2852
2853         [EFL] webview should be updated from (0,0) when using the evasGL.
2854         https://bugs.webkit.org/show_bug.cgi?id=137948
2855
2856         Reviewed by Gyuyoung Kim.
2857
2858         Changed the point of the start position to update the evasObject
2859         correctly when using the evasGL for graphics backend.
2860
2861         * UIProcess/API/efl/EwkView.cpp:
2862         (EwkView::displayTimerFired):
2863
2864 2015-05-26  Dan Bernstein  <mitz@apple.com>
2865
2866         <rdar://problem/21104551> Update build settings
2867
2868         Reviewed by Anders Carlsson.
2869
2870         * Configurations/DebugRelease.xcconfig:
2871         * Configurations/FeatureDefines.xcconfig:
2872         * Configurations/Version.xcconfig:
2873         * Configurations/WebContentService.Development.xcconfig:
2874         * Configurations/WebContentService.xcconfig:
2875
2876 2015-05-26  Milan Crha  <mcrha@redhat.com>
2877
2878         [GTK] Expand wildcards inside generate-inspector-gresource-manifest.py
2879         https://bugs.webkit.org/show_bug.cgi?id=138134
2880
2881         Reviewed by Žan Doberšek.
2882
2883         * PlatformGTK.cmake: Command line with expanded resources exceeds 32KB, which
2884         is a limit on Windows. It's better to expand wildcards inside the python script.
2885
2886 2015-05-25  Dan Bernstein  <mitz@apple.com>
2887
2888         ASSERT_MAIN_THREAD and DOM_ASSERT_MAIN_THREAD are unnecessary no-ops
2889         https://bugs.webkit.org/show_bug.cgi?id=145372
2890
2891         Reviewed by Sam Weinig.
2892
2893         * Configurations/Base.xcconfig: Removed DISABLE_THREAD_CHECK from DEBUG_DEFINES.
2894
2895 2015-05-25  Carlos Garcia Campos  <cgarcia@igalia.com>
2896
2897         [GTK] Add construct property to WebKitWebContext to set the IndexedDB database directory
2898         https://bugs.webkit.org/show_bug.cgi?id=140882
2899
2900         Reviewed by Gustavo Noronha Silva.
2901
2902         Add WebKitWebContext:indexed-db-database-directory construct only property.
2903
2904         * UIProcess/API/gtk/WebKitWebContext.cpp:
2905         (webkitWebContextGetProperty):
2906         (webkitWebContextSetProperty):
2907         (webkitWebContextConstructed):
2908         (webkit_web_context_class_init):
2909
2910 2015-05-24  Sam Weinig  <sam@webkit.org>
2911
2912         Crash when using a removed ScriptMessageHandler
2913         <rdar://problem/20888499>
2914         https://bugs.webkit.org/show_bug.cgi?id=145359
2915
2916         Reviewed by Dan Bernstein.
2917
2918         * WebProcess/UserContent/WebUserContentController.cpp:
2919         (WebKit::WebUserMessageHandlerDescriptorProxy::~WebUserMessageHandlerDescriptorProxy):
2920         Invalidate the descriptor when the message handler client (as implemented by WebUserMessageHandlerDescriptorProxy)
2921         goes away. This will happen if a script message handler is removed at the API level or the WebUserContentController
2922         is destroyed (which will happen if all the pages get destroyed).
2923
2924 2015-05-23  Dan Bernstein  <mitz@apple.com>
2925
2926         <rdar://problem/21090327> /S/L/PrivateFrameworks/WebKit.framework is missing Headers and PrivateHeaders symlinks
2927         https://bugs.webkit.org/show_bug.cgi?id=145354
2928
2929         Reviewed by David Kilzer.
2930
2931         * WebKit2.xcodeproj/project.pbxproj: Create Headers and PrivateHeaders symlinks alongside
2932         the dylib symlink.
2933
2934 2015-05-23  Sungmann Cho  <sungmann.cho@navercorp.com>
2935
2936         Rename ShareableResource::create(Handle&) to map(Handle&) to match SharedMemory.
2937         https://bugs.webkit.org/show_bug.cgi?id=145288
2938
2939         Reviewed by Sam Weinig.
2940
2941         * Shared/ShareableResource.cpp:
2942         (WebKit::ShareableResource::Handle::tryWrapInSharedBuffer):
2943         (WebKit::ShareableResource::map):
2944         (WebKit::ShareableResource::create): Deleted.
2945         * Shared/ShareableResource.h:
2946
2947 2015-05-22  Jon Lee  <jonlee@apple.com>
2948
2949         Rename MediaPlaybackAllowsInline
2950         https://bugs.webkit.org/show_bug.cgi?id=145315
2951
2952         Reviewed by Eric Carlson.
2953
2954         Our API uses allowsInlineMediaPlayback. Our symbols should reflect the same.
2955
2956         * Shared/WebPreferencesDefinitions.h:
2957         * UIProcess/API/C/WKPreferences.cpp:
2958         (WKPreferencesSetMediaPlaybackAllowsInline): Update the call to preferences.
2959         The C API will not change in a future patch.
2960         (WKPreferencesGetMediaPlaybackAllowsInline): Ditto.
2961         * UIProcess/API/Cocoa/WKWebView.mm:
2962         (-[WKWebView initWithFrame:configuration:]): Update the name of the key.
2963         * WebProcess/WebPage/WebPage.cpp:
2964         (WebKit::WebPage::updatePreferences): Ditto.
2965
2966         * UIProcess/API/gtk/WebKitSettings.cpp: Update the call.
2967         (webkit_settings_get_media_playback_allows_inline):
2968         (webkit_settings_set_media_playback_allows_inline):
2969
2970 2015-05-22  Jon Lee  <jonlee@apple.com>
2971
2972         Rename MediaPlaybackAllowsAirPlay
2973         https://bugs.webkit.org/show_bug.cgi?id=145316
2974
2975         Reviewed by Eric Carlson.
2976
2977         In preparation for an API rename, update internal symbols from mediaPlaybackAllowsAirPlay
2978         to allowsAirPlayForMediaPlayback.
2979
2980         * Shared/WebPreferencesDefinitions.h: Update the name.
2981         * UIProcess/API/Cocoa/WKWebView.mm:
2982         (-[WKWebView initWithFrame:configuration:]): Ditto.
2983         * WebProcess/WebPage/WebPage.cpp:
2984         (WebKit::WebPage::updatePreferences): Update the call to settings.
2985
2986 2015-05-22  Jon Lee  <jonlee@apple.com>
2987
2988         Unreviewed GTK fix after r184802.
2989
2990         * UIProcess/API/gtk/WebKitSettings.cpp:
2991         (webkit_settings_get_media_playback_requires_user_gesture):
2992         (webkit_settings_set_media_playback_requires_user_gesture):
2993
2994 2015-05-22  Jon Lee  <jonlee@apple.com>
2995
2996         Rename MediaPlaybackRequiresUserGesture
2997         https://bugs.webkit.org/show_bug.cgi?id=145314
2998
2999         Reviewed by Anders Carlsson.
3000
3001         In preparation for an API rename, update internal symbols from mediaPlaybackRequiresUserGesture
3002         to requiresUserGestureForMediaPlayback.
3003
3004         No changes are being made to the API in this patch.
3005
3006         * Shared/WebPreferencesDefinitions.h: Update the name of the macro and the setting.
3007         * UIProcess/API/C/WKPreferences.cpp: The C API will not change in a future patch.
3008         (WKPreferencesSetMediaPlaybackRequiresUserGesture): Update the call to preferences.
3009         (WKPreferencesGetMediaPlaybackRequiresUserGesture): Ditto.
3010         * UIProcess/API/Cocoa/WKWebView.mm:
3011         (-[WKWebView initWithFrame:configuration:]): Update the name of the key.
3012         * WebProcess/WebPage/WebPage.cpp:
3013         (WebKit::WebPage::updatePreferences): Ditto.
3014
3015 2015-05-22  Commit Queue  <commit-queue@webkit.org>
3016
3017         Unreviewed, rolling out r183647.
3018         https://bugs.webkit.org/show_bug.cgi?id=145326
3019
3020         broke some toolbar blurring behavior (Requested by thorton on
3021         #webkit).
3022
3023         Reverted changeset:
3024
3025         "Asynchronous (or timed-out synchronous) resize flashes white
3026         instead of page background color"
3027         https://bugs.webkit.org/show_bug.cgi?id=144468
3028         http://trac.webkit.org/changeset/183647
3029
3030 2015-05-22  Yongjun Zhang  <yongjun_zhang@apple.com>
3031
3032         Image link doesn't create a preview view controller.
3033         https://bugs.webkit.org/show_bug.cgi?id=145320
3034
3035         Also try to create the preview view controller if the hit-tested node
3036         is a image link.
3037
3038         Reviewed by Beth Dakin.
3039
3040         * UIProcess/ios/WKContentViewInteraction.mm:
3041         (-[WKContentView gestureRecognizerShouldBegin:]):
3042         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
3043
3044 2015-05-22  Tim Horton  <timothy_horton@apple.com>
3045
3046         Avoid doing an extra layout in some cases while doing scale-to-fit
3047         https://bugs.webkit.org/show_bug.cgi?id=145321
3048         <rdar://problem/21051165>
3049
3050         Reviewed by Beth Dakin.
3051
3052         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
3053         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3054         (WebKit::TiledCoreAnimationDrawingArea::scaleViewToFitDocumentIfNeeded):
3055         If we make it to scaleViewToFitDocumentIfNeeded with valid layout,
3056         the view width is still less than the last-known minimum document size,
3057         and the document size hasn't changed, update the view scale without
3058         doing an extra layout, keeping the fixed layout size at the previously
3059         computed minimum document size.
3060
3061 2015-05-22  Beth Dakin  <bdakin@apple.com>
3062
3063         Yellow highlight and DD popover don't go away when scrolling an iframe
3064         https://bugs.webkit.org/show_bug.cgi?id=145312
3065         -and corresponding-
3066         rdar://problem/19692334
3067
3068         Reviewed by Tim Horton.
3069
3070         Match what Lookup already does for their popover and dismiss our popovers on 
3071         scroll.
3072         * UIProcess/API/mac/WKView.mm:
3073         (-[WKView scrollWheel:]):
3074
3075         This should not be needed anymore.
3076         * UIProcess/WebPageProxy.cpp:
3077         (WebKit::WebPageProxy::pageDidScroll):
3078
3079 2015-05-22  Tim Horton  <timothy_horton@apple.com>
3080
3081         Remove action menu support
3082         https://bugs.webkit.org/show_bug.cgi?id=145305
3083         <rdar://problem/21070771>
3084
3085         Reviewed by Anders Carlsson.
3086
3087         * Configurations/WebKit.xcconfig:
3088         * Shared/API/c/WKActionMenuItemTypes.h:
3089         * Shared/API/c/WKActionMenuTypes.h:
3090         * UIProcess/API/Cocoa/WKViewPrivate.h:
3091         * UIProcess/API/mac/WKView.mm:
3092         (-[WKView _didPerformImmediateActionHitTest:contentPreventsDefault:userData:]):
3093         (-[WKView dealloc]): Deleted.
3094         (-[WKView mouseDown:]): Deleted.
3095         (-[WKView initWithFrame:processPool:configuration:webView:]): Deleted.
3096         (-[WKView prepareForMenu:withEvent:]): Deleted.
3097         (-[WKView willOpenMenu:withEvent:]): Deleted.
3098         (-[WKView didCloseMenu:withEvent:]): Deleted.
3099         (-[WKView _didPerformActionMenuHitTest:forImmediateAction:contentPreventsDefault:userData:]): Deleted.
3100         (-[WKView _actionMenuItemsForHitTestResult:withType:defaultActionMenuItems:]): Deleted.
3101         (-[WKView _actionMenuItemsForHitTestResult:withType:defaultActionMenuItems:userData:]): Deleted.
3102         * UIProcess/API/mac/WKViewInternal.h:
3103         * UIProcess/PageClient.h:
3104         * UIProcess/WebPageProxy.cpp:
3105         (WebKit::WebPageProxy::performImmediateActionHitTestAtLocation):
3106         (WebKit::WebPageProxy::didPerformImmediateActionHitTest):
3107         (WebKit::WebPageProxy::performActionMenuHitTestAtLocation): Deleted.
3108         (WebKit::WebPageProxy::selectLastActionMenuRange): Deleted.
3109         (WebKit::WebPageProxy::focusAndSelectLastActionMenuHitTestResult): Deleted.
3110         (WebKit::WebPageProxy::didPerformActionMenuHitTest): Deleted.
3111         * UIProcess/WebPageProxy.h:
3112         * UIProcess/WebPageProxy.messages.in:
3113         * UIProcess/mac/PageClientImpl.h:
3114         * UIProcess/mac/PageClientImpl.mm:
3115         (WebKit::PageClientImpl::didPerformImmediateActionHitTest):
3116         (WebKit::PageClientImpl::didPerformActionMenuHitTest): Deleted.
3117         * UIProcess/mac/WKActionMenuController.h: Removed.
3118         * UIProcess/mac/WKActionMenuController.mm: Removed.
3119         * UIProcess/mac/WKImmediateActionController.h:
3120         * UIProcess/mac/WKImmediateActionController.mm:
3121         (-[WKImmediateActionController didPerformImmediateActionHitTest:contentPreventsDefault:userData:]):
3122         (-[WKImmediateActionController immediateActionRecognizerWillPrepare:]):
3123         (-[WKImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
3124         (-[WKImmediateActionController didPerformActionMenuHitTest:contentPreventsDefault:userData:]): Deleted.
3125         * WebKit2.xcodeproj/project.pbxproj:
3126         * WebProcess/InjectedBundle/API/APIInjectedBundlePageContextMenuClient.h:
3127         (API::InjectedBundle::PageContextMenuClient::prepareForImmediateAction):
3128         (API::InjectedBundle::PageContextMenuClient::prepareForActionMenu): Deleted.
3129         * WebProcess/InjectedBundle/API/c/WKBundlePageContextMenuClient.h:
3130         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
3131         * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h:
3132         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp:
3133         (WebKit::InjectedBundlePageContextMenuClient::prepareForImmediateAction):
3134         (WebKit::InjectedBundlePageContextMenuClient::prepareForActionMenu): Deleted.
3135         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.h:
3136         * WebProcess/WebPage/WebPage.h:
3137         * WebProcess/WebPage/WebPage.messages.in:
3138         * WebProcess/WebPage/WebPageOverlay.cpp:
3139         (WebKit::WebPageOverlay::actionContextForResultAtPoint):
3140         * WebProcess/WebPage/WebPageOverlay.h:
3141         (WebKit::WebPageOverlay::Client::actionContextForResultAtPoint):
3142         * WebProcess/WebPage/mac/WebPageMac.mm:
3143         (WebKit::textIndicatorTransitionForImmediateAction):
3144         (WebKit::WebPage::performImmediateActionHitTestAtLocation):
3145         (WebKit::textIndicatorTransitionForActionMenu): Deleted.
3146         (WebKit::WebPage::performActionMenuHitTestAtLocation): Deleted.
3147         (WebKit::WebPage::selectLastActionMenuRange): Deleted.
3148         (WebKit::WebPage::focusAndSelectLastActionMenuHitTestResult): Deleted.
3149         Remove everything, except some enums that clients still refer to.
3150         Also, leave SPI that used to be shared between immediate actions and
3151         action menus intact, even if it had "action menu" in the name. We can
3152         deprecate and rename in another patch... except for the very recently-added
3153         support from r184106, which we'll revert entirely, removing WKBundlePageOverlayV2, 
3154         which was not adopted by any clients.
3155
3156 2015-05-22  Brady Eidson  <beidson@apple.com>
3157
3158         Rework how the ResourceRequest user initiated property key is used.
3159         Followup to https://bugs.webkit.org/show_bug.cgi?id=145281
3160
3161         Reviewed by Dan Bernstein.
3162
3163         * Shared/API/Cocoa/_WKNSURLRequestExtras.mm:
3164         (-[NSURLRequest _web_isUserInitiated]):
3165         (-[NSMutableURLRequest _web_setIsUserInitiated:]):
3166
3167         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3168         (WKResourceRequestIsUserInitiatedKey): Deleted.
3169         (InitWebCoreSystemInterface): Deleted.
3170
3171 2015-05-21  Gavin Barraclough  <barraclough@apple.com>
3172
3173         Networking process sometimes suspended while WebContent runnable
3174         https://bugs.webkit.org/show_bug.cgi?id=145291
3175         <rdar://problem/21033029>
3176
3177         Reviewed by Andreas Kling.
3178
3179         There is an asymmetry in how the Networking process suspension is managed.
3180         We drop the assertion (& suspend the process) whenever the WebProcess says
3181         it is ready to suspend, but we only take the assertion (& resume execution)
3182         when the WebContent process is actually resumed. This leaves a race – where
3183         the WebContent process was willing to be suspended, but the UI app changed
3184         its mind suspending it. Since the WebContent process never actually suspended
3185         (we only prepared it to), we never send a resume, and since we never resume,
3186         we never wake the Networking process.
3187
3188         The fix is pretty clean. A web process should take a token on the networking
3189         process precisely whenever it holds an assertion on the web content process.
3190         This also enables a nice refinement, that when holding a BG assertion on the
3191         WebContent process we only need to hold a BG assertion on the networking
3192         process.
3193
3194         * UIProcess/Network/NetworkProcessProxy.cpp:
3195         (WebKit::NetworkProcessProxy::didSetAssertionState):
3196             - no-op
3197         * UIProcess/Network/NetworkProcessProxy.h:
3198             - added didSetAssertionState.
3199         * UIProcess/ProcessThrottler.cpp:
3200         (WebKit::ProcessThrottler::updateAssertionNow):
3201         (WebKit::ProcessThrottler::updateAssertion):
3202         (WebKit::ProcessThrottler::didConnectToProcess):
3203             - whenever taking/updating the assertion, inform the client via didSetAssertionState.
3204         * UIProcess/ProcessThrottlerClient.h:
3205             - added didSetAssertionState.
3206         * UIProcess/WebProcessProxy.cpp:
3207         (WebKit::WebProcessProxy::didFinishLaunching):
3208             removed initializeNetworkProcessActivityToken - this is taken via ProcessThrottler::didConnectToProcess.
3209         (WebKit::WebProcessProxy::sendProcessDidResume):
3210             - removed call to initializeNetworkProcessActivityToken - updated via didSetAssertionState.
3211         (WebKit::WebProcessProxy::processReadyToSuspend):
3212             - removed update of m_tokenForNetworkProcess - updated via didSetAssertionState.
3213         (WebKit::WebProcessProxy::didSetAssertionState):
3214             - update m_backgroundTokenForNetworkProcess/m_foregroundTokenForNetworkProcess.
3215         (WebKit::WebProcessProxy::initializeNetworkProcessActivityToken): Deleted.
3216             - updated via didSetAssertionState.
3217         * UIProcess/WebProcessProxy.h:
3218             - added didSetAssertionState, added separate FG/BG activity tokens for Networking process.
3219
3220 2015-05-22  Dan Bernstein  <mitz@apple.com>
3221
3222         Fixed the fix for <rdar://problem/20830673> Symlink the WebKit dylib instead of just the framework directory
3223         https://bugs.webkit.org/show_bug.cgi?id=145287
3224
3225         Reviewed by Anders Carlsson.
3226
3227         * WebKit2.xcodeproj/project.pbxproj: Give the symlink the correct destination.
3228
3229 2015-05-21  Brady Eidson  <beidson@apple.com>
3230
3231         Add an "initiated by user gesture" flag to ResourceRequest.
3232         https://bugs.webkit.org/show_bug.cgi?id=145281
3233
3234         Reviewed by Alex Christensen.
3235
3236         Expose a new category on NSURLRequest to allow SPI clients to easily set/get the flag:
3237         * Shared/API/Cocoa/_WKNSURLRequestExtras.h: Added.
3238         * Shared/API/Cocoa/_WKNSURLRequestExtras.mm: Added.
3239         (-[NSURLRequest _web_isUserInitiated]):
3240         (-[NSMutableURLRequest _web_setIsUserInitiated:]):
3241
3242         * WebKit2.xcodeproj/project.pbxproj:
3243
3244         Expose the new property key to WebCore:
3245         * WebProcess/WebCoreSupport/mac/WebSystemInterface.mm:
3246         (WKResourceRequestIsUserInitiatedKey):
3247         (InitWebCoreSystemInterface):
3248
3249 2015-05-21  Daniel Bates  <dabates@apple.com>
3250
3251         Rollout <http://trac.webkit.org/changeset/183909>
3252         (https://bugs.webkit.org/show_bug.cgi?id=144657)
3253
3254         Revert <http://trac.webkit.org/changeset/183909> since pausing the database
3255         thread prevents in-progress transactions from completing. We need to think
3256         about this change some more.
3257
3258         * UIProcess/WebPageProxy.h:
3259         * UIProcess/ios/WKContentView.mm:
3260         (-[WKContentView _applicationDidEnterBackground:]): Deleted.
3261         * UIProcess/ios/WebPageProxyIOS.mm:
3262         (WebKit::WebPageProxy::applicationDidEnterBackground): Deleted.
3263         * WebProcess/WebCoreSupport/WebDatabaseManager.cpp:
3264         (WebKit::WebDatabaseManager::setPauseAllDatabases): Deleted.
3265         * WebProcess/WebCoreSupport/WebDatabaseManager.h:
3266         * WebProcess/WebPage/WebPage.h:
3267         * WebProcess/WebPage/WebPage.messages.in:
3268         * WebProcess/WebPage/ios/WebPageIOS.mm:
3269         (WebKit::WebPage::applicationWillEnterForeground): Deleted.
3270         (WebKit::WebPage::applicationDidEnterBackground): Deleted.
3271
3272 2015-05-21  Enrica Casucci  <enrica@apple.com>
3273
3274         [iOS] Crash when taking a snapshot of a large PDF.
3275         https://bugs.webkit.org/show_bug.cgi?id=145286
3276         rdar://problem/20892362
3277
3278         Reviewed by Tim Horton.
3279
3280         The code for the PDF case was incorrectly computing the snapshot rect.
3281         On top of that drawViewHierarchyInRect was ignoring the rect and
3282         always creating an image using the view bounds causing the crash.
3283         We are now always using the IOSurface if we are parented or
3284         an image context when we are not.
3285
3286         * UIProcess/API/Cocoa/WKWebView.mm:
3287         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
3288
3289 2015-05-21  Anders Carlsson  <andersca@apple.com>
3290
3291         Symlink the WebKit dylib instead of just the framework directory
3292         https://bugs.webkit.org/show_bug.cgi?id=145287
3293         rdar://problem/20830673
3294
3295         Reviewed by Dan Bernstein.
3296
3297         * WebKit2.xcodeproj/project.pbxproj:
3298
3299 2015-05-21  Anders Carlsson  <andersca@apple.com>
3300
3301         WKWebsiteDataStore doesn't track and remove iOS Safari's offline application cache entries
3302         https://bugs.webkit.org/show_bug.cgi?id=145279
3303         rdar://problem/20657912
3304
3305         Reviewed by Dan Bernstein.
3306
3307         Special-case iOS Safari and WebApp when computing the default application cache directory.
3308
3309         * UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
3310         (API::applicationCacheDirectory):
3311         (API::WebsiteDataStore::defaultDataStoreConfiguration):
3312
3313 2015-05-21  Brian Weinstein  <bweinstein@apple.com>
3314
3315         Add a _WKWebKitContentExtensionStore initializer that takes a path.
3316         https://bugs.webkit.org/show_bug.cgi?id=145269 and work towards <rdar://problem/21031414>
3317
3318         Reviewed by Anders Carlsson.
3319
3320         * UIProcess/API/APIUserContentExtensionStore.cpp:
3321         (API::UserContentExtensionStore::storeWithPath):
3322         * UIProcess/API/APIUserContentExtensionStore.h:
3323         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.h:
3324         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
3325         (+[_WKUserContentExtensionStore storeWithURL:]):
3326
3327 2015-05-21  Alexey Proskuryakov  <ap@apple.com>
3328
3329         Build fix. Silence some deprecation warnings.
3330
3331         * UIProcess/ios/forms/WKFileUploadPanel.mm:
3332         (-[WKFileUploadPanel _presentPopoverWithContentViewController:animated:]):
3333         * UIProcess/ios/forms/WKFormInputControl.mm:
3334         (-[WKDateTimePopover initWithView:datePickerMode:]):
3335         * UIProcess/ios/forms/WKFormPopover.h:
3336         * UIProcess/ios/forms/WKFormPopover.mm:
3337         * UIProcess/ios/forms/WKFormSelectPopover.mm:
3338         (-[WKSelectPopover initWithView:hasGroups:]):
3339
3340 2015-05-21  Csaba Osztrogonác  <ossy@webkit.org>
3341
3342         [EFL] Remove an unused private field from EwkPopupMenuItem class
3343         https://bugs.webkit.org/show_bug.cgi?id=145249
3344
3345         Reviewed by Gyuyoung Kim.
3346
3347         * UIProcess/API/efl/ewk_popup_menu.cpp:
3348         (EwkPopupMenu::EwkPopupMenu):
3349         * UIProcess/API/efl/ewk_popup_menu_private.h:
3350
3351 2015-05-21  Csaba Osztrogonác  <ossy@webkit.org>
3352
3353         [EFL] Fix mismatched-tags warnings in UIProcess/API/efl
3354         https://bugs.webkit.org/show_bug.cgi?id=145129
3355
3356         Reviewed by Gyuyoung Kim.
3357
3358         * UIProcess/API/efl/EwkViewCallbacks.h:
3359         * UIProcess/API/efl/ewk_application_cache_manager.h:
3360         * UIProcess/API/efl/ewk_auth_request.h:
3361         * UIProcess/API/efl/ewk_back_forward_list.h:
3362         * UIProcess/API/efl/ewk_back_forward_list_item.h:
3363         * UIProcess/API/efl/ewk_color_picker.h:
3364         * UIProcess/API/efl/ewk_context.h:
3365         * UIProcess/API/efl/ewk_context_menu_item.h:
3366         * UIProcess/API/efl/ewk_cookie_manager.h:
3367         * UIProcess/API/efl/ewk_database_manager.h:
3368         * UIProcess/API/efl/ewk_download_job.h:
3369         * UIProcess/API/efl/ewk_error.h:
3370         * UIProcess/API/efl/ewk_favicon_database.h:
3371         * UIProcess/API/efl/ewk_file_chooser_request.h:
3372         * UIProcess/API/efl/ewk_form_submission_request.h:
3373         * UIProcess/API/efl/ewk_navigation_data.h:
3374         * UIProcess/API/efl/ewk_navigation_policy_decision.h:
3375         * UIProcess/API/efl/ewk_object.h:
3376         * UIProcess/API/efl/ewk_page_group.h:
3377         * UIProcess/API/efl/ewk_popup_menu.h:
3378         * UIProcess/API/efl/ewk_popup_menu_item.h:
3379         * UIProcess/API/efl/ewk_security_origin.h:
3380         * UIProcess/API/efl/ewk_settings.h:
3381         * UIProcess/API/efl/ewk_storage_manager.h:
3382         * UIProcess/API/efl/ewk_url_request.h:
3383         * UIProcess/API/efl/ewk_url_response.h:
3384         * UIProcess/API/efl/ewk_url_scheme_request.h:
3385         * UIProcess/API/efl/ewk_view.h:
3386         * UIProcess/API/efl/ewk_window_features.h:
3387         * WebProcess/InjectedBundle/API/efl/ewk_extension.h:
3388         * WebProcess/InjectedBundle/API/efl/ewk_page.h:
3389
3390 2015-05-21  Csaba Osztrogonác  <ossy@webkit.org>
3391
3392         Fix mismatched-tags warnings related to CoordinatedGraphics
3393         https://bugs.webkit.org/show_bug.cgi?id=145130
3394
3395         Reviewed by Darin Adler.
3396
3397         * Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
3398         * UIProcess/CoordinatedGraphics/CoordinatedLayerTreeHostProxy.messages.in:
3399         * WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:
3400
3401 2015-05-20  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3402
3403         Unreviewed GTK build fix since r184686.
3404
3405         * UIProcess/gtk/WebProcessPoolGtk.cpp:
3406         (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): Add *legacy* prefix.
3407         (WebKit::WebProcessPool::platformDefaultApplicationCacheDirectory): Deleted.
3408
3409 2015-05-20  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3410
3411         Unreviewed EFL build fix since r184686.
3412
3413         * UIProcess/efl/WebProcessPoolEfl.cpp:
3414         (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory): Add *legacy* prefix.
3415         (WebKit::WebProcessPool::platformDefaultApplicationCacheDirectory): Deleted.
3416
3417 2015-05-20  Chris Dumez  <cdumez@apple.com>
3418
3419         [WK2][iOS] Update WebContent process sandbox profile for AWD logging
3420         https://bugs.webkit.org/show_bug.cgi?id=145229
3421         <rdar://problem/20543269>
3422
3423         Reviewed by Alexey Proskuryakov.
3424
3425         * Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:
3426
3427 2015-05-20  Gavin Barraclough  <barraclough@apple.com>
3428
3429         dispatchViewStateChange should not wait for sync reply if the page isn't visible
3430         https://bugs.webkit.org/show_bug.cgi?id=145242
3431         <rdar://problem/20967937>
3432
3433         Reviewed by Ben Poulain.
3434
3435         This is particularly problematic on iOS, since if the page isn't visible the process is likely suspended.
3436
3437
3438         * UIProcess/WebPageProxy.cpp:
3439         (WebKit::WebPageProxy::dispatchViewStateChange):
3440         (WebKit::WebPageProxy::waitForDidUpdateViewState):
3441
3442 2015-05-20  Marcos Chavarría Teijeiro  <mchavarria@igalia.com>
3443
3444         Enable disk cache for range requests
3445         https://bugs.webkit.org/show_bug.cgi?id=144682
3446
3447         Reviewed by Antti Koivisto.
3448
3449         Add Range header value to the network cache key constructor so we take
3450         into account this value. The 206 response code is also marked to be cached.
3451
3452         * NetworkProcess/cache/NetworkCache.cpp:
3453         (WebKit::NetworkCache::makeCacheKey):
3454         (WebKit::NetworkCache::isStatusCodeCacheableByDefault):
3455         * NetworkProcess/cache/NetworkCacheKey.cpp:
3456         (WebKit::NetworkCache::Key::Key):
3457         (WebKit::NetworkCache::Key::operator=):
3458         (WebKit::NetworkCache::Key::computeHash):
3459         (WebKit::NetworkCache::Key::operator==):
3460         (WebKit::NetworkCache::Key::encode):
3461         (WebKit::NetworkCache::Key::decode):
3462         (WebKit::NetworkCache::Key::stringToHash): Deleted.
3463         * NetworkProcess/cache/NetworkCacheKey.h:
3464
3465 2015-05-20  Anders Carlsson  <andersca@apple.com>
3466
3467         WKWebsiteDataStore API doesn't report webkit.org as using Databases or App Cache after visiting http://www.webkit.org/demos/sticky-notes/
3468         https://bugs.webkit.org/show_bug.cgi?id=145238
3469         rdar://problem/20581175
3470
3471         Reviewed by Tim Horton.
3472
3473         Make sure to set the application cache and WebSQL directories when using the legacy data store.
3474
3475         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3476         (WebKit::WebProcessPool::legacyPlatformDefaultApplicationCacheDirectory):
3477         (WebKit::WebProcessPool::platformDefaultApplicationCacheDirectory):
3478         Rename this and move it to the right place.
3479
3480         * UIProcess/WebProcessPool.cpp:
3481         (WebKit::legacyWebsiteDataStoreConfiguration):
3482         Rename this and add the application cache and WebSQL directories.
3483
3484         (WebKit::WebProcessPool::WebProcessPool):
3485         Call legacyWebsiteDataStoreConfiguration.
3486
3487         (WebKit::WebProcessPool::applicationCacheDirectory):
3488         Call legacyPlatformDefaultApplicationCacheDirectory.
3489
3490         * UIProcess/WebProcessPool.h:
3491
3492 2015-05-20  Enrica Casucci  <enrica@apple.com>
3493
3494         [iOS] Using CSS viewport units causes incorrect layout.
3495         https://bugs.webkit.org/show_bug.cgi?id=145225
3496         rdar://problem/20924495
3497
3498         Reviewed by Benjamin Poulain.
3499
3500         * WebProcess/WebPage/ios/WebPageIOS.mm:
3501         (WebKit::WebPage::updateViewportSizeForCSSViewportUnits):
3502
3503 2015-05-20  Tim Horton  <timothy_horton@apple.com>
3504
3505         Allow overriding the waitForDidUpdateViewState timeout
3506         https://bugs.webkit.org/show_bug.cgi?id=145230
3507         <rdar://problem/20990162>
3508
3509         Reviewed by Darin Adler.
3510
3511         * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
3512         (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateViewState):
3513         Use the value from NSUserDefaults, if it exists.
3514         We'll only check once, so changing the default requires a restart of the UI process.
3515
3516 2015-05-20  Anders Carlsson  <andersca@apple.com>
3517
3518         Make sure we always have a process pool to perform data store operations with
3519         https://bugs.webkit.org/show_bug.cgi?id=145231
3520         rdar://problem/20618248
3521
3522         Reviewed by Tim Horton.
3523
3524         Make sure that we always return a process pool. If we're a legacy C SPI per-context data store,
3525         find the process pool we're a part of and use that. Otherwise, create a new one.
3526     
3527         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3528         (WebKit::WebsiteDataStore::processPools):
3529
3530 2015-05-19  Jer Noble  <jer.noble@apple.com>
3531
3532         Touching HTMLMediaElement.h or MediaPlayer.h causes a world rebuild.
3533         https://bugs.webkit.org/show_bug.cgi?id=145193
3534
3535         Reviewed by Eric Carlson.
3536
3537         Use HTMLMediaElementEnums instead of HTMLMediaElement.
3538
3539         * UIProcess/API/Cocoa/WKWebView.mm:
3540         (-[WKWebView _isShowingVideoOptimized]): HTMLMediaElement -> HTMLMediaElementEnums.
3541         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
3542         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
3543         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
3544         (WebKit::WebVideoFullscreenManagerProxy::hasMode): Ditto.
3545         (WebKit::WebVideoFullscreenModelContext::fullscreenModeChanged): Ditto.
3546         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): Ditto.
3547         (WebKit::WebVideoFullscreenManagerProxy::fullscreenModeChanged): Ditto.
3548         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
3549         (WebKit::WebChromeClient::enterVideoFullscreenForVideoElement): Ditto.
3550         * WebProcess/WebCoreSupport/WebChromeClient.h:
3551         * WebProcess/ios/WebVideoFullscreenManager.h:
3552         (WebKit::WebVideoFullscreenInterfaceContext::fullscreenMode): Ditto.
3553         (WebKit::WebVideoFullscreenInterfaceContext::setFullscreenMode): Ditto.
3554         * WebProcess/ios/WebVideoFullscreenManager.messages.in:
3555         * WebProcess/ios/WebVideoFullscreenManager.mm:
3556         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement): Ditto.
3557         (WebKit::WebVideoFullscreenManager::fullscreenModeChanged): Ditto.
3558         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen): Ditto.
3559
3560 2015-05-20  Anders Carlsson  <andersca@apple.com>
3561
3562         Refactor process pool enumeration code in WebsiteDataStore
3563         https://bugs.webkit.org/show_bug.cgi?id=145218
3564
3565         Reviewed by Tim Horton.
3566
3567         Also make sure to keep the WebProcessPool objects alive for the duration of the various data store
3568         operations. This is the first step towards having the data store create a single process pool lazily if
3569         there are no web views associated with the data store.
3570
3571         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3572         (WebKit::WebsiteDataStore::fetchData):
3573         (WebKit::WebsiteDataStore::removeData):
3574         (WebKit::WebsiteDataStore::processPools):
3575         * UIProcess/WebsiteData/WebsiteDataStore.h:
3576
3577 2015-05-20  Alex Christensen  <achristensen@webkit.org>
3578
3579         [Content Extensions] Relax restrictions on triggers that match everything.
3580         https://bugs.webkit.org/show_bug.cgi?id=145069
3581
3582         Reviewed by Benjamin Poulain.
3583
3584         * UIProcess/API/APIUserContentExtensionStore.h:
3585         Increment version number to reflect changes in DFABytecode.
3586
3587 2015-05-20  Sungmann Cho  <sungmann.cho@navercorp.com>
3588
3589         Minor cleanups to PluginProcessProxy.
3590         https://bugs.webkit.org/show_bug.cgi?id=145199
3591
3592         Reviewed by Anders Carlsson.
3593
3594         1. Remove unnecessary forward declaration.
3595         2. Remove unnecessary #include.
3596
3597         * UIProcess/Plugins/PluginProcessProxy.cpp:
3598         * UIProcess/Plugins/PluginProcessProxy.h:
3599
3600 2015-05-20  Marcos Chavarría Teijeiro  <mchavarria@igalia.com>
3601
3602         [GTK] Add some documentation to WebKitWebExtension
3603         https://bugs.webkit.org/show_bug.cgi?id=142786
3604
3605         Reviewed by Carlos Garcia Campos.
3606
3607         WebKitWebExtension API documentation lacks of some details and the information
3608         available is in some contributors blog posts. I add the section
3609         documentation with a small guide about how to use WebExtensions.
3610
3611         The code examples were taken from Carlos García and Adrián Pérez blog
3612         posts.
3613
3614         * WebProcess/InjectedBundle/API/gtk/WebKitWebExtension.cpp:
3615
3616 2015-05-20  Sungmann Cho  <sungmann.cho@navercorp.com>
3617
3618         Rename WebsiteDataStore::isNonPersistent() to WebsiteDataStore::isPersistent().
3619         https://bugs.webkit.org/show_bug.cgi?id=145111
3620
3621         Reviewed by Darin Adler.
3622
3623         This is a follow up to https://bugs.webkit.org/show_bug.cgi?id=144158.
3624
3625         * UIProcess/API/APIWebsiteDataStore.cpp:
3626         (API::WebsiteDataStore::isPersistent):
3627         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3628         (WebKit::WebsiteDataStore::fetchData):
3629         (WebKit::WebsiteDataStore::removeData):
3630         * UIProcess/WebsiteData/WebsiteDataStore.h:
3631         (WebKit::WebsiteDataStore::isPersistent):
3632         (WebKit::WebsiteDataStore::isNonPersistent): Deleted.
3633
3634 2015-05-20  Hyungwook Lee  <hyungwook.lee@navercorp.com>
3635
3636         [EFL] Fix build failure, linker does not find libXext.
3637         https://bugs.webkit.org/show_bug.cgi?id=144100
3638
3639         Reviewed by Gyuyoung Kim.
3640
3641         Move Xext library from WebProcess_LIBRARIES to WebKit2_LIBRARIES.
3642
3643         * PlatformEfl.cmake:
3644
3645 2015-05-19  Carlos Garcia Campos  <cgarcia@igalia.com>
3646
3647         [SOUP] Network Cache: Implement ShareableResource for Soup and enable it for GTK platform
3648         https://bugs.webkit.org/show_bug.cgi?id=144380
3649
3650         Reviewed by Antti Koivisto.
3651
3652         It improves the network cache performance, by mmaping big
3653         resources and sending only the file descriptor to the web process
3654         instead of the actual file data. It needs some changes in
3655         cross-platform code, because we can't use the same approach as
3656         mac (it uses a platform specific implementation not available in
3657         other platforms).
3658
3659         * NetworkProcess/cache/NetworkCache.cpp:
3660         (WebKit::NetworkCache::Cache::store): Use
3661         Data::tryCreateSharedMemory() to create the shared memory used by
3662         the ShareableResource. Also add an ASSERT instead of checking the
3663         shareable resource created is not nullptr, because the
3664         ShareableResource::create() that receives a shared memory should
3665         never return nullptr.
3666         * NetworkProcess/cache/NetworkCacheData.h:
3667         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
3668         (WebKit::NetworkCache::Data::tryCreateSharedMemory):
3669         * NetworkProcess/cache/NetworkCacheDataSoup.cpp:
3670         (WebKit::NetworkCache::Data::tryCreateSharedMemory): Create a
3671         SharedMemory object to wrap the mapped file, but keeping the ownership.
3672         * NetworkProcess/cache/NetworkCacheEntry.cpp:
3673         (WebKit::NetworkCache::Entry::initializeShareableResourceHandleFromStorageRecord):
3674         Use Data::tryCreateSharedMemory() to create the shared memory used
3675         bythe ShareableResource. Also add an ASSERT instead of checking
3676         the shareable resource created is not nullptr, because the
3677         ShareableResource::create() that receives a shared memory should
3678         never return nullptr.
3679         * Platform/SharedMemory.h:
3680         * Platform/unix/SharedMemoryUnix.cpp:
3681         (WebKit::SharedMemory::map): Use wrapMap() and initialize
3682         m_isWrappingMap to false.
3683         (WebKit::SharedMemory::wrapMap): Create a SharedMemory object for
3684         the given map, without taking its ownership.
3685         (WebKit::SharedMemory::~SharedMemory): Do not unmap and close the
3686         file descriptor if m_isWrappingMap is true.
3687         * Shared/ShareableResource.cpp:
3688         (WebKit::createShareableResourceDeallocator):
3689         (WebKit::ShareableResource::wrapInSharedBuffer): Create a SharedBuffer
3690         wrapping the ShareableResource data.
3691         (WebKit::ShareableResource::Handle::tryWrapInSharedBuffer): Create
3692         a ShareableResource for the handle and create a SharedBuffer
3693         wrapping it.
3694         * Shared/ShareableResource.h:
3695         * WebKit2Prefix.h: Enable ENABLE_SHAREABLE_RESOURCE for GTK.
3696         * WebProcess/Network/WebResourceLoader.cpp:
3697         (WebKit::WebResourceLoader::didReceiveResource): Get the CFData
3698         from the SharedBuffer for QuickLook instead of wrapping the handle again.
3699
3700 2015-05-19  Carlos Garcia Campos  <cgarcia@igalia.com>
3701
3702         [SOUP] Network Cache: Disable network cache efficacy logging
3703         https://bugs.webkit.org/show_bug.cgi?id=145172
3704
3705         Reviewed by Martin Robinson.
3706
3707         Disable network cache efficacy logging by default, since we are
3708         not currently using the collected data.
3709
3710         * UIProcess/soup/WebProcessPoolSoup.cpp:
3711         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3712
3713 2015-05-19  Michael Saboff  <msaboff@apple.com>
3714
3715         REGRESSION(183787): JIT is enabled for all builds
3716         https://bugs.webkit.org/show_bug.cgi?id=145179
3717
3718         Reviewed by Geoffrey Garen.
3719
3720         Eliminated the setting of ENABLE_JIT, as wtf/Platform.h has appropriate logic to
3721         set it depending on OS and CPU type.
3722
3723         * Configurations/FeatureDefines.xcconfig:
3724
3725 2015-05-19  Brady Eidson  <beidson@apple.com>
3726
3727         X-Frame-Options headers not respected when loading from application cache.
3728         <rdar://problem/14877623> and https://bugs.webkit.org/show_bug.cgi?id=131800
3729
3730         Reviewed by Alexey Proskuryakov.
3731
3732         * WebProcess/WebPage/WebPage.cpp:
3733         (WebKit::WebPage::loadDataImpl):
3734
3735 2015-05-19  Sungmann Cho  <sungmann.cho@navercorp.com>
3736
3737         Add PLUGIN_ARCHITECTURE(MAC) around WKNVCALayerRenderServerPort in NetscapeBrowserFunc.h.
3738         https://bugs.webkit.org/show_bug.cgi?id=145173
3739
3740         Reviewed by Anders Carlsson.
3741
3742         WKNVCALayerRenderServerPort in NetscapeBrowserFunc.h is meaningful only for Mac.
3743         So we need to add PLUGIN_ARCHITECTURE(MAC) around it.
3744
3745         * WebProcess/Plugins/Netscape/NetscapeBrowserFuncs.h:
3746
3747 2015-05-19  Brent Fulgham  <bfulgham@apple.com>
3748
3749         REGRESSION(142590): Part 2: Scroll-snap points are improperly snapping to earlier index values (Scrolling Thread) 
3750         https://bugs.webkit.org/show_bug.cgi?id=145175
3751         <rdar://problem/21023785>
3752
3753         Reviewed by Beth Dakin.
3754
3755         Add a stub implementation of isScrollSnapInProgress to match ScrollingCoordinator signature.
3756
3757         * WebProcess/Scrolling/RemoteScrollingCoordinator.h:
3758         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
3759         (WebKit::RemoteScrollingCoordinator::isScrollSnapInProgress): Added stub.
3760
3761 2015-05-19  Jeremy Jones  <jeremyj@apple.com>
3762
3763         WebVideoFullscreenManagerProxy has incorrect OS_VERSION_MIN_REQUIRED conditionals.
3764         https://bugs.webkit.org/show_bug.cgi?id=145158
3765
3766         Reviewed by Eric Carlson.
3767
3768         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
3769         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame):
3770
3771 2015-05-19  Ting-Wei Lan  <lantw44@gmail.com>
3772
3773         [SOUP] Use st_birthtime to get creation time of files on systems support it
3774         https://bugs.webkit.org/show_bug.cgi?id=144989
3775
3776         Reviewed by Carlos Garcia Campos.
3777
3778         FreeBSD and NetBSD have either st_birthtime field or compatiblity macro
3779         with the same name in stat. It is better to use it instead of manually
3780         setting xattr, which is unreliable because both operating systems and
3781         file systems support are required.
3782
3783         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
3784         (WebKit::NetworkCache::fileTimes):
3785         * NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp:
3786         (WebKit::NetworkCache::IOChannel::IOChannel):
3787
3788 2015-05-19  Chris Dumez  <cdumez@apple.com>
3789
3790         Mark static variables as const when possible
3791         https://bugs.webkit.org/show_bug.cgi?id=145161
3792
3793         Reviewed by Andreas Kling.
3794
3795         * Platform/IPC/MessageEncoder.cpp:
3796         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3797         (WebKit::networkProcessLatencyQOS):
3798         (WebKit::networkProcessThroughputQOS):
3799         (WebKit::webProcessLatencyQOS):
3800         (WebKit::webProcessThroughputQOS):
3801         * UIProcess/Plugins/mac/PluginProcessProxyMac.mm:
3802         (WebKit::PluginProcessProxy::pluginNeedsExecutableHeap):
3803         (WebKit::pluginProcessLatencyQOS):
3804         (WebKit::pluginProcessThroughputQOS):
3805         * WebProcess/WebPage/WebPage.cpp:
3806
3807 2015-05-18  Michael Catanzaro  <mcatanzaro@igalia.com>
3808
3809         [CMake] Ignore warnings in system headers
3810         https://bugs.webkit.org/show_bug.cgi?id=144747
3811
3812         Reviewed by Darin Adler.
3813
3814         Separate include directories into WebKit project includes and system includes. Suppress all
3815         warnings from headers in system include directories using the SYSTEM argument to
3816         the include_directories command.
3817
3818         * CMakeLists.txt:
3819         * PlatformEfl.cmake:
3820         * PlatformGTK.cmake:
3821
3822 2015-05-18  Csaba Osztrogonác  <ossy@webkit.org>
3823
3824         Fix return-type warnings in test_ewk2_color_picker.cpp
3825         https://bugs.webkit.org/show_bug.cgi?id=145122
3826
3827         Reviewed by Gyuyoung Kim.
3828
3829         * UIProcess/API/efl/tests/test_ewk2_color_picker.cpp:
3830         (EWK2ColorPickerTest::hideColorPicker):
3831         (EWK2ColorPickerTest::hideColorPickerByRemovingElement):
3832
3833 2015-05-18  Skachkov Alexandr  <gskachkov@gmail.com>
3834
3835         [ES6] Arrow function syntax. Feature flag for arrow function
3836         https://bugs.webkit.org/show_bug.cgi?id=145108
3837
3838         Reviewed by Ryosuke Niwa.
3839
3840         Added feature flag ENABLE_ES6_ARROWFUNCTION_SYNTAX for arrow function
3841
3842         * Configurations/FeatureDefines.xcconfig:
3843
3844 2015-05-18  Anders Carlsson  <andersca@apple.com>
3845
3846         WKWebsiteDataStore should fully support session storage
3847         https://bugs.webkit.org/show_bug.cgi?id=145145
3848         rdar://problem/10690447
3849
3850         Reviewed by Sam Weinig.
3851
3852         Add a session store data type and handle it when clearing and fetching data.
3853
3854         * Shared/WebsiteData/WebsiteDataTypes.h:
3855         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
3856         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
3857         (dataTypesToString):
3858         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
3859         (WebKit::toWebsiteDataTypes):
3860         (WebKit::toWKWebsiteDataTypes):
3861         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
3862         (+[WKWebsiteDataStore allWebsiteDataTypes]):
3863         * UIProcess/Storage/StorageManager.cpp:
3864         (WebKit::StorageManager::SessionStorageNamespace::origins):
3865         (WebKit::StorageManager::SessionStorageNamespace::clearStorageAreasMatchingOrigin):
3866         (WebKit::StorageManager::SessionStorageNamespace::clearAllStorageAreas):
3867         (WebKit::StorageManager::getSessionStorageOrigins):
3868         (WebKit::StorageManager::deleteSessionStorageOrigins):
3869         (WebKit::StorageManager::deleteSessionStorageEntriesForOrigins):
3870         * UIProcess/Storage/StorageManager.h:
3871         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
3872         (WebKit::WebsiteDataStore::fetchData):
3873         (WebKit::WebsiteDataStore::removeData):
3874
3875 2015-05-18  Brady Eidson  <beidson@apple.com>
3876
3877         Followup to: Networking process on iOS can be suspended and never exit
3878         https://bugs.webkit.org/show_bug.cgi?id=144971.
3879
3880         Unreviewed. Fixing API tests that revealed the unintentional change in behavior.
3881
3882         * Shared/ChildProcessProxy.cpp:
3883         (WebKit::ChildProcessProxy::shutDownProcess): The on WebProcessProxy code path that this
3884           was adopted from had an m_connection null check, and that null check needs to remain.
3885
3886 2015-05-18  Csaba Osztrogonác  <ossy@webkit.org>
3887
3888         [GTK] URTBF after r184503.
3889
3890         * PlatformGTK.cmake:
3891
3892 2015-05-18  Brady Eidson  <beidson@apple.com>
3893
3894         Networking process on iOS can be suspended and never exit.
3895         <rdar://problem/20368630> and https://bugs.webkit.org/show_bug.cgi?id=144971
3896
3897         Reviewed by Darin Adler.
3898
3899         There's a few issues here.
3900         
3901         1 - When the NetworkProcessProxy goes away, it takes its process assertion with it. This causes
3902             the Network process to suspend indefinitely, unable to ever respond to IPC::Connection callbacks.
3903             We already solved this with WebProcess with a watchdog timer keeping both the process assertion
3904             and xpc_connection alive while the process shuts down. This patch expands that to the network
3905             process, and it will be easy to expand that to database and plugin processes doing forward.
3906         
3907         2 - All of our child processes either decide to self-terminate or listen for their connection to
3908             close at which point they terminate. This leads to various races. We should
3909             move to a model where the UI process explicitly tells them to shutdown, and this patch starts us 
3910             down that path.
3911         
3912         * CMakeLists.txt:
3913         * DerivedSources.make:
3914         * WebKit2.xcodeproj/project.pbxproj:
3915         
3916         * NetworkProcess/NetworkProcess.cpp:
3917         (WebKit::NetworkProcess::didReceiveMessage): Send ChildProcess messages to ChildProcess.
3918         
3919         * Shared/ChildProcess.cpp:
3920         (WebKit::ChildProcess::shutDown): For now, just terminate the process. In the future have the
3921           process do cleanup work before it is terminated.
3922         * Shared/ChildProcess.h:
3923         * Shared/ChildProcess.messages.in: Added.
3924         
3925         * Shared/ChildProcessProxy.cpp:
3926         (WebKit::ChildProcessProxy::shutDownProcess): Set a watchdog and - if possible - explicitly message 
3927           the process to ShutDown.
3928         (WebKit::ChildProcessProxy::abortProcessLaunchIfNeeded): Deleted.
3929         * Shared/ChildProcessProxy.h:
3930         
3931         * UIProcess/WebProcessPool.cpp:
3932         (WebKit::WebProcessPool::~WebProcessPool): Explicitly tell the network process to shut down.
3933         
3934         * UIProcess/WebProcessProxy.cpp:
3935         (WebKit::WebProcessProxy::removeWebPage): Move abortProcessLaunchIfNeeded() and the watchdog timer
3936           code to ChildProcessProxy::shutDownProcess.
3937         
3938         * WebProcess/WebProcess.cpp:
3939         (WebKit::WebProcess::didReceiveMessage): Send ChildProcess messages to ChildProcess::didReceiveMessage.
3940
3941 2015-05-17  Carlos Garcia Campos  <cgarcia@igalia.com>
3942
3943         Network Cache: Make Data::adoptMap take the ownership of the file descriptor
3944         https://bugs.webkit.org/show_bug.cgi?id=144950
3945
3946         Reviewed by Antti Koivisto.
3947
3948         It will be required to implement ShareableResource for soup
3949         network backend. Also move the common code of Data to a common
3950         file and add mapToFile(). The mapFile version that receives a file
3951         descriptor has been renamed to adoptAndMapFile().
3952
3953         * CMakeLists.txt: Add new file to compilation.
3954         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
3955         (WebKit::NetworkCache::BlobStorage::add): Use mapToFile().
3956         * NetworkProcess/cache/NetworkCacheData.cpp: Added.
3957         (WebKit::NetworkCache::Data::mapToFile): Write the data to the
3958         given file and map it.
3959         (WebKit::NetworkCache::mapFile):
3960         (WebKit::NetworkCache::adoptAndMapFile):
3961         (WebKit::NetworkCache::computeSHA1):
3962         (WebKit::NetworkCache::bytesEqual):
3963         * NetworkProcess/cache/NetworkCacheData.h:
3964         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
3965         (WebKit::NetworkCache::Data::adoptMap): Close the file descriptor.
3966         * NetworkProcess/cache/NetworkCacheDataSoup.cpp:
3967         (WebKit::NetworkCache::Data::Data): Use a constructor that
3968         receives a file descriptor instead of the one receiving
3969         Backing. If the file descriptor is not -1 then the Data is a map.
3970         (WebKit::NetworkCache::MapWrapper::~MapWrapper): Also close the
3971         file descriptor.
3972         (WebKit::NetworkCache::Data::adoptMap): Pass the file descriptor
3973         to the MapWrapper and create the Data passing the file descriptor.
3974         * UIProcess/API/APIUserContentExtensionStore.cpp:
3975         (API::openAndMapContentExtension): Use mapFile that receives a
3976         file path.
3977         (API::compiledToFile): Use adoptAndMapFile() and don't close the
3978         descriptor.
3979
3980 2015-05-16  Andy Estes  <aestes@apple.com>
3981
3982         [iOS] WKPDFView should not follow javascript: links
3983         https://bugs.webkit.org/show_bug.cgi?id=145101
3984
3985         Reviewed by Dan Bernstein.
3986
3987         * UIProcess/WebPageProxy.cpp:
3988         (WebKit::WebPageProxy::navigateToPDFLinkWithSimulatedClick): Returned early if url's protocol is javascript:.
3989         (WebKit::WebPageProxy::navigateToURLWithSimulatedClick): Renamed to navigateToPDFLinkWithSimulatedClick to
3990         reflect that this function is exclusively for following PDF links.
3991         * UIProcess/WebPageProxy.h:
3992         * UIProcess/ios/WKPDFView.mm:
3993         (-[WKPDFView annotation:wasTouchedAtPoint:controller:]):
3994         (-[WKPDFView actionSheetAssistant:openElementAtLocation:]):
3995         * WebProcess/WebPage/WebPage.cpp:
3996         (WebKit::WebPage::navigateToPDFLinkWithSimulatedClick): Renamed from navigateToURLWithSimulatedClick.
3997         (WebKit::WebPage::navigateToURLWithSimulatedClick): Renamed to navigateToPDFLinkWithSimulatedClick.
3998         * WebProcess/WebPage/WebPage.h:
3999         * WebProcess/WebPage/WebPage.messages.in:
4000
4001 2015-05-16  Brent Fulgham  <bfulgham@apple.com>
4002
4003         [iOS] Remote scrolling tree needs to coordinate scroll snap state during resize/rotations
4004         https://bugs.webkit.org/show_bug.cgi?id=145059
4005         <rdar://problem/20975978>
4006
4007         Reviewed by Simon Fraser.
4008
4009         The web view needs to update its scroll snap point offsets to take into account any
4010         adjustments to the view size caused by content insets. We also need to update the
4011         offstes after device rotation.
4012
4013         * UIProcess/API/Cocoa/WKWebView.mm:
4014         (-[WKWebView scrollViewWillEndDragging:withVelocity:targetContentOffset:]): Retrieve the proper
4015         computed content inset for the view and incorporate into any scroll snap point adjustments.
4016         (-[WKWebView _updateVisibleContentRects]): If we have active scroll snap points, 
4017         * UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
4018         * UIProcess/ios/RemoteScrollingCoordinatorProxyIOS.mm:
4019         (WebKit::RemoteScrollingCoordinatorProxy::adjustTargetContentOffsetForSnapping): Update to account
4020         for content inset.
4021         (WebKit::RemoteScrollingCoordinatorProxy::shouldSnapForMainFrameScrolling): Also validate that the
4022         active index is valid.
4023         (WebKit::RemoteScrollingCoordinatorProxy::closestSnapOffsetForMainFrameScrolling): Update to track
4024         current active snap offset index.
4025         (WebKit::RemoteScrollingCoordinatorProxy::hasActiveSnapPoint): Added.
4026         (WebKit::RemoteScrollingCoordinatorProxy::nearestActiveSnapPoint): Added. It calculates the proper
4027         scroll position incorporating any snap point and content insets.
4028
4029 2015-05-15  Yongjun Zhang  <yongjun_zhang@apple.com>
4030
4031         Don't reset the preview recognizer in [WKContentViewInteraction cleanupInteraction]
4032         https://bugs.webkit.org/show_bug.cgi?id=145081
4033
4034         We shouldn't reset the recognizer in [WKContentViewInteraction cleanupInteraction] since we don't re-add it
4035         back to WKContentView when the process relaunched. Since we already add/remove it when the view is move into/
4036         removed from the window, we don't need reset it in cleanupInteraction.
4037
4038         Reviewed by Dan Bernstein.
4039
4040         * UIProcess/ios/WKContentViewInteraction.mm:
4041         (-[WKContentView cleanupInteraction]):
4042
4043 2015-05-15  James Savage  <james.savage@apple.com>
4044
4045         REGRESSION (r181910): WKWebView incorrectly scales snapshot
4046         https://bugs.webkit.org/show_bug.cgi?id=145076
4047
4048         Reviewed by Tim Horton.
4049
4050         We added a fast path to snapshotting using IOSurfaces with
4051         http://trac.webkit.org/changeset/181910 which incorrectly determined
4052         scale and transform and resulted in bad snapshots in some situations.
4053
4054         * UIProcess/API/Cocoa/WKWebView.mm:
4055         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
4056         When snapshotting an IOSurface we need to compute our scale based off of
4057         the rect in the WKWebView coordinates, we also failed to account for
4058         non-zero origins in the snapshot rect. Remove an unused varible while
4059         we're here.
4060
4061 2015-05-15  Alex Christensen  <achristensen@webkit.org>
4062
4063         [Content Extensions] Fail to load old content extension files
4064         https://bugs.webkit.org/show_bug.cgi?id=145027
4065
4066         Reviewed by Eric Carlson.
4067
4068         * UIProcess/API/APIUserContentExtensionStore.cpp:
4069     &nbs