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