Add WK_ARRAY and WK_SET annotations
[WebKit-https.git] / Source / WebKit2 / ChangeLog
1 2015-04-22  Anders Carlsson  <andersca@apple.com>
2
3         Add WK_ARRAY and WK_SET annotations
4         https://bugs.webkit.org/show_bug.cgi?id=144075
5         rdar://problem/19417770
6
7         Reviewed by Dan Bernstein.
8
9         * Shared/API/Cocoa/WKFoundation.h:
10         * UIProcess/API/Cocoa/WKBackForwardList.h:
11         * UIProcess/API/Cocoa/WKUserContentController.h:
12         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
13         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
14         * mac/postprocess-framework-headers.sh:
15
16 2015-04-22  Brent Fulgham  <bfulgham@apple.com>
17
18         Unreviewed build fix after r183136.
19
20         * WebProcess/WebPage/mac/WebPageMac.mm: Correct capitalization of
21         'HTMLPluginImageElement.h' -> 'HTMLPlugInImageElement.h'
22
23 2015-04-21  Brent Fulgham  <bfulgham@apple.com>
24
25         Extend action menus to support PDF
26         https://bugs.webkit.org/show_bug.cgi?id=143895
27         <rdar://problem/19003333>
28
29         Reviewed by Tim Horton.
30
31         If the mouse pointer is over a PDF, try to provide a relevant action menu for whatever
32         content is under the mouse. For now, we only support copying text and handling URLs.
33
34         If no text is selected, use the dictionary lookup service to find a semantically appropriate
35         selection underneath the mouse. This is consistent with how normal text is treated in pure HTML
36         views. If some text is already selected, and the mouse is over the existing selection, continue
37         using the selected text. Otherwise, discard the old selection and select the most appropriate
38         region under the mouse pointer.
39
40         * Shared/API/c/WKActionMenuTypes.h: Add PDF menu option.
41         * Shared/WebMouseEvent.cpp: Recognize mouse force events as valid mouse events.
42         * UIProcess/mac/WKActionMenuController.mm:
43         (-[WKActionMenuController _defaultMenuItemsForPDF]): Add simply copy text option.
44         (-[WKActionMenuController _defaultMenuItems]): Recognize PDFs and add relevant action
45         menu entries.
46         * WebProcess/Plugins/Netscape/NetscapePlugin.h: Provide stub for new method.
47         * WebProcess/Plugins/PDF/PDFLayerControllerDetails.h: Expose 'rectsForSelectionInLayerSpace',
48         'rectsForAnnotationInLayoutSpace', 'layout', and 'currentPage'.
49         * WebProcess/Plugins/PDF/PDFPlugin.h:
50         * WebProcess/Plugins/PDF/PDFPlugin.mm:
51         (WebKit::PDFPlugin::getSelectionForWordAtPoint): Added.
52         (WebKit::PDFPlugin::existingSelectionContainsPoint): Added.
53         (WebKit::PDFPlugin::lookupTextAtLocation): Added.
54         * WebProcess/Plugins/Plugin.h: Add declaration for new 'getSelectionForWordAtPoint' method.
55         * WebProcess/Plugins/PluginProxy.h: Provide stub for new method.
56         * WebProcess/Plugins/PluginView.cpp:
57         (WebKit::PluginView::getSelectionForWordAtPoint): Added.
58         (WebKit::PluginView::existingSelectionContainsPoint): Added.
59         (WebKit::PluginView::lookupTextAtLocation): Added.
60         * WebProcess/Plugins/PluginView.h:
61         * WebProcess/WebPage/mac/WebPageMac.mm:
62         (WebKit::WebPage::performActionMenuHitTestAtLocation): Update to support PDF documents and retrieve
63         relevant content to support later action menu handling.
64
65 2015-04-22  Eric Carlson  <eric.carlson@apple.com>
66
67         Update AirPlay sandbox rules
68         https://bugs.webkit.org/show_bug.cgi?id=144062
69         <rdar://problem/19869448>
70
71         Reviewed by Alexey Proskuryakov.
72
73         * WebProcess/com.apple.WebProcess.sb.in: Remove obsolete rules.
74
75 2015-04-22  Alexey Proskuryakov  <ap@apple.com>
76
77         [Mac] In nightlies and local builds, WebKit services can get terminated under memory pressure
78         https://bugs.webkit.org/show_bug.cgi?id=144052
79         rdar://problem/19754404
80
81         Reviewed by Darin Adler.
82
83         * Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.Development.mm:
84         (main): Make XPC transaction tracking work again after a re-exec.
85
86 2015-04-22  Zan Dobersek  <zdobersek@igalia.com>
87
88         [WK2] Have API::Array creation methods return Ref<>
89         https://bugs.webkit.org/show_bug.cgi?id=143933
90
91         Reviewed by Darin Adler.
92
93         API::Array::create() and API::Array::createStringArray() should return Ref<> objects
94         as the return values are never null. It's up to the caller to implicitly convert the
95         returned objects to RefPtr<> if so required. All the call-sites have been updated to
96         reflect that.
97
98         * Shared/API/APIArray.cpp:
99         (API::Array::create):
100         (API::Array::createStringArray):
101         (API::Array::copy):
102         * Shared/API/APIArray.h:
103         * Shared/API/APIDictionary.cpp:
104         (API::Dictionary::keys):
105         * Shared/API/APIDictionary.h:
106         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
107         (ensureObjectStream):
108         * Shared/API/c/WKArray.cpp:
109         (WKArrayCreate):
110         (WKArrayCreateAdoptingValues):
111         * Shared/API/c/WKContextMenuItem.cpp:
112         (WKContextMenuCopySubmenuItems):
113         * Shared/API/c/WKDictionary.cpp:
114         (WKDictionaryCopyKeys):
115         * Shared/API/c/WKMutableArray.cpp:
116         (WKMutableArrayCreate):
117         * Shared/Cocoa/WKNSDictionary.mm:
118         (-[WKNSDictionary keyEnumerator]):
119         * Shared/SecurityOriginData.cpp:
120         (WebKit::performAPICallbackWithSecurityOriginDataVector):
121         * Shared/WebContextMenuItem.cpp:
122         (WebKit::WebContextMenuItem::submenuItemsAsAPIArray):
123         * Shared/WebContextMenuItem.h:
124         * Shared/WebOpenPanelParameters.cpp:
125         (WebKit::WebOpenPanelParameters::acceptMIMETypes):
126         (WebKit::WebOpenPanelParameters::selectedFileNames):
127         * Shared/WebOpenPanelParameters.h:
128         * UIProcess/API/C/WKBackForwardListRef.cpp:
129         (WKBackForwardListCopyBackListWithLimit):
130         (WKBackForwardListCopyForwardListWithLimit):
131         * UIProcess/API/C/WKGrammarDetail.cpp:
132         (WKGrammarDetailCopyGuesses):
133         * UIProcess/API/C/WKOpenPanelParameters.cpp:
134         (WKOpenPanelParametersCopyAcceptedMIMETypes):
135         (WKOpenPanelParametersCopySelectedFileNames):
136         * UIProcess/API/C/WKPage.cpp:
137         (WKPageSetPageContextMenuClient):
138         (WKPageCopyRelatedPages):
139         * UIProcess/API/Cocoa/WKBackForwardList.mm:
140         (-[WKBackForwardList backList]):
141         (-[WKBackForwardList forwardList]):
142         * UIProcess/API/Cocoa/WKBrowsingContextGroup.mm:
143         (createWKArray):
144         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
145         (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
146         * UIProcess/API/gtk/WebKitBackForwardList.cpp:
147         (webkit_back_forward_list_get_back_list_with_limit):
148         (webkit_back_forward_list_get_forward_list_with_limit):
149         * UIProcess/API/gtk/WebKitFileChooserRequest.cpp:
150         (webkit_file_chooser_request_get_mime_types):
151         (webkit_file_chooser_request_get_mime_types_filter):
152         (webkit_file_chooser_request_select_files):
153         * UIProcess/API/gtk/WebKitNotificationProvider.cpp:
154         (WebKitNotificationProvider::notificationCloseCallback):
155         * UIProcess/Notifications/WebNotificationManagerProxy.cpp:
156         (WebKit::WebNotificationManagerProxy::populateCopyOfNotificationPermissions):
157         * UIProcess/Notifications/WebNotificationProvider.cpp:
158         (WebKit::WebNotificationProvider::clearNotifications):
159         * UIProcess/Plugins/WebPluginSiteDataManager.cpp:
160         (WebKit::WebPluginSiteDataManager::didGetSitesWithData):
161         * UIProcess/StatisticsRequest.cpp:
162         (WebKit::StatisticsRequest::completedRequest):
163         * UIProcess/UserContent/WebUserContentControllerProxy.cpp:
164         (WebKit::WebUserContentControllerProxy::WebUserContentControllerProxy):
165         * UIProcess/WebBackForwardList.cpp:
166         (WebKit::WebBackForwardList::backList):
167         (WebKit::WebBackForwardList::forwardList):
168         (WebKit::WebBackForwardList::backListAsAPIArrayWithLimit):
169         (WebKit::WebBackForwardList::forwardListAsAPIArrayWithLimit):
170         * UIProcess/WebBackForwardList.h:
171         * UIProcess/WebCookieManagerProxy.cpp:
172         (WebKit::WebCookieManagerProxy::didGetHostnamesWithCookies):
173         * UIProcess/WebDatabaseManagerProxy.cpp:
174         (WebKit::WebDatabaseManagerProxy::didGetDatabasesByOrigin):
175         (WebKit::WebDatabaseManagerProxy::didGetDatabaseOrigins):
176         * UIProcess/WebGrammarDetail.cpp:
177         (WebKit::WebGrammarDetail::guesses):
178         * UIProcess/WebGrammarDetail.h:
179         * UIProcess/WebKeyValueStorageManager.cpp:
180         (WebKit::WebKeyValueStorageManager::getKeyValueStorageOrigins):
181         (WebKit::WebKeyValueStorageManager::getStorageDetailsByOrigin):
182         * UIProcess/WebMediaCacheManagerProxy.cpp:
183         (WebKit::WebMediaCacheManagerProxy::didGetHostnamesWithMediaCache):
184         * UIProcess/WebOriginDataManagerProxy.cpp:
185         (WebKit::WebOriginDataManagerProxy::didGetOrigins):
186         * UIProcess/WebPageProxy.cpp:
187         (WebKit::WebPageProxy::didFindStringMatches):
188         * UIProcess/WebProcessPool.cpp:
189         (WebKit::WebProcessPool::pluginInfoStoreDidLoadPlugins):
190         * UIProcess/ios/forms/WKFileUploadPanel.mm:
191         (-[WKFileUploadPanel _chooseFiles:displayString:iconImage:]):
192         (-[WKFileUploadPanel presentWithParameters:resultListener:]):
193         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFrame.mm:
194         (-[WKWebProcessPlugInFrame childFrames]):
195         * WebProcess/InjectedBundle/API/c/WKBundleBackForwardListItem.cpp:
196         (WKBundleBackForwardListItemCopyChildren):
197         * WebProcess/InjectedBundle/API/c/WKBundleFrame.cpp:
198         (WKBundleFrameCopyChildFrames):
199         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
200         (WKBundlePageCopyTrackedRepaintRects):
201         * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.cpp:
202         (WebKit::InjectedBundleBackForwardListItem::children):
203         * WebProcess/InjectedBundle/InjectedBundleBackForwardListItem.h:
204         * WebProcess/InjectedBundle/InjectedBundlePageContextMenuClient.cpp:
205         (WebKit::InjectedBundlePageContextMenuClient::getCustomMenuFromDefaultItems):
206         * WebProcess/InjectedBundle/InjectedBundlePageFormClient.cpp:
207         (WebKit::InjectedBundlePageFormClient::didAssociateFormControls):
208         * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp:
209         (WebKit::InjectedBundlePageLoaderClient::featuresUsedInPage):
210         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
211         (WebKit::findLargestFrameInFrameSet):
212         * WebProcess/WebPage/WebFrame.cpp:
213         (WebKit::WebFrame::childFrames):
214         * WebProcess/WebPage/WebFrame.h:
215         * WebProcess/WebPage/WebPage.cpp:
216         (WebKit::WebPage::trackedRepaintRects):
217         * WebProcess/WebPage/WebPage.h:
218
219 2015-04-21  Eric Carlson  <eric.carlson@apple.com>
220
221         [Mac] Use one playback target for all web processes
222         https://bugs.webkit.org/show_bug.cgi?id=144009
223
224         Reviewed by Tim Horton.
225
226         Every WebPageProxy uses the WebMediaSessionManager singleton to talk to the playback target
227         picker.
228
229         * UIProcess/PageClient.h:
230         * UIProcess/WebPageProxy.cpp:
231         (WebKit::WebPageProxy::WebPageProxy):
232         (WebKit::WebPageProxy::resetState):
233         (WebKit::WebPageProxy::isPlayingMediaDidChange):
234         (WebKit::WebPageProxy::addPlaybackTargetPickerClient):
235         (WebKit::WebPageProxy::removePlaybackTargetPickerClient):
236         (WebKit::WebPageProxy::showPlaybackTargetPicker):
237         (WebKit::WebPageProxy::playbackTargetPickerClientStateDidChange):
238         (WebKit::WebPageProxy::setPlaybackTarget):
239         (WebKit::WebPageProxy::externalOutputDeviceAvailableDidChange):
240         (WebKit::WebPageProxy::setShouldPlayToPlaybackTarget):
241         (WebKit::WebPageProxy::devicePickerProxy): Deleted.
242         (WebKit::WebPageProxy::startingMonitoringPlaybackTargets): Deleted.
243         (WebKit::WebPageProxy::stopMonitoringPlaybackTargets): Deleted.
244         (WebKit::WebPageProxy::didChoosePlaybackTarget): Deleted.
245         * UIProcess/WebPageProxy.h:
246         (WebKit::WebPageProxy::isPlayingAudio):
247         * UIProcess/WebPageProxy.messages.in:
248         * UIProcess/mac/PageClientImpl.h:
249         * UIProcess/mac/PageClientImpl.mm:
250         (WebKit::PageClientImpl::mediaSessionManager):
251         (WebKit::PageClientImpl::createPlaybackTargetPicker): Deleted.
252         * UIProcess/mac/WebMediaSessionManagerMac.cpp: Added.
253         (WebKit::WebMediaSessionManagerMac::singleton):
254         (WebKit::WebMediaSessionManagerMac::WebMediaSessionManagerMac):
255         (WebKit::WebMediaSessionManagerMac::~WebMediaSessionManagerMac):
256         (WebKit::WebMediaSessionManagerMac::targetPicker):
257         * UIProcess/mac/WebMediaSessionManagerMac.h: Added.
258         * WebProcess/Plugins/PluginView.h:
259         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
260         (WebKit::WebChromeClient::isPlayingMediaDidChange):
261         (WebKit::WebChromeClient::addPlaybackTargetPickerClient):
262         (WebKit::WebChromeClient::removePlaybackTargetPickerClient):
263         (WebKit::WebChromeClient::showPlaybackTargetPicker):
264         (WebKit::WebChromeClient::playbackTargetPickerClientStateDidChange):
265         (WebKit::WebChromeClient::startingMonitoringPlaybackTargets): Deleted.
266         (WebKit::WebChromeClient::stopMonitoringPlaybackTargets): Deleted.
267         * WebProcess/WebCoreSupport/WebChromeClient.h:
268         * WebProcess/WebPage/WebPage.h:
269         * WebProcess/WebPage/WebPage.messages.in:
270         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
271         (WebKit::TiledCoreAnimationDrawingArea::dispatchAfterEnsuringUpdatedScrollPosition):
272         * WebProcess/WebPage/mac/WebPageMac.mm:
273         (WebKit::WebPage::playbackTargetSelected):
274         (WebKit::WebPage::playbackTargetAvailabilityDidChange):
275         (WebKit::WebPage::setShouldPlayToPlaybackTarget):
276
277 2015-04-21  Anders Carlsson  <andersca@apple.com>
278
279         WKWebsiteDataStore doesn't track and remove IndexedDB databases
280         https://bugs.webkit.org/show_bug.cgi?id=144032
281         rdar://problem/20242856
282
283         Reviewed by Tim Horton.
284
285         * DatabaseProcess/DatabaseProcess.cpp:
286         (WebKit::DatabaseProcess::fetchWebsiteData):
287         (WebKit::DatabaseProcess::deleteWebsiteData):
288         (WebKit::DatabaseProcess::deleteWebsiteDataForOrigins):
289         * DatabaseProcess/DatabaseProcess.h:
290         * DatabaseProcess/DatabaseProcess.messages.in:
291         * Shared/WebsiteData/WebsiteDataTypes.h:
292         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
293         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
294         (dataTypesToString):
295         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
296         (WebKit::toWebsiteDataTypes):
297         (WebKit::toWKWebsiteDataTypes):
298         * UIProcess/Databases/DatabaseProcessProxy.cpp:
299         (WebKit::generateCallbackID):
300         (WebKit::DatabaseProcessProxy::~DatabaseProcessProxy):
301         (WebKit::DatabaseProcessProxy::fetchWebsiteData):
302         (WebKit::DatabaseProcessProxy::deleteWebsiteData):
303         (WebKit::DatabaseProcessProxy::deleteWebsiteDataForOrigins):
304         (WebKit::DatabaseProcessProxy::didClose):
305         (WebKit::DatabaseProcessProxy::didFetchWebsiteData):
306         (WebKit::DatabaseProcessProxy::didDeleteWebsiteData):
307         (WebKit::DatabaseProcessProxy::didDeleteWebsiteDataForOrigins):
308         * UIProcess/Databases/DatabaseProcessProxy.h:
309         * UIProcess/Databases/DatabaseProcessProxy.messages.in:
310         * UIProcess/WebProcessPool.h:
311         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
312         (WebKit::WebsiteDataStore::fetchData):
313         (WebKit::WebsiteDataStore::removeData):
314
315 2015-04-21  Anders Carlsson  <andersca@apple.com>
316
317         Add module maps for WebKit
318         https://bugs.webkit.org/show_bug.cgi?id=144026
319         rdar://problem/19665428
320
321         Reviewed by Dan Bernstein.
322
323         * Configurations/WebKit.xcconfig:
324         * Modules/OSX.modulemap: Added.
325         * Modules/iOS.modulemap: Added.
326
327 2015-04-21  Tim Horton  <timothy_horton@apple.com>
328
329         Long pause under _takeViewSnapshot when screen updates are disabled
330         https://bugs.webkit.org/show_bug.cgi?id=144017
331         <rdar://problem/20548397>
332
333         Reviewed by Simon Fraser.
334
335         * UIProcess/API/mac/WKView.mm:
336         (-[WKView _takeViewSnapshot]):
337         Use CGSHWCaptureWindowList, for snapshotting that doesn't block on
338         the next commit, and can succeed while screen updates are disabled
339         without blocking.
340
341 2015-04-21  Chris Dumez  <cdumez@apple.com>
342
343         [WK2][NetworkCache] Better account of resource revalidations in efficacy logging
344         https://bugs.webkit.org/show_bug.cgi?id=144014
345
346         Reviewed by Antti Koivisto.
347
348         Better account of resource revalidations in efficacy logging.
349         Prevously, resources that were in the cache but needed revalidation
350         were counted as retrieval successes, which is not entirely accurate.
351
352         We now distinguish "is in the cache and is directly usable" from
353         "is in the cache but needs revalidation". We also log how many of these
354         revalidations are successful.
355
356         * NetworkProcess/NetworkResourceLoader.cpp:
357         (WebKit::NetworkResourceLoader::didReceiveResponseAsync):
358         * NetworkProcess/cache/NetworkCache.cpp:
359         (WebKit::NetworkCache::Cache::update):
360         * NetworkProcess/cache/NetworkCache.h:
361         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
362         (WebKit::NetworkCache::Statistics::recordRetrievedCachedEntry):
363         (WebKit::NetworkCache::Statistics::recordRevalidationSuccess):
364         * NetworkProcess/cache/NetworkCacheStatistics.h:
365
366 2015-04-21  Dan Bernstein  <mitz@apple.com>
367
368         [Cocoa] Framework header postprocessing should respect additional definitions
369         https://bugs.webkit.org/show_bug.cgi?id=144018
370
371         Reviewed by Anders Carlsson.
372
373         * mac/postprocess-framework-headers.sh: Read definitons from
374         /usr/local/include/WebKitAdditions/Scripts/postprocess-framework-headers-definitions, and
375         have them take precedence over OSX_VERSION and IOS_VERSION and supply additional options to
376         sed.
377
378 2015-04-21  Anders Carlsson  <andersca@apple.com>
379
380         Fix block signatures
381         https://bugs.webkit.org/show_bug.cgi?id=144002
382
383         Reviewed by Andreas Kling.
384
385         * UIProcess/API/Cocoa/WKUIDelegate.h:
386         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
387         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
388         (-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
389         (-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
390         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
391         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
392         (-[_WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
393         (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
394         * UIProcess/ios/WKPDFView.mm:
395         (-[WKPDFView _highlightLinkAnnotation:forDuration:completionHandler:]):
396         * UIProcess/ios/forms/WKFileUploadPanel.mm:
397         (-[WKFileUploadPanel _processMediaInfoDictionaries:successBlock:failureBlock:]):
398         (-[WKFileUploadPanel _processMediaInfoDictionaries:atIndex:processedResults:processedImageCount:processedVideoCount:successBlock:failureBlock:]):
399         (-[WKFileUploadPanel _uploadItemFromMediaInfo:successBlock:failureBlock:]):
400
401 2015-04-21  Timothy Horton  <timothy_horton@apple.com>
402
403         PDFs still don't snapshot properly in iOS Safari
404         https://bugs.webkit.org/show_bug.cgi?id=143976
405         <rdar://problem/18283459>
406
407         Reviewed by Anders Carlsson.
408
409         * UIProcess/WebPageProxy.cpp:
410         (WebKit::WebPageProxy::didLayoutForCustomContentProvider):
411         * UIProcess/WebPageProxy.h:
412         * UIProcess/API/Cocoa/WKWebView.mm:
413         (-[WKWebView _didFinishLoadingDataForCustomContentProviderWithSuggestedFilename:data:]):
414         Inform the client that we've passed all reasonable layout milestones
415         as soon as the custom content provider has been handed its data.
416         WKPDFView, the only custom content provider, synchronously lays out
417         its subviews upon initial receipt of data, so this works fine for it.
418         This ensures that clients that normally depend on layout milestones firing
419         won't break when a custom content view is installed.
420
421         (-[WKWebView _snapshotRect:intoImageOfWidth:completionHandler:]):
422         Fall back to renderInContext: if the custom content view is not parented
423         when a snapshot is requested.
424
425 2015-04-21  Dan Bernstein  <mitz@apple.com>
426
427         Merged WKBackForwardListItem’s Internal category into the class extension in WKBackForwardListItemInternal.h.
428
429         Reviewed by Anders Carlsson.
430
431         * UIProcess/API/Cocoa/WKBackForwardListItem.mm:
432         (-[WKBackForwardListItem _item]):
433         (-[WKBackForwardListItem _apiObject]):
434         * UIProcess/API/Cocoa/WKBackForwardListItemInternal.h:
435
436 2015-04-21  Chris Dumez  <cdumez@apple.com>
437
438         Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&) constructor explicit
439         https://bugs.webkit.org/show_bug.cgi?id=143970
440
441         Reviewed by Darin Adler.
442
443         Make Vector(const Vector<T, otherCapacity, otherOverflowBehaviour>&)
444         constructor explicit as it copies the vector and it is easy to call it
445         by mistake.
446
447         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.cpp:
448         (WebKit::WebIDBServerConnection::setIndexKeys):
449         * WebProcess/Databases/IndexedDB/WebIDBServerConnection.h:
450
451 2015-04-20  Dan Bernstein  <mitz@apple.com>
452
453         Expose more bundle form client functions as WKWebProcessPlugInFormDelegatePrivate methods
454         https://bugs.webkit.org/show_bug.cgi?id=143973
455
456         Reviewed by Anders Carlsson.
457
458         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInFormDelegatePrivate.h: Declared new
459         delegate methods.
460
461         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.h: Declared new frame
462         property.
463         * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInNodeHandle.mm:
464         (-[WKWebProcessPlugInNodeHandle frame]): Added. Returns the node’s document’s frame. This is
465         useful to delegates getting an array of nodes via the new method.
466
467         * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
468         (-[WKWebProcessPlugInBrowserContextController _setFormDelegate:]): Added overrides of
469         shouldNotifyOnFormChanges and didAssociateFormControls, which call the new delegate methods.
470
471 2015-04-20  Joseph Pecoraro  <pecoraro@apple.com>
472
473         Cleanup some StringBuilder use
474         https://bugs.webkit.org/show_bug.cgi?id=143550
475
476         Reviewed by Darin Adler.
477
478         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:
479         (WebKit::buildObjectStoreStatement):
480         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
481         (WebKit::v2RecordsTableSchema):
482         * Shared/Databases/IndexedDB/IDBUtilities.cpp:
483         (WebKit::uniqueDatabaseIdentifier):
484         * UIProcess/API/APIUserScript.cpp:
485         (API::UserScript::generateUniqueURL):
486         * UIProcess/WebProcessPool.cpp:
487         (WebKit::WebProcessPool::didReceiveInvalidMessage):
488         * WebProcess/Databases/IndexedDB/WebIDBFactoryBackend.cpp:
489         (WebKit::combinedSecurityOriginIdentifier):
490
491 2015-04-20  Anders Carlsson  <andersca@apple.com>
492
493         Modify the WKWebsiteDataStore API to take a NSSet of types instead of a bitmask
494         https://bugs.webkit.org/show_bug.cgi?id=143966
495
496         Reviewed by Dan Bernstein.
497
498         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h:
499         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm:
500         (dataTypesToString):
501         (-[WKWebsiteDataRecord dataTypes]):
502         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h:
503         (WebKit::toWebsiteDataTypes):
504         (WebKit::toWKWebsiteDataTypes):
505         * UIProcess/API/Cocoa/WKWebsiteDataStore.h:
506         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
507         (+[WKWebsiteDataStore allWebsiteDataTypes]):
508         (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
509         (-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
510         (-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
511         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
512         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
513         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
514         (toWKWebsiteDataTypes):
515         (-[_WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
516         (-[_WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
517         (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
518
519 2015-04-20  Beth Dakin  <bdakin@apple.com>
520
521         Should remove mouseForceClick and mouseForceCancelled from DOM force events
522         https://bugs.webkit.org/show_bug.cgi?id=143904
523         -and corresponding-
524         rdar://problem/20578842
525
526         Reviewed by Dan Bernstein.
527
528         * WebProcess/WebPage/mac/WebPageMac.mm:
529         (WebKit::WebPage::immediateActionDidCancel):
530
531 2015-04-20  Tim Horton  <timothy_horton@apple.com>
532
533         Implement immediate action support for tel: and mailto: URLs
534         https://bugs.webkit.org/show_bug.cgi?id=143916
535         <rdar://problem/19721711>
536
537         Reviewed by Darin Adler.
538
539         * Shared/API/c/WKImmediateActionTypes.h:
540         * UIProcess/mac/WKImmediateActionController.mm:
541         (-[WKImmediateActionController _defaultAnimationController]):
542         (-[WKImmediateActionController _animationControllerForDataDetectedText]):
543         (-[WKImmediateActionController _animationControllerForDataDetectedLink]):
544         (-[WKImmediateActionController _menuItemForDataDetectedText]): Deleted.
545         Add _animationControllerForDataDetectedLink and use it when
546         building immediate actions for tel: and mailto: links.
547
548 2015-04-20  Alex Christensen  <achristensen@webkit.org>
549
550         Properly report errors from _WKUserContentExtensionStore.
551         https://bugs.webkit.org/show_bug.cgi?id=143808
552
553         Reviewed by Darin Adler.
554
555         * UIProcess/API/Cocoa/_WKUserContentExtensionStore.mm:
556         (-[_WKUserContentExtensionStore compileContentExtensionForIdentifier:encodedContentExtension:completionHandler:]):
557         (-[_WKUserContentExtensionStore lookupContentExtensionForIdentifier:completionHandler:]):
558         (-[_WKUserContentExtensionStore removeContentExtensionForIdentifier:completionHandler:]):
559
560 2015-04-18  Simon Fraser  <simon.fraser@apple.com>
561
562         REGRESSION (r181656): Animated tiled layers are missing content
563         https://bugs.webkit.org/show_bug.cgi?id=143911
564         rdar://problem/20596328
565
566         Reviewed by Darin Adler.
567         
568         After r181656, all requestAnimationFrame was falling back to timers, and not
569         using the platform's DisplayRefreshMonitor, because of a Nullopt vs nullptr
570         fumble.
571         
572         Replace this confusing Optional<> code with simpler code that just forces the
573         clients to make a DisplayRefreshMonitor if they can, first asking
574         ChromeClient, and then falling back to createDefaultDisplayRefreshMonitor().
575         
576         Make lots of things into references, and use C++11 initialization in some places.
577
578         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
579         (WebKit::WebChromeClient::createDisplayRefreshMonitor):
580         * WebProcess/WebCoreSupport/WebChromeClient.h:
581
582 2015-04-18  Dan Bernstein  <mitz@apple.com>
583
584         SwipeShadow images are installed on iOS
585         https://bugs.webkit.org/show_bug.cgi?id=143915
586
587         Reviewed by Tim Horton.
588
589         * Configurations/WebKit.xcconfig: Added Resources/Mac/* to
590         EXCLUDED_SOURCE_FILE_NAMES[sdk=iphone*]. We could move more resources there and remove
591         individual patterns.
592         * Resources/SwipeShadow.png: Moved to mac.
593         * Resources/SwipeShadow@2x.png: Moved to mac.
594         * Resources/mac: Added.
595         * Resources/mac/SwipeShadow.png: Moved from Source/WebKit2/Resources/SwipeShadow.png.
596         * Resources/mac/SwipeShadow@2x.png: Moved from Source/WebKit2/Resources/SwipeShadow@2x.png.
597         * WebKit2.xcodeproj/project.pbxproj: Created mac group in the Resources group and moved
598         SwipeShadow*.png into it. Updated for file moves.
599
600 2015-04-18  Chris Dumez  <cdumez@apple.com>
601
602         Fix NetworkCache Statistics database bootstrapping after r182803
603         https://bugs.webkit.org/show_bug.cgi?id=143890
604
605         Reviewed by Darin Adler.
606
607         Update the NetworkCache Statistics database bootstrapping code to use
608         the records path instead of the version path. Also check that the
609         filenames in the folder are valid hashes to discard the *-body files.
610
611         * NetworkProcess/cache/NetworkCache.cpp:
612         (WebKit::NetworkCache::Cache::recordsPath):
613         (WebKit::NetworkCache::Cache::storagePath): Deleted.
614         * NetworkProcess/cache/NetworkCache.h:
615         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
616         (WebKit::NetworkCache::Statistics::initialize):
617         (WebKit::NetworkCache::Statistics::bootstrapFromNetworkCache):
618         (WebKit::NetworkCache::Statistics::shrinkIfNeeded):
619
620 2015-04-17  Tim Horton  <timothy_horton@apple.com>
621
622         Clients sometimes block for 500ms in waitForPossibleGeometryUpdates
623         https://bugs.webkit.org/show_bug.cgi?id=143901
624         <rdar://problem/20488655>
625
626         Reviewed by Anders Carlsson.
627
628         * Platform/IPC/Connection.cpp:
629         (IPC::Connection::waitForMessage):
630         InterruptWaitingIfSyncMessageArrives already cancels waitForMessage if
631         a sync message arrives while waiting, but it should also avoid waiting
632         if there's a sync message already in the queue when the waiting starts,
633         as that will have the same nasty effect.
634
635         * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
636         (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForPossibleGeometryUpdate):
637         If a synchronous message comes in from the Web process while we're waiting,
638         cancel our synchronous wait for DidUpdateGeometry. This will cause the size
639         change to not synchronize with the Web process' painting, but that is better
640         than pointlessly blocking for 500ms.
641
642 2015-04-17  Chris Dumez  <cdumez@apple.com>
643
644         Possible null pointer dereference in WebDiagnosticLoggingClient::logDiagnosticMessageWithValue()
645         https://bugs.webkit.org/show_bug.cgi?id=143899
646         <rdar://problem/20584215>
647
648         Reviewed by Anders Carlsson.
649
650         WebDiagnosticLoggingClient::logDiagnosticMessage*() methods failed to
651         check that m_page.corePage() was non-null before dereferencing, thus
652         causing crashes when it is null.
653
654         * WebProcess/WebCoreSupport/WebDiagnosticLoggingClient.cpp:
655         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessage):
656         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithResult):
657         (WebKit::WebDiagnosticLoggingClient::logDiagnosticMessageWithValue):
658
659 2015-04-17  Yongjun Zhang  <yongjun_zhang@apple.com>
660
661         WebKit client should be able to add view controller for link preview.
662         https://bugs.webkit.org/show_bug.cgi?id=143686
663
664         Add delegate methods to WKUIDelegatePrivate so that a WebKit client can prepare a view controller
665         for link preview and react to the dismissal of this view controller. Also connect WKContentView to
666         preview gesture recognizer and forwards the delegate callbacks to corresponding delegate methods
667         in WKUIDelegatePrivate.
668
669         Reviewed by Beth Dakin.
670
671         * Platform/spi/ios/UIKitSPI.h:
672         * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
673         * UIProcess/ios/WKContentView.mm:
674         (-[WKContentView willMoveToWindow:]):
675         * UIProcess/ios/WKContentViewInteraction.h:
676         * UIProcess/ios/WKContentViewInteraction.mm:
677         (-[WKContentView cleanupInteraction]):
678         (-[WKContentView gestureRecognizer:canPreventGestureRecognizer:]):
679         (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
680         (-[WKContentView gestureRecognizerShouldBegin:]):
681         (-[WKContentView previewViewControllerForPosition:inSourceView:]):
682         (-[WKContentView commitPreviewViewController:]):
683         (-[WKContentView willPresentPreviewViewController:forPosition:inSourceView:]):
684         (-[WKContentView didDismissPreviewViewController:committing:]):
685
686 2015-04-17  Beth Dakin  <bdakin@apple.com>
687
688         Force mouse events should go through normal mouse event handling code paths
689         https://bugs.webkit.org/show_bug.cgi?id=143749
690         -and corresponding-
691         rdar://problem/20472895
692
693         Reviewed by Dean Jackson.
694
695         This patch makes pressureChangeWithEvent create NativeWebMouseEvents with the 
696         NSEventTypePressures that is gets and sends those down to the web process.
697
698         Re-name pressureEvent to lastPressureEvent. Now that event can sometimes be an 
699         NSEventTypePressure, the new name makes it clear how the second parameter differs 
700         from the first.
701         * Shared/NativeWebMouseEvent.h:
702
703         New event types for the new types of events.
704         * Shared/WebEvent.h:
705         * Shared/WebEventConversion.cpp:
706         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
707         * Shared/mac/NativeWebMouseEventMac.mm:
708         (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
709         * Shared/mac/WebEventFactory.h:
710
711         All of the square-peg, round-hole problems of massaging the NSEventTypePressures 
712         events into WebMouseEvents is taken care of here.
713         * Shared/mac/WebEventFactory.mm:
714         (WebKit::mouseButtonForEvent):
715         (WebKit::globalPointForEvent):
716         (WebKit::pointForEvent):
717         (WebKit::WebEventFactory::createWebMouseEvent):
718
719         Instead of calling the old inputDeviceForceDidChange, create a NativeWebMouseEvent 
720         and handle it.
721         * UIProcess/API/mac/WKView.mm:
722         (-[WKView pressureChangeWithEvent:]):
723
724         Handle the new types.
725         * UIProcess/WebPageProxy.cpp:
726         (WebKit::WebPageProxy::didReceiveEvent):
727
728         Can delete inputDeviceForceDidChange since it’s no longer used.
729         (WebKit::WebPageProxy::inputDeviceForceDidChange): Deleted.
730         * UIProcess/WebPageProxy.h:
731
732         Handle the new types of mouse events properly.
733         * WebProcess/WebPage/WebPage.cpp:
734         (WebKit::handleMouseEvent):
735
736         Delete inputDeviceForceDidChange() and m_lastForceStage.
737         * WebProcess/WebPage/WebPage.h:
738         * WebProcess/WebPage/WebPage.messages.in:
739         * WebProcess/WebPage/mac/WebPageMac.mm:
740         (WebKit::WebPage::inputDeviceForceDidChange): Deleted.
741
742         Handle new WebEvent types.
743         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
744
745 2015-04-17  Commit Queue  <commit-queue@webkit.org>
746
747         Unreviewed, rolling out r182912 and r182920.
748         https://bugs.webkit.org/show_bug.cgi?id=143881
749
750         Build breakage in some configurations (Requested by ap on
751         #webkit).
752
753         Reverted changesets:
754
755         "Force mouse events should go through normal mouse event
756         handling code paths"
757         https://bugs.webkit.org/show_bug.cgi?id=143749
758         http://trac.webkit.org/changeset/182912
759
760         http://trac.webkit.org/changeset/182920
761
762 2015-04-17  Antti Koivisto  <antti@apple.com>
763
764         Network Cache: Read resource record and body in parallel
765         https://bugs.webkit.org/show_bug.cgi?id=143879
766
767         Reviewed by Chris Dumez.
768
769         We currently first fetch the record file and then fetch the body blob if needed.
770         We can do both operations in parallel to reduce latency.
771
772         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
773         (WebKit::NetworkCache::traverseCacheFiles):
774
775             Do all validation in the client.
776
777         * NetworkProcess/cache/NetworkCacheStorage.cpp:
778         (WebKit::NetworkCache::Storage::synchronize):
779
780             Maintain a bloom filter that contains the body blobs to avoid unnecessary IO attempts.
781             Delete any unknown file in cache directory.
782
783         (WebKit::NetworkCache::Storage::addToRecordFilter):
784
785             More informative name for record filter.
786
787         (WebKit::NetworkCache::Storage::mayContain):
788         (WebKit::NetworkCache::Storage::readRecord):
789         (WebKit::NetworkCache::Storage::storeBodyAsBlob):
790         (WebKit::NetworkCache::Storage::dispatchReadOperation):
791
792             Start record read IO and body blob read IO in parallel.
793
794         (WebKit::NetworkCache::Storage::finishReadOperation):
795
796             The read is finished when we have both the record and the blob.
797
798         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
799         (WebKit::NetworkCache::Storage::retrieve):
800         (WebKit::NetworkCache::Storage::store):
801         (WebKit::NetworkCache::Storage::traverse):
802         (WebKit::NetworkCache::Storage::clear):
803         (WebKit::NetworkCache::Storage::shrink):
804         (WebKit::NetworkCache::Storage::addToContentsFilter): Deleted.
805         (WebKit::NetworkCache::Storage::decodeRecord): Deleted.
806         * NetworkProcess/cache/NetworkCacheStorage.h:
807         (WebKit::NetworkCache::Storage::ReadOperation::ReadOperation):
808
809             ReadOperation is now mutable and gathers the read result.
810
811 2015-04-16  Anders Carlsson  <andersca@apple.com>
812
813         Stop installing WebKit2.framework
814         https://bugs.webkit.org/show_bug.cgi?id=143860
815         rdar://problem/18298491
816
817         Reviewed by Dan Bernstein.
818
819         * Configurations/WebKit2.xcconfig:
820         Set SKIP_INSTALL=YES for all SDKs except 10.9 where we still need it.
821
822 2015-04-17  Carlos Garcia Campos  <cgarcia@igalia.com>
823
824         Unreviewed. Fix the build with ENABLE(NETWORK_CACHE) and !ENABLE(SHAREABLE_RESOURCE).
825
826         * NetworkProcess/cache/NetworkCacheEntry.cpp:
827         * NetworkProcess/cache/NetworkCacheFileSystemPosix.h:
828         (WebKit::NetworkCache::fileTimes): There's no st_birthtime in Linux.
829
830 2015-04-17  Carlos Garcia Campos  <cgarcia@igalia.com>
831
832         [SOUP] ResourceRequest cache policy is not encoded/decoded in IPC messages
833         https://bugs.webkit.org/show_bug.cgi?id=143867
834
835         Reviewed by Sergio Villar Senin.
836
837         Encode/Decode the ResourceRequest cache policy.
838
839         * Shared/soup/WebCoreArgumentCodersSoup.cpp:
840         (IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
841         (IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):
842
843 2015-04-16  Sungmann Cho  <sungmann.cho@navercorp.com>
844
845         Use UNUSED_PARAM instead of the void casting to suppress unused parameter warnings.
846         https://bugs.webkit.org/show_bug.cgi?id=143750
847
848         Reviewed by Darin Adler.
849
850         No new tests, no behavior change.
851
852         * WebProcess/Notifications/NotificationPermissionRequestManager.cpp:
853         (WebKit::NotificationPermissionRequestManager::NotificationPermissionRequestManager):
854
855 2015-04-16  Brady Eidson  <beidson@apple.com>
856
857         Compiling a content extension fails when user's home directory is on a different volume from /var/tmp.
858         https://bugs.webkit.org/show_bug.cgi?id=143834
859
860         Reviewed by Anders Carlsson.
861
862         * UIProcess/API/APIUserContentExtensionStore.cpp:
863         (API::compiledToFile): Use moveFile() instead of renameFile()
864
865 2015-04-16  Anders Carlsson  <andersca@apple.com>
866
867         Deprecate _WKWebsiteDataStore in favor of WKWebsiteDataStore
868         https://bugs.webkit.org/show_bug.cgi?id=143844
869
870         Reviewed by Dan Bernstein.
871
872         * Shared/API/Cocoa/WKFoundation.h:
873         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
874         (-[WKWebViewConfiguration _validate]):
875         * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
876         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
877         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
878         * mac/postprocess-framework-headers.sh:
879
880 2015-04-16  Alex Christensen  <achristensen@webkit.org>
881
882         Removed unused WKUserContentFilterRef.
883         https://bugs.webkit.org/show_bug.cgi?id=143852
884
885         Reviewed by Sam Weinig.
886
887         * Shared/WebCompiledContentExtension.cpp:
888         (WebKit::LegacyContentExtensionCompilationClient::LegacyContentExtensionCompilationClient): Deleted.
889         (WebKit::LegacyContentExtensionCompilationClient::writeBytecode): Deleted.
890         (WebKit::LegacyContentExtensionCompilationClient::writeActions): Deleted.
891         (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData): Deleted.
892         * Shared/WebCompiledContentExtension.h:
893         * UIProcess/API/C/WKUserContentFilterRef.cpp: Removed.
894         * UIProcess/API/C/WKUserContentFilterRef.h: Removed.
895         * UIProcess/API/C/WebKit2_C.h:
896         * UIProcess/API/Cocoa/_WKUserContentFilter.h:
897         * UIProcess/API/Cocoa/_WKUserContentFilter.mm:
898         (-[_WKUserContentFilter initWithName:serializedRules:]): Deleted.
899         * WebKit2.xcodeproj/project.pbxproj:
900
901 2015-04-16  Beth Dakin  <bdakin@apple.com>
902
903         Rubber-stamped by Tim Horton.
904
905         Fixing a small mistake in http://trac.webkit.org/changeset/182912 which should 
906         make sure to use the most up-to-date pressure information when setting the force 
907         on a WebMouseEvent.
908
909         * Shared/mac/WebEventFactory.mm:
910         (WebKit::WebEventFactory::createWebMouseEvent):
911
912 2015-04-13  Jer Noble  <jer.noble@apple.com>
913
914         [iOS] When simultaneously exiting-and-entering fullscreen, WebVideoFullscreenManager/Proxy becomes confused about what video element it represents.
915         https://bugs.webkit.org/show_bug.cgi?id=143680
916
917         Reviewed by Simon Fraser.
918
919         The original assumption of WebVideoFullscreenManager and -Proxy was that the two classes would represent a
920         single video element and its full screen state. With multiple animations in and out of fullscreen combined with
921         multiple fullscreen modes, this assumption no longer holds true.
922
923         Rather than having a WebVideoFullscreenManager which /isa/ WebVideoFullscreenModelVideoElement, the manager now
924         /hasa/ WebVideoFullscreenModelVideoElement (or has many such models). Ditto for WebVideoFullscreenManager and
925         WebVideoFullscreenInterfaceAVKit. The WebVideoFullscreenInterfaceAVKit still needs a WebVideoFullscreenModel to
926         communicate with, so a new wrapper class is used for that purpose, WebVideoFullscreenModelContext. Ditto for
927         WebVideoFullscreenModelVideoElement and the new class WebVideoFullscreenInterfaceContext. These context classes
928         are paired and share a contextId, allowing the manager and its proxy to route messages between the UIProcess's
929         WebVideoFullscreenInterfaceAVKit to-and-from the WebProcess's WebVideoFullscreenModelVideoElement.
930
931         Both the WebVideoFullscreenModelContext and the WebVideoFullscreenInterfaceContext take a back-pointer to their
932         manager or manager proxy, and each method on the context simply calls the matching method on the manager and
933         passes its contextId as a parameter.
934
935         Both the WebVideoFullscreenManager and the WebVideoFullscreenManagerProxy pass that contextId in each of their
936         cross-process messages.
937
938         On the other side, the manager and proxy also have a map between contextIds and their matching
939         WebVideoFullscreenModelVideoElement (in the case of WebVideoFullscreenManager) or
940         WebVideoFullscreenInterfaceAVKit (in the case of WebVideoFullscreenManagerProxy).
941
942         While this change is large by LoC, it is almost entirely boilerplate.  The new and interesting pieces are these:
943
944         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
945         (WebKit::WebVideoFullscreenManagerProxy::WebVideoFullscreenManagerProxy): No longer a WebVideoFullscreenInterfaceAVKit.
946         (WebKit::WebVideoFullscreenManagerProxy::invalidate): Walk through the models and interfaces, invalidating each.
947         (WebKit::WebVideoFullscreenManagerProxy::createModelAndInterface): Added. Return a new model and interface tuple.
948         (WebKit::WebVideoFullscreenManagerProxy::ensureModelAndInterface): Added. Lazily create, and add to the m_contextMap
949             a new model and interface object.
950         (WebKit::WebVideoFullscreenManagerProxy::ensureModel): Return the model half of ensureModelAndInterface().
951         (WebKit::WebVideoFullscreenManagerProxy::ensureInterface): Return the interface half of ensureModelAndInterface().
952         (WebKit::WebVideoFullscreenManagerProxy::enterFullscreen): Walk through the outstanding interface objects, and if 
953             any have a fullscreen mode which matches the about-to-be-fullscreen interface, request that that other interface
954             exit fullscreen.
955         * WebProcess/ios/WebVideoFullscreenManager.mm:
956         (WebKit::nextContextId): Static, incrementing counter used as a contextId source.
957         (WebKit::WebVideoFullscreenManager::WebVideoFullscreenManager): No longer a WebVideoFullscreenModelVideoElement.
958         (WebKit::WebVideoFullscreenManager::~WebVideoFullscreenManager): Walk through the models and interfaces, invalidating each.
959         (WebKit::WebVideoFullscreenManager::ensureModelAndInterface): Added. Return a new model and interface tuple.
960         (WebKit::WebVideoFullscreenManager::ensureModelAndInterface):  Added. Lazily create, and add to the m_contextMap
961             a new model and interface object.
962         (WebKit::WebVideoFullscreenManager::ensureModel): Return the model half of ensureModelAndInterface().
963         (WebKit::WebVideoFullscreenManager::ensureInterface): Return the interface half of ensureModelAndInterface().
964
965         New classes and methods which just forward on to their owning objects:
966
967         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
968         (WebKit::WebVideoFullscreenModelContext::create):
969         (WebKit::WebVideoFullscreenModelContext::~WebVideoFullscreenModelContext):
970         (WebKit::WebVideoFullscreenModelContext::invalidate):
971         (WebKit::WebVideoFullscreenModelContext::layerHost):
972         (WebKit::WebVideoFullscreenModelContext::setLayerHost):
973         (WebKit::WebVideoFullscreenModelContext::setInitialVideoLayerFrame):
974         (WebKit::WebVideoFullscreenModelContext::WebVideoFullscreenModelContext):
975         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
976         (WebKit::WebVideoFullscreenModelContext::play):
977         (WebKit::WebVideoFullscreenModelContext::pause):
978         (WebKit::WebVideoFullscreenModelContext::togglePlayState):
979         (WebKit::WebVideoFullscreenModelContext::beginScrubbing):
980         (WebKit::WebVideoFullscreenModelContext::endScrubbing):
981         (WebKit::WebVideoFullscreenModelContext::seekToTime):
982         (WebKit::WebVideoFullscreenModelContext::fastSeek):
983         (WebKit::WebVideoFullscreenModelContext::beginScanningForward):
984         (WebKit::WebVideoFullscreenModelContext::beginScanningBackward):
985         (WebKit::WebVideoFullscreenModelContext::endScanning):
986         (WebKit::WebVideoFullscreenModelContext::requestExitFullscreen):
987         (WebKit::WebVideoFullscreenModelContext::setVideoLayerFrame):
988         (WebKit::WebVideoFullscreenModelContext::videoLayerFrame):
989         (WebKit::WebVideoFullscreenModelContext::setVideoLayerGravity):
990         (WebKit::WebVideoFullscreenModelContext::videoLayerGravity):
991         (WebKit::WebVideoFullscreenModelContext::selectAudioMediaOption):
992         (WebKit::WebVideoFullscreenModelContext::selectLegibleMediaOption):
993         (WebKit::WebVideoFullscreenModelContext::fullscreenModeChanged):
994         (WebKit::WebVideoFullscreenModelContext::didSetupFullscreen):
995         (WebKit::WebVideoFullscreenModelContext::didEnterFullscreen):
996         (WebKit::WebVideoFullscreenModelContext::didExitFullscreen):
997         (WebKit::WebVideoFullscreenModelContext::didCleanupFullscreen):
998         (WebKit::WebVideoFullscreenModelContext::fullscreenMayReturnToInline):
999         * WebProcess/ios/WebVideoFullscreenManager.h:
1000         (WebKit::WebVideoFullscreenInterfaceContext::create):
1001         (WebKit::WebVideoFullscreenInterfaceContext::invalidate):
1002         (WebKit::WebVideoFullscreenInterfaceContext::layerHostingContext):
1003         (WebKit::WebVideoFullscreenInterfaceContext::isAnimating):
1004         (WebKit::WebVideoFullscreenInterfaceContext::setIsAnimating):
1005         (WebKit::WebVideoFullscreenInterfaceContext::targetIsFullscreen):
1006         (WebKit::WebVideoFullscreenInterfaceContext::setTargetIsFullscreen):
1007         (WebKit::WebVideoFullscreenInterfaceContext::fullscreenMode):
1008         (WebKit::WebVideoFullscreenInterfaceContext::setFullscreenMode):
1009         (WebKit::WebVideoFullscreenInterfaceContext::isFullscreen):
1010         (WebKit::WebVideoFullscreenInterfaceContext::setIsFullscreen):
1011         * WebProcess/ios/WebVideoFullscreenManager.mm:
1012         (WebKit::WebVideoFullscreenInterfaceContext::WebVideoFullscreenInterfaceContext):
1013         (WebKit::WebVideoFullscreenInterfaceContext::~WebVideoFullscreenInterfaceContext):
1014         (WebKit::WebVideoFullscreenInterfaceContext::setLayerHostingContext):
1015         (WebKit::WebVideoFullscreenInterfaceContext::resetMediaState):
1016         (WebKit::WebVideoFullscreenInterfaceContext::setDuration):
1017         (WebKit::WebVideoFullscreenInterfaceContext::setCurrentTime):
1018         (WebKit::WebVideoFullscreenInterfaceContext::setBufferedTime):
1019         (WebKit::WebVideoFullscreenInterfaceContext::setRate):
1020         (WebKit::WebVideoFullscreenInterfaceContext::setVideoDimensions):
1021         (WebKit::WebVideoFullscreenInterfaceContext::setSeekableRanges):
1022         (WebKit::WebVideoFullscreenInterfaceContext::setCanPlayFastReverse):
1023         (WebKit::WebVideoFullscreenInterfaceContext::setAudioMediaSelectionOptions):
1024         (WebKit::WebVideoFullscreenInterfaceContext::setLegibleMediaSelectionOptions):
1025         (WebKit::WebVideoFullscreenInterfaceContext::setExternalPlayback):
1026
1027         Cross-process methods which now take a contextId parameter:
1028
1029         * UIProcess/ios/WebVideoFullscreenManagerProxy.messages.in:
1030         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
1031         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
1032         (WebKit::WebVideoFullscreenManagerProxy::resetMediaState):
1033         (WebKit::WebVideoFullscreenManagerProxy::setCurrentTime):
1034         (WebKit::WebVideoFullscreenManagerProxy::setBufferedTime):
1035         (WebKit::WebVideoFullscreenManagerProxy::setVideoDimensions):
1036         (WebKit::WebVideoFullscreenManagerProxy::setSeekableRangesVector):
1037         (WebKit::WebVideoFullscreenManagerProxy::setCanPlayFastReverse):
1038         (WebKit::WebVideoFullscreenManagerProxy::setAudioMediaSelectionOptions):
1039         (WebKit::WebVideoFullscreenManagerProxy::setLegibleMediaSelectionOptions):
1040         (WebKit::WebVideoFullscreenManagerProxy::setExternalPlaybackProperties):
1041         (WebKit::WebVideoFullscreenManagerProxy::setDuration):
1042         (WebKit::WebVideoFullscreenManagerProxy::setRate):
1043         (WebKit::WebVideoFullscreenManagerProxy::exitFullscreen):
1044         (WebKit::WebVideoFullscreenManagerProxy::cleanupFullscreen):
1045         (WebKit::WebVideoFullscreenManagerProxy::preparedToReturnToInline):
1046         (WebKit::WebVideoFullscreenManagerProxy::play):
1047         (WebKit::WebVideoFullscreenManagerProxy::pause):
1048         (WebKit::WebVideoFullscreenManagerProxy::togglePlayState):
1049         (WebKit::WebVideoFullscreenManagerProxy::beginScrubbing):
1050         (WebKit::WebVideoFullscreenManagerProxy::endScrubbing):
1051         (WebKit::WebVideoFullscreenManagerProxy::seekToTime):
1052         (WebKit::WebVideoFullscreenManagerProxy::fastSeek):
1053         (WebKit::WebVideoFullscreenManagerProxy::beginScanningForward):
1054         (WebKit::WebVideoFullscreenManagerProxy::beginScanningBackward):
1055         (WebKit::WebVideoFullscreenManagerProxy::endScanning):
1056         (WebKit::WebVideoFullscreenManagerProxy::requestExitFullscreen):
1057         (WebKit::WebVideoFullscreenManagerProxy::didSetupFullscreen):
1058         (WebKit::WebVideoFullscreenManagerProxy::didExitFullscreen):
1059         (WebKit::WebVideoFullscreenManagerProxy::didEnterFullscreen):
1060         (WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen):
1061         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame):
1062         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerGravity):
1063         (WebKit::WebVideoFullscreenManagerProxy::selectAudioMediaOption):
1064         (WebKit::WebVideoFullscreenManagerProxy::selectLegibleMediaOption):
1065         (WebKit::WebVideoFullscreenManagerProxy::fullscreenModeChanged):
1066         (WebKit::WebVideoFullscreenManagerProxy::fullscreenMayReturnToInline):
1067         (WebKit::WebVideoFullscreenManagerProxy::videoLayerFrame): Deleted.
1068         (WebKit::WebVideoFullscreenManagerProxy::videoLayerGravity): Deleted.
1069         * WebProcess/ios/WebVideoFullscreenManager.messages.in:
1070         * WebProcess/ios/WebVideoFullscreenManager.mm:
1071         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
1072         (WebKit::WebVideoFullscreenManager::exitVideoFullscreenForVideoElement):
1073         (WebKit::WebVideoFullscreenManager::resetMediaState):
1074         (WebKit::WebVideoFullscreenManager::setDuration):
1075         (WebKit::WebVideoFullscreenManager::setCurrentTime):
1076         (WebKit::WebVideoFullscreenManager::setBufferedTime):
1077         (WebKit::WebVideoFullscreenManager::setRate):
1078         (WebKit::WebVideoFullscreenManager::setVideoDimensions):
1079         (WebKit::WebVideoFullscreenManager::setSeekableRanges):
1080         (WebKit::WebVideoFullscreenManager::setCanPlayFastReverse):
1081         (WebKit::WebVideoFullscreenManager::setAudioMediaSelectionOptions):
1082         (WebKit::WebVideoFullscreenManager::setLegibleMediaSelectionOptions):
1083         (WebKit::WebVideoFullscreenManager::setExternalPlayback):
1084         (WebKit::WebVideoFullscreenManager::play):
1085         (WebKit::WebVideoFullscreenManager::pause):
1086         (WebKit::WebVideoFullscreenManager::togglePlayState):
1087         (WebKit::WebVideoFullscreenManager::beginScrubbing):
1088         (WebKit::WebVideoFullscreenManager::endScrubbing):
1089         (WebKit::WebVideoFullscreenManager::seekToTime):
1090         (WebKit::WebVideoFullscreenManager::fastSeek):
1091         (WebKit::WebVideoFullscreenManager::beginScanningForward):
1092         (WebKit::WebVideoFullscreenManager::beginScanningBackward):
1093         (WebKit::WebVideoFullscreenManager::endScanning):
1094         (WebKit::WebVideoFullscreenManager::requestExitFullscreen):
1095         (WebKit::WebVideoFullscreenManager::selectAudioMediaOption):
1096         (WebKit::WebVideoFullscreenManager::selectLegibleMediaOption):
1097         (WebKit::WebVideoFullscreenManager::fullscreenModeChanged):
1098         (WebKit::WebVideoFullscreenManager::didSetupFullscreen):
1099         (WebKit::WebVideoFullscreenManager::didEnterFullscreen):
1100         (WebKit::WebVideoFullscreenManager::didExitFullscreen):
1101         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen):
1102         (WebKit::WebVideoFullscreenManager::setVideoLayerGravityEnum):
1103         (WebKit::WebVideoFullscreenManager::fullscreenMayReturnToInline):
1104         (WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced):
1105         (WebKit::WebVideoFullscreenManager::exitVideoFullscreen): Deleted.
1106
1107 2015-04-16  Beth Dakin  <bdakin@apple.com>
1108
1109         Force mouse events should go through normal mouse event handling code paths
1110         https://bugs.webkit.org/show_bug.cgi?id=143749
1111         -and corresponding-
1112         rdar://problem/20472895
1113
1114         Reviewed by Dean Jackson.
1115
1116         This patch makes pressureChangeWithEvent create NativeWebMouseEvents with the 
1117         NSEventTypePressures that is gets and sends those down to the web process.
1118
1119         Re-name pressureEvent to lastPressureEvent. Now that event can sometimes be an 
1120         NSEventTypePressure, the new name makes it clear how the second parameter differs 
1121         from the first.
1122         * Shared/NativeWebMouseEvent.h:
1123
1124         New event types for the new types of events.
1125         * Shared/WebEvent.h:
1126         * Shared/WebEventConversion.cpp:
1127         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
1128         * Shared/mac/NativeWebMouseEventMac.mm:
1129         (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
1130         * Shared/mac/WebEventFactory.h:
1131
1132         All of the square-peg, round-hole problems of massaging the NSEventTypePressures 
1133         events into WebMouseEvents is taken care of here.
1134         * Shared/mac/WebEventFactory.mm:
1135         (WebKit::mouseButtonForEvent):
1136         (WebKit::globalPointForEvent):
1137         (WebKit::pointForEvent):
1138         (WebKit::WebEventFactory::createWebMouseEvent):
1139
1140         Instead of calling the old inputDeviceForceDidChange, create a NativeWebMouseEvent 
1141         and handle it.
1142         * UIProcess/API/mac/WKView.mm:
1143         (-[WKView pressureChangeWithEvent:]):
1144
1145         Handle the new types.
1146         * UIProcess/WebPageProxy.cpp:
1147         (WebKit::WebPageProxy::didReceiveEvent):
1148
1149         Can delete inputDeviceForceDidChange since it’s no longer used.
1150         (WebKit::WebPageProxy::inputDeviceForceDidChange): Deleted.
1151         * UIProcess/WebPageProxy.h:
1152
1153         Handle the new types of mouse events properly.
1154         * WebProcess/WebPage/WebPage.cpp:
1155         (WebKit::handleMouseEvent):
1156
1157         Delete inputDeviceForceDidChange() and m_lastForceStage.
1158         * WebProcess/WebPage/WebPage.h:
1159         * WebProcess/WebPage/WebPage.messages.in:
1160         * WebProcess/WebPage/mac/WebPageMac.mm:
1161         (WebKit::WebPage::inputDeviceForceDidChange): Deleted.
1162
1163         Handle new WebEvent types.
1164         * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
1165
1166 2015-04-16  Dan Bernstein  <mitz@apple.com>
1167
1168         <rdar://problem/20575744> Also include a definition of __NSd_{current deployment target} in WKFoundation.h.
1169
1170         Reviewed by Tim Horton.
1171
1172         * WebKit2.xcodeproj/project.pbxproj:
1173
1174 2015-04-16  Timothy Horton  <timothy_horton@apple.com>
1175
1176         Provide a mechanism through the legacy SPI to know when swipe gestures begin and end
1177         https://bugs.webkit.org/show_bug.cgi?id=143740
1178         <rdar://problem/20468540>
1179
1180         Reviewed by Dan Bernstein.
1181
1182         In the C SPI, add three WKPageLoaderClient callbacks for the three
1183         navigation gesture events (did begin, will end, did end).
1184
1185         * UIProcess/API/C/WKPageLoaderClient.h:
1186         Add the callbacks.
1187
1188         * UIProcess/API/APILoaderClient.h:
1189         (API::LoaderClient::navigationGestureDidBegin):
1190         (API::LoaderClient::navigationGestureWillEnd):
1191         (API::LoaderClient::navigationGestureDidEnd):
1192         * UIProcess/WebPageProxy.cpp:
1193         (WebKit::WebPageProxy::navigationGestureDidBegin):
1194         (WebKit::WebPageProxy::navigationGestureWillEnd):
1195         (WebKit::WebPageProxy::navigationGestureDidEnd):
1196         Dispatch navigation gesture events to the loader client as well as
1197         (after a bounce through the PageClient) the navigation delegate.
1198
1199         * UIProcess/API/C/WKPage.cpp:
1200         (WKPageSetPageLoaderClient):
1201         Call the callbacks.
1202
1203         * UIProcess/mac/ViewGestureController.h:
1204         * UIProcess/mac/ViewGestureControllerMac.mm:
1205         (WebKit::ViewGestureController::trackSwipeGesture):
1206         (WebKit::ViewGestureController::willEndSwipeGesture):
1207         While we were already informing WebPageProxy of 'did begin' and 'did end'
1208         navigation gesture events, we were missing 'will end'. Add it.
1209
1210 2015-04-16  Tim Horton  <timothy_horton@apple.com>
1211
1212         Dispatching multiple asynchronous animated resizes in parallel causes page scale to detach from reality
1213         https://bugs.webkit.org/show_bug.cgi?id=143812
1214         <rdar://problem/19866038>
1215
1216         Reviewed by Simon Fraser.
1217
1218         * Shared/VisibleContentRectUpdateInfo.h:
1219         (WebKit::VisibleContentRectUpdateInfo::VisibleContentRectUpdateInfo):
1220         No cats in transaction (more of these below, too).
1221
1222         * UIProcess/WebPageProxy.h:
1223         * UIProcess/WebPageProxy.messages.in:
1224         * UIProcess/ios/WebPageProxyIOS.mm:
1225         (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
1226         (WebKit::WebPageProxy::dynamicViewportUpdateChangedTarget):
1227         * WebProcess/WebPage/WebPage.h:
1228         * WebProcess/WebPage/WebPage.messages.in:
1229         * WebProcess/WebPage/ios/WebPageIOS.mm:
1230         (WebKit::WebPage::handleTap):
1231         (WebKit::WebPage::commitPotentialTap):
1232         (WebKit::WebPage::dynamicViewportSizeUpdate):
1233         Add an incrementing ID to dynamicViewportSizeUpdates. The UI process keeps
1234         the current ID, and it is bounced through the Web process (dynamicViewportSizeUpdates)
1235         back to the UI process (dynamicViewportUpdateChangedTarget). If we have
1236         dispatched another dynamicViewportSizeUpdate in the interim, ignore
1237         the intermediate target.
1238
1239 2015-04-16  Sungmann Cho  <sungmann.cho@navercorp.com>
1240
1241         Remove PluginController::isPluginVisible().
1242         https://bugs.webkit.org/show_bug.cgi?id=143830
1243
1244         Reviewed by Darin Adler.
1245
1246         PluginController::isPluginVisible() was introduced by http://webkit.org/b/60285.
1247         This method had been used only for WebKit2 on Windows, and no one uses it now.
1248         So we can remove it.
1249
1250         No new tests, no behavior change.
1251
1252         * PluginProcess/PluginControllerProxy.cpp:
1253         (WebKit::PluginControllerProxy::isPluginVisible): Deleted.
1254         * PluginProcess/PluginControllerProxy.h:
1255         * WebProcess/Plugins/PluginController.h:
1256         * WebProcess/Plugins/PluginView.cpp:
1257         (WebKit::PluginView::isPluginVisible): Deleted.
1258         * WebProcess/Plugins/PluginView.h:
1259
1260 2015-04-16  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1261
1262         [EFL] Disable a flaky ewk_context_network_process_model() API test
1263         https://bugs.webkit.org/show_bug.cgi?id=143824
1264
1265         Reviewed by Csaba Osztrogonác.
1266
1267         ewk_context_network_process_model has been often failed. Though Bug 142967
1268         was filed to fix this issue, it is not solved yet. To maintain EFL bot, this patch
1269         disables it until fixing it.
1270
1271         * UIProcess/API/efl/tests/test_ewk2_context.cpp:
1272         (TEST_F):
1273
1274 2015-04-16  Csaba Osztrogonác  <ossy@webkit.org>
1275
1276         [WK2] Forwarding headers generator shouldn't generate unnecessary headers
1277         https://bugs.webkit.org/show_bug.cgi?id=143820
1278
1279         Reviewed by Carlos Garcia Campos.
1280
1281         * Scripts/generate-forwarding-headers.pl:
1282         (collectNeededHeaders):
1283
1284 2015-04-16  Csaba Osztrogonác  <ossy@webkit.org>
1285
1286         [GTK] Run forwarding headers generator unconditionally
1287         https://bugs.webkit.org/show_bug.cgi?id=143819
1288
1289         Reviewed by Carlos Garcia Campos.
1290
1291         * PlatformGTK.cmake:
1292
1293 2015-04-15  Brent Fulgham  <bfulgham@apple.com>
1294
1295         [Mac] Disable "Save to Downloads" option for local files
1296         https://bugs.webkit.org/show_bug.cgi?id=143794
1297
1298         Reviewed by Tim Horton.
1299
1300         Disable the Image and Media download options if the download
1301         target is a local file. We can only download web resources;
1302         anything else is actually a no-op.
1303
1304         * UIProcess/mac/WKActionMenuController.mm:
1305         (-[WKActionMenuController _defaultMenuItemsForVideo]):
1306         (-[WKActionMenuController _defaultMenuItemsForImage]):
1307
1308 2015-04-15  Anders Carlsson  <andersca@apple.com>
1309
1310         Make websiteDataStore on WKWebViewConfiguration public
1311         https://bugs.webkit.org/show_bug.cgi?id=143810
1312
1313         Reviewed by Dan Bernstein.
1314
1315         * UIProcess/API/Cocoa/WKWebView.mm:
1316         (-[WKWebView initWithFrame:configuration:]):
1317         * UIProcess/API/Cocoa/WKWebViewConfiguration.h:
1318         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1319         (-[WKWebViewConfiguration copyWithZone:]):
1320         (-[WKWebViewConfiguration websiteDataStore]):
1321         (-[WKWebViewConfiguration setWebsiteDataStore:]):
1322         (-[WKWebViewConfiguration _websiteDataStore]):
1323         (-[WKWebViewConfiguration _setWebsiteDataStore:]):
1324
1325 2015-04-15  Anders Carlsson  <andersca@apple.com>
1326
1327         Make WKWebsiteDataStore public
1328         https://bugs.webkit.org/show_bug.cgi?id=143805
1329
1330         Reviewed by Dan Bernstein.
1331
1332         Rename the current _WKWebsiteDataStore to WKWebsiteDataStore. Make init unavailable and tighten up the
1333         types of the defaultDataStore and nonPersistentDataStore class methods.
1334         
1335         Add a new _WKWebsiteDataStore @interface and @implementation that derives from WKWebsiteDataStore
1336         and forwards the defaultDataStore and nonPersistentDataStore method calls.
1337
1338         * Shared/API/Cocoa/WebKit.h:
1339         * Shared/Cocoa/APIObject.mm:
1340         (API::Object::newObject):
1341         * UIProcess/API/Cocoa/WKWebView.mm:
1342         (-[WKWebView initWithFrame:configuration:]):
1343         * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
1344         (-[WKWebViewConfiguration _websiteDataStore]):
1345         * UIProcess/API/Cocoa/WKWebsiteDataStore.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStore.h.
1346         * UIProcess/API/Cocoa/WKWebsiteDataStore.mm: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStore.mm.
1347         (+[WKWebsiteDataStore defaultDataStore]):
1348         (+[WKWebsiteDataStore nonPersistentDataStore]):
1349         (-[WKWebsiteDataStore dealloc]):
1350         (-[WKWebsiteDataStore isNonPersistent]):
1351         (toSystemClockTime):
1352         (-[WKWebsiteDataStore fetchDataRecordsOfTypes:completionHandler:]):
1353         (-[WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]):
1354         (toWebsiteDataRecords):
1355         (-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:]):
1356         (-[WKWebsiteDataStore _apiObject]):
1357         * UIProcess/API/Cocoa/WKWebsiteDataStoreInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataStoreInternal.h.
1358         (WebKit::wrapper):
1359         * UIProcess/API/Cocoa/_WKWebsiteDataStore.h:
1360         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
1361         (+[_WKWebsiteDataStore defaultDataStore]):
1362         (+[_WKWebsiteDataStore nonPersistentDataStore]):
1363         (-[_WKWebsiteDataStore dealloc]): Deleted.
1364         (-[_WKWebsiteDataStore isNonPersistent]): Deleted.
1365         (toWebsiteDataTypes): Deleted.
1366         (toSystemClockTime): Deleted.
1367         (-[_WKWebsiteDataStore removeDataOfTypes:modifiedSince:completionHandler:]): Deleted.
1368         (-[_WKWebsiteDataStore _apiObject]): Deleted.
1369         * WebKit2.xcodeproj/project.pbxproj:
1370
1371 2015-04-15  Timothy Horton  <timothy_horton@apple.com>
1372
1373         Custom CSS cursors do not use -webkit-image-set on retina displays
1374         https://bugs.webkit.org/show_bug.cgi?id=120783
1375
1376         Reviewed by Beth Dakin.
1377         Patch by Evan Wallace <evan.exe@gmail.com>.
1378
1379         Serialize the cursor image scale for SetCursor messages so custom
1380         CSS cursors work with -webkit-image-set on retina displays.
1381
1382         * Shared/WebCoreArgumentCoders.cpp:
1383         (CoreIPC::ArgumentCoder<Cursor>::encode):
1384         (CoreIPC::ArgumentCoder<Cursor>::decode):
1385
1386 2015-04-15  Alex Christensen  <achristensen@webkit.org>
1387
1388         Progress towards CMake on Mac.
1389         https://bugs.webkit.org/show_bug.cgi?id=143785
1390
1391         Reviewed by Csaba Osztrogonác.
1392
1393         * CMakeLists.txt:
1394         * PlatformEfl.cmake:
1395         * PlatformGTK.cmake:
1396
1397 2015-04-15  Anders Carlsson  <andersca@apple.com>
1398
1399         Make WKWebsiteDataRecord public
1400         https://bugs.webkit.org/show_bug.cgi?id=143796
1401
1402         Reviewed by Dan Bernstein.
1403
1404         Rename _WKWebsiteDataRecord and associated files to WKWebsiteDataRecord and
1405         add a new _WKWebsiteDataRecord.h with a class @interface declaration that just
1406         inherits from WKWebsiteDataRecord. We don't need an @implementation since nobody is expected
1407         to allocate _WKWebsiteDataRecord objects.
1408
1409         * Shared/API/Cocoa/WebKit.h:
1410         * Shared/Cocoa/APIObject.mm:
1411         (API::Object::newObject):
1412         * UIProcess/API/Cocoa/WKWebsiteDataRecord.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataRecord.h.
1413         * UIProcess/API/Cocoa/WKWebsiteDataRecord.mm: Renamed from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataRecord.mm.
1414         (-[WKWebsiteDataRecord dealloc]):
1415         (dataTypesToString):
1416         (-[WKWebsiteDataRecord description]):
1417         (-[WKWebsiteDataRecord displayName]):
1418         (-[WKWebsiteDataRecord dataTypes]):
1419         (-[WKWebsiteDataRecord _apiObject]):
1420         * UIProcess/API/Cocoa/WKWebsiteDataRecordInternal.h: Renamed from Source/WebKit2/UIProcess/API/Cocoa/_WKWebsiteDataRecordInternal.h.
1421         (WebKit::wrapper):
1422         (WebKit::toWebsiteDataTypes):
1423         (WebKit::toWKWebsiteDataTypes):
1424         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
1425         * UIProcess/API/Cocoa/_WKWebsiteDataStore.mm:
1426         (toWebsiteDataRecords):
1427         * WebKit2.xcodeproj/project.pbxproj:
1428
1429 2015-04-13  Jer Noble  <jer.noble@apple.com>
1430
1431         [Fullscreen] ChromeClient::exitVideoFullscreen() should take a pointer to a HTMLVideoElement.
1432         https://bugs.webkit.org/show_bug.cgi?id=143674
1433
1434         Reviewed by Darin Adler.
1435
1436         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1437         (WebKit::WebChromeClient::enterVideoFullscreenForVideoElement): Takes a reference.
1438         (WebKit::WebChromeClient::exitVideoFullscreenForVideoElement): Renamed from exitVideoFullscreen().
1439         (WebKit::WebChromeClient::exitVideoFullscreen): Deleted.
1440         * WebProcess/WebCoreSupport/WebChromeClient.h:
1441         * WebProcess/ios/WebVideoFullscreenManager.h:
1442         * WebProcess/ios/WebVideoFullscreenManager.mm:
1443         (WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement): Ditto.
1444         (WebKit::WebVideoFullscreenManager::exitVideoFullscreenForVideoElement): Renamed from exitVideoFullscreen().
1445         (WebKit::WebVideoFullscreenManager::didEnterFullscreen): Pass a reference.
1446         (WebKit::WebVideoFullscreenManager::didCleanupFullscreen): Ditto.
1447         (WebKit::WebVideoFullscreenManager::exitVideoFullscreen): Deleted.
1448
1449 2015-04-15  Antti Koivisto  <antti@apple.com>
1450
1451         Network Cache: Inline small body data to record file
1452         https://bugs.webkit.org/show_bug.cgi?id=143783
1453
1454         Reviewed by Chris Dumez.
1455
1456         We currently save all body data as separate files. We can improve space efficiency and do less reads and writes
1457         by inlining smaller resource bodies with the header.
1458
1459         * NetworkProcess/cache/NetworkCacheIOChannel.h:
1460         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1461         (WebKit::NetworkCache::IOChannel::read):
1462         (WebKit::NetworkCache::IOChannel::readSync):
1463         (WebKit::NetworkCache::IOChannel::write):
1464
1465             Add WorkQueue argument to allow specifying which queue the result is submitted to.
1466
1467         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1468         (WebKit::NetworkCache::decodeRecordMetaData):
1469
1470             Add a boolean indicating whether the body is inlined.
1471
1472         (WebKit::NetworkCache::decodeRecordHeader):
1473         (WebKit::NetworkCache::Storage::decodeRecord):
1474         (WebKit::NetworkCache::encodeRecordMetaData):
1475         (WebKit::NetworkCache::Storage::storeBodyAsBlob):
1476         (WebKit::NetworkCache::Storage::encodeRecord):
1477         (WebKit::NetworkCache::Storage::dispatchReadOperation):
1478
1479             Read the record first, then read the blob if needed.
1480             Submit the read operation directly from the main queue. Only thing we do is opening an IO channel
1481             and that uses O_NONBLOCK.
1482             Process the read results in the IO work queue where we now do the blob retrieval.
1483
1484         (WebKit::NetworkCache::shouldStoreBodyAsBlob):
1485
1486             The current threshold for saving a separate blob is 16KB.
1487
1488         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
1489         (WebKit::NetworkCache::Storage::traverse):
1490         (WebKit::NetworkCache::createRecord): Deleted.
1491         (WebKit::NetworkCache::encodeRecordHeader): Deleted.
1492         * NetworkProcess/cache/NetworkCacheStorage.h:
1493
1494 2015-04-15  Tim Horton  <timothy_horton@apple.com>
1495
1496         Non-local keyboards don't update scroll view parameters
1497         https://bugs.webkit.org/show_bug.cgi?id=143791
1498         <rdar://problem/18974020>
1499
1500         * Platform/spi/ios/UIKitSPI.h:
1501         Fix the build.
1502
1503 2015-04-15  Tim Horton  <timothy_horton@apple.com>
1504
1505         Non-local keyboards don't update scroll view parameters
1506         https://bugs.webkit.org/show_bug.cgi?id=143791
1507         <rdar://problem/18974020>
1508
1509         Reviewed by Enrica Casucci.
1510
1511         * UIProcess/API/Cocoa/WKWebView.mm:
1512         (-[WKWebView _shouldUpdateKeyboardWithInfo:]):
1513         (-[WKWebView _keyboardWillChangeFrame:]):
1514         (-[WKWebView _keyboardWillShow:]):
1515         Make sure that we update scroll view parameters (obscured insets, etc.)
1516         if we have a non-local keyboard, in addition to the cases where we have an assisted node.
1517
1518 2015-04-15  Dan Bernstein  <mitz@apple.com>
1519
1520         <rdar://problem/20549298> No matching __NSi_ definition for postprocessed value of WK_{MAC,IOS}_TBA
1521         https://bugs.webkit.org/show_bug.cgi?id=143786
1522
1523         Reviewed by Anders Carlsson.
1524
1525         * Shared/API/Cocoa/WKFoundation.h: Added a placeholder for the postprocessing script to
1526         insert a definition of __NSi_* for the current deployment target. Import CoreFoundation.h so
1527         that we can check if the macro is already defined.
1528         * WebKit2.xcodeproj/project.pbxproj: In the Postprocess WKFoundation.h script build phase,
1529         replace the placeholder with a definition of __NSi_{current deployment target} if not
1530         already defined.
1531
1532 2015-04-14  Anders Carlsson  <andersca@apple.com>
1533
1534         Make creating send rights from shared memory more robust
1535         https://bugs.webkit.org/show_bug.cgi?id=143730
1536         rdar://problem/16595870
1537
1538         Reviewed by Darin Adler.
1539
1540         This cleans up creation of handles and send rights and also fixes a bug where it would be impossible
1541         to send more than 128 MB of shared memory in a single object.
1542
1543         * Platform/SharedMemory.h:
1544         * Platform/mac/SharedMemoryMac.cpp:
1545         (WebKit::makeMemoryEntry):
1546         New helper function that creates a memory entry send right. This uses MAP_MEM_VM_SHARE which ensures
1547         that memory objects larger than 128 MB will be handled correctly.
1548
1549         (WebKit::SharedMemory::create):
1550         Call makeMemoryEntry.
1551
1552         (WebKit::SharedMemory::createHandle):
1553         Call createSendRight.
1554
1555         (WebKit::SharedMemory::createSendRight):
1556         Call makeMemoryEntry and add the necessary assertions.
1557
1558 2015-04-15  Eric Carlson  <eric.carlson@apple.com>
1559
1560         Generalize "isPlayingAudio" to include other media characteristics
1561         https://bugs.webkit.org/show_bug.cgi?id=143713
1562
1563         Reviewed by Jer Noble.
1564
1565         * UIProcess/API/C/WKPage.cpp:
1566         (toGenericCallbackFunction): Scope CallbackBase.
1567         (WKPageForceRepaint): Ditto.
1568         (WKPageValidateCommand): Ditto.
1569         (WKPageComputePagesForPrinting): Ditto.
1570
1571         * UIProcess/API/Cocoa/_WKThumbnailView.mm:
1572         (-[_WKThumbnailView _requestSnapshotIfNeeded]): Ditto.
1573
1574         * UIProcess/API/mac/WKView.mm:
1575         (-[WKView becomeFirstResponder]): Ditto.
1576         (-[WKView updateFontPanelIfNeeded]): Ditto.
1577         (-[WKView validateUserInterfaceItem:]): Ditto.
1578         (-[WKView startSpeaking:]): Ditto.
1579         (-[WKView selectedRangeWithCompletionHandler:]): Ditto.
1580         (-[WKView markedRangeWithCompletionHandler:]): Ditto.
1581         (-[WKView hasMarkedTextWithCompletionHandler:]): Ditto.
1582         (-[WKView attributedSubstringForProposedRange:completionHandler:]): Ditto.
1583         (-[WKView firstRectForCharacterRange:completionHandler:]): Ditto.
1584         (-[WKView characterIndexForPoint:completionHandler:]): Ditto.
1585
1586         * UIProcess/WebPageProxy.cpp:
1587         (WebKit::WebPageProxy::isPlayingMediaDidChange): Rename from isPlayingAudioDidChange.
1588         (WebKit::WebPageProxy::isPlayingAudioDidChange): Deleted.
1589         * UIProcess/WebPageProxy.h:
1590
1591         * UIProcess/WebPageProxy.messages.in:
1592
1593         * UIProcess/mac/WKFullScreenWindowController.mm:
1594         (-[WKFullScreenWindowController dealloc]): Scope CallbackBase.
1595         (-[WKFullScreenWindowController finishedExitFullScreenAnimation:]): Ditto.
1596
1597         * UIProcess/mac/WKPrintingView.mm:
1598         (-[WKPrintingView _preparePDFDataForPrintingOnSecondaryThread]): Ditto.
1599         (-[WKPrintingView _askPageToComputePageRects]): Ditto.
1600         (-[WKPrintingView _drawPreview:]): Ditto.
1601
1602         * WebProcess/Plugins/PluginView.cpp:
1603         (WebKit::PluginView::setPluginIsPlayingAudio):
1604         * WebProcess/WebCoreSupport/WebChromeClient.cpp:
1605         (WebKit::WebChromeClient::isPlayingMediaDidChange):
1606         (WebKit::WebChromeClient::isPlayingAudioDidChange): Deleted.
1607         * WebProcess/WebCoreSupport/WebChromeClient.h:
1608
1609 2015-04-15  Antti Koivisto  <antti@apple.com>
1610
1611         Network Cache: Add thread-safe accessors for storage paths
1612         https://bugs.webkit.org/show_bug.cgi?id=143668
1613
1614         Reviewed by Darin Adler.
1615
1616         Less need to use StringCapture.
1617
1618         * NetworkProcess/cache/NetworkCache.cpp:
1619         (WebKit::NetworkCache::Cache::dumpFilePath):
1620         (WebKit::NetworkCache::Cache::storagePath):
1621         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1622         (WebKit::NetworkCache::makeRecordsDirectoryPath):
1623         (WebKit::NetworkCache::Storage::Storage):
1624         (WebKit::NetworkCache::Storage::basePath):
1625         (WebKit::NetworkCache::Storage::versionPath):
1626         (WebKit::NetworkCache::Storage::recordsPath):
1627         (WebKit::NetworkCache::Storage::synchronize):
1628         (WebKit::NetworkCache::Storage::remove):
1629         (WebKit::NetworkCache::Storage::dispatchReadOperation):
1630         (WebKit::NetworkCache::Storage::finishReadOperation):
1631         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
1632         (WebKit::NetworkCache::Storage::traverse):
1633         (WebKit::NetworkCache::Storage::clear):
1634         (WebKit::NetworkCache::Storage::shrink):
1635         (WebKit::NetworkCache::Storage::deleteOldVersions):
1636         (WebKit::NetworkCache::makeRecordDirectoryPath): Deleted.
1637         * NetworkProcess/cache/NetworkCacheStorage.h:
1638         (WebKit::NetworkCache::Storage::baseDirectoryPath): Deleted.
1639         (WebKit::NetworkCache::Storage::directoryPath): Deleted.
1640
1641 2015-04-14  Tim Horton  <timothy_horton@apple.com>
1642
1643         Update gesture swipe shadow style
1644         https://bugs.webkit.org/show_bug.cgi?id=143616
1645         <rdar://problem/19295843>
1646
1647         Reviewed by Darin Adler.
1648
1649         * UIProcess/mac/ViewGestureController.h:
1650         * UIProcess/mac/ViewGestureControllerMac.mm:
1651         (WebKit::ViewGestureController::beginSwipeGesture):
1652         For the modern shadow style, use a layer stretched along the edge of the swiping content
1653         with the newly added PNGs as the layer contents.
1654
1655         Add a dimming layer over the lower layer of content which fades in/out
1656         during the swipe.
1657
1658         (WebKit::ViewGestureController::handleSwipeGesture):
1659         Fade the dimming layer in and out during the entire swipe.
1660         Fade the shadow layer out during the last few pixels of the swipe.
1661
1662         (WebKit::ViewGestureController::removeSwipeSnapshot):
1663         Unparent the new layers.
1664
1665         * WebKit2.xcodeproj/project.pbxproj:
1666         * Resources/SwipeShadow.png:
1667         * Resources/SwipeShadow@2x.png:
1668         Add the new resources.
1669
1670 2015-04-14  Brian Weinstein  <bweinstein@apple.com>
1671
1672         Add SPI to clear HSTS hosts added since a date.
1673         https://bugs.webkit.org/show_bug.cgi?id=143726
1674         and
1675         rdar://problem/16664597
1676
1677         Reviewed by Anders Carlsson.
1678
1679         * UIProcess/API/C/mac/WKContextPrivateMac.h:
1680         * UIProcess/API/C/mac/WKContextPrivateMac.mm:
1681         (WKContextResetHSTSHostsAddedAfterDate): Call into the WebProcessPool.
1682         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
1683         (WebKit::WebProcessPool::resetHSTSHostsAddedAfterDate): Call CFNetwork SPI to clear HSTS hosts added
1684         after the given date.
1685         * UIProcess/WebProcessPool.h:
1686
1687 2015-04-14  Anders Carlsson  <andersca@apple.com>
1688
1689         More work on making the SharedMemory interface more sane
1690         https://bugs.webkit.org/show_bug.cgi?id=143718
1691
1692         Reviewed by Andreas Kling.
1693
1694         Get rid of m_shouldVMDeallocateData. The idea is that shared memory created by calling
1695         SharedMemory::allocate has a non-null m_data pointer, and a null m_port. Shared memory created
1696         by calling SharedMemory::create with a pointer and a length has a non-null port but a null m_data
1697         since the data can be unmapped by the caller and we don't want to hold on to dangling pointers.
1698
1699         * Platform/SharedMemory.h:
1700         (WebKit::SharedMemory::data):
1701         * Platform/mac/SharedMemoryMac.cpp:
1702         (WebKit::SharedMemory::allocate):
1703         (WebKit::SharedMemory::create):
1704         (WebKit::SharedMemory::map):
1705         (WebKit::SharedMemory::~SharedMemory):
1706         (WebKit::SharedMemory::createHandle):
1707
1708 2015-04-14  Antti Koivisto  <antti@apple.com>
1709
1710         Network Cache: Deduplicate body data
1711         https://bugs.webkit.org/show_bug.cgi?id=143652
1712
1713         Reviewed by Darin Adler.
1714
1715         It is common to have cache entries with identical body data. This happens when the same resource is loaded from
1716         a different URL (https vs http, slash vs no-slash at end, etc.). It also happens when the same URL is
1717         referenced from different cache partitions.
1718
1719         We can improve disk space efficiency and use less memory by sharing identical body data between cache entries.
1720
1721         This patch splits the body data out from the record file. The new record file contains meta data and response
1722         headers only. Body data is stored using the new BlobStorage interface. Files are deduplicated by computing
1723         SHA1 hash over the data and looking for an existing blob with the same hash. If found the existing entry
1724         is reused by creating a hard link to it.
1725
1726         The new disk structure looks like this:
1727
1728         WebKitCache/
1729             Version 3/
1730                 Blobs/
1731                     0A3C9A970ADA27FAE9BD7BC630BAD0B929C293C0
1732                     0A6B8060BA77DF92C82A2FD7AF58F79524D8F34C
1733                     ...
1734                 Records/
1735                     apple.com/
1736                         0B8645B04E7EC78C178B7460052601C2
1737                         0B8645B04E7EC78C178B7460052601C2-body
1738                         0CB1A3638D1C5A09C5E3283A74FA040B
1739                         0CB1A3638D1C5A09C5E3283A74FA040B-body
1740                         ...
1741
1742         Each record file has an associated -body which is a hard link to a file in the Blobs directory.
1743
1744         The patch increases effective capacity by 10-20% with a typical cache. It also saves memory especially when identical
1745         resources are used in multiple tabs.
1746
1747         Currently all >0 sized resources are stored as shared blobs. In future small resources should be integrated into record
1748         files and blobs used for larger files only.
1749
1750         * NetworkProcess/cache/NetworkCache.cpp:
1751         (WebKit::NetworkCache::Cache::store):
1752         (WebKit::NetworkCache::Cache::update):
1753
1754             Adopt the new storage interface.
1755
1756         (WebKit::NetworkCache::Cache::dumpContentsToFile):
1757         * NetworkProcess/cache/NetworkCacheBlobStorage.cpp: Added.
1758         (WebKit::NetworkCache::BlobStorage::BlobStorage):
1759         (WebKit::NetworkCache::BlobStorage::synchronize):
1760
1761             Compute size and delete unused files from the Blobs directory (link count == 1).
1762
1763         (WebKit::NetworkCache::BlobStorage::blobPath):
1764         (WebKit::NetworkCache::BlobStorage::add):
1765         (WebKit::NetworkCache::BlobStorage::get):
1766
1767             Interface for storing and retrieving data blobs. Blobs are deduplicated on add.
1768
1769         (WebKit::NetworkCache::BlobStorage::remove):
1770
1771             Removes the link but doesn't remove the blob even if there are no other clients. That happens on next synchronize().
1772
1773         (WebKit::NetworkCache::BlobStorage::shareCount):
1774
1775             Checks the link count to get the number of clients.
1776
1777         * NetworkProcess/cache/NetworkCacheBlobStorage.h: Added.
1778         (WebKit::NetworkCache::BlobStorage::approximateSize):
1779         * NetworkProcess/cache/NetworkCacheCoders.cpp:
1780         (WebKit::NetworkCache::Coder<SHA1::Digest>::encode):
1781         (WebKit::NetworkCache::Coder<SHA1::Digest>::decode):
1782         * NetworkProcess/cache/NetworkCacheCoders.h:
1783         * NetworkProcess/cache/NetworkCacheData.h:
1784         (WebKit::NetworkCache::Data::isEmpty):
1785         * NetworkProcess/cache/NetworkCacheDataCocoa.mm:
1786         (WebKit::NetworkCache::Data::empty):
1787         (WebKit::NetworkCache::Data::fromMap):
1788         (WebKit::NetworkCache::mapFile):
1789         (WebKit::NetworkCache::computeSHA1):
1790         (WebKit::NetworkCache::bytesEqual):
1791
1792             Add some helpers.
1793
1794         * NetworkProcess/cache/NetworkCacheEntry.cpp:
1795         (WebKit::NetworkCache::Entry::asJSON):
1796         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
1797         (WebKit::NetworkCache::IOChannel::IOChannel):
1798         * NetworkProcess/cache/NetworkCacheStorage.cpp:
1799         (WebKit::NetworkCache::makeRecordDirectoryPath):
1800         (WebKit::NetworkCache::makeBlobDirectoryPath):
1801         (WebKit::NetworkCache::Storage::Storage):
1802         (WebKit::NetworkCache::Storage::approximateSize):
1803         (WebKit::NetworkCache::Storage::synchronize):
1804         (WebKit::NetworkCache::partitionPathForKey):
1805         (WebKit::NetworkCache::recordPathForKey):
1806         (WebKit::NetworkCache::bodyPath):
1807         (WebKit::NetworkCache::decodeRecordMetaData):
1808         (WebKit::NetworkCache::decodeRecordHeader):
1809         (WebKit::NetworkCache::createRecord):
1810         (WebKit::NetworkCache::encodeRecordMetaData):
1811         (WebKit::NetworkCache::encodeRecordHeader):
1812         (WebKit::NetworkCache::Storage::remove):
1813         (WebKit::NetworkCache::Storage::updateFileModificationTime):
1814         (WebKit::NetworkCache::Storage::dispatchReadOperation):
1815
1816             Read both the blob and the record entry.
1817
1818         (WebKit::NetworkCache::Storage::finishReadOperation):
1819
1820             Factor to a function.
1821
1822         (WebKit::NetworkCache::Storage::store):
1823         (WebKit::NetworkCache::Storage::traverse):
1824         (WebKit::NetworkCache::Storage::dispatchPendingWriteOperations):
1825         (WebKit::NetworkCache::Storage::dispatchWriteOperation):
1826
1827             We don't need separate full write and header write paths anymore. Everything is treated
1828             as a full write and deduplication stops us writing the body again.
1829
1830             This simplifies the code and data structures.
1831
1832         (WebKit::NetworkCache::Storage::finishWriteOperation):
1833
1834             Factor to a function.
1835
1836         (WebKit::NetworkCache::Storage::clear):
1837         (WebKit::NetworkCache::deletionProbability):
1838
1839             Take the sharing count into account when computing deletion probability.
1840             It is less useful to delete a record that shares its body with others as data won't get deleted.
1841
1842         (WebKit::NetworkCache::Storage::shrinkIfNeeded):
1843         (WebKit::NetworkCache::Storage::shrink):
1844         (WebKit::NetworkCache::Storage::deleteOldVersions):
1845         (WebKit::NetworkCache::directoryPathForKey): Deleted.
1846         (WebKit::NetworkCache::filePathForKey): Deleted.
1847         (WebKit::NetworkCache::openFileForKey): Deleted.
1848         (WebKit::NetworkCache::decodeRecord): Deleted.
1849         (WebKit::NetworkCache::Storage::update): Deleted.
1850
1851             No need for separate update interface anymore. Regular store() avoids unnecessary body write.
1852
1853         (WebKit::NetworkCache::Storage::dispatchFullWriteOperation): Deleted.
1854         (WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation): Deleted.
1855         * NetworkProcess/cache/NetworkCacheStorage.h:
1856         * WebKit2.xcodeproj/project.pbxproj:
1857
1858 2015-04-14  Chris Dumez  <cdumez@apple.com>
1859
1860         REGRESSION(r182603): [GTK] More than 500 crashes on the layout tests with the debug build.
1861         https://bugs.webkit.org/show_bug.cgi?id=143715
1862
1863         Reviewed by Darin Adler.
1864
1865         Enable assertions checking that calling editorState() does not cause a
1866         synchronous layout only on Mac and iOS. This assertion does not
1867         necessarily hold true on other ports as each one as its own
1868         platformEditorState() implementation. In particular, this assertion
1869         was being hit on GTK.
1870
1871         * WebProcess/WebPage/WebPage.cpp:
1872         (WebKit::WebPage::didChangeSelection):
1873
1874 2015-04-13  Alexey Proskuryakov  <ap@apple.com>
1875
1876         Build fixes after r182772.
1877
1878         * UIProcess/API/mac/WKView.mm:
1879         (-[WKView _updateAutomaticallyComputedFixedLayoutSize]): Make a CGSize, not an NSSize.
1880         (-[WKView _setAutomaticallyComputesFixedLayoutSizeFromViewScale:]): Moved implementation
1881         to the correct place.
1882         (-[WKView _automaticallyComputesFixedLayoutSizeFromViewScale]): Ditto.
1883         (-[WKView _layoutMode]): Use a memeber from _data directly, not via a method.
1884
1885 2015-04-13  Alexey Proskuryakov  <ap@apple.com>
1886
1887         More build fix.
1888
1889         * UIProcess/mac/PageClientImpl.mm:
1890         (WebKit::PageClientImpl::setDragImage):
1891
1892 2015-04-13  Hunseop Jeong  <hs85.jeong@samsung.com>
1893
1894         [EFL][GTK] Fix build break after r182753 
1895         https://bugs.webkit.org/show_bug.cgi?id=143689
1896
1897         Reviewed by Anders Carlsson.
1898
1899         * Platform/IPC/unix/ConnectionUnix.cpp:
1900         (IPC::Connection::processMessage):
1901         (IPC::Connection::sendOutgoingMessage):
1902         * Platform/unix/SharedMemoryUnix.cpp:
1903         (WebKit::SharedMemory::allocate):
1904         (WebKit::accessModeMMap):
1905         (WebKit::SharedMemory::map):
1906         (WebKit::SharedMemory::create): Deleted.
1907
1908 2015-04-13  Alexey Proskuryakov  <ap@apple.com>
1909
1910         Build fix.
1911
1912         * UIProcess/mac/PageClientImpl.mm: (WebKit::PageClientImpl::setDragImage):
1913
1914 2015-04-13  Anders Carlsson  <andersca@apple.com>
1915
1916         Keep track of each shared memory object's protection when deciding whether to return our existing port
1917         https://bugs.webkit.org/show_bug.cgi?id=143687
1918
1919         Reviewed by Tim Horton.
1920
1921         * Platform/SharedMemory.h:
1922         * Platform/mac/SharedMemoryMac.cpp:
1923         (WebKit::machProtection):
1924         (WebKit::SharedMemory::create):
1925         (WebKit::SharedMemory::map):
1926         (WebKit::SharedMemory::createHandle):
1927
1928 2015-04-13  Tim Horton  <timothy_horton@apple.com>
1929
1930         Add a persistent, fixed scale factor to make it easy to scale down WK(Web)Views
1931         https://bugs.webkit.org/show_bug.cgi?id=143560
1932         <rdar://problem/16302047>
1933
1934         Reviewed by Darin Adler.
1935
1936         Add a new "view" scale factor to WKView and WKWebView.
1937
1938         Unlike page scale (or "magnification" in the API), view scale:
1939             - persists between page loads
1940             - persists between Web process crashes
1941             - is not user adjustable
1942             - can reliably be < 1
1943
1944         The page scale and view scale are multiplied together whenever we push
1945         a new page scale down into WebCore, so the implementation of view scale
1946         is transparent to WebCore, and acts effectively as a constant multiplier
1947         for the (user-adjustable) page scale factor.
1948
1949         * UIProcess/WebPageProxy.cpp:
1950         (WebKit::WebPageProxy::scaleView):
1951         Add scaleView, which updates our cached viewScaleFactor and pushes it to the Web process.
1952
1953         (WebKit::WebPageProxy::creationParameters):
1954         Plumb viewScaleFactor through the page creation parameters.
1955
1956         * UIProcess/WebPageProxy.h:
1957         (WebKit::WebPageProxy::viewScaleFactor): Added.
1958
1959         * WebProcess/WebPage/WebPage.cpp:
1960         (WebKit::WebPage::WebPage):
1961         If the viewScaleFactor is not 1 at creation time, call scalePage with a page scale of 1.
1962         Internally, scalePage will multiply in the viewScaleFactor and push it all to the Web process.
1963
1964         (WebKit::WebPage::scalePage):
1965         Multiply the page scale factor by the view scale factor before passing it to WebCore.
1966
1967         (WebKit::WebPage::scalePageInViewCoordinates):
1968         Early returns need to check the total scale, not just the new page scale.
1969
1970         (WebKit::WebPage::totalScaleFactor):
1971         The scale that we get back from WebCore::Page::pageScaleFactor is the product
1972         of WebKit2's view and page scales. So, here we'll call that the totalScaleFactor.
1973         (Might need a different name because it seems like "total" should include deviceScale too).
1974
1975         (WebKit::WebPage::pageScaleFactor):
1976         WebKit2's notion of the pageScaleFactor does not include the view scale, so
1977         divide it out of WebCore's page scale.
1978
1979         (WebKit::WebPage::scaleView):
1980         Apply a new view scale, maintaining the current scroll position.
1981
1982         * WebProcess/WebPage/WebPage.h:
1983         (WebKit::WebPage::viewScaleFactor):
1984         * WebProcess/WebPage/WebPage.messages.in:
1985
1986         * Shared/WebPageCreationParameters.cpp:
1987         (WebKit::WebPageCreationParameters::encode):
1988         (WebKit::WebPageCreationParameters::decode):
1989         * Shared/WebPageCreationParameters.h:
1990         Plumb viewScaleFactor through the page creation parameters.
1991
1992         * UIProcess/API/Cocoa/WKViewPrivate.h:
1993         * UIProcess/API/Cocoa/WKWebView.mm:
1994         (-[WKWebView _viewScale]):
1995         (-[WKWebView _setViewScale:]):
1996         * UIProcess/API/mac/WKView.mm:
1997         (-[WKView _viewScale]):
1998         (-[WKView _setViewScale:]):
1999         Push the new view scale to WebPage.
2000
2001         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2002         * UIProcess/API/Cocoa/WKWebView.mm:
2003         (-[WKWebView _setAutomaticallyComputesFixedLayoutSizeFromViewScale:]):
2004         (-[WKWebView _automaticallyComputesFixedLayoutSizeFromViewScale]):
2005         * UIProcess/API/mac/WKView.mm:
2006         (-[WKView setFrameSize:]):
2007         (-[WKView _updateAutomaticallyComputedFixedLayoutSize]):
2008         (-[WKView _setAutomaticallyComputesFixedLayoutSizeFromViewScale:]):
2009         (-[WKView _automaticallyComputesFixedLayoutSizeFromViewScale]):
2010         * UIProcess/API/mac/WKViewInternal.h:
2011         Add a new layout mode, "DynamicSizeComputedFromViewScale",
2012         which turns on fixed layout size mode, and sets the fixed layout size
2013         based on the view's frame and view scale. The fixed layout size is maintained
2014         as the frame of the view scaled by the inverse of the view scale. This
2015         makes it very easy to maintain a WK(Web)View that is scaled down by
2016         a constant amount, but is laid out as if it were not.
2017         
2018         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
2019         (WebKit::TiledCoreAnimationDrawingArea::adjustTransientZoom):
2020         (WebKit::TiledCoreAnimationDrawingArea::commitTransientZoom):
2021         (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
2022         Because the transient zoom mechanism touches layers that WebCore owns,
2023         it mostly need to operate with totalScaleFactor, because that is what WebCore sees.
2024
2025 2015-04-10  Brent Fulgham  <bfulgham@apple.com>
2026
2027         Expand test infrastructure to support scrolling tests
2028         https://bugs.webkit.org/show_bug.cgi?id=143286
2029         <rdar://problem/20375516>
2030
2031         Reviewed by Simon Fraser.
2032
2033         Extend the WK2 testing API to include a method for setting a JSC callback function to be triggered
2034         by the new WebCore::WheelEventTestTrigger singleton.
2035
2036         * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
2037         (WKBundlePageStartMonitoringScrollOperations): WK2 method that causes the testing system to begin tracking wheel events.
2038         (WKBundlePageRegisterScrollOperationCompletionCallback): WK2 method to set the callback function for testing.
2039         * WebProcess/InjectedBundle/API/c/WKBundlePage.h:
2040
2041 2015-04-13  Enrica Casucci  <enrica@apple.com>
2042
2043         Clients of WKWebView should be able to override drag functions.
2044         https://bugs.webkit.org/show_bug.cgi?id=143618
2045
2046         Reviewed by Darin Adler.
2047
2048         WKWebView now implements the drag protocol functions and
2049         forwards the calls to the inner WKView.
2050         In the page client, when we receive a request to start drag
2051         from the WebProcess, we call _dragImageForView in WKView with
2052         the target view. The function calls dragImage on the given view,
2053         so that its clients can override the dragImage function.
2054
2055         * UIProcess/API/Cocoa/WKWebView.mm:
2056         (-[WKWebView draggingEntered:]):
2057         (-[WKWebView draggingUpdated:]):
2058         (-[WKWebView draggingExited:]):
2059         (-[WKWebView prepareForDragOperation:]):
2060         (-[WKWebView performDragOperation:]):
2061         * UIProcess/API/mac/WKView.mm:
2062         (-[WKView _dragImageForView:withImage:at:linkDrag:]):
2063         (-[WKView _setDragImage:at:linkDrag:]): Deleted.
2064         * UIProcess/API/mac/WKViewInternal.h:
2065         * UIProcess/mac/PageClientImpl.mm:
2066         (WebKit::PageClientImpl::setDragImage):
2067
2068 2015-04-13  Alex Christensen  <achristensen@webkit.org>
2069
2070         [iOS] Unreviewed build fix after r182760.
2071
2072         * Shared/WebCoreArgumentCoders.cpp:
2073         (IPC::encodeSharedBuffer):
2074         (IPC::decodeSharedBuffer):
2075         Update SharedMemory function names.
2076
2077 2015-04-13  Anders Carlsson  <andersca@apple.com>
2078
2079         Rename SharedMemory::create overloads
2080         https://bugs.webkit.org/show_bug.cgi?id=143679
2081
2082         Reviewed by Beth Dakin.
2083
2084         Rename the SharedMemory::create overload that allocates memory to SharedMemory::allocate,
2085         and the SharedMemory::create overload that maps in a handle to SharedMemory::map.
2086
2087         * Platform/SharedMemory.h:
2088         * Platform/mac/SharedMemoryMac.cpp:
2089         (WebKit::SharedMemory::allocate):
2090         (WebKit::SharedMemory::map):
2091         (WebKit::SharedMemory::create): Deleted.
2092         * Shared/ShareableBitmap.cpp:
2093         (WebKit::ShareableBitmap::createShareable):
2094         (WebKit::ShareableBitmap::create):
2095         * Shared/ShareableResource.cpp:
2096         (WebKit::ShareableResource::create):
2097         * Shared/ShareableResource.h:
2098         * Shared/WebCompiledContentExtension.cpp:
2099         (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData):
2100         * Shared/WebCompiledContentExtensionData.cpp:
2101         (WebKit::WebCompiledContentExtensionData::decode):
2102         * Shared/WebHitTestResult.cpp:
2103         (WebKit::WebHitTestResult::Data::Data):
2104         (WebKit::WebHitTestResult::Data::decode):
2105         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2106         (WebKit::WebPasteboardProxy::getPasteboardBufferForType):
2107         (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
2108         * UIProcess/VisitedLinkProvider.cpp:
2109         (WebKit::VisitedLinkProvider::resizeTable):
2110         * UIProcess/mac/WebPageProxyMac.mm:
2111         (WebKit::WebPageProxy::dataSelectionForPasteboard):
2112         (WebKit::WebPageProxy::setPromisedDataForImage):
2113         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2114         (WebKit::PDFPlugin::writeItemsToPasteboard):
2115         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2116         (WebKit::WebPlatformStrategies::bufferForType):
2117         (WebKit::WebPlatformStrategies::setBufferForType):
2118         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2119         (WebKit::WebDragClient::declareAndWriteDragImage):
2120         * WebProcess/WebPage/VisitedLinkTableController.cpp:
2121         (WebKit::VisitedLinkTableController::setVisitedLinkTable):
2122         * WebProcess/WebPage/mac/WebPageMac.mm:
2123         (WebKit::WebPage::getDataSelectionForPasteboard):
2124
2125 2015-04-13  Brady Eidson  <beidson@apple.com>
2126
2127         Share sheets from Share menus appear outside the browser window.
2128         <rdar://problem/20455592> and https://bugs.webkit.org/show_bug.cgi?id=143620
2129
2130         Reviewed by Darin Adler.
2131
2132         Refactor existing Sharing Service Picker code to also be used for the Share menu NSMenuItem.
2133
2134         * UIProcess/WebPageProxy.cpp:
2135         (WebKit::WebPageProxy::internalShowContextMenu):
2136         (WebKit::WebPageProxy::platformInitializeShareMenuItem):
2137         * UIProcess/WebPageProxy.h:
2138
2139         * UIProcess/mac/WKSharingServicePickerDelegate.h: Added.
2140         * UIProcess/mac/WKSharingServicePickerDelegate.mm: Added.
2141         (+[WKSharingServicePickerDelegate sharedSharingServicePickerDelegate]):
2142         (-[WKSharingServicePickerDelegate menuProxy]):
2143         (-[WKSharingServicePickerDelegate setMenuProxy:]):
2144         (-[WKSharingServicePickerDelegate setPicker:]):
2145         (-[WKSharingServicePickerDelegate setFiltersEditingServices:]):
2146         (-[WKSharingServicePickerDelegate setHandlesEditingReplacement:]):
2147         (-[WKSharingServicePickerDelegate sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]):
2148         (-[WKSharingServicePickerDelegate sharingServicePicker:delegateForSharingService:]):
2149         (-[WKSharingServicePickerDelegate sharingService:willShareItems:]):
2150         (-[WKSharingServicePickerDelegate sharingService:didShareItems:]):
2151         (-[WKSharingServicePickerDelegate sharingService:sourceWindowForShareItems:sharingContentScope:]):
2152
2153         * UIProcess/mac/WebContextMenuProxyMac.mm:
2154         (WebKit::WebContextMenuProxyMac::setupServicesMenu):
2155         (+[WKSharingServicePickerDelegate sharedSharingServicePickerDelegate]): Deleted.
2156         (-[WKSharingServicePickerDelegate menuProxy]): Deleted.
2157         (-[WKSharingServicePickerDelegate setMenuProxy:]): Deleted.
2158         (-[WKSharingServicePickerDelegate setPicker:]): Deleted.
2159         (-[WKSharingServicePickerDelegate setIncludeEditorServices:]): Deleted.
2160         (-[WKSharingServicePickerDelegate sharingServicePicker:sharingServicesForItems:mask:proposedSharingServices:]): Deleted.
2161         (-[WKSharingServicePickerDelegate sharingServicePicker:delegateForSharingService:]): Deleted.
2162         (-[WKSharingServicePickerDelegate sharingService:willShareItems:]): Deleted.
2163         (-[WKSharingServicePickerDelegate sharingService:didShareItems:]): Deleted.
2164         (-[WKSharingServicePickerDelegate sharingService:sourceWindowForShareItems:sharingContentScope:]): Deleted.
2165
2166         * UIProcess/mac/WebPageProxyMac.mm:
2167         (WebKit::WebPageProxy::platformInitializeShareMenuItem):
2168
2169         * WebKit2.xcodeproj/project.pbxproj:
2170
2171 2015-04-13  Anders Carlsson  <andersca@apple.com>
2172
2173         Begin cleaning up the shared memory interface
2174         https://bugs.webkit.org/show_bug.cgi?id=143677
2175
2176         Reviewed by Andreas Kling.
2177
2178         Rename createFromVMBuffer to create and add a protection parameter (which is currently unused).
2179         Also, turn SharedMemory::Protection into a proper enum class.
2180
2181         * NetworkProcess/cache/NetworkCache.cpp:
2182         (WebKit::NetworkCache::Cache::store):
2183         * NetworkProcess/cache/NetworkCacheEntry.cpp:
2184         (WebKit::NetworkCache::Entry::initializeBufferFromStorageRecord):
2185         * NetworkProcess/mac/NetworkResourceLoaderMac.mm:
2186         (WebKit::tryGetShareableHandleFromCFData):
2187         * Platform/SharedMemory.h:
2188         * Platform/mac/SharedMemoryMac.cpp:
2189         (WebKit::SharedMemory::create):
2190         (WebKit::machProtection):
2191         (WebKit::SharedMemory::createHandle):
2192         (WebKit::SharedMemory::createFromVMBuffer): Deleted.
2193         * Shared/ContextMenuContextData.cpp:
2194         (WebKit::ContextMenuContextData::encode):
2195         (WebKit::ContextMenuContextData::decode):
2196         * Shared/ShareableBitmap.h:
2197         * Shared/ShareableResource.cpp:
2198         (WebKit::ShareableResource::create):
2199         (WebKit::ShareableResource::createHandle):
2200         * Shared/WebCompiledContentExtensionData.cpp:
2201         (WebKit::WebCompiledContentExtensionData::encode):
2202         (WebKit::WebCompiledContentExtensionData::decode):
2203         * Shared/WebHitTestResult.cpp:
2204         (WebKit::WebHitTestResult::Data::encode):
2205         (WebKit::WebHitTestResult::Data::decode):
2206         * UIProcess/API/APIUserContentExtensionStore.cpp:
2207         (API::createExtension):
2208         * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
2209         (WebKit::WebPasteboardProxy::getPasteboardBufferForType):
2210         (WebKit::WebPasteboardProxy::setPasteboardBufferForType):
2211         (WebKit::WebPasteboardProxy::readBufferFromPasteboard):
2212         * UIProcess/VisitedLinkProvider.cpp:
2213         (WebKit::VisitedLinkProvider::sendTable):
2214         * UIProcess/mac/WKPrintingView.mm:
2215         (pageDidDrawToImage):
2216         * UIProcess/mac/WebPageProxyMac.mm:
2217         (WebKit::WebPageProxy::dataSelectionForPasteboard):
2218         (WebKit::WebPageProxy::setPromisedDataForImage):
2219         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2220         (WebKit::PDFPlugin::writeItemsToPasteboard):
2221         * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
2222         (WebKit::WebPlatformStrategies::bufferForType):
2223         (WebKit::WebPlatformStrategies::setBufferForType):
2224         (WebKit::WebPlatformStrategies::readBufferFromPasteboard):
2225         * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
2226         (WebKit::WebDragClient::declareAndWriteDragImage):
2227         * WebProcess/WebPage/VisitedLinkTableController.cpp:
2228         (WebKit::VisitedLinkTableController::setVisitedLinkTable):
2229         * WebProcess/WebPage/WebPage.cpp:
2230         (WebKit::WebPage::takeSnapshot):
2231         (WebKit::WebPage::drawRectToImage):
2232         * WebProcess/WebPage/mac/WebPageMac.mm:
2233         (WebKit::WebPage::getDataSelectionForPasteboard):
2234
2235 2015-04-10  Jon Honeycutt  <jhoneycutt@apple.com>
2236
2237         Cannot click "Next" button on Google two-factor auth setup page
2238
2239         <https://bugs.webkit.org/show_bug.cgi?id=143624>
2240         <rdar://problem/19175714>
2241
2242         This issue occurs when this site focuses the submit button. When it
2243         receives focus, we try to assist it. While we consider ourselves to be
2244         assisting it, we ignore further gesture inputs for that node, including
2245         the tap gesture.
2246
2247         To fix this, only assist input types that we know are assistable,
2248         including text fields, select and date elements, etc.
2249
2250         Reviewed by Darin Adler.
2251
2252         * UIProcess/ios/WKContentViewInteraction.mm:
2253         (isAssistableInputType):
2254         If the type is a known-assistable type, return true.
2255         (-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:userObject:]):
2256         Call isAssistableInputType() to determine whether we should do any kind
2257         of assistance for this node.
2258
2259 2015-04-13  Beth Dakin  <bdakin@apple.com>
2260
2261         Add force property to MouseEvents
2262         https://bugs.webkit.org/show_bug.cgi?id=143569
2263         -and corresponding-
2264         rdar://problem/20472954
2265
2266         Reviewed by Darin Adler.
2267
2268         In order to accommodate adding force to all PlatformMouseEvents, we have to add it 
2269         to pass a caches pressure event to NativeWebMouseEvent and add force to 
2270         WebMouseEvent.
2271
2272         NativeWebMouseEvent now requires a second NSEvent for the pressureEvent. 
2273         * Shared/NativeWebMouseEvent.h:
2274
2275         WebMouseEvent takes a force parameter.
2276         * Shared/WebEvent.h:
2277         (WebKit::WebMouseEvent::force):
2278         * Shared/WebEventConversion.cpp:
2279         (WebKit::WebKit2PlatformMouseEvent::WebKit2PlatformMouseEvent):
2280         * Shared/WebMouseEvent.cpp:
2281         (WebKit::WebMouseEvent::WebMouseEvent):
2282         (WebKit::WebMouseEvent::encode):
2283         (WebKit::WebMouseEvent::decode):
2284         * Shared/mac/NativeWebMouseEventMac.mm:
2285         (WebKit::NativeWebMouseEvent::NativeWebMouseEvent):
2286         * Shared/mac/WebEventFactory.h:
2287         * Shared/mac/WebEventFactory.mm:
2288         (WebKit::WebEventFactory::createWebMouseEvent):
2289
2290         Cache the most recent pressureEvent in _data so that it can be sent along to the 
2291         NativeWebMouseEvent constructor.
2292         * UIProcess/API/mac/WKView.mm:
2293         (-[WKView pressureChangeWithEvent:]):
2294         (-[WKView acceptsFirstMouse:]):
2295         (-[WKView shouldDelayWindowOrderingForEvent:]):
2296         (-[WKView _postFakeMouseMovedEventForFlagsChangedEvent:]):
2297         (-[WKView initWithFrame:processPool:configuration:webView:]):
2298
2299         WebMouseEvent takes a force parameter.
2300         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2301         (WebKit::PDFPlugin::showContextMenuAtPoint):
2302         * WebProcess/Plugins/PluginView.cpp:
2303         (WebKit::PluginView::createWebEvent):
2304
2305         MouseEvent and PlatformMouseEvent both take force parameters too.
2306         * WebProcess/WebPage/WebPage.cpp:
2307         (WebKit::WebPage::navigateToURLWithSimulatedClick):
2308         (WebKit::WebPage::contextMenuAtPointInWindow):
2309         (WebKit::WebPage::dragEnded):
2310         (WebKit::WebPage::simulateMouseDown):
2311         (WebKit::WebPage::simulateMouseUp):
2312         (WebKit::WebPage::simulateMouseMotion):
2313
2314         The functions that dispatch the force events no longer take a PlatformMouseEvent 
2315         as a parameter.
2316         * WebProcess/WebPage/mac/WebPageMac.mm:
2317         (WebKit::WebPage::inputDeviceForceDidChange):
2318         (WebKit::WebPage::immediateActionDidCancel):
2319
2320 2015-04-13  Andreas Kling  <akling@apple.com>
2321
2322         Don't segregate heap objects based on Structure immortality.
2323         <https://webkit.org/b/143638>
2324
2325         Reviewed by Darin Adler.
2326
2327         * WebProcess/Plugins/Netscape/JSNPObject.h:
2328
2329 2015-04-13  Timothy Horton  <timothy_horton@apple.com>
2330
2331         javascript: links in inline PDFs shouldn't execute JavaScript in the context of the host website
2332         https://bugs.webkit.org/show_bug.cgi?id=143642
2333         <rdar://problem/18259355>
2334
2335         Reviewed by Darin Adler.
2336
2337         * WebProcess/Plugins/PDF/PDFPlugin.mm:
2338         (WebKit::PDFPlugin::clickedLink):
2339         Don't follow javascript: URLs.
2340
2341 2015-04-10  Alex Christensen  <achristensen@webkit.org>
2342
2343         [Content Extensions] Don't unmap shared memory while using it.
2344         https://bugs.webkit.org/show_bug.cgi?id=143625
2345
2346         Reviewed by Darin Adler.
2347
2348         * Shared/WebCompiledContentExtension.cpp:
2349         (WebKit::WebCompiledContentExtension::createFromCompiledContentExtensionData):
2350         * Shared/WebCompiledContentExtensionData.h:
2351         (WebKit::WebCompiledContentExtensionData::WebCompiledContentExtensionData):
2352         * UIProcess/API/APIUserContentExtensionStore.cpp:
2353         (API::createExtension):
2354         Keep the Data object alive as long as the SharedMemory that uses it.
2355
2356 2015-04-12  Darin Adler  <darin@apple.com>
2357
2358         [Cocoa] Localizable strings are inconsistent and need to be regenerated
2359         https://bugs.webkit.org/show_bug.cgi?id=143661
2360
2361         Reviewed by Dan Bernstein.
2362
2363         * UIProcess/WebEditCommandProxy.cpp:
2364         (WebKit::WebEditCommandProxy::nameForEditAction): Also added a comment
2365         about the fact that we have two copies of all the localizable strings.
2366
2367 2015-04-12  Sungmann Cho  <sungmann.cho@navercorp.com>
2368
2369         Fix trival typos related to the word "coordinate".
2370         https://bugs.webkit.org/show_bug.cgi?id=143644
2371
2372         Reviewed by Alexey Proskuryakov.
2373
2374         No new tests, no behavior change.
2375
2376         * Shared/WebHitTestResult.cpp:
2377         (WebKit::WebHitTestResult::Data::encode):
2378         (WebKit::WebHitTestResult::Data::decode):
2379         * Shared/WebHitTestResult.h:
2380         * WebProcess/WebPage/mac/WebPageMac.mm:
2381         (WebKit::WebPage::performActionMenuHitTestAtLocation):
2382         (WebKit::WebPage::lookupTextAtLocation):
2383
2384 2015-04-12  Sungmann Cho  <sungmann.cho@navercorp.com>
2385
2386         Remove PluginModuleInfo.cpp from WebKit2
2387         https://bugs.webkit.org/show_bug.cgi?id=143643
2388
2389         Reviewed by Darin Adler.
2390
2391         Remove PluginModuleInfo.cpp from WebKit2 because it is totally empty.
2392
2393         No new tests, no behavior change.
2394
2395         * CMakeLists.txt:
2396         * Shared/Plugins/PluginModuleInfo.cpp: Removed.
2397         * WebKit2.xcodeproj/project.pbxproj:
2398
2399 2015-04-11  Yusuke Suzuki  <utatane.tea@gmail.com>
2400
2401         [ES6] Enable Symbol in web pages
2402         https://bugs.webkit.org/show_bug.cgi?id=143375
2403
2404         Reviewed by Ryosuke Niwa.
2405
2406         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2407         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2408         * UIProcess/efl/WebInspectorProxyEfl.cpp:
2409         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2410         * UIProcess/gtk/WebInspectorProxyGtk.cpp:
2411         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2412         * UIProcess/mac/WebInspectorProxyMac.mm:
2413         (WebKit::WebInspectorProxy::platformCreateInspectorPage):
2414
2415 2015-04-08  Sam Weinig  <sam@webkit.org>
2416
2417         Allow LaunchServices to handle URLs on link navigations
2418         <rdar://problem/19446826>
2419         https://bugs.webkit.org/show_bug.cgi?id=143544
2420
2421         Reviewed by Anders Carlsson.
2422
2423         * UIProcess/Cocoa/NavigationState.mm:
2424         (WebKit::tryAppLink):
2425         (WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
2426         Only let LaunchServices have a crack at the URL if the navigation is:
2427             1) a main frame navigation
2428             2) a result of a user gesture
2429
2430 2015-04-10  Tim Horton  <timothy_horton@apple.com>
2431
2432         Replace setFixedLayoutSizeEnabled: with an enum of layout modes
2433         https://bugs.webkit.org/show_bug.cgi?id=143576
2434
2435         Reviewed by Simon Fraser.
2436
2437         * UIProcess/API/C/WKLayoutMode.h: Added.
2438         * UIProcess/API/Cocoa/WKViewPrivate.h:
2439         * UIProcess/API/Cocoa/WKWebView.mm:
2440         (-[WKWebView _layoutMode]):
2441         (-[WKWebView _setLayoutMode:]):
2442         (-[WKWebView _isFixedLayoutEnabled]): Deleted.
2443         (-[WKWebView _setFixedLayoutEnabled:]): Deleted.
2444         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2445         * UIProcess/API/Cocoa/_WKLayoutMode.h: Added.
2446         * UIProcess/API/mac/WKView.mm:
2447         (-[WKView _layoutMode]):
2448         (-[WKView _setLayoutMode:]):
2449         (-[WKView _isFixedLayoutEnabled]): Deleted.
2450         (-[WKView _setFixedLayoutEnabled:]): Deleted.
2451         * WebKit2.xcodeproj/project.pbxproj:
2452         Add enums for "layout mode". Currently we have two values: "ViewSize",
2453         which is the normal behavior, and "FixedSize", which is fixed layout mode.
2454         More values will come in the future.
2455
2456 2015-04-10  Anders Carlsson  <andersca@apple.com>
2457
2458         _WKWebsiteDataStore doesn't track and remove offline application cache entries
2459         https://bugs.webkit.org/show_bug.cgi?id=143614
2460         rdar://problem/20243235
2461
2462         Reviewed by Andreas Kling.
2463
2464         * Shared/WebsiteData/WebsiteDataTypes.h:
2465         Add WebsiteDataTypeOfflineWebApplicationCache.
2466
2467         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.h:
2468         * UIProcess/API/Cocoa/_WKWebsiteDataRecord.mm:
2469         (dataTypesToString):
2470         * UIProcess/API/Cocoa/_WKWebsiteDataRecordInternal.h:
2471         (WebKit::toWebsiteDataTypes):
2472         (WebKit::toWKWebsiteDataTypes):
2473         Add WKWebsiteDataTypeOfflineWebApplicationCache.
2474
2475         * UIProcess/WebsiteData/WebsiteDataStore.cpp:
2476         (WebKit::WebsiteDataStore::fetchData):
2477         Create a custom application cache storage and fetch the origins from it.
2478
2479         (WebKit::WebsiteDataStore::removeData):
2480         Delete either all the cache entries (since we don't track time in the application cache),
2481         or the ones specified by the given entries.
2482
2483 2015-04-10  Eric Carlson  <eric.carlson@apple.com>
2484
2485         [Mac] Refactor MediaPlaybackTarget
2486         https://bugs.webkit.org/show_bug.cgi?id=143571
2487
2488         Reviewed by Jer Noble.
2489
2490         Pass a MediaPlaybackTargetContext across process boundary instead of a MediaPlaybackTarget.
2491         * Shared/WebCoreArgumentCoders.h:
2492         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encode): New.
2493         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decode): New.
2494         * Shared/mac/WebCoreArgumentCoders.cpp:
2495         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::encodePlatformData): New.
2496         (IPC::ArgumentCoder<MediaPlaybackTargetContext>::decodePlatformData): New.
2497         (IPC::ArgumentCoder<MediaPlaybackTarget>::encode): Deleted.
2498         (IPC::ArgumentCoder<MediaPlaybackTarget>::decode): Deleted.
2499         * UIProcess/WebPageProxy.cpp:
2500         (WebKit::WebPageProxy::didChoosePlaybackTarget): Take a Ref<MediaPlaybackTarget>&&.
2501         * UIProcess/WebPageProxy.h:
2502         * WebProcess/WebPage/WebPage.h:
2503         * WebProcess/WebPage/WebPage.messages.in:
2504         * WebProcess/WebPage/mac/WebPageMac.mm:
2505         (WebKit::WebPage::playbackTargetSelected): Take a Ref<MediaPlaybackTarget>&&.
2506
2507 2015-04-10  Hunseop Jeong  <hs85.jeong@samsung.com>
2508
2509         Fix some minor typos related to the WebProcessCreationParameter. 
2510         https://bugs.webkit.org/show_bug.cgi?id=143598
2511
2512         Reviewed by Csaba Osztrogonác.
2513
2514         No new tests, no behavior change.
2515
2516         * Shared/WebProcessCreationParameters.cpp:
2517         (WebKit::WebProcessCreationParameters::encode):
2518         (WebKit::WebProcessCreationParameters::decode):
2519         * Shared/WebProcessCreationParameters.h:
2520         * UIProcess/WebProcessPool.cpp:
2521         (WebKit::WebProcessPool::createNewWebProcess):
2522         * WebProcess/WebProcess.cpp:
2523         (WebKit::WebProcess::initializeWebProcess):
2524
2525 2015-04-09  Andy Estes  <aestes@apple.com>
2526
2527         [Cocoa] Add a HAVE(AVKIT) and use it
2528         https://bugs.webkit.org/show_bug.cgi?id=143593
2529
2530         Reviewed by David Kilzer.
2531
2532         * UIProcess/API/Cocoa/WKWebView.mm:
2533         (-[WKWebView _mayAutomaticallyShowVideoOptimized]): Returned false if !HAVE(AVKIT).
2534         * UIProcess/WebPageProxy.cpp:
2535         (WebKit::WebPageProxy::WebPageProxy): Removed the check for < iOS 8.2.
2536         (WebKit::WebPageProxy::reattachToWebProcess): Ditto.
2537         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2538         (WebKit::WebVideoFullscreenManagerProxy::create): Created a version of this function that returns nullptr if
2539         the minimum required version of iOS is less than 8.2 or if !HAVE(AVKIT).
2540         * WebProcess/WebPage/WebPage.cpp:
2541         (WebKit::WebPage::updatePreferences): Only called Settings::setAVKitEnabled(true) if HAVE(AVKIT).
2542
2543 2015-04-09  Hunseop Jeong  <hs85.jeong@samsung.com>
2544
2545         Use modern loops in WebProcess 
2546         https://bugs.webkit.org/show_bug.cgi?id=143302
2547
2548         Reviewed by Darin Adler.
2549
2550         Use modern range for-loops in WebProcess.
2551
2552         No new tests, no behavior change.
2553
2554         * WebProcess/WebProcess.cpp:
2555         (WebKit::WebProcess::initializeConnection):
2556         (WebKit::WebProcess::initializeWebProcess):
2557         (WebKit::WebProcess::focusedWebPage):
2558         (WebKit::WebProcess::webPageGroup):
2559         (WebKit::WebProcess::setTextCheckerState):
2560         (WebKit::WebProcess::resetAllGeolocationPermissions):
2561
2562 2015-04-09  Gordon Sheridan  <gordon_sheridan@apple.com>
2563
2564         Track IconDatabase retain counts for WebContent processes. Balance retain/releases for processes that terminate before successfully doing it themselves.
2565         https://bugs.webkit.org/show_bug.cgi?id=143517.
2566
2567         Reviewed by Brady Eidson.
2568
2569         * UIProcess/WebIconDatabase.messages.in:
2570         Move RetainIconForPageURL and ReleaseIconForPageURL messages to WebProcessProxy so they can be associated with the appropriate web process.
2571
2572         * UIProcess/WebProcessProxy.cpp:
2573         (WebKit::WebProcessProxy::connectionDidClose):
2574         Call releaseRemainingIconsForPageURLs() to balance retains/releases for this process.
2575
2576         (WebKit::WebProcessProxy::retainIconForPageURL):
2577         Track retain counts for page URLs and call through to WebIconDatabase.
2578
2579         (WebKit::WebProcessProxy::releaseIconForPageURL):
2580         Ditto.
2581
2582         (WebKit::WebProcessProxy::releaseRemainingIconsForPageURLs):
2583         Call releaseIconForPageURL() once for each outstanding retain count, for each page URL.
2584
2585         * UIProcess/WebProcessProxy.h:
2586         Declare methods for retainIconForPageURL(), releaseIconForPageURL(), and releaseRemainingIconsForPageURLs().
2587         Declare hash map to track number of retains per page URL.
2588
2589         * UIProcess/WebProcessProxy.messages.in:
2590         Moved RetainIconForPageURL and ReleaseIconForPageURL messages here from WebIconDatabase.
2591
2592         * WebProcess/IconDatabase/WebIconDatabaseProxy.cpp:
2593         (WebKit::WebIconDatabaseProxy::retainIconForPageURL):
2594         Modify the receiver of the message to be WebProcessProxy.
2595
2596         (WebKit::WebIconDatabaseProxy::releaseIconForPageURL):
2597         Ditto.
2598
2599 2015-04-09  Chris Dumez  <cdumez@apple.com>
2600
2601         [WK2] Regression(r182194): The NetworkProcess is calling the wrong memory pressure handler before suspending
2602         https://bugs.webkit.org/show_bug.cgi?id=143575
2603         <rdar://problem/20484338>
2604
2605         Reviewed by Andreas Kling.
2606
2607         After r182194, the NetworkProcess is calling the memory pressure
2608         handler before getting suspended to free-up as much memory as possible
2609         at this point.
2610
2611         However, we were calling the default memory pressure handling code
2612         instead of the custom handler registered by the NetworkProcess. This
2613         patch fixes the problem.
2614
2615         * NetworkProcess/NetworkProcess.cpp:
2616         (WebKit::NetworkProcess::lowMemoryHandler):
2617         (WebKit::NetworkProcess::initializeNetworkProcess):
2618         (WebKit::NetworkProcess::processWillSuspend):
2619         * NetworkProcess/NetworkProcess.h:
2620
2621 2015-04-09  Brady Eidson  <beidson@apple.com>
2622
2623         REGRESSION (r182573): Action Menus no longer appear for WebKit2 views displaying an image
2624         rdar://problem/20486551 and https://bugs.webkit.org/show_bug.cgi?id=143574
2625
2626         Reviewed by Brent Fulgham.
2627
2628         * Shared/WebHitTestResult.cpp:
2629         (WebKit::WebHitTestResult::Data::Data): Clear up a name scoping issue.
2630
2631 2015-04-09  Chris Dumez  <cdumez@apple.com>
2632
2633         [WK2][iOS] editorState() should not cause a synchronous layout
2634         https://bugs.webkit.org/show_bug.cgi?id=142536
2635         <rdar://problem/20041506>
2636
2637         Reviewed by Enrica Casucci.
2638
2639         platformEditorState() on iOS does a synchronous layout to compute some
2640         of the EditorState members (e.g. caretRectAtStart / caretRectAtEnd).
2641         This is bad for performance as this is called every time the selection
2642         is changed (which happens for e.g. when you set the value of a focused
2643         HTMLInputElement).
2644
2645         This patch updates the behavior on iOS to only send a partial EditorState
2646         on selection change so that the UIProcess gets most of the information
2647         (the ones that do not require style recalc or layout) ASAP. A full Editor
2648         state is then sent after the asynchronous layout is done.
2649
2650         With this change, I see a 38% improvement on Speedometer (26.4 +/- 0.37
2651         -> 36.5 +/- 0.54) on iPhone 6 Plus.
2652
2653         * Shared/EditorState.cpp:
2654         (WebKit::EditorState::encode):
2655         (WebKit::EditorState::decode):
2656         (WebKit::EditorState::PostLayoutData::encode):
2657         (WebKit::EditorState::PostLayoutData::decode):
2658         * Shared/EditorState.h:
2659         (WebKit::EditorState::EditorState): Deleted.
2660         * UIProcess/ios/WKContentView.mm:
2661         (-[WKContentView _didCommitLayerTree:]):
2662         * UIProcess/ios/WKContentViewInteraction.mm:
2663         (WebKit::WKSelectionDrawingInfo::WKSelectionDrawingInfo):
2664         (-[WKContentView webSelectionRects]):
2665         (-[WKContentView _addShortcut:]):
2666         (-[WKContentView selectedText]):
2667         (-[WKContentView isReplaceAllowed]):
2668         (-[WKContentView _promptForReplace:]):
2669         (-[WKContentView _transliterateChinese:]):
2670         (-[WKContentView textStylingAtPosition:inDirection:]):
2671         (-[WKContentView canPerformAction:withSender:]):
2672         (-[WKContentView _showDictionary:]):
2673         (-[WKContentView _characterBeforeCaretSelection]):
2674         (-[WKContentView _characterInRelationToCaretSelection:]):
2675         (-[WKContentView _selectionAtDocumentStart]):
2676         (-[WKContentView selectedTextRange]):
2677         (-[WKContentView hasContent]):
2678         * WebProcess/WebCoreSupport/WebEditorClient.cpp:
2679         (WebKit::WebEditorClient::didChangeSelectionAndUpdateLayout):
2680         * WebProcess/WebCoreSupport/WebEditorClient.h:
2681         * WebProcess/WebPage/WebPage.cpp:
2682         (WebKit::WebPage::editorState):
2683         (WebKit::WebPage::didChangeSelection):
2684         (WebKit::WebPage::sendPostLayoutEditorStateIfNeeded):
2685         * WebProcess/WebPage/WebPage.h:
2686         * WebProcess/WebPage/efl/WebPageEfl.cpp:
2687         (WebKit::WebPage::platformEditorState):
2688         * WebProcess/WebPage/gtk/WebPageGtk.cpp:
2689         (WebKit::WebPage::platformEditorState):
2690         * WebProcess/WebPage/ios/WebPageIOS.mm:
2691         (WebKit::WebPage::platformEditorState):
2692         * WebProcess/WebPage/mac/WebPageMac.mm:
2693         (WebKit::WebPage::platformEditorState):
2694
2695 2015-04-09  Antti Koivisto  <antti@apple.com>
2696
2697         Network Cache: Crash in WebCore::CachedResource::tryReplaceEncodedData
2698         https://bugs.webkit.org/show_bug.cgi?id=143562
2699
2700         Reviewed by Anders Carlsson.
2701
2702         If another thread comes and truncates the file before we map it we end up with a map that crashes when accessed.
2703
2704         * NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
2705         (WebKit::NetworkCache::IOChannel::IOChannel):
2706
2707             When creating a new file unlink any existing file instead of using O_TRUNC.
2708
2709 2015-04-09  Csaba Osztrogonác  <ossy@webkit.org>
2710
2711         [EFL][GTK] WebKit2's generate-forwarding-headers.pl runs too many times
2712         https://bugs.webkit.org/show_bug.cgi?id=142907
2713
2714         Unreviewed typo fix after r182595.
2715
2716         * PlatformGTK.cmake:
2717
2718 2015-04-09  Csaba Osztrogonác  <ossy@webkit.org>
2719
2720         [EFL][GTK] WebKit2's generate-forwarding-headers.pl runs too many times
2721         https://bugs.webkit.org/show_bug.cgi?id=142907
2722
2723         Reviewed by Carlos Garcia Campos.
2724
2725         * PlatformEfl.cmake:
2726         * PlatformGTK.cmake:
2727         * Scripts/generate-forwarding-headers.pl: Make it work with more path and platform arguments.
2728
2729 2015-04-08  Joseph Pecoraro  <pecoraro@apple.com>
2730
2731         Exception in console and broken right click after attempting to show context menu in Inspector
2732         https://bugs.webkit.org/show_bug.cgi?id=143556
2733
2734         Reviewed by Brady Eidson.
2735
2736         * Shared/mac/NativeContextMenuItem.mm:
2737         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
2738         Add an ASSERT to immediately catch a menu item created with a nil native menu item.
2739
2740         * UIProcess/WebPageProxy.cpp:
2741         (WebKit::WebPageProxy::internalShowContextMenu):
2742         Gracefully handle a null share context menu item.
2743
2744 2015-04-08  Brent Fulgham  <bfulgham@apple.com>
2745
2746         [Mac] Unreviewed test fix after r182584
2747         https://bugs.webkit.org/show_bug.cgi?id=143452
2748
2749         Correct bit comparison to use the correct value for the Control-key
2750
2751         * Shared/mac/WebEventFactory.mm:
2752         (WebKit::typeForEvent):
2753
2754 2015-04-08  Jaehun Lim  <ljaehun.lim@samsung.com>
2755
2756         [EFL] Create PageUIClientEfl after sending CreateWebPage message
2757         https://bugs.webkit.org/show_bug.cgi?id=143514
2758
2759         Reviewed by Gyuyoung Kim.
2760
2761         UIProcess sends some messages to WebPage before WebPage is created. It makes some error logs on debug build.
2762         So this patch moves the initialization of m_pageUIClient after calling WKViewInitialize().
2763
2764         * UIProcess/API/efl/EwkView.cpp:
2765         (EwkView::EwkView):
2766
2767 2015-04-08  Brent Fulgham  <bfulgham@apple.com>
2768
2769         [Mac] WebKit is not honoring OS preferences for secondary click behaviors
2770         https://bugs.webkit.org/show_bug.cgi?id=143452
2771         <rdar://problem/20437483>
2772
2773         Reviewed by Tim Horton.
2774
2775         We cannot rely on the event's button number to decide behavior. The OS settings might have
2776         mapped middle button to context menu, etc. Instead, we should ask the OS (via NSMenu) what
2777         the proper button press behavior is.
2778
2779         * Shared/mac/WebEventFactory.mm:
2780         (WebKit::mouseButtonForEvent): Ask NSMenu what kind of button press we have received.
2781
2782 2015-04-08  Brady Eidson  <beidson@apple.com>
2783
2784         Expose the "Share" menu for links, images, and media.
2785         <rdar://problem/20435340> and https://bugs.webkit.org/show_bug.cgi?id=143502
2786
2787         Reviewed by Tim Horton.
2788
2789         * Shared/ContextMenuContextData.cpp:
2790         (WebKit::ContextMenuContextData::ContextMenuContextData):
2791
2792         * Shared/WebHitTestResult.cpp:
2793         (WebKit::WebHitTestResult::Data::Data):
2794         * Shared/WebHitTestResult.h:
2795
2796         * UIProcess/WebPageProxy.cpp:
2797         (WebKit::WebPageProxy::internalShowContextMenu):
2798
2799         * WebProcess/WebCoreSupport/WebContextMenuClient.cpp:
2800         (WebKit::WebContextMenuClient::shareMenuItem):
2801         * WebProcess/WebCoreSupport/WebContextMenuClient.h:
2802
2803         * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
2804         (WebKit::WebContextMenuClient::shareSelectedTextMenuItem): Deleted.
2805
2806         * WebProcess/WebPage/mac/WebPageMac.mm:
2807         (WebKit::WebPage::performActionMenuHitTestAtLocation):
2808
2809 2015-04-08  Anders Carlsson  <andersca@apple.com>
2810
2811         Add encoding and decoding of ints to WKRemoteObjectCoder
2812         https://bugs.webkit.org/show_bug.cgi?id=143538
2813
2814         Reviewed by Tim Horton.
2815
2816         * Shared/API/Cocoa/WKRemoteObjectCoder.mm:
2817         (-[WKRemoteObjectEncoder encodeInt:forKey:]):
2818         (-[WKRemoteObjectDecoder decodeIntForKey:]):
2819
2820 2015-04-08  Anders Carlsson  <andersca@apple.com>
2821
2822         Delete ApplicationCache static member functions
2823         https://bugs.webkit.org/show_bug.cgi?id=143534
2824
2825         Reviewed by Tim Horton.
2826
2827         * WebProcess/ApplicationCache/WebApplicationCacheManager.cpp:
2828         (WebKit::WebApplicationCacheManager::deleteEntriesForOrigin):
2829         (WebKit::WebApplicationCacheManager::deleteAllEntries):
2830         * WebProcess/InjectedBundle/InjectedBundle.cpp:
2831         (WebKit::InjectedBundle::clearApplicationCacheForOrigin):
2832         (WebKit::InjectedBundle::appCacheUsageForOrigin):
2833
2834 2015-04-08  Enrica Casucci  <enrica@apple.com>
2835
2836         32-bit build fix after r182554.
2837
2838         * UIProcess/API/mac/WKView.mm:
2839         (-[WKView resignFirstResponder]):
2840
2841 2015-04-08  Beth Dakin  <bdakin@apple.com>
2842
2843         Force events should not require preventDefault in order to fire
2844         https://bugs.webkit.org/show_bug.cgi?id=143503
2845         -and corresponding-
2846         rdar://problem/20458916
2847
2848         Reviewed by Tim Horton.
2849
2850         We no longer need m_lastActionMenuHitTestPreventsDefault since we’ll always 
2851         dispatch the events to Element.
2852         * WebProcess/WebPage/WebPage.cpp:
2853         (WebKit::WebPage::WebPage):
2854         * WebProcess/WebPage/WebPage.h:
2855         * WebProcess/WebPage/mac/WebPageMac.mm:
2856         (WebKit::WebPage::performActionMenuHitTestAtLocation):
2857         (WebKit::WebPage::inputDeviceForceDidChange):
2858         (WebKit::WebPage::immediateActionDidCancel):
2859
2860 2015-04-08  Enrica Casucci  <enrica@apple.com>
2861
2862         Calling makeFirstResponder on WKWebView doesn't work.
2863         https://bugs.webkit.org/show_bug.cgi?id=143482
2864         rdar://problem/20298166
2865
2866         Reviewed by Dan Bernstein.
2867
2868         Adding forwarding of the responder status to the WKView.
2869         We also need to avoid doing any cleanup in resignFirstResponder
2870         if we know we are about to regain responder status again.
2871         Same goes for becomeFirstResponder.
2872
2873         * UIProcess/API/Cocoa/WKWebView.mm:
2874         (-[WKWebView becomeFirstResponder]):
2875         (-[WKWebView acceptsFirstResponder]):
2876         * UIProcess/API/mac/WKView.mm:
2877         (-[WKView becomeFristResponder]):
2878         (-[WKView resignFirstResponder]):
2879
2880 2015-04-07  Tim Horton  <timothy_horton@apple.com>
2881
2882         Fix the build.
2883
2884         * UIProcess/API/mac/WKView.mm:
2885         (-[WKView _setFixedLayoutSize:]):
2886
2887 2015-04-07  Tim Horton  <timothy_horton@apple.com>
2888
2889         Expose and test fixedLayoutSize via modern WebKit SPI
2890         https://bugs.webkit.org/show_bug.cgi?id=143500
2891
2892         Reviewed by Simon Fraser.
2893
2894         * UIProcess/API/Cocoa/WKViewPrivate.h:
2895         * UIProcess/API/Cocoa/WKWebView.mm:
2896         (-[WKWebView _isFixedLayoutEnabled]):
2897         (-[WKWebView _setFixedLayoutEnabled:]):
2898         (-[WKWebView _fixedLayoutSize]):
2899         (-[WKWebView _setFixedLayoutSize:]):
2900         * UIProcess/API/Cocoa/WKWebViewPrivate.h:
2901         * UIProcess/API/mac/WKView.mm:
2902         (-[WKView _isFixedLayoutEnabled]):
2903         (-[WKView _setFixedLayoutEnabled:]):
2904         (-[WKView _fixedLayoutSize]):
2905         (-[WKView _setFixedLayoutSize:]):
2906         Add API for adjusting the fixed layout size, and whether or not we use it.
2907
2908         * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
2909         (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
2910         Repair a mistake I made in r139822, where I brought odd TILED_BACKING_STORE-only
2911         logic (which disables scrollbars if fixedLayoutSize is enabled) to the rest of the ports.
2912         Put it back as TILED_BACKING_STORE-only.
2913
2914         Persist the fixedLayoutSize through view creation; we already persist the enabled state,
2915         but not the size, which doesn't make any sense.
2916
2917         * WebProcess/WebPage/WebPage.cpp:
2918         (WebKit::WebPage::fixedLayoutSize):
2919         * WebProcess/WebPage/WebPage.h:
2920         Add a fixedLayoutSize() getter.
2921
2922 2015-04-07  Brady Eidson  <beidson@apple.com>
2923
2924         ContextMenuItem refactoring
2925         https://bugs.webkit.org/show_bug.cgi?id=143485
2926
2927         Reviewed by Beth Dakin.
2928
2929         * Shared/mac/NativeContextMenuItem.mm:
2930         (WebKit::NativeContextMenuItem::NativeContextMenuItem):
2931
2932 2015-04-07  Simon Fraser  <simon.fraser@apple.com>
2933
2934         Add a new setting, AntialiasedFontDilationEnabled, exposed via WK2.
2935         https://bugs.webkit.org/show_bug.cgi?id=143495
2936
2937         Reviewed by Tim Horton.
2938         
2939         Exposed the antialiasedFontDilationEnabled setting via WK C SPI and Objective-C SPI.
2940
2941         * Shared/WebPreferencesDefinitions.h:
2942         * UIProcess/API/C/WKPreferences.cpp:
2943         (WKPreferencesSetAntialiasedFontDilationEnabled):
2944         (WKPreferencesGetAntialiasedFontDilationEnabled):
2945         * UIProcess/API/C/WKPreferencesRefPrivate.h:
2946         * UIProcess/API/Cocoa/WKPreferences.mm:
2947         (-[WKPreferences _antialiasedFontDilationEnabled]):
2948         (-[WKPreferences _setAntialiasedFontDilationEnabled:]):
2949         * UIProcess/API/Cocoa/WKPreferencesPrivate.h:
2950         * WebProcess/WebPage/WebPage.cpp:
2951         (WebKit::WebPage::updatePreferences):
2952
2953 2015-04-07  Beth Dakin  <bdakin@apple.com>
2954
2955         Should only propagate pressure events with relevant phases
2956         https://bugs.webkit.org/show_bug.cgi?id=143494
2957         -and corresponding-
2958         rdar://problem/20453738
2959
2960         Reviewed by Tim Horton.
2961
2962         We only care about the changed, began, and ended phases. 
2963         * UIProcess/API/mac/WKView.mm:
2964         (-[WKView pressureChangeWithEvent:]):
2965
2966 2015-04-07  Jer Noble  <jer.noble@apple.com>
2967
2968         Unreviewed build fix; make calls to new SPI conditional on iOS version.
2969
2970         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
2971         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame):
2972
2973 2015-04-06  Anders Carlsson  <andersca@apple.com>
2974
2975         Create the web inspector process pool lazily
2976         https://bugs.webkit.org/show_bug.cgi?id=143456
2977         rdar://problem/20146520
2978
2979         Reviewed by Mark Lam.
2980
2981         Add and implement WebInspectorProxy::isInspectorProcessPool instead of always creating the inspector process pool
2982         when trying to determine if a given process pool is the inspector process pool.
2983
2984         This should speed up initialization somewhat and avoid creating a storage manager for example.
2985
2986         * UIProcess/WebInspectorProxy.cpp:
2987         (WebKit::WebInspectorProxy::inspectorProcessPool):
2988         (WebKit::WebInspectorProxy::isInspectorProcessPool):
2989         * UIProcess/WebInspectorProxy.h:
2990         * UIProcess/WebProcessProxy.cpp:
2991         (WebKit::WebProcessProxy::getLaunchOptions):
2992
2993 2015-04-06  Brady Eidson  <beidson@apple.com>
2994
2995         Combine ActionMenuHitTestResult with WebHitTestResult
2996         https://bugs.webkit.org/show_bug.cgi?id=143444
2997
2998         Reviewed by Beth Dakin.
2999
3000         * Shared/mac/ActionMenuHitTestResult.h: Removed.
3001         * Shared/mac/ActionMenuHitTestResult.mm: Removed.
3002
3003         * Shared/WebHitTestResult.cpp:
3004         (WebKit::WebHitTestResult::Data::Data):
3005         (WebKit::WebHitTestResult::Data::encode):
3006         (WebKit::WebHitTestResult::Data::decode):
3007         (WebKit::WebHitTestResult::Data::platformEncode):
3008         (WebKit::WebHitTestResult::Data::platformDecode):
3009         * Shared/WebHitTestResult.h:
3010         * Shared/mac/WebHitTestResult.mm: Added.
3011         (WebKit::WebHitTestResult::Data::platformEncode):
3012         (WebKit::WebHitTestResult::Data::platformDecode):
3013
3014         * UIProcess/API/mac/WKView.mm:
3015         (-[WKView _didPerformActionMenuHitTest:forImmediateAction:contentPreventsDefault:userData:]):
3016         (-[WKView _didPerformActionMenuHitTest:forImmediateAction:userData:]): Deleted.
3017         * UIProcess/API/mac/WKViewInternal.h:
3018         * UIProcess/PageClient.h:
3019         * UIProcess/WebPageProxy.cpp:
3020         (WebKit::WebPageProxy::didPerformActionMenuHitTest):
3021         * UIProcess/WebPageProxy.h:
3022         * UIProcess/WebPageProxy.messages.in:
3023         * UIProcess/mac/PageClientImpl.h:
3024         * UIProcess/mac/PageClientImpl.mm:
3025         (WebKit::PageClientImpl::didPerformActionMenuHitTest):
3026         * UIProcess/mac/WKActionMenuController.h:
3027         * UIProcess/mac/WKActionMenuController.mm:
3028         (-[WKActionMenuController willDestroyView:]):
3029         (-[WKActionMenuController _clearActionMenuState]):
3030         (-[WKActionMenuController didPerformActionMenuHitTest:userData:]):
3031         (-[WKActionMenuController _hitTestResultDataImage]):
3032         (-[WKActionMenuController _defaultMenuItemsForImage]):
3033         (-[WKActionMenuController _copyImage:]):
3034         (-[WKActionMenuController _addImageToPhotos:]):
3035         (-[WKActionMenuController _defaultMenuItemsForDataDetectedText]):
3036         (-[WKActionMenuController _defaultMenuItemsForEditableTextWithSuggestions]):
3037         (-[WKActionMenuController _defaultMenuItemsForDataDetectableLink]):
3038         (-[WKActionMenuController _webHitTestResult]):
3039         (-[WKActionMenuController _defaultMenuItems]):
3040         (-[WKActionMenuController _hitTestResultImage]): Deleted.
3041         * UIProcess/mac/WKImmediateActionController.h:
3042         * UIProcess/mac/WKImmediateActionController.mm:
3043         (-[WKImmediateActionController willDestroyView:]):
3044         (-[WKImmediateActionController _clearImmediateActionState]):
3045         (-[WKImmediateActionController didPerformActionMenuHitTest:contentPreventsDefault:userData:]):
3046         (-[WKImmediateActionController immediateActionRecognizerDidUpdateAnimation:]):
3047         (-[WKImmediateActionController _webHitTestResult]):
3048         (-[WKImmediateActionController _defaultAnimationController]):
3049         (-[WKImmediateActionController _updateImmediateActionItem]):
3050         (-[WKImmediateActionController _menuItemForDataDetectedText]):
3051         (-[WKImmediateActionController _animationControllerForText]):
3052         (-[WKImmediateActionController didPerformActionMenuHitTest:userData:]): Deleted.
3053         * WebKit2.xcodeproj/project.pbxproj:
3054         * WebProcess/WebPage/mac/WebPageMac.mm:
3055         (WebKit::WebPage::performActionMenuHitTestAtLocation):
3056
3057 2015-04-06  Jer Noble  <jer.noble@apple.com>
3058
3059         Synchronize fullscreen animation between processes.
3060         https://bugs.webkit.org/show_bug.cgi?id=143131
3061
3062         Reviewed by Simon Fraser.
3063
3064         Support synchronize resizing by animating within the UIProcess. Since setVideoLayerFrameFenced() is now only
3065         ever called from within a 0-duration transaction, make that the official contract of the function and wrap
3066         the WebProcess side of that method in its own 0-duration transaction.
3067
3068         * Platform/spi/ios/BackBoardServicesSPI.h: Added.
3069         * Platform/spi/ios/UIKitSPI.h:
3070         * UIProcess/ios/WebVideoFullscreenManagerProxy.h:
3071         * UIProcess/ios/WebVideoFullscreenManagerProxy.mm:
3072         (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): Remember the initial rect.
3073         (WebKit::WebVideoFullscreenManagerProxy::videoLayerFrame): Added; simple getter.
3074         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame): Use a different synchronization fence primative.
3075             Save the cached frame value.
3076         (WebKit::WebVideoFullscreenManagerProxy::videoLayerGravity): Added; simple getter.
3077         (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerGravity): Save the cached gravity value.
3078         * WebKit2.xcodeproj/project.pbxproj:
3079         * WebProcess/ios/WebVideoFullscreenManager.mm:
3080         (WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced): Wrap in a 0-length transaction.
3081
3082 2015-04-06  Chris Dumez  <cdumez@apple.com>
3083
3084         [WK2][iOS] Regression(r182323): ASSERTION FAILED: WebCore::SQLiteDatabaseTracker::hasTransactionInProgress() in NetworkCache::Statistics::initialize()
3085         https://bugs.webkit.org/show_bug.cgi?id=143451
3086         <rdar://problem/20437994>
3087
3088         Reviewed by Anders Carlsson.
3089
3090         Initialize WebProcess::m_webSQLiteDatabaseTracker and
3091         NetworkProcess::m_webSQLiteDatabaseTracker in their respective class
3092         constructors instead of doing it later in the initializeWebProcess() /
3093         initializeNetworkProcess() methods.
3094
3095         If we do it later, it can happen that the tracker gets set after
3096         a SQLiteTransactionInProgressAutoCounter initialization and before
3097         the actual transaction. When this happens, the
3098         SQLiteTransactionInProgressAutoCounter variable fails to increment the
3099         transaction count. Then when the transaction is executed,
3100         SQLiteDatabaseTracker::hasTransactionInProgress() can return false.
3101         This would lead to possible assertions on start up on iOS.
3102
3103         * NetworkProcess/NetworkProcess.cpp:
3104         (WebKit::NetworkProcess::NetworkProcess):
3105         (WebKit::NetworkProcess::initializeNetworkProcess):
3106         * NetworkProcess/NetworkProcess.h:
3107         * WebProcess/WebProcess.cpp:
3108         (WebKit::WebProcess::WebProcess):
3109         (WebKit::WebProcess::initializeConnection):
3110         * WebProcess/WebProcess.h:
3111
3112 2015-04-06  Beth Dakin  <bdakin@apple.com>
3113
3114         https://trac.webkit.org/changeset/182338 introduced a build failure that I 
3115         attempted to fix with https://trac.webkit.org/changeset/182341 , but that disabled 
3116         the feature accidentally.  This should do the right thing.
3117
3118         * UIProcess/API/mac/WKView.mm:
3119         (-[WKView pressureChangeWithEvent:]):
3120
3121 2015-04-06  Commit Queue  <commit-queue@webkit.org>
3122
3123         Unreviewed, rolling out r182296.
3124         https://bugs.webkit.org/show_bug.cgi?id=143448
3125
3126         This will disturb network cache efficacy logging, we should
3127         reland this later. (Requested by cdumez__ on #webkit).
3128
3129         Reverted changeset:
3130
3131         "[WK2][NetworkCache] Drop HTTP method from NetworkCache::Key"
3132         https://bugs.webkit.org/show_bug.cgi?id=143348
3133         http://trac.webkit.org/changeset/182296
3134
3135 2015-04-06  Žan Doberšek  <zdobersek@igalia.com>
3136
3137         [WK2] API::Array::copy() should move the resulting Vector<> of copies into the Array::create() call
3138         https://bugs.webkit.org/show_bug.cgi?id=143413
3139
3140         Reviewed by Darin Adler.
3141
3142         Move the Vector<> object containing the copied elements into the Array::create()
3143         call, avoiding copying all the elements again.
3144
3145         While here, change the Vector<> parameters for Array::create() and the Array
3146         constructor to rvalue references. This will ensure that the passed-in object
3147         is moved into the Array::create() call if possible, or explicitly copied
3148         otherwise. The constructor is moved into the header for inlining opportunities
3149         and the unnecessary parameter in the create(Vector<>&&) method declaration
3150         removed.
3151
3152         * Shared/API/APIArray.cpp:
3153         (API::Array::create):
3154         (API::Array::copy):
3155         (API::Array::Array): Deleted.
3156         * Shared/API/APIArray.h:
3157
3158 2015-04-06  Žan Doberšek  <zdobersek@igalia.com>
3159
3160         UserScript, UserStyleSheet constructors should take in Vector<String> rvalues
3161         https://bugs.webkit.org/show_bug.cgi?id=143411
3162
3163         Reviewed by Darin Adler.
3164
3165         Move the whitelist and blacklist Vector<String> objects into the
3166         UserScript and UserStyleSheet constructors in ArgumentCoder<T>::decode
3167         functions.
3168
3169         * Shared/WebCoreArgumentCoders.cpp:
3170         (IPC::ArgumentCoder<UserStyleSheet>::decode):
3171         (IPC::ArgumentCoder<UserScript>::decode):
3172
3173 2015-04-05  Darin Adler  <darin@apple.com>
3174
3175         [Mac] Spins seen in WKSetApplicationInformationItem, so it should not be called on the main thread
3176         https://bugs.webkit.org/show_bug.cgi?id=143423
3177         rdar://problem/18773785
3178
3179         Reviewed by Alexey Proskuryakov.
3180
3181         * WebProcess/cocoa/WebProcessCocoa.mm:
3182         (WebKit::origin): Factored out this helper function from updateActivePages below, so
3183         the function below is easier to read.
3184         (WebKit::WebProcess::updateActivePages): Refactored to use the new origin function.
3185         Use dispatch_async to call WKSetApplicationInformationItem without blocking.
3186
3187 2015-04-05  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3188
3189         Use constants of sqlite3 directly for status of SQL result in webdatabase
3190         https://bugs.webkit.org/show_bug.cgi?id=143329
3191
3192         Reviewed by Darin Adler.
3193
3194         In webdatabase, it has used own constant variables as well as using sqlite3 constants directly.
3195         If sqlite3 constants are changed in the library, we should modify many files as well. Besides
3196         it can cause to use if~else statement which consumes more cpu cycles compared to switch~case.
3197
3198         * DatabaseProcess/IndexedDB/sqlite/SQLiteIDBCursor.cpp:
3199         (WebKit::SQLiteIDBCursor::createSQLiteStatement):
3200         (WebKit::SQLiteIDBCursor::resetAndRebindStatement):
3201         (WebKit::SQLiteIDBCursor::bindArguments):
3202         (WebKit::SQLiteIDBCursor::internalAdvanceOnce):
3203         * DatabaseProcess/IndexedDB/sqlite/UniqueIDBDatabaseBackingStoreSQLite.cpp:
3204         (WebKit::createOrMigrateRecordsTableIfNecessary):
3205         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createAndPopulateInitialMetadata):
3206         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::extractExistingMetadata):
3207         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::changeDatabaseVersion):
3208         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createObjectStore):
3209         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteObjectStore):
3210         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::clearObjectStore):
3211         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::createIndex):
3212         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteIndex):
3213         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::generateKeyNumber):
3214         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::updateKeyGeneratorNumber):
3215         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::keyExistsInObjectStore):
3216         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::putRecord):
3217         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::uncheckedPutIndexRecord):
3218         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::deleteRecord):
3219         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRecordFromObjectStore):
3220         (WebKit::UniqueIDBDatabaseBackingStoreSQLite::getKeyRangeRecordFromObjectStore):
3221         * NetworkProcess/cache/NetworkCacheStatistics.cpp:
3222         (WebKit::NetworkCache::executeSQLStatement):
3223         (WebKit::NetworkCache::Statistics::initialize):
3224         (WebKit::NetworkCache::Statistics::queryWasEverRequested):
3225         (WebKit::NetworkCache::Statistics::addHashesToDatabase):
3226         (WebKit::NetworkCache::Statistics::addStoreDecisionsToDatabase):
3227         * UIProcess/Storage/LocalStorageDatabase.cpp:
3228         (WebKit::LocalStorageDatabase::importItems):
3229         (WebKit::LocalStorageDatabase::updateDatabaseWithChangedItems):
3230         (WebKit::LocalStorageDatabase::databaseIsEmpty):
3231         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
3232         (WebKit::LocalStorageDatabaseTracker::deleteAllDatabases):
3233         (WebKit::LocalStorageDatabaseTracker::importOriginIdentifiers):
3234         (WebKit::LocalStorageDatabaseTracker::addDatabaseWithOriginIdentifier):
3235         (WebKit::LocalStorageDatabaseTracker::removeDatabaseWithOriginIdentifier):
3236         (WebKit::LocalStorageDatabaseTracker::pathForDatabaseWithOriginIdentifier):
3237         * WebProcess/Cookies/soup/WebKitSoupCookieJarSqlite.cpp:
3238         (webkitSoupCookieJarSqliteLoad):
3239         (webkitSoupCookieJarSqliteInsertCookie):
3240         (webkitSoupCookieJarSqliteDeleteCookie):
3241
3242 2015-04-05  Simon Fraser  <simon.fraser@apple.com>
3243
3244         Remove "go ahead and" from comments
3245         https://bugs.webkit.org/show_bug.cgi?id=143421
3246
3247         Reviewed by Darin Adler, Benjamin Poulain.
3248
3249         Remove the phrase "go ahead and" from comments where it doesn't add
3250         anything (which is almost all of them).
3251
3252         * Platform/unix/EnvironmentUtilities.cpp:
3253         (WebKit::EnvironmentUtilities::stripValuesEndingWithString):
3254         * PluginProcess/PluginProcess.cpp:
3255         (WebKit::PluginProcess::didClose):
3256         * UIProcess/API/mac/WKView.mm:
3257         (-[WKView insertText:replacementRange:]):
3258         (-[WKView _pluginFocusOrWindowFocusChanged:pluginComplexTextInputIdentifier:]):
3259         * UIProcess/Storage/LocalStorageDatabaseTracker.cpp:
3260         (WebKit::LocalStorageDatabaseTracker::removeDatabaseWithOriginIdentifier):
3261
3262 2015-04-05  Antti Koivisto  <antti@apple.com>
3263
3264         Bloom filter should support longer hashes
3265         https://bugs.webkit.org/show_bug.cgi?id=143419
3266
3267         Reviewed by Dan Bernstein.
3268
3269         Use the hash digest directly in the contents filter instead of going via shortHash.
3270
3271         * NetworkProcess/cache/NetworkCacheKey.h:
3272         (WebKit::NetworkCache::Key::hash):
3273         (WebKit::NetworkCache::Key::shortHash): Deleted.
3274         (WebKit::NetworkCache::Key::toShortHash): Deleted.
3275
3276             No longer needed.
3277
3278         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3279         (WebKit::NetworkCache::Storage::synchronize):
3280         (WebKit::NetworkCache::Storage::addToContentsFilter):
3281         (WebKit::NetworkCache::Storage::mayContain):
3282         * NetworkProcess/cache/NetworkCacheStorage.h:
3283
3284 2015-04-05  Antti Koivisto  <antti@apple.com>
3285
3286         Network cache Bloom filter is too big
3287         https://bugs.webkit.org/show_bug.cgi?id=143400
3288
3289         Follow-up: Fix an ineffective assert.
3290
3291         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3292         (WebKit::NetworkCache::Storage::setMaximumSize): Average resource size is closer to 50KB than 50MB.
3293
3294 2015-04-05  Antti Koivisto  <antti@apple.com>
3295
3296         Rename Cache::setMaximumSize to setCapacity
3297         https://bugs.webkit.org/show_bug.cgi?id=143418
3298
3299         Reviewed by Dan Bernstein.
3300
3301         * NetworkProcess/cache/NetworkCache.cpp:
3302         (WebKit::NetworkCache::Cache::setCapacity):
3303         (WebKit::NetworkCache::Cache::setMaximumSize): Deleted.
3304         * NetworkProcess/cache/NetworkCache.h:
3305         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3306         (WebKit::NetworkCache::Storage::retrieve):
3307         (WebKit::NetworkCache::Storage::store):
3308         (WebKit::NetworkCache::Storage::update):
3309         (WebKit::NetworkCache::Storage::setCapacity):
3310         (WebKit::NetworkCache::Storage::shrinkIfNeeded):
3311         (WebKit::NetworkCache::Storage::shrink):
3312         (WebKit::NetworkCache::Storage::setMaximumSize): Deleted.
3313         * NetworkProcess/cache/NetworkCacheStorage.h:
3314         * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
3315         (WebKit::NetworkProcess::platformSetCacheModel):
3316
3317 2015-04-04  Antti Koivisto  <antti@apple.com>
3318
3319         Network cache Bloom filter is too big
3320         https://bugs.webkit.org/show_bug.cgi?id=143400
3321
3322         Reviewed by Chris Dumez.
3323
3324         It is currently 1MB.
3325
3326         This patch switches the cache from a counting filter (CountingBloomFilter) to a bit filter (BloomFilter).
3327
3328         It also reduces the filter size from 2^20 to 2^18 elements which is good for ~26000 cache entries while
3329         still keeping false positive rate below 1%. The current cache capacity allows around 4000 entries
3330         with typical web contents.
3331
3332         The new filter size is 32KB.
3333
3334         * NetworkProcess/cache/NetworkCacheStorage.cpp:
3335         (WebKit::NetworkCache::Storage::Storage):
3336         (WebKit::NetworkCache::Storage::synchronize):
3337
3338             Turn initialization function into general purpose synchronization function.
3339
3340         (WebKit::NetworkCache::Storage::addToContentsFilter):
3341
3342             Collect newly added hashes so we don't miss entries that were added during synchronization.
3343
3344         (WebKit::NetworkCache::Storage::mayContain):
3345         (WebKit::NetworkCache::Storage::remove):
3346         (WebKit::NetworkCache::Storage::retrieve):
3347         (WebKit::NetworkCache::Storage::store):
3348         (WebKit::NetworkCache::Storage::dispatchPendingWriteOperations):
3349         (WebKit::NetworkCache::Storage::dispatchFullWriteOperation):
3350         (WebKit::NetworkCache::Storage::dispatchHeaderWriteOperation):
3351         (WebKit::NetworkCache::Storage::setMaximumSize):
3352         (WebKit::NetworkCache::Storage::clear):
3353         (WebKit::NetworkCache::Storage::shrinkIfNeeded):
3354         (WebKit::NetworkCache::Storage::shrink):
3355
3356             Non-counting Bloom filter does not support removals so this requires a new strategy.
3357
3358             Shrink code now simply deletes entries. The filter is updated by calling synchronize() at the end.
3359             While we could synchronize the filter during traversal it is better to just have one function for that.
3360
3361         (WebKit::NetworkCache::Storage::initialize): Deleted.
3362         * NetworkProcess/cache/NetworkCacheStorage.h:
3363         (WebKit::NetworkCache::Storage::mayContain):
3364         (WebKit::NetworkCache::Storage::cacheMayContain): Deleted.
3365
3366 2015-04-04  Andy Estes  <aestes@apple.com>
3367
3368         [Content Filtering] Blocked page is not always displayed when it should be
3369         https://bugs.webkit.org/show_bug.cgi?id=143410
3370
3371         Reviewed by Andreas Kling.
3372
3373         * UIProcess/WebFrameProxy.cpp:
3374         (WebKit::WebFrameProxy::didStartProvisionalLoad): Stopped clearing m_contentFilterUnblockHandler here.
3375         (WebKit::WebFrameProxy::didHandleContentFilterUnblockNavigation): Started doing it here instead.
3376
3377 2015-04-04  Chris Dumez  <cdumez@apple.com>
3378
3379         [WK2][Cocoa] Add a way to temporarily disable the WebKit Network Cache for testing
3380         https://bugs.webkit.org/show_bug.cgi?id=143392
3381         <rdar://problem/20315669>
3382
3383         Reviewed by Antti Koivisto.
3384
3385         Add a way to temporarily disable the WebKit Network Cache for testing.
3386         It will be used temporarily for comparing page load times with and
3387         without the WebKit network disk cache enabled.
3388
3389         This is in addition to the existing "WebKitNetworkCacheEnabled"
3390         NSUserDefaults:
3391         webkitNetworkCacheIsEnabled = [defaults boolForKey:WebKitNetworkCacheEnabledDefaultsKey]
3392             && ![defaults boolForKey:WebKitNetworkCacheTemporarilyDisabledForTestingKey];
3393
3394         * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
3395         (WebKit::WebProcessPool::platformInitializeNetworkProcess):
3396
3397 2015-04-04  Simon Fraser  <simon.fraser@apple.com>
3398
3399         REGRESSION (r182215): Feedly crashes when closing article
3400         https://bugs.webkit.org/show_bug.cgi?id=143405
3401         rdar://problem/20382734, rdar://problem/20395497
3402
3403         Reviewed by Tim Horton.
3404         
3405         Calling computeNonFastScrollableRegion() eagerly when scrollable areas come and go
3406         is bad, because it can cause FrameView::layout() to get called in the middle of
3407         RenderObject destruction, which leaves the render tree in a bad state.
3408         
3409         Fix by calling computeNonFastScrollableRegion() lazily, just before scrolling tree commit.
3410         
3411         AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged() now just sets
3412         a flag to say that the non-fast region needs to be recomputed, and that schedules
3413         a scrolling tree commit. When the commit happens, we recompute the region. If the
3414         region didn't change, and no other changes are pending, there's no need to commit.
3415
3416         * WebProcess/Scrolling/RemoteScrollingCoordinator.mm:
3417         (WebKit::RemoteScrollingCoordinator::buildTransaction):
3418         * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
3419         (WebKit::TiledCoreAnimationDrawingArea::flushLayers): Outdent #ifdefs.
3420
3421 2015-04-03  Beth Dakin  <bdakin@apple.com>
3422
3423         Attempted build fix.
3424
3425         * UIProcess/API/mac/WKView.mm:
3426
3427 2015-04-03  Simon Fraser  <simon.fraser@apple.com>
3428
3429         Fix the firing of the ReachedSessionRestorationRenderTreeSizeThreshold milestone on iOS
3430         https://bugs.webkit.org/show_bug.cgi?id=143394
3431
3432         Reviewed by Tim Horton.
3433         
3434         A client reshuffle at some point broke the dispatch of the ReachedSessionRestorationRenderTreeSizeThreshold
3435         milestone. Fix by using WebPageProxy::didLayout() to fire the milestone.
3436
3437         * UIProcess/ios/WebPageProxyIOS.mm:
3438         (WebKit::WebPageProxy::didCommitLayerTree):
3439
3440 2015-04-03  Beth Dakin  <bdakin@apple.com>
3441
3442         https://bugs.webkit.org/show_bug.cgi?id=143387
3443         Improvements to webkitmouseforce web API
3444         -and corresponding-
3445         rdar://problem/20281808
3446         rdar://problem/20281853
3447
3448         Reviewed by Darin Adler.
3449
3450         This patch:
3451         1. Dispatches webkitmouseforceup and webkitmouseforceclick at the right time.
3452         2. Dispatches webkitmouseforcechanged from mousedown all the way through through 
3453         mouseup.
3454         3. Uses force values from pressureChangeWithEvent instead of the immediate action 
3455         gesture recognizer.