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