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