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