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